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