made all orders queuable
This commit is contained in:
@@ -37,22 +37,20 @@ namespace OpenRA
|
||||
this.Queued = queued;
|
||||
}
|
||||
|
||||
public Order(string orderString, Actor subject)
|
||||
: this(orderString, subject, null, int2.Zero, null, false) { }
|
||||
public Order(string orderString, Actor subject, Actor targetActor)
|
||||
: this(orderString, subject, targetActor, int2.Zero, null, false) { }
|
||||
public Order(string orderString, Actor subject, int2 targetLocation)
|
||||
: this(orderString, subject, null, targetLocation, null, false) { }
|
||||
public Order(string orderString, Actor subject, bool queued)
|
||||
: this(orderString, subject, null, int2.Zero, null, queued) { }
|
||||
public Order(string orderString, Actor subject, Actor targetActor, bool queued)
|
||||
: this(orderString, subject, targetActor, int2.Zero, null, queued) { }
|
||||
public Order(string orderString, Actor subject, int2 targetLocation, bool queued)
|
||||
: this(orderString, subject, null, targetLocation, null, queued) { }
|
||||
public Order(string orderString, Actor subject, string targetString)
|
||||
: this(orderString, subject, null, int2.Zero, targetString, false) { }
|
||||
public Order(string orderString, Actor subject, Actor targetActor, int2 targetLocation)
|
||||
: this(orderString, subject, targetActor, targetLocation, null, false) { }
|
||||
public Order(string orderString, Actor subject, Actor targetActor, string targetString)
|
||||
: this(orderString, subject, targetActor, int2.Zero, targetString, false) { }
|
||||
public Order(string orderString, Actor subject, int2 targetLocation, string targetString)
|
||||
: this(orderString, subject, null, targetLocation, targetString, false) { }
|
||||
public Order(string orderString, Actor subject, string targetString, bool queued)
|
||||
: this(orderString, subject, null, int2.Zero, targetString, queued) { }
|
||||
public Order(string orderString, Actor subject, Actor targetActor, int2 targetLocation, bool queued)
|
||||
: this(orderString, subject, targetActor, targetLocation, null, queued) { }
|
||||
public Order(string orderString, Actor subject, Actor targetActor, string targetString, bool queued)
|
||||
: this(orderString, subject, targetActor, int2.Zero, targetString, queued) { }
|
||||
public Order(string orderString, Actor subject, int2 targetLocation, string targetString, bool queued)
|
||||
: this(orderString, subject, null, targetLocation, targetString, queued) { }
|
||||
|
||||
public byte[] Serialize()
|
||||
{
|
||||
@@ -120,7 +118,7 @@ namespace OpenRA
|
||||
var name = r.ReadString();
|
||||
var data = r.ReadString();
|
||||
|
||||
return new Order( name, null, data ) { IsImmediate = true };
|
||||
return new Order( name, null, data, false ) { IsImmediate = true };
|
||||
}
|
||||
|
||||
default:
|
||||
@@ -164,32 +162,32 @@ namespace OpenRA
|
||||
// Now that Orders are resolved by individual Actors, these are weird; you unpack orders manually, but not pack them.
|
||||
public static Order Chat(string text)
|
||||
{
|
||||
return new Order("Chat", null, text) { IsImmediate = true };
|
||||
return new Order("Chat", null, text, false) { IsImmediate = true };
|
||||
}
|
||||
|
||||
public static Order TeamChat(string text)
|
||||
{
|
||||
return new Order("TeamChat", null, text) { IsImmediate = true };
|
||||
return new Order("TeamChat", null, text, false) { IsImmediate = true };
|
||||
}
|
||||
|
||||
public static Order Command(string text)
|
||||
{
|
||||
return new Order("Command", null, text) { IsImmediate = true };
|
||||
return new Order("Command", null, text, false) { IsImmediate = true };
|
||||
}
|
||||
|
||||
public static Order StartProduction(Actor subject, string item, int count)
|
||||
{
|
||||
return new Order("StartProduction", subject, new int2( count, 0 ), item );
|
||||
return new Order("StartProduction", subject, new int2( count, 0 ), item, false );
|
||||
}
|
||||
|
||||
public static Order PauseProduction(Actor subject, string item, bool pause)
|
||||
{
|
||||
return new Order("PauseProduction", subject, new int2( pause ? 1 : 0, 0 ), item);
|
||||
return new Order("PauseProduction", subject, new int2( pause ? 1 : 0, 0 ), item, false);
|
||||
}
|
||||
|
||||
public static Order CancelProduction(Actor subject, string item, int count)
|
||||
{
|
||||
return new Order("CancelProduction", subject, new int2( count, 0 ), item);
|
||||
return new Order("CancelProduction", subject, new int2( count, 0 ), item, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA.Orders
|
||||
{
|
||||
world.CancelInputMode();
|
||||
foreach (var subject in subjects)
|
||||
yield return new Order(order, subject, xy);
|
||||
yield return new Order(order, subject, xy, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,11 +46,11 @@ namespace OpenRA.Orders
|
||||
var actorsInvolved = orders.Select(o => o.self).Distinct();
|
||||
if (actorsInvolved.Any())
|
||||
yield return new Order("CreateGroup", actorsInvolved.First().Owner.PlayerActor,
|
||||
string.Join(",", actorsInvolved.Select(a => a.ActorID.ToString()).ToArray()))
|
||||
string.Join(",", actorsInvolved.Select(a => a.ActorID.ToString()).ToArray()), false)
|
||||
;
|
||||
|
||||
foreach (var o in orders)
|
||||
yield return CheckSameOrder(o.iot, o.trait.IssueOrder(o.self, o.iot, o.target));
|
||||
yield return CheckSameOrder(o.iot, o.trait.IssueOrder(o.self, o.iot, o.target, mi.Modifiers.HasModifier(Modifiers.Shift)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Traits
|
||||
public interface IIssueOrder
|
||||
{
|
||||
IEnumerable<IOrderTargeter> Orders { get; }
|
||||
Order IssueOrder( Actor self, IOrderTargeter order, Target target );
|
||||
Order IssueOrder( Actor self, IOrderTargeter order, Target target, bool queued );
|
||||
}
|
||||
public interface IOrderTargeter
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Widgets.Delegates
|
||||
() => world.LocalPlayer.PlayerActor.Trait<DeveloperMode>().DisableShroud;
|
||||
devmodeBG.GetWidget<CheckboxWidget>("CHECKBOX_SHROUD").OnMouseDown = mi =>
|
||||
{
|
||||
world.IssueOrder(new Order("DevShroud", world.LocalPlayer.PlayerActor));
|
||||
world.IssueOrder(new Order("DevShroud", world.LocalPlayer.PlayerActor, false));
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenRA.Widgets.Delegates
|
||||
() => world.LocalPlayer.PlayerActor.Trait<DeveloperMode>().UnitInfluenceDebug;
|
||||
devmodeBG.GetWidget("CHECKBOX_UNITDEBUG").OnMouseDown = mi =>
|
||||
{
|
||||
world.IssueOrder(new Order("DevUnitDebug", world.LocalPlayer.PlayerActor));
|
||||
world.IssueOrder(new Order("DevUnitDebug", world.LocalPlayer.PlayerActor, false));
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -59,13 +59,13 @@ namespace OpenRA.Widgets.Delegates
|
||||
() => world.LocalPlayer.PlayerActor.Trait<DeveloperMode>().PathDebug;
|
||||
devmodeBG.GetWidget("CHECKBOX_PATHDEBUG").OnMouseDown = mi =>
|
||||
{
|
||||
world.IssueOrder(new Order("DevPathDebug", world.LocalPlayer.PlayerActor));
|
||||
world.IssueOrder(new Order("DevPathDebug", world.LocalPlayer.PlayerActor, false));
|
||||
return true;
|
||||
};
|
||||
|
||||
devmodeBG.GetWidget<ButtonWidget>("GIVE_CASH").OnMouseUp = mi =>
|
||||
{
|
||||
world.IssueOrder(new Order("DevGiveCash", world.LocalPlayer.PlayerActor));
|
||||
world.IssueOrder(new Order("DevGiveCash", world.LocalPlayer.PlayerActor, false));
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace OpenRA.Widgets.Delegates
|
||||
() => world.LocalPlayer.PlayerActor.Trait<DeveloperMode>().FastBuild;
|
||||
devmodeBG.GetWidget<CheckboxWidget>("INSTANT_BUILD").OnMouseDown = mi =>
|
||||
{
|
||||
world.IssueOrder(new Order("DevFastBuild", world.LocalPlayer.PlayerActor));
|
||||
world.IssueOrder(new Order("DevFastBuild", world.LocalPlayer.PlayerActor, false));
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace OpenRA.Widgets.Delegates
|
||||
() => world.LocalPlayer.PlayerActor.Trait<DeveloperMode>().FastCharge;
|
||||
devmodeBG.GetWidget<CheckboxWidget>("INSTANT_CHARGE").OnMouseDown = mi =>
|
||||
{
|
||||
world.IssueOrder(new Order("DevFastCharge", world.LocalPlayer.PlayerActor));
|
||||
world.IssueOrder(new Order("DevFastCharge", world.LocalPlayer.PlayerActor, false));
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -89,13 +89,13 @@ namespace OpenRA.Widgets.Delegates
|
||||
() => world.LocalPlayer.PlayerActor.Trait<DeveloperMode>().AllTech;
|
||||
devmodeBG.GetWidget<CheckboxWidget>("ENABLE_TECH").OnMouseDown = mi =>
|
||||
{
|
||||
world.IssueOrder(new Order("DevEnableTech", world.LocalPlayer.PlayerActor));
|
||||
world.IssueOrder(new Order("DevEnableTech", world.LocalPlayer.PlayerActor, false));
|
||||
return true;
|
||||
};
|
||||
|
||||
devmodeBG.GetWidget<ButtonWidget>("GIVE_EXPLORATION").OnMouseUp = mi =>
|
||||
{
|
||||
world.IssueOrder(new Order("DevGiveExploration", world.LocalPlayer.PlayerActor));
|
||||
world.IssueOrder(new Order("DevGiveExploration", world.LocalPlayer.PlayerActor, false));
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace OpenRA.Widgets.Delegates
|
||||
var nextStance = GetNextStance((Stance)Enum.Parse(typeof(Stance), bw.Text));
|
||||
|
||||
world.IssueOrder(new Order("SetStance", world.LocalPlayer.PlayerActor,
|
||||
new int2(p.Index, (int)nextStance)));
|
||||
new int2(p.Index, (int)nextStance), false));
|
||||
|
||||
bw.Text = nextStance.ToString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user