Add a CustomTerrain debug overlay.

This commit is contained in:
Matthias Mailänder
2016-05-01 15:47:13 +02:00
parent 6af7fa412c
commit 9b6e15ea78
12 changed files with 119 additions and 2 deletions

View File

@@ -134,6 +134,18 @@ namespace OpenRA.Mods.Common.Widgets.Logic
showActorTagsCheckbox.IsChecked = () => devTrait.ShowActorTags;
showActorTagsCheckbox.OnClick = () => devTrait.ShowActorTags ^= true;
}
var showCustomTerrainCheckbox = widget.GetOrNull<CheckboxWidget>("SHOW_CUSTOMTERRAIN_OVERLAY");
if (showCustomTerrainCheckbox != null)
{
var customTerrainDebugTrait = world.WorldActor.TraitOrDefault<CustomTerrainDebugOverlay>();
showCustomTerrainCheckbox.Disabled = customTerrainDebugTrait == null;
if (customTerrainDebugTrait != null)
{
showCustomTerrainCheckbox.IsChecked = () => customTerrainDebugTrait.Enabled;
showCustomTerrainCheckbox.OnClick = () => customTerrainDebugTrait.Enabled ^= true;
}
}
}
public void Order(World world, string order)