tidy whitespace
This commit is contained in:
@@ -34,7 +34,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
var devModeButton = Widget.RootWidget.GetWidget<ButtonWidget>("INGAME_DEVELOPERMODE_BUTTON");
|
||||
devModeButton.OnClick = () => devmodeBG.Visible ^= true;
|
||||
|
||||
|
||||
var devTrait = world.LocalPlayer.PlayerActor.Trait<DeveloperMode>();
|
||||
|
||||
var shroudCheckbox = devmodeBG.GetWidget<CheckboxWidget>("CHECKBOX_SHROUD");
|
||||
@@ -73,7 +72,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
devModeButton.IsVisible = () => { return world.LobbyInfo.GlobalSettings.AllowCheats; };
|
||||
}
|
||||
|
||||
|
||||
public void Order(World world, string order)
|
||||
{
|
||||
world.IssueOrder(new Order(order, world.LocalPlayer.PlayerActor, false));
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
int validPlayers = 0;
|
||||
readonly World world;
|
||||
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public DiplomacyLogic( [ObjectCreator.Param] World world )
|
||||
{
|
||||
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
validPlayers = world.Players.Where(a => a != world.LocalPlayer && !a.NonCombatant).Count();
|
||||
diplomacy.IsVisible = () => (validPlayers > 0);
|
||||
}
|
||||
|
||||
|
||||
// This is shit
|
||||
void LayoutDialog(Widget bg)
|
||||
{
|
||||
|
||||
@@ -17,20 +17,20 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
public class IngameChromeLogic
|
||||
{
|
||||
Widget gameRoot;
|
||||
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public IngameChromeLogic( [ObjectCreator.Param] World world )
|
||||
{
|
||||
Game.AddChatLine += AddChatLine;
|
||||
Game.BeforeGameStart += UnregisterEvents;
|
||||
|
||||
|
||||
var r = Widget.RootWidget;
|
||||
gameRoot = r.GetWidget("INGAME_ROOT");
|
||||
var optionsBG = gameRoot.GetWidget("INGAME_OPTIONS_BG");
|
||||
|
||||
|
||||
r.GetWidget<ButtonWidget>("INGAME_OPTIONS_BUTTON").OnClick = () =>
|
||||
optionsBG.Visible = !optionsBG.Visible;
|
||||
|
||||
|
||||
optionsBG.GetWidget<ButtonWidget>("DISCONNECT").OnClick = () =>
|
||||
{
|
||||
optionsBG.Visible = false;
|
||||
@@ -39,11 +39,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
Widget.CloseWindow();
|
||||
Widget.OpenWindow("MAINMENU_BG");
|
||||
};
|
||||
|
||||
|
||||
optionsBG.GetWidget<ButtonWidget>("SETTINGS").OnClick = () => Widget.OpenWindow("SETTINGS_MENU");
|
||||
optionsBG.GetWidget<ButtonWidget>("MUSIC").OnClick = () => Widget.OpenWindow("MUSIC_MENU");
|
||||
optionsBG.GetWidget<ButtonWidget>("RESUME").OnClick = () => optionsBG.Visible = false;
|
||||
|
||||
|
||||
optionsBG.GetWidget<ButtonWidget>("SURRENDER").OnClick = () =>
|
||||
world.IssueOrder(new Order("Surrender", world.LocalPlayer.PlayerActor, false));
|
||||
optionsBG.GetWidget("SURRENDER").IsVisible = () => (world.LocalPlayer != null && world.LocalPlayer.WinState == WinState.Undefined);
|
||||
@@ -54,7 +54,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
return world.LocalPlayer != null && world.LocalPlayer.WinState != WinState.Undefined;
|
||||
};
|
||||
|
||||
|
||||
postgameText.GetText = () =>
|
||||
{
|
||||
var state = world.LocalPlayer.WinState;
|
||||
@@ -62,13 +62,13 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
(state == WinState.Lost ? "YOU ARE DEFEATED" : "YOU ARE VICTORIOUS");
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
void UnregisterEvents()
|
||||
{
|
||||
Game.AddChatLine -= AddChatLine;
|
||||
Game.BeforeGameStart -= UnregisterEvents;
|
||||
}
|
||||
|
||||
|
||||
void AddChatLine(Color c, string from, string text)
|
||||
{
|
||||
gameRoot.GetWidget<ChatDisplayWidget>("CHAT_DISPLAY").AddLine(c, from, text);
|
||||
|
||||
Reference in New Issue
Block a user