Add EnableDebugCommandsInReplays option

This commit is contained in:
rob-v
2017-08-09 20:30:15 +02:00
committed by reaperrr
parent 6840177776
commit dd9d5450bc
5 changed files with 17 additions and 1 deletions

View File

@@ -94,6 +94,7 @@ namespace OpenRA
public bool SendSystemInformation = true; public bool SendSystemInformation = true;
public int SystemInformationVersionPrompt = 0; public int SystemInformationVersionPrompt = 0;
public string UUID = System.Guid.NewGuid().ToString(); public string UUID = System.Guid.NewGuid().ToString();
public bool EnableDebugCommandsInReplays = false;
} }
public class GraphicSettings public class GraphicSettings

View File

@@ -130,7 +130,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Game.BeforeGameStart += UnregisterEvents; Game.BeforeGameStart += UnregisterEvents;
CloseChat(); CloseChat();
chatText.IsDisabled = () => world.IsReplay; chatText.IsDisabled = () => world.IsReplay && !Game.Settings.Debug.EnableDebugCommandsInReplays;
var keyListener = chatChrome.Get<LogicKeyListenerWidget>("KEY_LISTENER"); var keyListener = chatChrome.Get<LogicKeyListenerWidget>("KEY_LISTENER");
keyListener.OnKeyPress = e => keyListener.OnKeyPress = e =>

View File

@@ -674,6 +674,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
BindCheckboxPref(panel, "FETCH_NEWS_CHECKBOX", gs, "FetchNews"); BindCheckboxPref(panel, "FETCH_NEWS_CHECKBOX", gs, "FetchNews");
BindCheckboxPref(panel, "LUADEBUG_CHECKBOX", ds, "LuaDebug"); BindCheckboxPref(panel, "LUADEBUG_CHECKBOX", ds, "LuaDebug");
BindCheckboxPref(panel, "SENDSYSINFO_CHECKBOX", ds, "SendSystemInformation"); BindCheckboxPref(panel, "SENDSYSINFO_CHECKBOX", ds, "SendSystemInformation");
BindCheckboxPref(panel, "REPLAY_COMMANDS_CHECKBOX", ds, "EnableDebugCommandsInReplays");
return () => { }; return () => { };
} }

View File

@@ -585,6 +585,13 @@ Container@SETTINGS_PANEL:
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Show Map Debug Messages Text: Show Map Debug Messages
Checkbox@REPLAY_COMMANDS_CHECKBOX:
X: 310
Y: 220
Width: 300
Height: 20
Font: Regular
Text: Enable Debug Commands in Replays
Button@BACK_BUTTON: Button@BACK_BUTTON:
Key: escape Key: escape
Y: 393 Y: 393

View File

@@ -586,3 +586,10 @@ Background@SETTINGS_PANEL:
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Show Map Debug Messages Text: Show Map Debug Messages
Checkbox@REPLAY_COMMANDS_CHECKBOX:
X: 310
Y: 220
Width: 300
Height: 20
Font: Regular
Text: Enable Debug Commands in Replays