Merge pull request #5411 from RoosterDragon/general-clean

General Cleanup
This commit is contained in:
Chris Forbes
2014-05-25 11:03:03 +12:00
92 changed files with 177 additions and 179 deletions

View File

@@ -169,7 +169,7 @@ namespace OpenRA.Mods.RA.AI
return !double.IsNaN(attackChance) && attackChance < 30.0;
}
protected float NormalizedHealth(IEnumerable<Actor> actors, float normalizeByValue)
protected static float NormalizedHealth(IEnumerable<Actor> actors, float normalizeByValue)
{
var sumOfMaxHp = 0;
var sumOfHp = 0;
@@ -206,7 +206,7 @@ namespace OpenRA.Mods.RA.AI
return RelativeValue(own, enemy, 100, Average<Mobile>, (Actor a) => a.Trait<Mobile>().Info.Speed);
}
protected float RelativeValue(IEnumerable<Actor> own, IEnumerable<Actor> enemy, float normalizeByValue,
protected static float RelativeValue(IEnumerable<Actor> own, IEnumerable<Actor> enemy, float normalizeByValue,
Func<IEnumerable<Actor>, Func<Actor, int>, float> relativeFunc, Func<Actor, int> getValue)
{
if (!enemy.Any())

View File

@@ -22,7 +22,7 @@ using OpenRA.Support;
namespace OpenRA.Mods.RA.AI
{
public class HackyAIInfo : IBotInfo, ITraitInfo
public sealed class HackyAIInfo : IBotInfo, ITraitInfo
{
public readonly string Name = "Unnamed Bot";
public readonly int SquadSize = 8;
@@ -90,7 +90,7 @@ namespace OpenRA.Mods.RA.AI
public enum BuildingType { Building, Defense, Refinery }
public class HackyAI : ITick, IBot, INotifyDamage
public sealed class HackyAI : ITick, IBot, INotifyDamage
{
bool enabled;
public int ticks;
@@ -157,7 +157,7 @@ namespace OpenRA.Mods.RA.AI
.Select(t => t.TerrainType).ToArray();
}
int GetPowerProvidedBy(ActorInfo building)
static int GetPowerProvidedBy(ActorInfo building)
{
var bi = building.Traits.GetOrDefault<BuildingInfo>();
return bi != null ? bi.Power : 0;

View File

@@ -65,13 +65,13 @@ namespace OpenRA.Mods.RA.Activities
return new Wait(20); // nothing to do here
}
bool ShouldLayMine(Actor self, CPos p)
static bool ShouldLayMine(Actor self, CPos p)
{
// if there is no unit (other than me) here, we want to place a mine here
return !self.World.ActorMap.GetUnitsAt(p).Any(a => a != self);
}
void LayMine(Actor self)
static void LayMine(Actor self)
{
var limitedAmmo = self.TraitOrDefault<LimitedAmmo>();
if (limitedAmmo != null)

View File

@@ -77,7 +77,7 @@ namespace OpenRA.Mods.RA
}
}
void IssueDevCommand(World world, string command)
static void IssueDevCommand(World world, string command)
{
world.IssueOrder(new Order(command, world.LocalPlayer.PlayerActor, false));
}

View File

@@ -27,7 +27,7 @@ namespace OpenRA.Mods.RA
public override void Activate(Actor collector)
{
Combat.DoExplosion(self, (info as ExplodeCrateActionInfo).Weapon, collector.CenterPosition);
Combat.DoExplosion(self, ((ExplodeCrateActionInfo)info).Weapon, collector.CenterPosition);
base.Activate(collector);
}
}

View File

@@ -30,10 +30,11 @@ namespace OpenRA.Mods.RA
{
collector.World.AddFrameEndTask(w =>
{
var amount = (info as GiveCashCrateActionInfo).Amount;
var crateInfo = (GiveCashCrateActionInfo)info;
var amount = crateInfo.Amount;
collector.Owner.PlayerActor.Trait<PlayerResources>().GiveCash(amount);
if ((info as GiveCashCrateActionInfo).UseCashTick)
if (crateInfo.UseCashTick)
w.Add(new CashTick(collector.CenterPosition, collector.Owner.Color.RGB, amount));
});

View File

@@ -32,7 +32,7 @@ namespace OpenRA.Mods.RA.Crates
.Any(a => a.Actor.Owner == collector.Owner);
return hasBase ? info.SelectionShares :
(info as GiveMcvCrateActionInfo).NoBaseSelectionShares;
((GiveMcvCrateActionInfo)info).NoBaseSelectionShares;
}
}
}

View File

@@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA
{
var gainsExperience = collector.TraitOrDefault<GainsExperience>();
if (gainsExperience != null)
gainsExperience.GiveLevels((info as LevelUpCrateActionInfo).Levels);
gainsExperience.GiveLevels(((LevelUpCrateActionInfo)info).Levels);
});
base.Activate(collector);

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA
bool ShouldReveal(Player collectingPlayer)
{
if ((info as RevealMapCrateActionInfo).IncludeAllies)
if (((RevealMapCrateActionInfo)info).IncludeAllies)
return collectingPlayer.World.LocalPlayer != null &&
collectingPlayer.Stances[collectingPlayer.World.LocalPlayer] == Stance.Ally;

View File

@@ -20,7 +20,7 @@ namespace OpenRA.Mods.RA
class DemoTruck : IIssueOrder, IResolveOrder, IOrderVoice
{
void Explode(Actor self)
static void Explode(Actor self)
{
self.World.AddFrameEndTask(w =>
{

View File

@@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA
new TypeDictionary { new OwnerInit(self.Owner), new LocationInit(self.Location) });
if (IsSuitableCell(self, pilot, self.Location))
if (IsSuitableCell(self, pilot))
{
if (cp.Z > 0)
{
@@ -66,7 +66,7 @@ namespace OpenRA.Mods.RA
pilot.Destroy();
}
bool IsSuitableCell(Actor self, Actor actorToDrop, CPos p)
static bool IsSuitableCell(Actor self, Actor actorToDrop)
{
return actorToDrop.Trait<IPositionable>().CanEnterCell(self.Location, self, true);
}

View File

@@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA
class EmitCargoOnSell : INotifySold
{
void Emit(Actor self)
static void Emit(Actor self)
{
// TODO: would like to spill all actors out similar to how we call Unload
}

View File

@@ -28,7 +28,7 @@ namespace OpenRA.Mods.RA
{
public void Selling(Actor self) { }
void Emit(Actor self)
static void Emit(Actor self)
{
var info = self.Info.Traits.Get<EmitInfantryOnSellInfo>();
var csv = self.Info.Traits.GetOrDefault<CustomSellValueInfo>();

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Mods.RA
return new Order(order.OrderID, self, queued) { TargetActor = target.Actor };
}
bool IsValidOrder(Actor self, Order order)
static bool IsValidOrder(Actor self, Order order)
{
// Not targeting a frozen actor
if (order.ExtraData == 0 && order.TargetActor == null)

View File

@@ -56,7 +56,7 @@ namespace OpenRA.Mods.RA
return new Order(order.OrderID, self, queued) { TargetActor = target.Actor };
}
bool IsValidOrder(Actor self, Order order)
static bool IsValidOrder(Actor self, Order order)
{
// Not targeting an actor
if (order.ExtraData == 0 && order.TargetActor == null)

View File

@@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA
class GivesBounty : INotifyKilled
{
int GetMultiplier(Actor self)
static int GetMultiplier(Actor self)
{
// returns 100's as 1, so as to keep accuracy for longer.
var info = self.Info.Traits.Get<GivesBountyInfo>();

View File

@@ -349,7 +349,7 @@ namespace OpenRA.Mods.RA
}
}
CPos? FindNextResourceForBot(Actor self)
static CPos? FindNextResourceForBot(Actor self)
{
// NOTE: This is only used for the AI to find the next available resource to harvest.
var harvInfo = self.Info.Traits.Get<HarvesterInfo>();

View File

@@ -52,7 +52,7 @@ namespace OpenRA.Mods.RA
remainingFrames--;
}
Color ColorForEffect(EffectType t, Color orig)
static Color ColorForEffect(EffectType t, Color orig)
{
switch (t)
{

View File

@@ -171,7 +171,7 @@ namespace OpenRA.Mods.RA.Move
throw new InvalidOperationException("(Move) Sanity check failed");
}
void NotifyBlocker(Actor self, CPos nextCell)
static void NotifyBlocker(Actor self, CPos nextCell)
{
foreach (var blocker in self.World.ActorMap.GetUnitsAt(nextCell))
{

View File

@@ -31,10 +31,10 @@ namespace OpenRA.Mods.RA.Orders
if (mi.Button == MouseButton.Right)
world.CancelInputMode();
return OrderInner(world, xy, mi);
return OrderInner(world, mi);
}
IEnumerable<Order> OrderInner(World world, CPos xy, MouseInput mi)
IEnumerable<Order> OrderInner(World world, MouseInput mi)
{
if (mi.Button == MouseButton.Left)
{
@@ -59,7 +59,7 @@ namespace OpenRA.Mods.RA.Orders
public string GetCursor(World world, CPos xy, MouseInput mi)
{
mi.Button = MouseButton.Left;
return cursor + (OrderInner(world, xy, mi).Any() ? "" : "-blocked");
return cursor + (OrderInner(world, mi).Any() ? "" : "-blocked");
}
}

View File

@@ -23,10 +23,10 @@ namespace OpenRA.Mods.RA.Orders
if (mi.Button == MouseButton.Right)
world.CancelInputMode();
return OrderInner(world, xy, mi);
return OrderInner(world, mi);
}
IEnumerable<Order> OrderInner(World world, CPos xy, MouseInput mi)
IEnumerable<Order> OrderInner(World world, MouseInput mi)
{
if (mi.Button == MouseButton.Left)
{
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.RA.Orders
public string GetCursor(World world, CPos xy, MouseInput mi)
{
mi.Button = MouseButton.Left;
return OrderInner(world, xy, mi).Any()
return OrderInner(world, mi).Any()
? "repair" : "repair-blocked";
}
}

View File

@@ -58,12 +58,12 @@ namespace OpenRA.Mods.RA
}
}
bool IsSuitableCell(Actor actorToDrop, CPos p)
static bool IsSuitableCell(Actor actorToDrop, CPos p)
{
return actorToDrop.Trait<IPositionable>().CanEnterCell(p);
}
void FinishedDropping(Actor self)
static void FinishedDropping(Actor self)
{
self.CancelActivity();
self.QueueActivity(new FlyOffMap());

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA
public void Tick(Actor self) { IsActive = UpdateActive(self); }
bool UpdateActive(Actor self)
static bool UpdateActive(Actor self)
{
// Check if powered
if (self.IsDisabled()) return false;

View File

@@ -80,7 +80,7 @@ namespace OpenRA.Mods.RA
}
}
void ChangeOwnership(Actor self, Actor captor)
static void ChangeOwnership(Actor self, Actor captor)
{
self.World.AddFrameEndTask(w =>
{

View File

@@ -77,7 +77,7 @@ namespace OpenRA.Mods.RA.Render
dirty = false;
}
void UpdateNeighbours(Actor self)
static void UpdateNeighbours(Actor self)
{
var vec = new CVec(1, 1);
var neighbours = self.World.FindActorsInBox(self.Location - vec, self.Location + vec)

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA.Scripting
{
public TriggerGlobal(ScriptContext context) : base(context) { }
ScriptTriggers GetScriptTriggers(Actor a)
static ScriptTriggers GetScriptTriggers(Actor a)
{
var events = a.TraitOrDefault<ScriptTriggers>();
if (events == null)

View File

@@ -102,7 +102,7 @@ namespace OpenRA.Mods.RA.Scripting
return Activator.CreateInstance(type, argsArray);
}
object[] ConvertArgs(LuaTable args)
static object[] ConvertArgs(LuaTable args)
{
var argsArray = new object[args.Keys.Count];
for (var i = 1; i <= args.Keys.Count; i++)

View File

@@ -14,7 +14,7 @@ using OpenRA.Widgets;
namespace OpenRA.Scripting
{
public class Media
public static class Media
{
public static void PlayFMVFullscreen(World w, string movie, Action onComplete)
{

View File

@@ -54,7 +54,7 @@ namespace OpenRA.Mods.RA.Server
return true;
}
void CheckAutoStart(S server, Connection conn, Session.Client client)
static void CheckAutoStart(S server)
{
var playerClients = server.LobbyInfo.Clients.Where(c => c.Bot == null && c.Slot != null);
@@ -93,7 +93,7 @@ namespace OpenRA.Mods.RA.Server
server.SyncLobbyClients();
CheckAutoStart(server, conn, client);
CheckAutoStart(server);
return true;
}},
@@ -131,7 +131,7 @@ namespace OpenRA.Mods.RA.Server
client.Slot = s;
S.SyncClientToPlayerReference(client, server.Map.Players[s]);
server.SyncLobbyClients();
CheckAutoStart(server, conn, client);
CheckAutoStart(server);
return true;
}},

View File

@@ -27,7 +27,7 @@ namespace OpenRA.Mods.RA
SpawnUnitsForPlayer(world, s.Key, s.Value);
}
void SpawnUnitsForPlayer(World w, Player p, CPos sp)
static void SpawnUnitsForPlayer(World w, Player p, CPos sp)
{
var spawnClass = p.PlayerReference.StartingUnitsClass ?? w.LobbyInfo.GlobalSettings.StartingUnitsClass;
var unitGroup = w.Map.Rules.Actors["world"].Traits.WithInterface<MPStartUnitsInfo>()

View File

@@ -54,7 +54,7 @@ namespace OpenRA.Mods.RA
public IEnumerable<Actor> UnitsInRange(CPos xy)
{
var range = (Info as ChronoshiftPowerInfo).Range;
var range = ((ChronoshiftPowerInfo)Info).Range;
var tiles = self.World.FindTilesInCircle(xy, range);
var units = new List<Actor>();
foreach (var t in tiles)
@@ -68,7 +68,7 @@ namespace OpenRA.Mods.RA
if (!self.Owner.Shroud.IsExplored(xy))
return false;
var range = (Info as ChronoshiftPowerInfo).Range;
var range = ((ChronoshiftPowerInfo)Info).Range;
var sourceTiles = self.World.FindTilesInCircle(xy, range);
var destTiles = self.World.FindTilesInCircle(sourceLocation, range);
var sourceTerrain = new List<string>();
@@ -120,7 +120,7 @@ namespace OpenRA.Mods.RA
this.manager = manager;
this.order = order;
this.power = power;
this.range = (power.Info as ChronoshiftPowerInfo).Range;
this.range = ((ChronoshiftPowerInfo)power.Info).Range;
tile = world.Map.SequenceProvider.GetSequence("overlay", "target-select").GetSprite(0);
}
@@ -179,7 +179,7 @@ namespace OpenRA.Mods.RA
this.order = order;
this.power = power;
this.sourceLocation = sourceLocation;
this.range = (power.Info as ChronoshiftPowerInfo).Range;
this.range = ((ChronoshiftPowerInfo)power.Info).Range;
var tileset = manager.self.World.TileSet.Id.ToLower();
validTile = world.Map.SequenceProvider.GetSequence("overlay", "target-valid-{0}".F(tileset)).GetSprite(0);
@@ -195,7 +195,7 @@ namespace OpenRA.Mods.RA
yield break;
}
var ret = OrderInner( world, xy, mi ).FirstOrDefault();
var ret = OrderInner(xy).FirstOrDefault();
if (ret == null)
yield break;
@@ -203,7 +203,7 @@ namespace OpenRA.Mods.RA
yield return ret;
}
IEnumerable<Order> OrderInner(World world, CPos xy, MouseInput mi)
IEnumerable<Order> OrderInner(CPos xy)
{
// Cannot chronoshift into unexplored location
if (IsValidTarget(xy))

View File

@@ -46,7 +46,7 @@ namespace OpenRA.Mods.RA
public void Launch(Actor atek, SupportPowerInfo info)
{
atek.World.Add(new DelayedAction((info as GpsPowerInfo).RevealDelay * 25,
atek.World.Add(new DelayedAction(((GpsPowerInfo)info).RevealDelay * 25,
() =>
{
Launched = true;

View File

@@ -54,12 +54,12 @@ namespace OpenRA.Mods.RA
foreach (var target in UnitsInRange(order.TargetLocation)
.Where(a => a.Owner.Stances[self.Owner] == Stance.Ally))
target.Trait<IronCurtainable>().Activate(target, (Info as IronCurtainPowerInfo).Duration * 25);
target.Trait<IronCurtainable>().Activate(target, ((IronCurtainPowerInfo)Info).Duration * 25);
}
public IEnumerable<Actor> UnitsInRange(CPos xy)
{
int range = (Info as IronCurtainPowerInfo).Range;
int range = ((IronCurtainPowerInfo)Info).Range;
var tiles = self.World.FindTilesInCircle(xy, range);
var units = new List<Actor>();
foreach (var t in tiles)
@@ -81,7 +81,7 @@ namespace OpenRA.Mods.RA
this.manager = manager;
this.order = order;
this.power = power;
this.range = (power.Info as IronCurtainPowerInfo).Range;
this.range = ((IronCurtainPowerInfo)power.Info).Range;
tile = world.Map.SequenceProvider.GetSequence("overlay", "target-select").GetSprite(0);
}

View File

@@ -37,12 +37,12 @@ namespace OpenRA.Mods.RA
{
base.Activate(self, order, manager);
var items = (Info as ParatroopersPowerInfo).DropItems;
var info = (ParatroopersPowerInfo)Info;
var items = info.DropItems;
var startPos = self.World.ChooseRandomEdgeCell();
self.World.AddFrameEndTask(w =>
{
var info = (Info as ParatroopersPowerInfo);
var flare = info.FlareType != null ? w.CreateActor(info.FlareType, new TypeDictionary
{
new LocationInit( order.TargetLocation ),

View File

@@ -49,7 +49,7 @@ namespace OpenRA.Mods.RA
new OwnerInit( self.Owner ),
});
camera.QueueActivity(new Wait(25 * (Info as SpyPlanePowerInfo).RevealTime));
camera.QueueActivity(new Wait(25 * ((SpyPlanePowerInfo)Info).RevealTime));
camera.QueueActivity(new RemoveSelf());
})));
plane.QueueActivity(new FlyOffMap());

View File

@@ -191,8 +191,8 @@ namespace OpenRA.Mods.RA.Widgets
if (!IsVisible()) return;
// TODO: fix
int paletteHeight = DrawPalette(CurrentQueue);
DrawBuildTabs(world, paletteHeight);
DrawPalette(CurrentQueue);
DrawBuildTabs(world);
}
int numActualRows = 5;
@@ -413,7 +413,7 @@ namespace OpenRA.Mods.RA.Widgets
Game.GetModifierKeys().HasModifier(Modifiers.Shift) ? 5 : 1));
}
void DrawBuildTabs(World world, int paletteHeight)
void DrawBuildTabs(World world)
{
const int tabWidth = 24;
const int tabHeight = 40;
@@ -450,7 +450,7 @@ namespace OpenRA.Mods.RA.Widgets
}
}
void DrawRightAligned(string text, int2 pos, Color c)
static void DrawRightAligned(string text, int2 pos, Color c)
{
var font = Game.Renderer.Fonts["Bold"];
font.DrawText(text, pos - new int2(font.Measure(text).X, 0), c);

View File

@@ -264,7 +264,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
return true;
}
void ShowColorDropDown(DropDownButtonWidget color, ColorPreviewManagerWidget preview, World world)
static void ShowColorDropDown(DropDownButtonWidget color, ColorPreviewManagerWidget preview, World world)
{
Action onExit = () =>
{

View File

@@ -152,7 +152,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
};
}
string ChooseNickname(string nickname)
static string ChooseNickname(string nickname)
{
if (!IrcUtils.IsNickname(nickname))
{
@@ -172,7 +172,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
IrcClient.Instance.Connect(s.Hostname, s.Port, s.ConnectionTimeout, nickname, s.Username ?? nickname, s.Realname ?? nickname);
}
Widget MakeLabelWidget(LabelWidget template, object item)
static Widget MakeLabelWidget(LabelWidget template, object item)
{
var itemString = item.ToString();
var widget = (LabelWidget)template.Clone();

View File

@@ -169,7 +169,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
}
}
string GetNewsCacheFile()
static string GetNewsCacheFile()
{
var cacheDir = Path.Combine(Platform.SupportDir, "Cache", Game.modData.Manifest.Mod.Id);
Directory.CreateDirectory(cacheDir);
@@ -190,7 +190,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
public string Content;
}
IEnumerable<NewsItem> ReadNews(byte[] bytes)
static IEnumerable<NewsItem> ReadNews(byte[] bytes)
{
var str = Encoding.UTF8.GetString(bytes);
return MiniYaml.FromString(str).Select(node => new NewsItem

View File

@@ -157,7 +157,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
modOffset = selectedIndex - 4;
}
void LoadMod(ModMetadata mod)
static void LoadMod(ModMetadata mod)
{
Game.RunAfterTick(() =>
{

View File

@@ -127,7 +127,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
});
}
string SongLengthLabel(MusicInfo song)
static string SongLengthLabel(MusicInfo song)
{
return "{0:D1}:{1:D2}".F(song.Length / 60, song.Length % 60);
}

View File

@@ -278,7 +278,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
});
}
string MapControl(double control)
static string MapControl(double control)
{
return (control * 100).ToString("F1") + "%";
}

View File

@@ -289,7 +289,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
ConnectionLogic.Connect(host, port, "", OpenLobby, DoNothing);
}
string GetPlayersLabel(GameServer game)
static string GetPlayersLabel(GameServer game)
{
if (game == null || game.Players == 0)
return "";
@@ -298,7 +298,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
return "{0} / {1}".F(game.Players, map.PlayerCount == 0 ? "?" : map.PlayerCount.ToString());
}
string GetStateLabel(GameServer game)
static string GetStateLabel(GameServer game)
{
if (game == null)
return "";

View File

@@ -211,7 +211,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
soundDevice = devices.FirstOrDefault(d => d.Engine == ss.Engine && d.Device == ss.Device) ?? devices.First();
var audioDeviceDropdown = panel.Get<DropDownButtonWidget>("AUDIO_DEVICE");
audioDeviceDropdown.OnMouseDown = _ => ShowAudioDeviceDropdown(audioDeviceDropdown, ss, devices);
audioDeviceDropdown.OnMouseDown = _ => ShowAudioDeviceDropdown(audioDeviceDropdown, devices);
audioDeviceDropdown.GetText = () => soundDevice.Label;
return () =>
@@ -400,7 +400,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
};
}
bool ShowMouseScrollDropdown(DropDownButtonWidget dropdown, GameSettings s)
static bool ShowMouseScrollDropdown(DropDownButtonWidget dropdown, GameSettings s)
{
var options = new Dictionary<string, MouseScrollType>()
{
@@ -422,7 +422,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
return true;
}
bool ShowAudioDeviceDropdown(DropDownButtonWidget dropdown, SoundSettings s, SoundDevice[] devices)
bool ShowAudioDeviceDropdown(DropDownButtonWidget dropdown, SoundDevice[] devices)
{
var i = 0;
var options = devices.ToDictionary(d => (i++).ToString(), d => d);
@@ -441,7 +441,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
return true;
}
bool ShowWindowModeDropdown(DropDownButtonWidget dropdown, GraphicSettings s)
static bool ShowWindowModeDropdown(DropDownButtonWidget dropdown, GraphicSettings s)
{
var options = new Dictionary<string, WindowMode>()
{
@@ -464,7 +464,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
return true;
}
bool ShowLanguageDropdown(DropDownButtonWidget dropdown)
static bool ShowLanguageDropdown(DropDownButtonWidget dropdown)
{
Func<string, ScrollItemWidget, ScrollItemWidget> setupItem = (o, itemTemplate) =>
{

View File

@@ -165,7 +165,7 @@ namespace OpenRA.Mods.RA.Widgets
}
}
Action<MouseInput> HandleSupportPower(string key, SupportPowerManager manager)
static Action<MouseInput> HandleSupportPower(string key, SupportPowerManager manager)
{
return mi =>
{

View File

@@ -251,7 +251,7 @@ namespace OpenRA.Mods.RA.Widgets
return true;
}
bool ToggleStatusBars()
static bool ToggleStatusBars()
{
Game.Settings.Game.AlwaysShowStatusBars ^= true;
return true;