add reset exploration developer cheat

This commit is contained in:
Matthias Mailänder
2013-03-07 20:32:00 +01:00
parent 3f56e00173
commit 58c3b52a1a
4 changed files with 26 additions and 10 deletions

View File

@@ -73,7 +73,7 @@ namespace OpenRA.Traits
self.Trait<PlayerResources>().GiveCash(Info.Cash);
break;
}
case "DevShroud":
case "DevShroudDisable":
{
DisableShroud ^= true;
self.Owner.Shroud.Disabled = DisableShroud;
@@ -89,6 +89,11 @@ namespace OpenRA.Traits
self.Owner.Shroud.ExploreAll(self.World);
break;
}
case "DevResetExploration":
{
self.Owner.Shroud.ResetExploration();
break;
}
case "DevUnlimitedPower":
{
UnlimitedPower ^= true;

View File

@@ -260,7 +260,7 @@ namespace OpenRA.Traits
Dirty();
}
public void ResetExploration() // for `hide map` crate
public void ResetExploration()
{
for (var j = 0; j <= exploredCells.GetUpperBound(1); j++)
for (var i = 0; i <= exploredCells.GetUpperBound(0); i++)

View File

@@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var shroudCheckbox = widget.Get<CheckboxWidget>("DISABLE_SHROUD");
shroudCheckbox.IsChecked = () => devTrait.DisableShroud;
shroudCheckbox.OnClick = () => Order(world, "DevShroud");
shroudCheckbox.OnClick = () => Order(world, "DevShroudDisable");
var pathCheckbox = widget.Get<CheckboxWidget>("SHOW_UNIT_PATHS");
pathCheckbox.IsChecked = () => devTrait.PathDebug;
@@ -56,6 +56,9 @@ namespace OpenRA.Mods.RA.Widgets.Logic
widget.Get<ButtonWidget>("GIVE_EXPLORATION").OnClick = () =>
world.IssueOrder(new Order("DevGiveExploration", world.LocalPlayer.PlayerActor, false));
widget.Get<ButtonWidget>("RESET_EXPLORATION").OnClick = () =>
world.IssueOrder(new Order("DevResetExploration", world.LocalPlayer.PlayerActor, false));
widget.Get<ButtonWidget>("CLOSE").OnClick = () => { Ui.CloseWindow(); onExit(); };
}

View File

@@ -13,18 +13,25 @@ Background@CHEATS_PANEL:
Height:25
Text:Developer Mode
Align:Center
Font:Bold
Checkbox@DISABLE_SHROUD:
X:30
Y:50
Height:20
Width:PARENT_RIGHT - 30
Text:Disable Shroud
Button@GIVE_EXPLORATION
Button@GIVE_EXPLORATION:
X:30
Y:80
Width:200
Height:20
Text: Give Exploration
Width:120
Height:25
Text:Give Exploration
Button@RESET_EXPLORATION:
X:200
Y:80
Width:120
Height:25
Text:Reset Exploration
Checkbox@SHOW_UNIT_PATHS:
X:30
Y:110
@@ -34,9 +41,10 @@ Background@CHEATS_PANEL:
Button@GIVE_CASH:
X:30
Y:140
Width:200
Width:150
Height:20
Text: Give Cash
Text: Give $ 20.000 Cash
Height:25
Checkbox@INSTANT_BUILD:
X:30
Y:170
@@ -71,6 +79,6 @@ Background@CHEATS_PANEL:
X:30
Y:360
Width:PARENT_RIGHT - 60
Height:20
Height:25
Text:Close
Key:escape