diff --git a/OpenRA.Game/Traits/Player/DeveloperMode.cs b/OpenRA.Game/Traits/Player/DeveloperMode.cs index 0b8975f66d..7185df51ba 100644 --- a/OpenRA.Game/Traits/Player/DeveloperMode.cs +++ b/OpenRA.Game/Traits/Player/DeveloperMode.cs @@ -20,7 +20,8 @@ namespace OpenRA.Traits public bool DisableShroud = false; public bool PathDebug = false; public bool UnitInfluenceDebug = false; - public bool UnlimitedPower; + public bool UnlimitedPower; + public bool BuildAnywhere; public object Create (ActorInitializer init) { return new DeveloperMode(this); } } @@ -34,17 +35,19 @@ namespace OpenRA.Traits [Sync] public bool DisableShroud; [Sync] public bool PathDebug; [Sync] public bool UnitInfluenceDebug; - [Sync] public bool UnlimitedPower; + [Sync] public bool UnlimitedPower; + [Sync] public bool BuildAnywhere; public DeveloperMode(DeveloperModeInfo info) { Info = info; - FastBuild = Info.FastBuild; - FastCharge = Info.FastCharge; - DisableShroud = Info.DisableShroud; - PathDebug = Info.PathDebug; + FastBuild = info.FastBuild; + FastCharge = info.FastCharge; + DisableShroud = info.DisableShroud; + PathDebug = info.PathDebug; UnitInfluenceDebug = info.UnitInfluenceDebug; - UnlimitedPower = info.UnlimitedPower; + UnlimitedPower = info.UnlimitedPower; + BuildAnywhere = info.BuildAnywhere; } public void ResolveOrder (Actor self, Order order) @@ -100,7 +103,12 @@ namespace OpenRA.Traits { UnlimitedPower ^= true; break; - } + } + case "DevBuildAnywhere": + { + BuildAnywhere ^= true; + break; + } default: return; } diff --git a/OpenRA.Mods.RA/Widgets/Delegates/DeveloperModeDelegate.cs b/OpenRA.Mods.RA/Widgets/Delegates/DeveloperModeDelegate.cs index 401c8a9494..6c62aade38 100644 --- a/OpenRA.Mods.RA/Widgets/Delegates/DeveloperModeDelegate.cs +++ b/OpenRA.Mods.RA/Widgets/Delegates/DeveloperModeDelegate.cs @@ -65,7 +65,10 @@ namespace OpenRA.Mods.RA.Widgets.Delegates devmodeBG.GetWidget("ENABLE_TECH").OnChange += _ => Order(world, "DevEnableTech"); devmodeBG.GetWidget("UNLIMITED_POWER").BindReadOnly(devTrait, "UnlimitedPower"); - devmodeBG.GetWidget("UNLIMITED_POWER").OnChange += _ => Order(world, "DevUnlimitedPower"); + devmodeBG.GetWidget("UNLIMITED_POWER").OnChange += _ => Order(world, "DevUnlimitedPower"); + + devmodeBG.GetWidget("BUILD_ANYWHERE").BindReadOnly(devTrait, "BuildAnywhere"); + devmodeBG.GetWidget("BUILD_ANYWHERE").OnChange += _ => Order(world, "DevBuildAnywhere"); devmodeBG.GetWidget("GIVE_EXPLORATION").OnMouseUp = mi => { diff --git a/mods/cnc/chrome/ingame.yaml b/mods/cnc/chrome/ingame.yaml index 31a631925d..60830a73b2 100644 --- a/mods/cnc/chrome/ingame.yaml +++ b/mods/cnc/chrome/ingame.yaml @@ -220,7 +220,7 @@ Container@INGAME_ROOT: X:(WINDOW_RIGHT - WIDTH)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2 Width:350 - Height:360 + Height:370 Visible:false Children: Label@LABEL_TITLE: @@ -287,10 +287,17 @@ Container@INGAME_ROOT: Width:PARENT_RIGHT - 30 Height:20 Text:Unlimited Power + Checkbox@BUILD_ANYWHERE + Id:BUILD_ANYWHERE + X:30 + Y:290 + Width:PARENT_RIGHT - 30 + Height:20 + Text:Build Anywhere Button@GIVE_EXPLORATION Id:GIVE_EXPLORATION X:30 - Y:290 + Y:320 Width:200 Height:20 Text: Give Exploration diff --git a/mods/ra/chrome/ingame.yaml b/mods/ra/chrome/ingame.yaml index 7f3a30cf87..789eea5103 100644 --- a/mods/ra/chrome/ingame.yaml +++ b/mods/ra/chrome/ingame.yaml @@ -227,7 +227,7 @@ Container@INGAME_ROOT: X:(WINDOW_RIGHT - WIDTH)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2 Width:350 - Height:360 + Height:370 Visible:false Children: Label@LABEL_TITLE: @@ -294,10 +294,17 @@ Container@INGAME_ROOT: Width:PARENT_RIGHT - 30 Height:20 Text:Unlimited Power + Checkbox@BUILD_ANYWHERE + Id:BUILD_ANYWHERE + X:30 + Y:290 + Width:PARENT_RIGHT - 30 + Height:20 + Text:Build Anywhere Button@GIVE_EXPLORATION Id:GIVE_EXPLORATION X:30 - Y:290 + Y:320 Width:200 Height:20 Text: Give Exploration