fix indents everywhere
This commit is contained in:
@@ -17,7 +17,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public ButtonTooltipLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] ToggleButtonWidget button)
|
||||
[ObjectCreator.Param] ToggleButtonWidget button)
|
||||
{
|
||||
var label = widget.GetWidget<LabelWidget>("LABEL");
|
||||
var hotkey = widget.GetWidget<LabelWidget>("HOTKEY");
|
||||
|
||||
@@ -28,8 +28,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncCheatsLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] Action onExit,
|
||||
[ObjectCreator.Param] World world)
|
||||
[ObjectCreator.Param] Action onExit,
|
||||
[ObjectCreator.Param] World world)
|
||||
{
|
||||
var panel = widget.GetWidget("CHEATS_PANEL");
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
ColorRamp ramp;
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncColorPickerLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] ColorRamp initialRamp,
|
||||
[ObjectCreator.Param] Action<ColorRamp> onChange,
|
||||
[ObjectCreator.Param] Action<ColorRamp> onSelect,
|
||||
[ObjectCreator.Param] WorldRenderer worldRenderer)
|
||||
[ObjectCreator.Param] ColorRamp initialRamp,
|
||||
[ObjectCreator.Param] Action<ColorRamp> onChange,
|
||||
[ObjectCreator.Param] Action<ColorRamp> onSelect,
|
||||
[ObjectCreator.Param] WorldRenderer worldRenderer)
|
||||
{
|
||||
var panel = widget.GetWidget("COLOR_CHOOSER");
|
||||
ramp = initialRamp;
|
||||
@@ -34,9 +34,9 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
Action sliderChanged = () =>
|
||||
{
|
||||
ramp = new ColorRamp((byte)(255*hueSlider.Value),
|
||||
(byte)(255*satSlider.Value),
|
||||
(byte)(255*lumSlider.Value),
|
||||
10);
|
||||
(byte)(255*satSlider.Value),
|
||||
(byte)(255*lumSlider.Value),
|
||||
10);
|
||||
onChange(ramp);
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
// Show connection failed dialog
|
||||
CloseWindow();
|
||||
Widget.OpenWindow("CONNECTIONFAILED_PANEL", new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "onAbort", onAbort },
|
||||
{ "onRetry", onRetry },
|
||||
{ "host", host },
|
||||
@@ -49,11 +49,11 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncConnectingLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] string host,
|
||||
[ObjectCreator.Param] int port,
|
||||
[ObjectCreator.Param] Action onConnect,
|
||||
[ObjectCreator.Param] Action onRetry,
|
||||
[ObjectCreator.Param] Action onAbort)
|
||||
[ObjectCreator.Param] string host,
|
||||
[ObjectCreator.Param] int port,
|
||||
[ObjectCreator.Param] Action onConnect,
|
||||
[ObjectCreator.Param] Action onRetry,
|
||||
[ObjectCreator.Param] Action onAbort)
|
||||
{
|
||||
this.host = host;
|
||||
this.port = port;
|
||||
@@ -74,7 +74,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
Game.JoinServer(host, port);
|
||||
Widget.OpenWindow("CONNECTING_PANEL", new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "host", host },
|
||||
{ "port", port },
|
||||
{ "onConnect", onConnect },
|
||||
@@ -82,16 +82,16 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{ "onRetry", () => Connect(host, port, onConnect, onAbort) }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CncConnectionFailedLogic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncConnectionFailedLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] string host,
|
||||
[ObjectCreator.Param] int port,
|
||||
[ObjectCreator.Param] Action onRetry,
|
||||
[ObjectCreator.Param] Action onAbort)
|
||||
[ObjectCreator.Param] string host,
|
||||
[ObjectCreator.Param] int port,
|
||||
[ObjectCreator.Param] Action onRetry,
|
||||
[ObjectCreator.Param] Action onAbort)
|
||||
{
|
||||
var panel = widget.GetWidget("CONNECTIONFAILED_PANEL");
|
||||
panel.GetWidget<ButtonWidget>("ABORT_BUTTON").OnClick = () => { Widget.CloseWindow(); onAbort(); };
|
||||
@@ -100,4 +100,4 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
widget.GetWidget<LabelWidget>("CONNECTING_DESC").GetText = () =>
|
||||
"Could not connect to {0}:{1}".F(host, port);
|
||||
}
|
||||
}}
|
||||
}}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncConquestObjectivesLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] World world)
|
||||
[ObjectCreator.Param] World world)
|
||||
{
|
||||
var panel = widget.GetWidget("CONQUEST_OBJECTIVES");
|
||||
panel.GetWidget<LabelWidget>("TITLE").GetText = () => "Conquest: " + world.Map.Title;
|
||||
|
||||
@@ -18,8 +18,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncDirectConnectLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] Action onExit,
|
||||
[ObjectCreator.Param] Action openLobby)
|
||||
[ObjectCreator.Param] Action onExit,
|
||||
[ObjectCreator.Param] Action openLobby)
|
||||
{
|
||||
var panel = widget.GetWidget("DIRECTCONNECT_PANEL");
|
||||
var ipField = panel.GetWidget<TextFieldWidget>("IP");
|
||||
|
||||
@@ -29,8 +29,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncDownloadPackagesLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] Dictionary<string,string> installData,
|
||||
[ObjectCreator.Param] Action afterInstall)
|
||||
[ObjectCreator.Param] Dictionary<string,string> installData,
|
||||
[ObjectCreator.Param] Action afterInstall)
|
||||
{
|
||||
this.installData = installData;
|
||||
this.afterInstall = afterInstall;
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncIngameChromeLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] World world )
|
||||
[ObjectCreator.Param] World world )
|
||||
{
|
||||
this.world = world;
|
||||
world.WorldActor.Trait<CncMenuPaletteEffect>()
|
||||
|
||||
@@ -21,8 +21,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncIngameMenuLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] World world,
|
||||
[ObjectCreator.Param] Action onExit)
|
||||
[ObjectCreator.Param] World world,
|
||||
[ObjectCreator.Param] Action onExit)
|
||||
{
|
||||
var resumeDisabled = false;
|
||||
menu = widget.GetWidget("INGAME_MENU");
|
||||
@@ -63,7 +63,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
hideButtons = true;
|
||||
Widget.OpenWindow("MUSIC_PANEL", new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "onExit", () => hideButtons = false },
|
||||
});
|
||||
};
|
||||
@@ -72,7 +72,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
hideButtons = true;
|
||||
Widget.OpenWindow("SETTINGS_PANEL", new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "world", world },
|
||||
{ "onExit", () => hideButtons = false },
|
||||
});
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
return;
|
||||
|
||||
if (!InstallUtils.ExtractFromPackage(source, extractPackage, filesToExtract, dest, onProgress, onError))
|
||||
return;
|
||||
return;
|
||||
|
||||
Game.RunAfterTick(() =>
|
||||
{
|
||||
|
||||
@@ -18,12 +18,12 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncInstallLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] Dictionary<string,string> installData,
|
||||
[ObjectCreator.Param] Action continueLoading)
|
||||
[ObjectCreator.Param] Dictionary<string,string> installData,
|
||||
[ObjectCreator.Param] Action continueLoading)
|
||||
{
|
||||
var panel = widget.GetWidget("INSTALL_PANEL");
|
||||
var args = new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "afterInstall", () => { Widget.CloseWindow(); continueLoading(); } },
|
||||
{ "installData", installData }
|
||||
};
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
panel.GetWidget<ButtonWidget>("MODS_BUTTON").OnClick = () =>
|
||||
{
|
||||
Widget.OpenWindow("MODS_PANEL", new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "onExit", () => {} },
|
||||
// Close this panel
|
||||
{ "onSwitch", Widget.CloseWindow },
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
};
|
||||
|
||||
Widget.OpenWindow("CONNECTIONFAILED_PANEL", new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "onAbort", onExit },
|
||||
{ "onRetry", onRetry },
|
||||
{ "host", om.Host },
|
||||
@@ -85,11 +85,11 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
internal CncLobbyLogic([ObjectCreator.Param( "widget" )] Widget lobby,
|
||||
[ObjectCreator.Param] World world, // Shellmap world
|
||||
[ObjectCreator.Param] OrderManager orderManager,
|
||||
[ObjectCreator.Param] Action onExit,
|
||||
[ObjectCreator.Param] Action onStart,
|
||||
[ObjectCreator.Param] bool addBots)
|
||||
[ObjectCreator.Param] World world, // Shellmap world
|
||||
[ObjectCreator.Param] OrderManager orderManager,
|
||||
[ObjectCreator.Param] Action onExit,
|
||||
[ObjectCreator.Param] Action onStart,
|
||||
[ObjectCreator.Param] bool addBots)
|
||||
{
|
||||
this.orderManager = orderManager;
|
||||
this.OnGameStart = () => { CloseWindow(); onStart(); };
|
||||
@@ -119,7 +119,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
var map = mapPreview.Map();
|
||||
if (map == null || mi.Button != MouseButton.Left
|
||||
|| orderManager.LocalClient.State == Session.ClientState.Ready)
|
||||
|| orderManager.LocalClient.State == Session.ClientState.Ready)
|
||||
return;
|
||||
|
||||
var p = map.SpawnPoints
|
||||
@@ -225,7 +225,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
lobby.GetWidget<ButtonWidget>("MUSIC_BUTTON").OnClick = () =>
|
||||
{
|
||||
Widget.OpenWindow("MUSIC_PANEL", new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "onExit", () => {} },
|
||||
});
|
||||
};
|
||||
@@ -290,8 +290,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
Func<int, ScrollItemWidget, ScrollItemWidget> setupItem = (ii, itemTemplate) =>
|
||||
{
|
||||
var item = ScrollItemWidget.Setup(itemTemplate,
|
||||
() => client.SpawnPoint == ii,
|
||||
() => orderManager.IssueOrder(Order.Command("spawn {0} {1}".F(client.Index, ii))));
|
||||
() => client.SpawnPoint == ii,
|
||||
() => orderManager.IssueOrder(Order.Command("spawn {0} {1}".F(client.Index, ii))));
|
||||
item.GetWidget<LabelWidget>("LABEL").GetText = () => ii == 0 ? "-" : ii.ToString();
|
||||
return item;
|
||||
};
|
||||
@@ -372,11 +372,11 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
}
|
||||
// Editable player in slot
|
||||
else if ((client.Index == orderManager.LocalClient.Index) ||
|
||||
(client.Bot != null && Game.IsHost))
|
||||
(client.Bot != null && Game.IsHost))
|
||||
{
|
||||
template = EditablePlayerTemplate.Clone();
|
||||
var botReady = (client.Bot != null && Game.IsHost
|
||||
&& orderManager.LocalClient.State == Session.ClientState.Ready);
|
||||
&& orderManager.LocalClient.State == Session.ClientState.Ready);
|
||||
var ready = botReady || client.State == Session.ClientState.Ready;
|
||||
|
||||
if (client.Bot != null)
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncMenuLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] World world)
|
||||
[ObjectCreator.Param] World world)
|
||||
{
|
||||
world.WorldActor.Trait<CncMenuPaletteEffect>()
|
||||
.Fade(CncMenuPaletteEffect.EffectType.Desaturated);
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
Menu = MenuType.None;
|
||||
Widget.OpenWindow("MODS_PANEL", new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "onExit", () => Menu = MenuType.Main },
|
||||
{ "onSwitch", RemoveShellmapUI }
|
||||
});
|
||||
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
Menu = MenuType.None;
|
||||
Widget.OpenWindow("SERVERBROWSER_PANEL", new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "onExit", () => Menu = MenuType.Multiplayer },
|
||||
{ "openLobby", () => OpenLobbyPanel(MenuType.Multiplayer, false) }
|
||||
});
|
||||
@@ -71,7 +71,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
Menu = MenuType.None;
|
||||
Widget.OpenWindow("CREATESERVER_PANEL", new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "onExit", () => Menu = MenuType.Multiplayer },
|
||||
{ "openLobby", () => OpenLobbyPanel(MenuType.Multiplayer, false) }
|
||||
});
|
||||
@@ -81,7 +81,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
Menu = MenuType.None;
|
||||
Widget.OpenWindow("DIRECTCONNECT_PANEL", new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "onExit", () => Menu = MenuType.Multiplayer },
|
||||
{ "openLobby", () => OpenLobbyPanel(MenuType.Multiplayer, false) }
|
||||
});
|
||||
@@ -95,7 +95,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
Menu = MenuType.None;
|
||||
Widget.OpenWindow("REPLAYBROWSER_PANEL", new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "onExit", () => Menu = MenuType.Settings },
|
||||
{ "onStart", RemoveShellmapUI }
|
||||
});
|
||||
@@ -105,7 +105,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
Menu = MenuType.None;
|
||||
Widget.OpenWindow("MUSIC_PANEL", new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "onExit", () => Menu = MenuType.Settings },
|
||||
});
|
||||
};
|
||||
@@ -114,7 +114,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
Menu = MenuType.None;
|
||||
Widget.OpenWindow("SETTINGS_PANEL", new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "world", world },
|
||||
{ "onExit", () => Menu = MenuType.Settings },
|
||||
});
|
||||
@@ -146,9 +146,9 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
var map = WidgetUtils.ChooseInitialMap(Game.Settings.Server.Map);
|
||||
|
||||
CncConnectingLogic.Connect(IPAddress.Loopback.ToString(),
|
||||
Game.CreateLocalServer(map),
|
||||
() => OpenLobbyPanel(MenuType.Main, true),
|
||||
() => { Game.CloseServer(); Menu = MenuType.Main; });
|
||||
Game.CreateLocalServer(map),
|
||||
() => OpenLobbyPanel(MenuType.Main, true),
|
||||
() => { Game.CloseServer(); Menu = MenuType.Main; });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncModBrowserLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] Action onSwitch,
|
||||
[ObjectCreator.Param] Action onExit)
|
||||
[ObjectCreator.Param] Action onSwitch,
|
||||
[ObjectCreator.Param] Action onExit)
|
||||
{
|
||||
var panel = widget.GetWidget("MODS_PANEL");
|
||||
var modList = panel.GetWidget<ScrollPanelWidget>("MOD_LIST");
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncMusicPlayerLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] Action onExit)
|
||||
[ObjectCreator.Param] Action onExit)
|
||||
{
|
||||
panel = widget.GetWidget("MUSIC_PANEL");
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
|
||||
panel.GetWidget<LabelWidget>("TIME_LABEL").GetText = () => (currentSong == null) ? "" :
|
||||
"{0:D2}:{1:D2} / {2:D2}:{3:D2}".F((int)Sound.MusicSeekPosition / 60, (int)Sound.MusicSeekPosition % 60,
|
||||
currentSong.Length / 60, currentSong.Length % 60);
|
||||
currentSong.Length / 60, currentSong.Length % 60);
|
||||
panel.GetWidget<LabelWidget>("TITLE_LABEL").GetText = () => (currentSong == null) ? "" : currentSong.Title;
|
||||
|
||||
var musicSlider = panel.GetWidget<SliderWidget>("MUSIC_SLIDER");
|
||||
|
||||
@@ -42,8 +42,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncServerBrowserLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] Action openLobby,
|
||||
[ObjectCreator.Param] Action onExit)
|
||||
[ObjectCreator.Param] Action openLobby,
|
||||
[ObjectCreator.Param] Action onExit)
|
||||
{
|
||||
var panel = widget.GetWidget("SERVERBROWSER_PANEL");
|
||||
var sl = panel.GetWidget<ScrollPanelWidget>("SERVER_LIST");
|
||||
@@ -127,9 +127,9 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
return;
|
||||
}
|
||||
|
||||
var gamesWaiting = games.Where(g => g.CanJoin());
|
||||
var gamesWaiting = games.Where(g => g.CanJoin());
|
||||
|
||||
if (gamesWaiting.Count() == 0)
|
||||
if (gamesWaiting.Count() == 0)
|
||||
{
|
||||
searchStatus = SearchStatus.NoGames;
|
||||
return;
|
||||
@@ -138,7 +138,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
searchStatus = SearchStatus.Hidden;
|
||||
currentServer = gamesWaiting.FirstOrDefault();
|
||||
|
||||
foreach (var loop in gamesWaiting)
|
||||
foreach (var loop in gamesWaiting)
|
||||
{
|
||||
var game = loop;
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncSettingsLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] World world,
|
||||
[ObjectCreator.Param] Action onExit)
|
||||
[ObjectCreator.Param] World world,
|
||||
[ObjectCreator.Param] Action onExit)
|
||||
{
|
||||
this.world = world;
|
||||
var panel = widget.GetWidget("SETTINGS_PANEL");
|
||||
|
||||
@@ -23,8 +23,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public ProductionTooltipLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] TooltipContainerWidget tooltipContainer,
|
||||
[ObjectCreator.Param] ProductionPaletteWidget palette)
|
||||
[ObjectCreator.Param] TooltipContainerWidget tooltipContainer,
|
||||
[ObjectCreator.Param] ProductionPaletteWidget palette)
|
||||
{
|
||||
var pm = palette.world.LocalPlayer.PlayerActor.Trait<PowerManager>();
|
||||
var pr = palette.world.LocalPlayer.PlayerActor.Trait<PlayerResources>();
|
||||
@@ -71,7 +71,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
var costString = "$: {0}".F(cost);
|
||||
costLabel.GetText = () => costString;
|
||||
costLabel.GetColor = () => pr.DisplayCash + pr.DisplayOre >= cost
|
||||
? Color.White : Color.Red;
|
||||
? Color.White : Color.Red;
|
||||
|
||||
var leftWidth = Math.Max(font.Measure(tooltip.Name).X, requiresFont.Measure(requiresString).X);
|
||||
var rightWidth = new [] {font.Measure(powerString).X, font.Measure(timeString).X, font.Measure(costString).X}.Aggregate(Math.Max);
|
||||
|
||||
@@ -18,8 +18,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public SimpleTooltipLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] TooltipContainerWidget tooltipContainer,
|
||||
[ObjectCreator.Param] Func<string> getText)
|
||||
[ObjectCreator.Param] TooltipContainerWidget tooltipContainer,
|
||||
[ObjectCreator.Param] Func<string> getText)
|
||||
{
|
||||
var label = widget.GetWidget<LabelWidget>("LABEL");
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public SupportPowerTooltipLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] TooltipContainerWidget tooltipContainer,
|
||||
[ObjectCreator.Param] SupportPowersWidget palette)
|
||||
[ObjectCreator.Param] TooltipContainerWidget tooltipContainer,
|
||||
[ObjectCreator.Param] SupportPowersWidget palette)
|
||||
{
|
||||
widget.IsVisible = () => palette.TooltipPower != null;
|
||||
var nameLabel = widget.GetWidget<LabelWidget>("NAME");
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
return;
|
||||
|
||||
time = "{0} / {1}".F(WidgetUtils.FormatTime(sp.RemainingTime),
|
||||
WidgetUtils.FormatTime(sp.Info.ChargeTime*25));
|
||||
WidgetUtils.FormatTime(sp.Info.ChargeTime*25));
|
||||
|
||||
if (sp == lastPower)
|
||||
return;
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public WorldTooltipLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] TooltipContainerWidget tooltipContainer,
|
||||
[ObjectCreator.Param] CncWorldInteractionControllerWidget wic)
|
||||
[ObjectCreator.Param] TooltipContainerWidget tooltipContainer,
|
||||
[ObjectCreator.Param] CncWorldInteractionControllerWidget wic)
|
||||
{
|
||||
widget.IsVisible = () => wic.TooltipType != Type.None;
|
||||
var label = widget.GetWidget<LabelWidget>("LABEL");
|
||||
|
||||
Reference in New Issue
Block a user