diff --git a/OpenRA.Game/Widgets/ButtonWidget.cs b/OpenRA.Game/Widgets/ButtonWidget.cs index 106eee97a1..5a4acdc6ce 100644 --- a/OpenRA.Game/Widgets/ButtonWidget.cs +++ b/OpenRA.Game/Widgets/ButtonWidget.cs @@ -24,8 +24,9 @@ namespace OpenRA.Widgets public string Font = ChromeMetrics.Get("ButtonFont"); public string ClickSound = null; public string ClickDisabledSound = null; + public bool Disabled = false; public Func GetText; - public Func IsDisabled = () => false; + public Func IsDisabled; public Action OnMouseDown = _ => {}; public Action OnMouseUp = _ => {}; @@ -39,6 +40,7 @@ namespace OpenRA.Widgets GetText = () => { return Text; }; OnMouseUp = _ => OnClick(); OnKeyPress = _ => OnClick(); + IsDisabled = () => Disabled; } protected ButtonWidget(ButtonWidget widget) @@ -50,6 +52,8 @@ namespace OpenRA.Widgets VisualHeight = widget.VisualHeight; GetText = widget.GetText; OnMouseDown = widget.OnMouseDown; + Disabled = widget.Disabled; + IsDisabled = widget.IsDisabled; OnMouseUp = mi => OnClick(); OnKeyPress = _ => OnClick(); diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs index 1b319152e1..6f38b7adfe 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs @@ -22,15 +22,13 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic var panel = widget.GetWidget("CONQUEST_OBJECTIVES"); panel.GetWidget("TITLE").GetText = () => "Conquest: " + world.Map.Title; - var objectiveCheckbox = panel.GetWidget("OBJECTIVE_CHECKBOX"); - objectiveCheckbox.IsDisabled = () => true; - - var statusLabel = panel.GetWidget("STATUS_LABEL"); + var statusLabel = panel.GetWidget("STATUS"); statusLabel.IsVisible = () => world.LocalPlayer != null; if (world.LocalPlayer != null) { var lp = world.LocalPlayer; + var objectiveCheckbox = panel.GetWidget("1"); objectiveCheckbox.IsChecked = () => lp.WinState != WinState.Undefined; objectiveCheckbox.GetCheckType = () => lp.WinState == WinState.Won ? "checked" : "crossed"; diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs index 919dad7f71..500b4f849a 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs @@ -115,7 +115,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic BindOrderButton(world, sidebarRoot, "REPAIR_BUTTON", "repair"); var playerResources = world.LocalPlayer.PlayerActor.Trait(); - sidebarRoot.GetWidget("CASH_DISPLAY").GetText = () => + sidebarRoot.GetWidget("CASH").GetText = () => "${0}".F(playerResources.DisplayCash + playerResources.DisplayOre); queueTabs = playerWidgets.GetWidget("PRODUCTION_TABS"); diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncPerfDebugLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncPerfDebugLogic.cs index 4c723f2bf4..3b0f17f30f 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncPerfDebugLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncPerfDebugLogic.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic { // Performance info var perfRoot = widget.GetWidget("PERFORMANCE_INFO"); - perfRoot.GetWidget("PERF_GRAPH").IsVisible = () => Game.Settings.Debug.PerfGraph; + perfRoot.IsVisible = () => Game.Settings.Debug.PerfGraph; var text = perfRoot.GetWidget("PERF_TEXT"); text.IsVisible = () => Game.Settings.Debug.PerfText; text.GetText = () => diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncSettingsLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncSettingsLogic.cs index d782aa9d46..d3c9b97428 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncSettingsLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncSettingsLogic.cs @@ -55,7 +55,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic playerPalettePreview = world.WorldActor.Trait(); playerPalettePreview.Ramp = playerSettings.ColorRamp; - var colorDropdown = generalPane.GetWidget("COLOR_DROPDOWN"); + var colorDropdown = generalPane.GetWidget("COLOR"); colorDropdown.OnMouseDown = _ => ShowColorPicker(colorDropdown, playerSettings); colorDropdown.GetWidget("COLORBLOCK").GetColor = () => playerSettings.ColorRamp.GetColor(0); diff --git a/mods/cnc/chrome/ingame.yaml b/mods/cnc/chrome/ingame.yaml index 9e874d9f46..9caca66787 100644 --- a/mods/cnc/chrome/ingame.yaml +++ b/mods/cnc/chrome/ingame.yaml @@ -41,7 +41,7 @@ Container@INGAME_ROOT: Height:WINDOW_BOTTOM TooltipContainer:TOOLTIP_CONTAINER Container@PLAYER_ROOT: - TooltipContainer: + TooltipContainer@TOOLTIP_CONTAINER: Container@OBSERVER_WIDGETS: Children: ToggleButton@OPTIONS_BUTTON: @@ -73,7 +73,7 @@ Container@OBSERVER_WIDGETS: Height:PARENT_BOTTOM-2 Container@PLAYER_WIDGETS: Children: - LogicTicker: + LogicTicker@WIN_LOSS_WATCHER: Button@CHEATS_BUTTON: X:WINDOW_RIGHT-400 Y:5 @@ -106,7 +106,7 @@ Container@PLAYER_WIDGETS: ClickSound:button.aud ClickDisabledSound:scold2.aud Children: - Image: + Image@ICON: X:7 Y:5 ImageCollection:order-icons @@ -123,7 +123,7 @@ Container@PLAYER_WIDGETS: ClickSound:button.aud ClickDisabledSound:scold2.aud Children: - Image: + Image@ICON: X:7 Y:5 ImageCollection:order-icons @@ -139,7 +139,7 @@ Container@PLAYER_WIDGETS: ClickSound:button.aud ClickDisabledSound:scold2.aud Children: - Image: + Image@ICON: X:7 Y:5 ImageCollection:order-icons @@ -169,11 +169,6 @@ Container@PLAYER_WIDGETS: Width:PARENT_RIGHT-2 Height:PARENT_BOTTOM-2 TooltipContainer:TOOLTIP_CONTAINER -# Label@POWERICON: -# X:4 -# Y:180 -# Text:P -# Font:Bold Background@SILOBAR: X:180 Y:5 @@ -187,11 +182,6 @@ Container@PLAYER_WIDGETS: Width:PARENT_RIGHT-2 Height:PARENT_BOTTOM-2 TooltipContainer:TOOLTIP_CONTAINER -# Label@SILOICON: -# X:181 -# Y:180 -# Text:T -# Font:Bold Label@CASH: Y:170 Width:PARENT_RIGHT @@ -213,7 +203,7 @@ Container@PLAYER_WIDGETS: ClickSound:button.aud ClickDisabledSound:scold2.aud Children: - Image: + Image@ICON: X:7 Y:7 ImageCollection:production-icons @@ -227,7 +217,7 @@ Container@PLAYER_WIDGETS: ClickSound:button.aud ClickDisabledSound:scold2.aud Children: - Image: + Image@ICON: X:7 Y:7 ImageCollection:production-icons @@ -241,7 +231,7 @@ Container@PLAYER_WIDGETS: ClickSound:button.aud ClickDisabledSound:scold2.aud Children: - Image: + Image@ICON: X:7 Y:7 ImageCollection:production-icons @@ -255,7 +245,7 @@ Container@PLAYER_WIDGETS: ClickSound:button.aud ClickDisabledSound:scold2.aud Children: - Image: + Image@ICON: X:7 Y:7 ImageCollection:production-icons @@ -269,11 +259,11 @@ Container@PLAYER_WIDGETS: ClickSound:button.aud ClickDisabledSound:scold2.aud Children: - Image: + Image@ICON: X:7 Y:7 ImageCollection:production-icons - ProductionTabs: + ProductionTabs@PRODUCTION_TABS: PaletteWidget:PRODUCTION_PALETTE ClickSound:button.aud DisabledClickSound:scold2.aud @@ -281,7 +271,7 @@ Container@PLAYER_WIDGETS: Y:268 Width:194 Height:20 - ProductionPalette: + ProductionPalette@PRODUCTION_PALETTE: X:WINDOW_RIGHT - 204 Y:287 TabClick: button.aud diff --git a/mods/cnc/chrome/objectives.yaml b/mods/cnc/chrome/objectives.yaml index c6ed1787e7..184771f640 100644 --- a/mods/cnc/chrome/objectives.yaml +++ b/mods/cnc/chrome/objectives.yaml @@ -37,6 +37,7 @@ Container@CONQUEST_OBJECTIVES: Height:20 Font:Bold Text:Crush all opposition! + Disabled: yes Container@LABEL_CONTAINER: X:17 Y:80 @@ -117,4 +118,4 @@ Container@CONQUEST_OBJECTIVES: X:380 Width:70 Height:25 - Align:Center \ No newline at end of file + Align:Center diff --git a/mods/cnc/chrome/settings.yaml b/mods/cnc/chrome/settings.yaml index 2157dd8c2f..469b2cdbbc 100644 --- a/mods/cnc/chrome/settings.yaml +++ b/mods/cnc/chrome/settings.yaml @@ -56,7 +56,7 @@ Container@SETTINGS_PANEL: Font:Bold Text:Debug Align:Center - Checkbox@PERFINFO_CHECKBOX: + Checkbox@PERFTEXT_CHECKBOX: X:15 Y:120 Width:300 @@ -98,7 +98,7 @@ Container@SETTINGS_PANEL: Height:25 Font:Regular Text:Windowed - Container@WINDOWRES: + Container@WINDOW_RESOLUTION: X:595 Y:40 Children: @@ -109,7 +109,7 @@ Container@SETTINGS_PANEL: Height:25 Width:25 Align:Center - TextField@SCREEN_WIDTH: + TextField@WINDOW_WIDTH: X:25 Width:45 Height:25 @@ -122,7 +122,7 @@ Container@SETTINGS_PANEL: Height:25 Width:15 Align:Center - TextField@SCREEN_HEIGHT: + TextField@WINDOW_HEIGHT: X:85 Width:45 Height:25 @@ -245,21 +245,6 @@ Container@SETTINGS_PANEL: Height:25 Font:Regular Text:Enabled -# Label@MULTITOUCH_SCROLL_LABEL: -# X:15 -# Y:210 -# Width:160 -# Height:20 -# Font:Regular -# Text:Multitouch Scrolling: -# Align:Right -# DropDownButton@MULTITOUCH_SCROLL: -# X:180 -# Y:210 -# Width:100 -# Height:25 -# Font:Regular -# Text:Enabled Label@KEYBOARD_TITLE: X:375 Y:20 @@ -274,27 +259,6 @@ Container@SETTINGS_PANEL: Height:20 Font:Regular Text:Shift-Enter Toggles Team Chat -# Label@BINDING_LABEL: -# Font:Bold -# X:375 -# Y:60 -# Width:200 -# Height:25 -# Align:Center -# Text:Action -# Label@KEY_LABEL: -# Font:Bold -# X:640 -# Y:60 -# Width:30 -# Height:25 -# Align:Right -# Text:Key -# ScrollPanel@KEYBINDINGS: -# X:375 -# Y:85 -# Width:350 -# Height:150 Button@GENERAL_BUTTON: Y:249 Width:140 @@ -306,7 +270,7 @@ Container@SETTINGS_PANEL: Width:140 Height:35 Text:Input - Button@SAVE_BUTTON: + Button@BACK_BUTTON: Key:escape X:600 Y:249 diff --git a/mods/cnc/chrome/tooltips.yaml b/mods/cnc/chrome/tooltips.yaml index f8635097c5..06b92935de 100644 --- a/mods/cnc/chrome/tooltips.yaml +++ b/mods/cnc/chrome/tooltips.yaml @@ -31,7 +31,7 @@ Background@WORLD_TOOLTIP: X:5 Height:23 Font:Bold - Image: + Image@FLAG: X:5 Y:24 Width:32 @@ -91,4 +91,4 @@ Background@SUPPORT_POWER_TOOLTIP: X:5 Y:20 Font:TinyBold - VAlign:Top \ No newline at end of file + VAlign:Top