Move cheats option to rules.

This commit is contained in:
Paul Chote
2016-02-29 17:52:54 +00:00
parent 5e59a9d1c1
commit aed8518e04
9 changed files with 40 additions and 10 deletions

View File

@@ -349,8 +349,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var allowCheats = optionsBin.GetOrNull<CheckboxWidget>("ALLOWCHEATS_CHECKBOX");
if (allowCheats != null)
{
var cheatsLocked = new CachedTransform<Map, bool>(
map => map.Rules.Actors["player"].TraitInfo<DeveloperModeInfo>().Locked);
allowCheats.IsChecked = () => orderManager.LobbyInfo.GlobalSettings.AllowCheats;
allowCheats.IsDisabled = () => configurationDisabled() || Map.Options.Cheats.HasValue;
allowCheats.IsDisabled = () => configurationDisabled() || cheatsLocked.Update(Map);
allowCheats.OnClick = () => orderManager.IssueOrder(Order.Command(
"allowcheats {0}".F(!orderManager.LobbyInfo.GlobalSettings.AllowCheats)));
}