diff --git a/OpenRA.Game/Widgets/Delegates/DeveloperModeDelegate.cs b/OpenRA.Game/Widgets/Delegates/DeveloperModeDelegate.cs index fc2a864a07..960f7b0486 100644 --- a/OpenRA.Game/Widgets/Delegates/DeveloperModeDelegate.cs +++ b/OpenRA.Game/Widgets/Delegates/DeveloperModeDelegate.cs @@ -29,10 +29,6 @@ namespace OpenRA.Widgets.Delegates public class DeveloperModeDelegate : IWidgetDelegate { - - float oldBuildSpeed = 0; - bool slowed = false; - public DeveloperModeDelegate () { var devmodeBG = Widget.RootWidget.GetWidget("INGAME_ROOT").GetWidget("DEVELOPERMODE_BG"); @@ -77,26 +73,28 @@ namespace OpenRA.Widgets.Delegates return true; }; - devmodeBG.GetWidget("SETTINGS_GIVE_CASH").OnMouseUp = mi => + devmodeBG.GetWidget("SETTINGS_GIVE_CASH").Checked = + () => true; + devmodeBG.GetWidget("SETTINGS_GIVE_CASH").OnMouseDown = mi => { - Game.world.AddFrameEndTask(w => - { - Game.world.LocalPlayer.PlayerActor.traits.Get().GiveCash(5000); - }); - TriggerCheatingMessage(); return true; }; devmodeBG.GetWidget("SETTINGS_BUILD_SPEED").OnMouseDown = mi => { - oldBuildSpeed = (!slowed)? Game.world.LocalPlayer.PlayerActor.Info.Traits.Get().BuildSpeed : oldBuildSpeed; - Game.world.LocalPlayer.PlayerActor.Info.Traits.Get().BuildSpeed = (slowed)? oldBuildSpeed : 0; - slowed ^= true; - TriggerCheatingMessage(); - return true; - }; + return true; + }; devmodeBG.GetWidget("SETTINGS_BUILD_SPEED").Checked = - () => {return slowed;}; + () => true; + + + devmodeBG.GetWidget("SETTINGS_CHARGE_TIME").OnMouseDown = mi => + { + return true; + }; + devmodeBG.GetWidget("SETTINGS_CHARGE_TIME").Checked = + () => true; + devModeButton.IsVisible = () => { return Game.Settings.DeveloperMode; }; } diff --git a/OpenRA.Game/Widgets/Delegates/SettingsMenuDelegate.cs b/OpenRA.Game/Widgets/Delegates/SettingsMenuDelegate.cs index 0144c17679..de1fbba052 100644 --- a/OpenRA.Game/Widgets/Delegates/SettingsMenuDelegate.cs +++ b/OpenRA.Game/Widgets/Delegates/SettingsMenuDelegate.cs @@ -132,30 +132,6 @@ namespace OpenRA.Widgets.Delegates return true; }; - var unitdebug = debug.GetWidget("UNITDEBUG_CHECKBOX"); - unitdebug.Checked = () => {return Game.Settings.UnitDebug;}; - unitdebug.OnMouseDown = mi => - { - Game.Settings.UnitDebug ^= true; - return true; - }; - - var pathdebug = debug.GetWidget("PATHDEBUG_CHECKBOX"); - pathdebug.Checked = () => {return Game.Settings.PathDebug;}; - pathdebug.OnMouseDown = mi => - { - Game.Settings.PathDebug ^= true; - return true; - }; - - var indexdebug = debug.GetWidget("INDEXDEBUG_CHECKBOX"); - indexdebug.Checked = () => {return Game.Settings.IndexDebug;}; - indexdebug.OnMouseDown = mi => - { - Game.Settings.IndexDebug ^= true; - return true; - }; - var timedebug = debug.GetWidget("GAMETIME_CHECKBOX"); timedebug.Checked = () => {return Game.Settings.ShowGameTimer;}; timedebug.OnMouseDown = mi => @@ -164,6 +140,14 @@ namespace OpenRA.Widgets.Delegates return true; }; + var devmode = debug.GetWidget("DEV_MODE_ENABLED"); + devmode.Checked = () => Game.Settings.DeveloperMode; + devmode.OnMouseDown = mi => + { + Game.Settings.DeveloperMode ^= true; + return true; + }; + bg.GetWidget("BUTTON_CLOSE").OnMouseUp = mi => { Game.Settings.Save(); Widget.RootWidget.CloseWindow(); diff --git a/mods/cnc/chrome/ingame.yaml b/mods/cnc/chrome/ingame.yaml index 89e869bef7..b5436d0022 100644 --- a/mods/cnc/chrome/ingame.yaml +++ b/mods/cnc/chrome/ingame.yaml @@ -203,7 +203,7 @@ Container@ROOT: Delegate:DeveloperModeDelegate X:(WINDOW_RIGHT - WIDTH)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2 - Width:300 + Width:350 Height:300 Visible:false Children: @@ -220,45 +220,52 @@ Container@ROOT: X:30 Y:50 Height:20 - Width:20 + Width:PARENT_RIGHT - 30 Text:Disable Shroud Checkbox@SETTINGS_CHECKBOX_UNITDEBUG: Id:SETTINGS_CHECKBOX_UNITDEBUG X:30 Y:80 - Width:300 + Width:PARENT_RIGHT - 30 Height:20 Text:Show Occupied Cells Checkbox@SETTINGS_CHECKBOX_PATHDEBUG: Id:SETTINGS_CHECKBOX_PATHDEBUG X:30 Y:110 - Width:300 + Width:PARENT_RIGHT - 30 Height:20 Text:Show Unit Paths Checkbox@SETTINGS_CHECKBOX_INDEXDEBUG: Id:SETTINGS_CHECKBOX_INDEXDEBUG X:30 Y:140 - Width:300 + Width:PARENT_RIGHT - 30 Height:20 Text:Show Spatial Index Debug Label@LABEL_MP_WARNING Id:LABEL_MP_WARNING X:30 Y:180 - Text:May cause errors under multiplayer: - Button@SETTINGS_GIVE_CASH + Text:Must be identical for all multiplayer players: + Checkbox@SETTINGS_GIVE_CASH Id:SETTINGS_GIVE_CASH X:30 Y:200 - Width:150 + Width:PARENT_RIGHT - 30 Height:20 Text: Give Cash Checkbox@SETTINGS_BUILD_SPEED Id:SETTINGS_BUILD_SPEED X:30 Y:230 - Width:20 + Width:PARENT_RIGHT - 30 Height:20 - Text:Instant Build Speed \ No newline at end of file + Text:Instant Build Speed + Checkbox@SETTINGS_CHARGE_TIME + Id:SETTINGS_CHARGE_TIME + X:30 + Y:260 + Width:PARENT_RIGHT - 30 + Height:20 + Text:Instant Charge Time (Special Powers) \ No newline at end of file diff --git a/mods/cnc/chrome/settings.yaml b/mods/cnc/chrome/settings.yaml index 68bf61615d..98fd77401b 100644 --- a/mods/cnc/chrome/settings.yaml +++ b/mods/cnc/chrome/settings.yaml @@ -193,31 +193,17 @@ Container@ROOT: Width:300 Height:20 Text:Collect Sync Reports - Checkbox@UNITDEBUG_CHECKBOX: - Id:UNITDEBUG_CHECKBOX + Checkbox@GAMETIME_CHECKBOX: + Id:GAMETIME_CHECKBOX X:0 Y:60 Width:300 Height:20 - Text:Show Occupied Cells - Checkbox@PATHDEBUG_CHECKBOX: - Id:PATHDEBUG_CHECKBOX + Text:Show Game Time Counter + Checkbox:DEV_MODE_ENABLED + Id:DEV_MODE_ENABLED X:0 Y:90 Width:300 Height:20 - Text:Show Unit Paths - Checkbox@INDEXDEBUG_CHECKBOX: - Id:INDEXDEBUG_CHECKBOX - X:0 - Y:120 - Width:300 - Height:20 - Text:Show Spatial Index Debug - Checkbox@GAMETIME_CHECKBOX: - Id:GAMETIME_CHECKBOX - X:0 - Y:150 - Width:300 - Height:20 - Text:Show Game Time Counter \ No newline at end of file + Text:Enable Developer Mode \ No newline at end of file diff --git a/mods/ra/chrome/ingame.yaml b/mods/ra/chrome/ingame.yaml index 34ddd28cf8..4e208367a6 100644 --- a/mods/ra/chrome/ingame.yaml +++ b/mods/ra/chrome/ingame.yaml @@ -212,7 +212,7 @@ Container@ROOT: Delegate:DeveloperModeDelegate X:(WINDOW_RIGHT - WIDTH)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2 - Width:300 + Width:350 Height:300 Visible:false Children: @@ -229,45 +229,52 @@ Container@ROOT: X:30 Y:50 Height:20 - Width:20 + Width:PARENT_RIGHT - 30 Text:Disable Shroud Checkbox@SETTINGS_CHECKBOX_UNITDEBUG: Id:SETTINGS_CHECKBOX_UNITDEBUG X:30 Y:80 - Width:300 + Width:PARENT_RIGHT - 30 Height:20 Text:Show Occupied Cells Checkbox@SETTINGS_CHECKBOX_PATHDEBUG: Id:SETTINGS_CHECKBOX_PATHDEBUG X:30 Y:110 - Width:300 + Width:PARENT_RIGHT - 30 Height:20 Text:Show Unit Paths Checkbox@SETTINGS_CHECKBOX_INDEXDEBUG: Id:SETTINGS_CHECKBOX_INDEXDEBUG X:30 Y:140 - Width:300 + Width:PARENT_RIGHT - 30 Height:20 Text:Show Spatial Index Debug Label@LABEL_MP_WARNING Id:LABEL_MP_WARNING X:30 Y:180 - Text:May cause errors under multiplayer: - Button@SETTINGS_GIVE_CASH + Text:Must be identical for all multiplayer players: + Checkbox@SETTINGS_GIVE_CASH Id:SETTINGS_GIVE_CASH X:30 Y:200 - Width:150 + Width:PARENT_RIGHT - 30 Height:20 Text: Give Cash Checkbox@SETTINGS_BUILD_SPEED Id:SETTINGS_BUILD_SPEED X:30 Y:230 - Width:20 + Width:PARENT_RIGHT - 30 Height:20 - Text:Instant Build Speed \ No newline at end of file + Text:Instant Build Speed + Checkbox@SETTINGS_CHARGE_TIME + Id:SETTINGS_CHARGE_TIME + X:30 + Y:260 + Width:PARENT_RIGHT - 30 + Height:20 + Text:Instant Charge Time (Special Powers) \ No newline at end of file diff --git a/mods/ra/chrome/settings.yaml b/mods/ra/chrome/settings.yaml index 68bf61615d..98fd77401b 100644 --- a/mods/ra/chrome/settings.yaml +++ b/mods/ra/chrome/settings.yaml @@ -193,31 +193,17 @@ Container@ROOT: Width:300 Height:20 Text:Collect Sync Reports - Checkbox@UNITDEBUG_CHECKBOX: - Id:UNITDEBUG_CHECKBOX + Checkbox@GAMETIME_CHECKBOX: + Id:GAMETIME_CHECKBOX X:0 Y:60 Width:300 Height:20 - Text:Show Occupied Cells - Checkbox@PATHDEBUG_CHECKBOX: - Id:PATHDEBUG_CHECKBOX + Text:Show Game Time Counter + Checkbox:DEV_MODE_ENABLED + Id:DEV_MODE_ENABLED X:0 Y:90 Width:300 Height:20 - Text:Show Unit Paths - Checkbox@INDEXDEBUG_CHECKBOX: - Id:INDEXDEBUG_CHECKBOX - X:0 - Y:120 - Width:300 - Height:20 - Text:Show Spatial Index Debug - Checkbox@GAMETIME_CHECKBOX: - Id:GAMETIME_CHECKBOX - X:0 - Y:150 - Width:300 - Height:20 - Text:Show Game Time Counter \ No newline at end of file + Text:Enable Developer Mode \ No newline at end of file