Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_VideoSettingsSubMenu.c
Go to the documentation of this file.
2{
3 FULLSCREEN = 0, // keep order in the enum
7};
8
9/*
10enum EAspectRatio
11{
12 ASPECT_RATIO_AUTO = 0, // keep order in the enum
13 ASPECT_RATIO_16_9,
14 ASPECT_RATIO_16_10,
15 ASPECT_RATIO_4_3,
16 ASPECT_RATIO_5_4,
17 ASPECT_RATIO_32_9,
18 ASPECT_RATIO_48_9,
19};
20// */
21
23{
24 protected ref array<int> m_aWidths = {};
25 protected ref array<int> m_aHeights = {};
26 protected ref array<int> m_aAAvalues = { 0, 2, 4, 8, 16, 32 };
27
30 // protected SCR_ComboBoxComponent m_AspectRatio;
33
34 protected string m_sResolutionScaleLocalisation = "#AR-Settings_RenderScale";
35
39
40 protected static const string RESOLUTION_FORMAT = "%1 × %2";
41 protected static const int CUSTOM_PRESET_INDEX = 4; // 4 is the custom option for quality preset
42
44 protected static const ref array<string> PRESET_SETTINGS = {
45 /*
46 the following settings are out of presets; they were not forgotten:
47 "WindowMode"
48 "Resolution"
49 "ResolutionScale"
50 "AspectRatio"
51 "VSync"
52 "MaxFPS"
53 "DOF" // scripted
54 "NearDOF" // scripted
55 */
56 "Detail",
57 "DistantShadows",
58 "EnvironmentQuality",
59 "FoliageSmoothing",
60 "GeometricDetail",
61 "GrassDistance",
62 "GrassLOD",
63 "HardwareAA",
64 "HBAO", // ambient occlusion
65 "ObjectDrawDistance",
66 "PostprocessAA",
67 "RenderTargetFormat",
68 "ShadowQuality",
69 "SSDO", // contact shadow
70 "SSR", // post-process quality
71 // "TerrainDetail", //disabled setting for now
72 "TerrainSurfaceDetail",
73 "TextureDetail",
74 "TextureFiltering",
75 };
76
77 //------------------------------------------------------------------------------------------------
79 {
80 // ignore this if we are loading settings
82 return;
83
84 if (binding)
86
87 super.OnMenuItemChanged(binding);
88 }
89
90 //------------------------------------------------------------------------------------------------
91 protected void OnCustomMenuItemChanged(string widgetName)
92 {
93 OnMenuItemChanged(new SCR_SettingsBindingBase("", "", widgetName));
94 //SCR_AnalyticsApplication.GetInstance().ChangeSetting("Video", widgetName);
95 }
96
97 //------------------------------------------------------------------------------------------------
98 protected void SetQualityPresetIndex(string changedSetting)
99 {
100 if (!PRESET_SETTINGS.Contains(changedSetting))
101 return;
102
103 SCR_ComboBoxComponent qualityPreset = SCR_ComboBoxComponent.GetComboBoxComponent("QualityPreset", m_wRoot);
104 if (qualityPreset)
105 qualityPreset.SetCurrentItem(CUSTOM_PRESET_INDEX);
106
107 BaseContainer display = GetGame().GetEngineUserSettings().GetModule("DisplayUserSettings");
108 display.Set("OverallQuality", CUSTOM_PRESET_INDEX);
109 }
110
111 //------------------------------------------------------------------------------------------------
112 override void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout, int index)
113 {
114 super.OnTabCreate(menuRoot, buttonsLayout, index);
115
116 m_ResourceManager = GetGame().GetEngineUserSettings().GetModule("ResourceManagerUserSettings");
117 m_Pipeline = GetGame().GetEngineUserSettings().GetModule("PipelineUserSettings");
118 m_Video = GetGame().GetEngineUserSettings().GetModule("VideoUserSettings");
119
121 m_ResolutionCombo = SCR_ComboBoxComponent.GetComboBoxComponent("Resolution", m_wRoot);
122 // m_AspectRatio = SCR_ComboBoxComponent.GetComboBoxComponent("AspectRatio", m_wRoot);
125
126 SCR_ComboBoxComponent aspectRatio = SCR_ComboBoxComponent.GetComboBoxComponent("AspectRatio", m_wRoot);
127 if (aspectRatio)
128 aspectRatio.SetVisible(false);
129
130 // Create bindings and load all standard entries
131 m_aSettingsBindings.Clear();
132
133 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("ResourceManagerUserSettings", "GeometricDetail", "GeometricDetail"));
134 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("TerrainGenMaterialSettings", "GeometryLevel", "TerrainDetail"));
135 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("VideoUserSettings", "Vsync", "VSync"));
136
137 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("GrassMaterialSettings", "Lod", "GrassLOD"));
138 // We are using game settings to be able to override distance of grass
139 //m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("GrassMaterialSettings", "Distance", "GrassDistance"));
140 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("TerrainGenMaterialSettings", "Detail", "TerrainSurfaceDetail"));
141 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("MaterialSystemUserSettings", "TextureFilter", "TextureFiltering"));
142
143 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("GraphicsQualitySettings", "ObjectDrawDistanceScale", "ObjectDrawDistance"));
144 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("VideoUserSettings", "Atoc", "FoliageSmoothing"));
145 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("VideoUserSettings", "ResolutionScale", "ResolutionScale"));
146 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("VideoUserSettings", "FsrEnabled", "FSR"));
147 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("VideoUserSettings", "RenderFormat", "RenderTargetFormat"));
148 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("VideoUserSettings", "DistantShadowsQuality", "DistantShadows"));
149 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("VideoUserSettings", "EnvironmentQuality", "EnvironmentQuality"));
150 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("DisplayUserSettings", "OverallQuality", "QualityPreset"));
151
152 // Post-process settings
153 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("DisplayUserSettings", "PPAA", "PostprocessAA", "PPQuality"));
154 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("DisplayUserSettings", "HBAO", "HBAO", "PPQuality"));
155 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("DisplayUserSettings", "SSDO", "SSDO", "PPQuality"));
156 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("DisplayUserSettings", "SSR", "SSR", "PPQuality"));
157 m_aSettingsBindings.Insert(new SCR_SettingBindingGameplay("SCR_VideoSettings", "m_iDofType", "DOF"));
158 m_aSettingsBindings.Insert(new SCR_SettingBindingGameplay("SCR_VideoSettings", "m_bNearDofEffect", "NearDOF"));
159
160 // Other settings
161 m_aSettingsBindings.Insert(new SCR_SettingBindingGameplay("SCR_GameplaySettings", "m_b2DScopes", "ScopeMode"));
162 m_aSettingsBindings.Insert(new SCR_SettingBindingEngine("UserInterfaceSettings", "UseSoftwareCursor", "CursorMode"));
163
164 LoadSettings();
165
174 SetupMaxFPS();
175
177
179
180 // TODO: bind OnRenderResolutionChanged when Alt+Enter event (non-existing atm) is triggered
181 }
182
183 //------------------------------------------------------------------------------------------------
184 protected void SetupTextureDetail(bool isInit = true)
185 {
187 return;
188
190 if (!textureDetail)
191 return;
192
193 const float item; // TODO: check for good const usage
194 float value, min, max, step;
195 m_ResourceManager.Get("TextureDetail", value);
196 m_ResourceManager.GetLimits(item, min, max, step);
197
198 int current = (max - value);
199 textureDetail.SetCurrentItem(current);
200
201 if (isInit)
202 textureDetail.m_OnChanged.Insert(OnTextureDetailChanged);
203 }
204
205 //------------------------------------------------------------------------------------------------
207 protected void OnMaxFPSChanged(SCR_SpinBoxComponent comp, int i)
208 {
209 if (!comp || !m_MaxFPS || !m_Video)
210 return;
211
212 bool isEnabled = m_MaxFPS.GetCurrentIndex();
213
214 int value = 0;
215 if (isEnabled)
216 value = m_MaxFPS.GetCurrentItem().ToInt();
217
218 m_Video.Set("MaxFps", value);
219
220 OnCustomMenuItemChanged("MaxFPS");
221 }
222
223 //------------------------------------------------------------------------------------------------
226 {
228 return;
229
230 const float item; // TODO: check for good const usage
231 float min, max, step;
232 m_ResourceManager.GetLimits(item, min, max, step);
233
234 int current = max - i;
235 m_ResourceManager.Set("TextureDetail", current);
236
237 OnCustomMenuItemChanged("TextureDetail");
238 }
239
240 //------------------------------------------------------------------------------------------------
241 protected void OnQualityPresetChanged(SCR_ComboBoxComponent combobox, int itemIndex)
242 {
244 return;
245
246 if (combobox.GetCurrentIndex() == CUSTOM_PRESET_INDEX)
247 return;
248
249 GetGame().ApplySettingsPreset();
250 GetGame().UserSettingsChanged();
251 LoadSettings(true, false);
252
253 // all scripted widgets have to be manually done here
254 m_bLoadingSettings = true;
255
256 SetupHardwareAA(false);
257 SetupTextureDetail(false);
258 SetupShadowQuality(false);
259
260 m_bLoadingSettings = false;
261
262 //SCR_AnalyticsApplication.GetInstance().SetQualityPresetSetting(itemIndex);
263 }
264
265 //------------------------------------------------------------------------------------------------
266 protected void SetupQualityPreset()
267 {
268 SCR_ComboBoxComponent qualityPreset = SCR_ComboBoxComponent.GetComboBoxComponent("QualityPreset", m_wRoot);
269 if (!qualityPreset)
270 return;
271
272 qualityPreset.m_OnChanged.Insert(OnQualityPresetChanged);
273 }
274
275 //------------------------------------------------------------------------------------------------
276 protected void SetupHardwareAA(bool isInit = true)
277 {
278 if (!m_Video)
279 return;
280
282 if (!antiAliasing)
283 return;
284
285//#ifdef PLATFORM_CONSOLE
286 // TODO: ifdefs are ugly and messy, make proper solution using menu configs and UI prefabs
287 //antiAliasing.GetRootWidget().SetVisible(false);
288 //return;
289//#endif
290
291 int value;
292 m_Video.Get("Fsaa", value);
293
294 int i = m_aAAvalues.Find(value);
295 if (i > -1)
296 antiAliasing.SetCurrentItem(i);
297
298 if (isInit)
299 antiAliasing.m_OnChanged.Insert(OnHardwareAAChanged);
300
301 SCR_SpinBoxComponent foliageSmoothing = SCR_SpinBoxComponent.GetSpinBoxComponent("FoliageSmoothing", m_wRoot);
302 if (foliageSmoothing && i == 0)
303 foliageSmoothing.SetEnabled(false);
304 }
305
306 //------------------------------------------------------------------------------------------------
308 protected void OnHardwareAAChanged(SCR_SpinBoxComponent comp, int i)
309 {
310 if (!m_Video || i < 0 || i >= m_aAAvalues.Count())
311 return;
312
313 m_Video.Set("Fsaa", m_aAAvalues[i]);
314
315 SCR_SpinBoxComponent foliageSmoothing = SCR_SpinBoxComponent.GetSpinBoxComponent("FoliageSmoothing", m_wRoot);
316 if (foliageSmoothing)
317 foliageSmoothing.SetEnabled(i > 0);
318
319 OnCustomMenuItemChanged("HardwareAA");
320 }
321
322 //------------------------------------------------------------------------------------------------
324 protected void OnResolutionScaleChanged(SCR_SliderComponent comp, float value)
325 {
326 value = Math.Round(value * 100);
327
328 comp.ShowCustomValue(value.ToString());
329
331
332 OnCustomMenuItemChanged("ResolutionScale");
333 }
334
335 //------------------------------------------------------------------------------------------------
338 {
340 return;
341
342 TextWidget labelWidget = m_ResolutionScale.GetLabel();
343 if (!labelWidget)
344 return;
345
346 float uiResWidth, uiResHeight;
347 int renderResWidth, renderResHeight;
348 GetGame().GetWorkspace().GetScreenSize(uiResWidth, uiResHeight);
349 float scale = m_ResolutionScale.GetValue();
350 renderResWidth = Math.Round(uiResWidth * scale);
351 renderResHeight = Math.Round(uiResHeight * scale);
352
353 labelWidget.SetTextFormat(m_sResolutionScaleLocalisation, renderResWidth, renderResHeight);
354 }
355
356 //------------------------------------------------------------------------------------------------
358 protected void OnShadowDetailChanged(SCR_SpinBoxComponent comp, int i)
359 {
360 if (!m_Pipeline)
361 return;
362
363 m_Pipeline.Set("ShadowQuality", i + 1);
364 OnCustomMenuItemChanged("ShadowQuality");
365 }
366
367 //------------------------------------------------------------------------------------------------
369 protected void OnViewDistanceChanged(SCR_SliderComponent comp, float value)
370 {
371 GetGame().SetViewDistance(value);
372 // Get desired type of DOF
373 BaseContainer m_VideoSettings = GetGame().GetGameUserSettings().GetModule("SCR_VideoSettings");
374 if (m_VideoSettings)
375 {
376 m_VideoSettings.Set("m_iViewDistance", value);
377 }
378 OnCustomMenuItemChanged("DrawDistance");
379 }
380
381 //------------------------------------------------------------------------------------------------
382 protected void OnGrassDistanceChanged(SCR_SliderComponent comp, float value)
383 {
384 GetGame().SetGrassDistance(value);
385 OnCustomMenuItemChanged("GrassDistance");
386 }
387
388 //------------------------------------------------------------------------------------------------
391 {
393 return;
394
395 bool borderlessFullscreen = (index == 0);
396
397 m_ResolutionCombo.GetRootWidget().SetVisible(!borderlessFullscreen);
398 m_ResolutionScale.GetRootWidget().SetVisible(borderlessFullscreen);
399
400 int nativeWidth, nativeHeight;
401 float scale;
402
403 if (borderlessFullscreen)
404 {
405 // Set to borderless fulscreen
406 m_Video.Set("WindowMode", EWindowMode.BORDERLESS);
407
408 SCR_ComboBoxComponent combo = SCR_ComboBoxComponent.GetComboBoxComponent("Resolution", m_wRoot);
409 if (!combo)
410 return;
411
412 System.GetNativeResolution(nativeWidth, nativeHeight);
413 int i = combo.GetCurrentIndex();
414 scale = m_aWidths[i] / nativeWidth;
415 m_Video.Set("ResolutionScale", scale);
416
417 m_ResolutionScale.SetValue(scale);
418 }
419 else
420 {
421 // Set to windowed mode
422 m_Video.Set("WindowMode", EWindowMode.WINDOWED);
423
424 m_Video.Get("ResolutionScale", scale);
425 System.GetNativeResolution(nativeWidth, nativeHeight);
426
427 int width = nativeWidth * scale;
428 int bestDiff = int.MAX;
429 int bestIdx = 0;
430
431 for (int i, cnt = m_aWidths.Count(); i < cnt; i++)
432 {
433 int diff = Math.AbsInt(m_aWidths[i] - width);
434
435 if (diff < bestDiff)
436 {
437 bestDiff = diff;
438 bestIdx = i;
439
440 if (diff == 0)
441 break;
442 }
443 }
444
445 m_Video.Set("ScreenWidth", m_aWidths[bestIdx]);
446 m_Video.Set("ScreenHeight", m_aHeights[bestIdx]);
447 m_Video.Set("ResolutionScale", 1.0);
448
450 }
451
452 OnCustomMenuItemChanged("WindowMode");
453 }
454
455 //------------------------------------------------------------------------------------------------
457 {
458 if (!m_Video)
459 return;
460
461 int scale, nativeWidth, nativeHeight, width, height;
462 m_Video.Get("ResolutionScale", scale);
463 m_Video.Get("ScreenWidth", width);
464 m_Video.Get("ScreenHeight", height);
465 System.GetNativeResolution(nativeWidth, nativeHeight);
466
467 width = width * scale;
468 height = height * scale;
469 int bestDiff = int.MAX;
470 int bestIdx = 0;
471
472 for (int i, cnt = m_aWidths.Count(); i < cnt; i++)
473 {
474 int diff = Math.AbsInt(m_aWidths[i] - width);
475
476 if (diff < bestDiff)
477 {
478 bestDiff = diff;
479 bestIdx = i;
480 if (diff == 0)
481 break;
482 }
483 }
484
485 int bestDiffH = int.MAX;
486 int bestIdxH = 0;
487
488 for (int i, cnt = m_aHeights.Count(); i < cnt; i++)
489 {
490 int diff = Math.AbsInt(m_aHeights[i] - height);
491
492 if (diff < bestDiffH)
493 {
494 bestDiffH = diff;
495 bestIdxH = i;
496 if (diff == 0)
497 break;
498 }
499 }
500
501 string resolutionStr = string.Format(RESOLUTION_FORMAT, m_aWidths[bestIdx], m_aHeights[bestIdxH]);
502
503 foreach (int i, string elementName : combo.m_aElementNames)
504 {
505 if (elementName != resolutionStr)
506 continue;
507
508 combo.SetCurrentItem(i);
509 return;
510 }
511 }
512
513 //------------------------------------------------------------------------------------------------
514 protected void SetupViewDistance()
515 {
516 float viewDistance;
518 if (!distance)
519 return;
520
521 float min = GetGame().GetMinimumViewDistance();
522 float max = GetGame().GetMaximumViewDistance();
523
524 // Get desired type of DOF
525 BaseContainer m_VideoSettings = GetGame().GetGameUserSettings().GetModule("SCR_VideoSettings");
526 if (m_VideoSettings)
527 {
528 m_VideoSettings.Get("m_iViewDistance", viewDistance);
529 GetGame().SetViewDistance(viewDistance);
530 }
531
532 float current = GetGame().GetViewDistance();
533 distance.SetMin(min);
534 distance.SetMax(max);
535 distance.SetStep(50);
536
537 distance.SetValue(current);
538 distance.GetOnChangedFinal().Insert(OnViewDistanceChanged);
539 }
540
541 //------------------------------------------------------------------------------------------------
542 protected void SetupGrassDistance()
543 {
545 if (!distance)
546 return;
547
548 int min = GetGame().GetMinimumGrassDistance();
549 int max = GetGame().GetMaximumGrassDistance();
550 int current = GetGame().GetGrassDistance();
551 distance.SetMin(min);
552 distance.SetMax(max);
553 distance.SetStep(1);
554
555 distance.SetValue(current);
556 distance.GetOnChangedFinal().Insert(OnGrassDistanceChanged);
557 }
558
559 //------------------------------------------------------------------------------------------------
560 protected void SetupShadowQuality(bool isInit = true)
561 {
562 if (!m_Pipeline)
563 return;
564 // Shadow detail quality is little special, because we want to skip the lowest setting
566 if (!shadowDetail)
567 return;
568
569 int shadowQuality;
570 m_Pipeline.Get("ShadowQuality", shadowQuality);
571 shadowDetail.SetCurrentItem(Math.ClampInt(shadowQuality - 1, 0, shadowDetail.GetNumItems() - 1));
572
573 if (isInit)
574 shadowDetail.m_OnChanged.Insert(OnShadowDetailChanged);
575 }
576
577 //------------------------------------------------------------------------------------------------
578 protected void SetupResolution()
579 {
581 return;
582
583 int mode;
584 m_Video.Get("WindowMode", mode);
585
586 // Hide resolutions if not in window mode
587
588#ifdef PLATFORM_CONSOLE
589 bool fullScreen = true;
590 bool showWindowMode = false;
591#else
592 bool fullScreen = (mode != EWindowMode.WINDOWED);
593 bool showWindowMode = true;
594#endif
595
596#ifdef WORKBENCH
597 fullScreen = true;
598 showWindowMode = false;
599#endif
600
601 if (showWindowMode)
602 {
603 m_WindowMode.SetCurrentItem(!fullScreen);
604 m_WindowMode.m_OnChanged.Insert(OnWindowModeChanged);
605 }
606
607 m_WindowMode.GetRootWidget().SetVisible(showWindowMode);
608
610 m_ResolutionScale.GetRootWidget().SetVisible(fullScreen);
612 m_ResolutionCombo.GetRootWidget().SetVisible(!fullScreen);
613
614 System.GetSupportedResolutions(m_aWidths, m_aHeights);
615 for (int i = 0, cnt = m_aWidths.Count(); i < cnt; i++)
616 {
617 m_ResolutionCombo.AddItem(string.Format(RESOLUTION_FORMAT, m_aWidths[i], m_aHeights[i]));
618 }
619
621 m_ResolutionCombo.m_OnChanged.Insert(UpdateResolution);
622 }
623
624 //------------------------------------------------------------------------------------------------
625 protected void SetupResolutionScale()
626 {
628 return;
629
630 float scale = m_ResolutionScale.GetValue() * 100;
631 scale = Math.Round(scale);
632 m_ResolutionScale.ShowCustomValue(scale.ToString());
633
636 }
637
638 //------------------------------------------------------------------------------------------------
642 {
643 ButtonWidget qualityPreset = ButtonWidget.Cast(m_wRoot.FindAnyWidget("QualityPreset"));
644 if (!qualityPreset)
645 return;
646
647 VerticalLayoutWidget settingsEntries = VerticalLayoutWidget.Cast(m_wScroll.FindAnyWidget("SettingsEntries"));
648 if (!settingsEntries)
649 return;
650
651 Widget child = settingsEntries.GetChildren();
652 while (child)
653 {
654 if (ButtonWidget.Cast(child))
655 {
656 GetGame().GetCallqueue().CallLater(GetGame().GetWorkspace().SetFocusedWidget, 0, false, child, false);
657 return;
658 }
659 child = child.GetSibling();
660 }
661 }
662
663 //------------------------------------------------------------------------------------------------
665 protected void UpdateResolution(SCR_ComboBoxComponent resolution, int current)
666 {
667 if (!resolution || !m_Video)
668 return;
669
670 m_Video.Set("ScreenWidth", m_aWidths[current]);
671 m_Video.Set("ScreenHeight", m_aHeights[current]);
672
674
675 OnCustomMenuItemChanged("Resolution");
676 }
677
678 //------------------------------------------------------------------------------------------------
679 protected void SetupMaxFPS()
680 {
681 if (!m_Video || !m_MaxFPS)
682 return;
683
684 int maxFPS;
685 m_Video.Get("MaxFps", maxFPS);
686
687 if (maxFPS < 1)
688 {
689 m_MaxFPS.SetCurrentItem(0);
690 }
691 else
692 {
693 for (int i = 1, cnt = m_MaxFPS.GetNumItems(); i < cnt; i++)
694 {
695 if (m_MaxFPS.GetItemName(i).ToInt() == maxFPS)
696 {
697 m_MaxFPS.SetCurrentItem(i);
698 break;
699 }
700 }
701 }
702
703 m_MaxFPS.m_OnChanged.Insert(OnMaxFPSChanged);
704 }
705
706 protected void HandleDescription()
707 {
708 ButtonWidget drawDistance = ButtonWidget.Cast(m_wRoot.FindAnyWidget("DrawDistance"));
709 if (!drawDistance)
710 return;
711
712 SCR_ModularButtonComponent buttonComp = SCR_ModularButtonComponent.Cast(drawDistance.FindHandler(SCR_ModularButtonComponent));
713 if (!buttonComp)
714 return;
715
716 buttonComp.m_OnFocus.Insert(DescriptionOnFocus);
717 buttonComp.m_OnFocusLost.Insert(DescriptionOnFocusLost);
718 }
719
720 protected void DescriptionOnFocus()
721 {
722 RichTextWidget title = RichTextWidget.Cast(m_wRoot.FindAnyWidget("DescriptionHeader"));
723 RichTextWidget body = RichTextWidget.Cast(m_wRoot.FindAnyWidget("DescriptionBody"));
724
725 if (!title || !body)
726 return;
727
728 title.SetText("#AR-Settings_DrawDistance");
729 body.SetText("#AR-Settings_Description_DrawDistance");
730 }
731
732 protected void DescriptionOnFocusLost()
733 {
734 RichTextWidget title = RichTextWidget.Cast(m_wRoot.FindAnyWidget("DescriptionHeader"));
735 RichTextWidget body = RichTextWidget.Cast(m_wRoot.FindAnyWidget("DescriptionBody"));
736
737 if (!title || !body)
738 return;
739
740 title.SetText(string.Empty);
741 body.SetText(string.Empty);
742 }
743}
vector scale
ArmaReforgerScripted GetGame()
Definition game.c:1398
float distance
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
void LoadSettings()
@ FULLSCREEN
Definition Math.c:13
override bool SetCurrentItem(int i, bool playSound=false, bool animate=false)
ref array< ref SCR_SettingsBindingBase > m_aSettingsBindings
static SCR_SliderComponent GetSliderComponent(string name, Widget parent, bool searchAllChildren=true)
void ShowCustomValue(string value)
static SCR_SpinBoxComponent GetSpinBoxComponent(string name, Widget parent, bool searchAllChildren=true)
override bool SetCurrentItem(int i, bool playSound=false, bool animate=false)
void SetQualityPresetIndex(string changedSetting)
void OnHardwareAAChanged(SCR_SpinBoxComponent comp, int i)
Event called when hardware AA spinbox changes.
void OnRenderResolutionChanged()
method called when resolution or resolution scale changes
SCR_SliderComponent m_ResolutionScale
void SetupTextureDetail(bool isInit=true)
static const ref array< string > PRESET_SETTINGS
list of WIDGET names
void SetResolutionCombo(SCR_ComboBoxComponent combo)
void OnQualityPresetChanged(SCR_ComboBoxComponent combobox, int itemIndex)
void OnViewDistanceChanged(SCR_SliderComponent comp, float value)
Event called when shadow quality slider changes.
void OnGrassDistanceChanged(SCR_SliderComponent comp, float value)
override void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout, int index)
SCR_ComboBoxComponent m_ResolutionCombo
void SetupShadowQuality(bool isInit=true)
void OnCustomMenuItemChanged(string widgetName)
static const string RESOLUTION_FORMAT
void OnTextureDetailChanged(SCR_SpinBoxComponent comp, int i)
Event called when texture detail spinbox changes.
void SetupHardwareAA(bool isInit=true)
void UpdateResolution(SCR_ComboBoxComponent resolution, int current)
Event called when resolution combo box changes.
void OnMaxFPSChanged(SCR_SpinBoxComponent comp, int i)
Event called when max FPS is changed.
void OnWindowModeChanged(SCR_SpinBoxComponent comp, int index)
Event called when window mode combo box changes.
void OnShadowDetailChanged(SCR_SpinBoxComponent comp, int i)
Event called when shadow quality spinbox changes.
void OnResolutionScaleChanged(SCR_SliderComponent comp, float value)
Event called when resolution scale slider changes.
override void OnMenuItemChanged(SCR_SettingsBindingBase binding)