expose hidden Debug settings to ra/d2k GUI
- performance text switch - performace text update rate - AI debug messages - trait report threshold ticks
This commit is contained in:
@@ -23,11 +23,12 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
// Perf text
|
||||
var perfText = perfRoot.Get<LabelWidget>("TEXT");
|
||||
perfText.IsVisible = () => Game.Settings.Debug.PerfText;
|
||||
perfText.GetText = () => "Render {0} ({5}={2:F1} ms)\nTick {4} ({3:F1} ms)".F(
|
||||
Game.RenderFrame,
|
||||
Game.NetFrameNumber,
|
||||
PerfHistory.items["render"].LastValue,
|
||||
PerfHistory.items["tick_time"].LastValue,
|
||||
PerfHistory.items["render"].Average(Game.Settings.Debug.Samples),
|
||||
PerfHistory.items["tick_time"].Average(Game.Settings.Debug.Samples),
|
||||
Game.LocalTick,
|
||||
PerfHistory.items["batches"].LastValue);
|
||||
}
|
||||
|
||||
@@ -195,14 +195,30 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
// Debug
|
||||
var debug = bg.Get("DEBUG_PANE");
|
||||
|
||||
var perfgraphCheckbox = debug.Get<CheckboxWidget>("PERFDEBUG_CHECKBOX");
|
||||
var perfgraphCheckbox = debug.Get<CheckboxWidget>("PERFGRAPH_CHECKBOX");
|
||||
perfgraphCheckbox.IsChecked = () => Game.Settings.Debug.PerfGraph;
|
||||
perfgraphCheckbox.OnClick = () => Game.Settings.Debug.PerfGraph ^= true;
|
||||
|
||||
var perftextCheckbox = debug.Get<CheckboxWidget>("PERFTEXT_CHECKBOX");
|
||||
perftextCheckbox.IsChecked = () => Game.Settings.Debug.PerfText;
|
||||
perftextCheckbox.OnClick = () => Game.Settings.Debug.PerfText ^= true;
|
||||
|
||||
var sampleSlider = debug.Get<SliderWidget>("PERFTEXT_SAMPLE_AMOUNT");
|
||||
sampleSlider.Value = sampleSlider.MaximumValue-Game.Settings.Debug.Samples;
|
||||
sampleSlider.OnChange += x => Game.Settings.Debug.Samples = (int)sampleSlider.MaximumValue-(int)Math.Round(x);
|
||||
|
||||
var checkunsyncedCheckbox = debug.Get<CheckboxWidget>("CHECKUNSYNCED_CHECKBOX");
|
||||
checkunsyncedCheckbox.IsChecked = () => Game.Settings.Debug.SanityCheckUnsyncedCode;
|
||||
checkunsyncedCheckbox.OnClick = () => Game.Settings.Debug.SanityCheckUnsyncedCode ^= true;
|
||||
|
||||
var botdebugCheckbox = debug.Get<CheckboxWidget>("BOTDEBUG_CHECKBOX");
|
||||
botdebugCheckbox.IsChecked = () => Game.Settings.Debug.BotDebug;
|
||||
botdebugCheckbox.OnClick = () => Game.Settings.Debug.BotDebug ^= true;
|
||||
|
||||
var longTickThreshold = debug.Get<SliderWidget>("LONG_TICK_THRESHOLD");
|
||||
longTickThreshold.Value = Game.Settings.Debug.LongTickThreshold;
|
||||
longTickThreshold.OnChange += x => Game.Settings.Debug.LongTickThreshold = x;
|
||||
|
||||
bg.Get<ButtonWidget>("BUTTON_CLOSE").OnClick = () =>
|
||||
{
|
||||
int x, y;
|
||||
|
||||
@@ -332,15 +332,51 @@ Background@SETTINGS_MENU:
|
||||
Height:PARENT_BOTTOM - 100
|
||||
Visible: false
|
||||
Children:
|
||||
Checkbox@PERFDEBUG_CHECKBOX:
|
||||
Checkbox@PERFGRAPH_CHECKBOX:
|
||||
X:0
|
||||
Y:0
|
||||
Width:300
|
||||
Height:20
|
||||
Text:Show Performance Information
|
||||
Checkbox@CHECKUNSYNCED_CHECKBOX:
|
||||
Text:Show Performance Graph
|
||||
Checkbox@PERFTEXT_CHECKBOX:
|
||||
X:0
|
||||
Y:30
|
||||
Width:300
|
||||
Height:20
|
||||
Text:Show Performance Text
|
||||
Label@PERFTEXT_SAMPLE_LABEL:
|
||||
X:30
|
||||
Y:70
|
||||
Text:Update Rate
|
||||
Slider@PERFTEXT_SAMPLE_AMOUNT:
|
||||
X:130
|
||||
Y:60
|
||||
Width:250
|
||||
Height:20
|
||||
Ticks:5
|
||||
MinimumValue: 1
|
||||
MaximumValue: 50
|
||||
Checkbox@CHECKUNSYNCED_CHECKBOX:
|
||||
X:0
|
||||
Y:90
|
||||
Width:300
|
||||
Height:20
|
||||
Text:Check Sync around Unsynced Code
|
||||
Checkbox@BOTDEBUG_CHECKBOX:
|
||||
X:0
|
||||
Y:120
|
||||
Width:300
|
||||
Height:20
|
||||
Text:Show Bot Debug Messages
|
||||
Label@PERFTEXT_SAMPLE_LABEL:
|
||||
X:0
|
||||
Y:160
|
||||
Text:Slow Trait Report Threshold in (mili)seconds
|
||||
Slider@LONG_TICK_THRESHOLD:
|
||||
X:0
|
||||
Y:170
|
||||
Width:380
|
||||
Height:20
|
||||
Ticks:25
|
||||
MinimumValue: 0.0001
|
||||
MaximumValue: 0.01
|
||||
|
||||
Reference in New Issue
Block a user