Game.IssueOrder wrapper for OM; moved some more features into mod
This commit is contained in:
@@ -15,7 +15,7 @@ namespace OpenRa
|
|||||||
public void Toggle()
|
public void Toggle()
|
||||||
{
|
{
|
||||||
if (isChatting && typing.Length > 0)
|
if (isChatting && typing.Length > 0)
|
||||||
Game.orderManager.IssueOrder(Order.Chat(typing));
|
Game.IssueOrder(Order.Chat(typing));
|
||||||
|
|
||||||
typing = "";
|
typing = "";
|
||||||
isChatting ^= true;
|
isChatting ^= true;
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ namespace OpenRa
|
|||||||
AddUiButton(new int2(r.Left + 200, r.Bottom - 40), "OK",
|
AddUiButton(new int2(r.Left + 200, r.Bottom - 40), "OK",
|
||||||
_ =>
|
_ =>
|
||||||
{
|
{
|
||||||
Game.orderManager.IssueOrder(Order.Chat("/map " + currentMap.Filename));
|
Game.IssueOrder(Order.Chat("/map " + currentMap.Filename));
|
||||||
showMapChooser = false;
|
showMapChooser = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -343,19 +343,19 @@ namespace OpenRa
|
|||||||
while (!PaletteAvailable(newpalette) && newpalette != (int)Game.world.LocalPlayer.Palette)
|
while (!PaletteAvailable(newpalette) && newpalette != (int)Game.world.LocalPlayer.Palette)
|
||||||
newpalette = (newpalette + d) % 8;
|
newpalette = (newpalette + d) % 8;
|
||||||
|
|
||||||
Game.orderManager.IssueOrder(
|
Game.IssueOrder(
|
||||||
Order.Chat("/pal " + newpalette));
|
Order.Chat("/pal " + newpalette));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CycleRace(bool left)
|
void CycleRace(bool left)
|
||||||
{
|
{
|
||||||
Game.orderManager.IssueOrder(
|
Game.IssueOrder(
|
||||||
Order.Chat("/race " + (((int)Game.world.LocalPlayer.Race - 1) ^ 1)));
|
Order.Chat("/race " + (((int)Game.world.LocalPlayer.Race - 1) ^ 1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CycleReady(bool left)
|
void CycleReady(bool left)
|
||||||
{
|
{
|
||||||
Game.orderManager.IssueOrder(
|
Game.IssueOrder(
|
||||||
new Order("ToggleReady", Game.world.LocalPlayer.PlayerActor, "") { IsImmediate = true });
|
new Order("ToggleReady", Game.world.LocalPlayer.PlayerActor, "") { IsImmediate = true });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -580,7 +580,7 @@ namespace OpenRa
|
|||||||
{
|
{
|
||||||
var queue = world.LocalPlayer.PlayerActor.traits.Get<Traits.ProductionQueue>();
|
var queue = world.LocalPlayer.PlayerActor.traits.Get<Traits.ProductionQueue>();
|
||||||
foreach( var item in queue.AllItems( groupName ) )
|
foreach( var item in queue.AllItems( groupName ) )
|
||||||
Game.orderManager.IssueOrder(Order.CancelProduction(world.LocalPlayer, item.Item));
|
Game.IssueOrder(Order.CancelProduction(world.LocalPlayer, item.Item));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChooseAvailableTab( World world )
|
void ChooseAvailableTab( World world )
|
||||||
@@ -958,7 +958,7 @@ namespace OpenRa
|
|||||||
{
|
{
|
||||||
var unit = Rules.Info[item];
|
var unit = Rules.Info[item];
|
||||||
Sound.Play(unit.Traits.Contains<BuildingInfo>() ? "abldgin1.aud" : "train1.aud");
|
Sound.Play(unit.Traits.Contains<BuildingInfo>() ? "abldgin1.aud" : "train1.aud");
|
||||||
Game.orderManager.IssueOrder(Order.StartProduction(world.LocalPlayer, item));
|
Game.IssueOrder(Order.StartProduction(world.LocalPlayer, item));
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleBuildPalette( World world, string item, bool isLmb )
|
void HandleBuildPalette( World world, string item, bool isLmb )
|
||||||
@@ -983,7 +983,7 @@ namespace OpenRa
|
|||||||
|
|
||||||
if (producing.Paused)
|
if (producing.Paused)
|
||||||
{
|
{
|
||||||
Game.orderManager.IssueOrder(Order.PauseProduction(player, item, false));
|
Game.IssueOrder(Order.PauseProduction(player, item, false));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -998,12 +998,12 @@ namespace OpenRa
|
|||||||
if (producing.Paused || producing.Done || producing.TotalCost == producing.RemainingCost)
|
if (producing.Paused || producing.Done || producing.TotalCost == producing.RemainingCost)
|
||||||
{
|
{
|
||||||
Sound.Play("cancld1.aud");
|
Sound.Play("cancld1.aud");
|
||||||
Game.orderManager.IssueOrder(Order.CancelProduction(player, item));
|
Game.IssueOrder(Order.CancelProduction(player, item));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Sound.Play("onhold1.aud");
|
Sound.Play("onhold1.aud");
|
||||||
Game.orderManager.IssueOrder(Order.PauseProduction(player, item, true));
|
Game.IssueOrder(Order.PauseProduction(player, item, true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,6 +210,8 @@ namespace OpenRa
|
|||||||
changePending = true;
|
changePending = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void IssueOrder(Order o) { orderManager.IssueOrder(o); } /* avoid exposing the OM to mod code */
|
||||||
|
|
||||||
public static void StartGame()
|
public static void StartGame()
|
||||||
{
|
{
|
||||||
var available = world.Map.SpawnPoints.ToList();
|
var available = world.Map.SpawnPoints.ToList();
|
||||||
|
|||||||
@@ -226,8 +226,6 @@
|
|||||||
<Compile Include="Traits\NukePower.cs" />
|
<Compile Include="Traits\NukePower.cs" />
|
||||||
<Compile Include="Traits\Passenger.cs" />
|
<Compile Include="Traits\Passenger.cs" />
|
||||||
<Compile Include="Traits\PlaceBuilding.cs" />
|
<Compile Include="Traits\PlaceBuilding.cs" />
|
||||||
<Compile Include="Traits\SonarPulsePower.cs" />
|
|
||||||
<Compile Include="Traits\SpyPlanePower.cs" />
|
|
||||||
<Compile Include="Traits\SupportPower.cs" />
|
<Compile Include="Traits\SupportPower.cs" />
|
||||||
<Compile Include="Traits\ProvidesRadar.cs" />
|
<Compile Include="Traits\ProvidesRadar.cs" />
|
||||||
<Compile Include="Traits\Repairable.cs" />
|
<Compile Include="Traits\Repairable.cs" />
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ namespace OpenRa
|
|||||||
|
|
||||||
Game.chat.AddLine(Color.White, "Debug", "Requesting package: {0}".F(currentPackage));
|
Game.chat.AddLine(Color.White, "Debug", "Requesting package: {0}".F(currentPackage));
|
||||||
|
|
||||||
Game.orderManager.IssueOrder(
|
Game.IssueOrder(
|
||||||
new Order("RequestFile", null, currentPackage) { IsImmediate = true });
|
new Order("RequestFile", null, currentPackage) { IsImmediate = true });
|
||||||
|
|
||||||
Fraction = 0f;
|
Fraction = 0f;
|
||||||
|
|||||||
@@ -66,7 +66,9 @@
|
|||||||
<Compile Include="RenderSpy.cs" />
|
<Compile Include="RenderSpy.cs" />
|
||||||
<Compile Include="RepairableNear.cs" />
|
<Compile Include="RepairableNear.cs" />
|
||||||
<Compile Include="Crate Actions\SpeedUpgrade.cs" />
|
<Compile Include="Crate Actions\SpeedUpgrade.cs" />
|
||||||
|
<Compile Include="SonarPulsePower.cs" />
|
||||||
<Compile Include="Spy.cs" />
|
<Compile Include="Spy.cs" />
|
||||||
|
<Compile Include="SpyPlanePower.cs" />
|
||||||
<Compile Include="Thief.cs" />
|
<Compile Include="Thief.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
using System;
|
using OpenRa.Traits;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using OpenRa.Orders;
|
|
||||||
|
|
||||||
namespace OpenRa.Traits
|
namespace OpenRa.Mods.RA
|
||||||
{
|
{
|
||||||
public class SonarPulsePowerInfo : SupportPowerInfo
|
public class SonarPulsePowerInfo : SupportPowerInfo
|
||||||
{
|
{
|
||||||
@@ -19,7 +16,7 @@ namespace OpenRa.Traits
|
|||||||
|
|
||||||
protected override void OnActivate()
|
protected override void OnActivate()
|
||||||
{
|
{
|
||||||
Game.orderManager.IssueOrder(new Order("SonarPulse", Owner.PlayerActor));
|
Game.IssueOrder(new Order("SonarPulse", Owner.PlayerActor));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResolveOrder(Actor self, Order order)
|
public void ResolveOrder(Actor self, Order order)
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
using OpenRa.Traits;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using OpenRa.Traits.Activities;
|
using OpenRa.Traits.Activities;
|
||||||
|
|
||||||
namespace OpenRa.Traits
|
namespace OpenRa.Mods.RA
|
||||||
{
|
{
|
||||||
class SpyPlanePowerInfo : SupportPowerInfo
|
class SpyPlanePowerInfo : SupportPowerInfo
|
||||||
{
|
{
|
||||||
Reference in New Issue
Block a user