DayZ 1.24
Loading...
Searching...
No Matches
OptionsMenuVideo.c
Go to the documentation of this file.
1class OptionsMenuVideo extends ScriptedWidgetEventHandler
2{
3 protected Widget m_Root;
4
5 protected Widget m_SettingsRoot;
6 protected Widget m_DetailsRoot;
11
12 protected GameOptions m_Options;
13 protected OptionsMenu m_Menu;
14
15#ifdef PLATFORM_CONSOLE
16#ifdef PLATFORM_PS4
17 protected ref OptionSelectorMultistate m_FlipModeSelector;
18#endif
19#else
20 //Overall
21 protected ref OptionSelectorMultistate m_OverallQualitySelector;
22
23 //Screen
24 protected ref OptionSelectorMultistate m_DisplayModeSelector;
25 protected ref OptionSelectorMultistate m_ResolutionSelector;
26 protected ref OptionSelectorSlider m_BrightnessSelector;
27 protected ref OptionSelectorMultistate m_VSyncSelector;
28 //protected ref OptionSelectorMultistate m_ColorDepthSelector;
29
30 //Scene
31 protected ref OptionSelectorMultistate m_ObjectDetailSelector;
32 protected ref OptionSelectorMultistate m_TerrainDetailSelector;
33 protected ref OptionSelectorMultistate m_TextureDetailSelector;
34 protected ref OptionSelectorMultistate m_ShadowDetailSelector;
35
36 //Rendering
37 protected ref OptionSelectorMultistate m_TextureFilteringSelector;
38 protected ref OptionSelectorMultistate m_TerrainSurfaceDetailSelector;
39 protected ref OptionSelectorMultistate m_PPAASelector;
40 protected ref OptionSelectorMultistate m_HWAASelector;
41 protected ref OptionSelectorMultistate m_ATOCSelector;
42 protected ref OptionSelectorMultistate m_AOSelector;
43 protected ref OptionSelectorMultistate m_PPQualitySelector;
44 protected ref OptionSelectorMultistate m_SSRQualitySelector;
45#endif
46
47#ifdef PLATFORM_CONSOLE
48#ifdef PLATFORM_PS4
50#endif
51#else
52 //Overall
54
55 //Screen
60 //protected ref ListOptionsAccess m_ColorDepthOption;
61
62 //Scene
67
68 //Rendering
77#endif
78
80
82 {
83 m_Root = GetGame().GetWorkspace().CreateWidgets(GetLayoutName(), parent);
84
85 m_DetailsRoot = details_root;
86 m_DetailsBodyDefault = m_DetailsRoot.FindAnyWidget("settings_details_body");
87 m_DetailsBodyConnectivity = m_DetailsRoot.FindAnyWidget("settings_details_body_connectivity");
88 m_DetailsLabel = TextWidget.Cast(m_DetailsRoot.FindAnyWidget("details_label"));
89 m_DetailsText = RichTextWidget.Cast(m_DetailsRoot.FindAnyWidget("details_content"));
90
92 m_Menu = menu;
93
94#ifdef PLATFORM_CONSOLE
95#ifdef PLATFORM_PS4
96 m_Root.FindAnyWidget("vsync_setting_option").SetUserID(OptionAccessType.AT_OPTIONS_FLIPMODE);
97#endif
98#else
99 m_Root.FindAnyWidget("overall_quality_setting_option").SetUserID(OptionAccessType.AT_QUALITY_PREFERENCE);
100 m_Root.FindAnyWidget("display_mode_setting_option").SetUserID(OptionAccessType.AT_OPTIONS_DISPLAY_MODE);
101 m_Root.FindAnyWidget("resolution_setting_option").SetUserID(OptionAccessType.AT_OPTIONS_RESOLUTION);
102 m_Root.FindAnyWidget("brightness_setting_option").SetUserID(OptionAccessType.AT_OPTIONS_BRIGHT_SLIDER);
103 m_Root.FindAnyWidget("vsync_setting_option").SetUserID(OptionAccessType.AT_VSYNC_VALUE);
104 //m_Root.FindAnyWidget( "color_depth_setting_option" ).SetUserID( OptionAccessType.AT_HDR_DETAIL );
105
106 //Scene
107 m_Root.FindAnyWidget("object_detail_setting_option").SetUserID(OptionAccessType.AT_OBJECTS_DETAIL);
108 m_Root.FindAnyWidget("terrain_detail_setting_option").SetUserID(OptionAccessType.AT_OPTIONS_TERRAIN);
109 m_Root.FindAnyWidget("texture_detail_setting_option").SetUserID(OptionAccessType.AT_TEXTURE_DETAIL);
110 m_Root.FindAnyWidget("shadow_detail_setting_option").SetUserID(OptionAccessType.AT_SHADOW_DETAIL);
111
112 //Rendering
113 m_Root.FindAnyWidget("texture_filtering_setting_option").SetUserID(OptionAccessType.AT_ANISO_DETAIL);
114 m_Root.FindAnyWidget("terrain_surface_detail_setting_option").SetUserID(OptionAccessType.AT_OPTIONS_TERRAIN_SHADER);
115 m_Root.FindAnyWidget("ppaa_setting_option").SetUserID(OptionAccessType.AT_OPTIONS_FXAA_VALUE);
116 m_Root.FindAnyWidget("hwaa_setting_option").SetUserID(OptionAccessType.AT_FSAA_DETAIL);
117 m_Root.FindAnyWidget("atoc_setting_option").SetUserID(OptionAccessType.AT_ATOC_DETAIL);
118 m_Root.FindAnyWidget("ao_setting_option").SetUserID(OptionAccessType.AT_AMBIENT_OCCLUSION);
119 m_Root.FindAnyWidget("pp_setting_option").SetUserID(OptionAccessType.AT_POSTPROCESS_EFFECTS);
120 m_Root.FindAnyWidget("ssr_setting_option").SetUserID(OptionAccessType.AT_WATER_DETAIL);
121#endif
122
123 FillTextMap();
126 GetGame().BeginOptionsVideo();
127
128 float x, y, y2;
129 m_Root.FindAnyWidget("video_settings_scroll").GetScreenSize(x, y);
130 m_Root.FindAnyWidget("video_settings_root").GetScreenSize(x, y2);
131 int f = (y2 > y);
132 m_Root.FindAnyWidget("video_settings_scroll").SetAlpha(f);
133
134 m_Root.SetHandler(this);
135 }
136
138 {
139 GetGame().EndOptionsVideo();
140 }
141
143 {
144#ifdef PLATFORM_CONSOLE
145#ifdef PLATFORM_PS4
146 array<string> opt1 = { "#STR_ENABLED", "#STR_DISABLED", "#STR_SELECTIVE" };
147 m_FlipModeSelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("vsync_setting_option"), m_FlipModeOption.GetIndex(), this, false, opt1);
148#endif
149#else
150 array<string> opt1 = { "#options_controls_disabled", "#options_controls_enabled" };
151 array<string> opt2 = { "#options_video_fullscreen", "#options_video_windowed" };
152 array<string> opt3 = { "#options_video_low", "#options_video_medium", "#options_video_high" };
153 array<string> opt4 = { "#options_video_poor", "#options_video_low", "#options_video_medium", "#options_video_high", "#options_video_extreme" };
154 array<string> opt41 = { "#options_video_low", "#options_video_medium", "#options_video_high", "#options_video_extreme" };
155 array<string> opt5 = { "#options_video_poor", "#options_video_low", "#options_video_medium", "#options_video_high", "#options_video_extreme", "#options_video_custom" };
156 array<string> opt6 = { "#options_controls_disabled", "#options_video_low", "#options_video_medium", "#options_video_high", "#options_video_extreme" };
157 array<string> opt7 = { "#options_controls_disabled", "#options_video_low", "#options_video_medium", "#options_video_high" };
159 array<string> opt9 = { "#options_controls_disabled", "#options_video_low", "#options_video_high" };
160
161 for (int i = 0; i < m_ResolutionOption.GetItemsCount(); i++)
162 {
163 string opt_text;
164 m_ResolutionOption.GetItemText(i, opt_text);
165 opt8.Insert(opt_text);
166 }
167
168 //Overall
169 m_OverallQualitySelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("overall_quality_setting_option"), m_OverallQualityOption.GetIndex(), this, false, opt5);
170
171 //Screen
172 m_DisplayModeSelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("display_mode_setting_option"), m_DisplayModeOption.GetIndex(), this, false, opt2);
173 m_ResolutionSelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("resolution_setting_option"), m_ResolutionOption.GetIndex(), this, false, opt8);
174 m_BrightnessSelector = new OptionSelectorSlider(m_Root.FindAnyWidget("brightness_setting_option"), m_BrightnessOption.ReadValue(), this, false, m_BrightnessOption.GetMin(), m_BrightnessOption.GetMax());
175 m_VSyncSelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("vsync_setting_option"), m_VSyncOption.GetIndex(), this, false, opt1);
176 //m_ColorDepthSelector = new OptionSelectorMultistate( m_Root.FindAnyWidget( "color_depth_setting_option" ), m_ColorDepthOption.GetIndex(), this, false, opt3 );
177
178 //Scene
179 m_ObjectDetailSelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("object_detail_setting_option"), m_ObjectDetailOption.GetIndex(), this, false, opt4);
180 m_TerrainDetailSelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("terrain_detail_setting_option"), m_TerrainDetailOption.GetIndex(), this, false, opt4);
181 m_TextureDetailSelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("texture_detail_setting_option"), m_TextureDetailOption.GetIndex(), this, false, opt4);
182 m_ShadowDetailSelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("shadow_detail_setting_option"), m_ShadowDetailOption.GetIndex(), this, false, opt4);
183
184 //Rendering
185 m_TextureFilteringSelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("texture_filtering_setting_option"), m_TextureFilteringOption.GetIndex(), this, false, opt3);
186 m_TerrainSurfaceDetailSelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("terrain_surface_detail_setting_option"), m_TerrainSurfaceDetailOption.GetIndex(), this, false, opt41);
187
188 m_PPAASelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("ppaa_setting_option"), m_PPAAOption.GetIndex(), this, false, opt6);
189 m_HWAASelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("hwaa_setting_option"), m_HWAAOption.GetIndex(), this, false, opt7);
190 m_ATOCSelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("atoc_setting_option"), m_ATOCOption.GetIndex(), this, false, opt1);
191 m_AOSelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("ao_setting_option"), m_AOOption.GetIndex(), this, false, opt6);
192 m_PPQualitySelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("pp_setting_option"), m_PPQualityOption.GetIndex(), this, false, opt3);
193 m_SSRQualitySelector = new OptionSelectorMultistate(m_Root.FindAnyWidget("ssr_setting_option"), m_SSRQualityOption.GetIndex(), this, false, opt9);
194#endif
195
196#ifdef PLATFORM_CONSOLE
197#ifdef PLATFORM_PS4
198 m_FlipModeSelector.m_OptionChanged.Insert(OnFlipModeChanged);
199#endif
200#else
201 //Overall
202 m_OverallQualitySelector.m_OptionChanged.Insert(OnOverallQualityChanged);
203
204 //Screen
205 m_DisplayModeSelector.m_OptionChanged.Insert(OnDisplayModeChanged);
206 m_ResolutionSelector.m_OptionChanged.Insert(OnResolutionChanged);
207 m_BrightnessSelector.m_OptionChanged.Insert(OnBrightnessChanged);
208 m_VSyncSelector.m_OptionChanged.Insert(OnVSyncChanged);
209 //m_ColorDepthSelector.m_OptionChanged.Insert( OnColorDepthChanged );
210
211 //Scene
212 m_ObjectDetailSelector.m_OptionChanged.Insert(OnObjectDetailChanged);
213 m_TerrainDetailSelector.m_OptionChanged.Insert(OnTerrainDetailChanged);
214 m_TextureDetailSelector.m_OptionChanged.Insert(OnTextureDetailChanged);
215 m_ShadowDetailSelector.m_OptionChanged.Insert(OnShadowDetailChanged);
216
217 //Rendering
218 m_TextureFilteringSelector.m_OptionChanged.Insert(OnTextureFilteringChanged);
219 m_TerrainSurfaceDetailSelector.m_OptionChanged.Insert(OnTerrainSurfaceDetailChanged);
220 m_PPAASelector.m_OptionChanged.Insert(OnPPAAChanged);
221 m_HWAASelector.m_OptionChanged.Insert(OnHWAAChanged);
222 m_ATOCSelector.m_OptionChanged.Insert(OnATOCChanged);
223 m_AOSelector.m_OptionChanged.Insert(OnAOChanged);
224 m_PPQualitySelector.m_OptionChanged.Insert(OnPPQualityChanged);
225 m_SSRQualitySelector.m_OptionChanged.Insert(OnSSRQualityChanged);
226#endif
227 }
228
230 {
231#ifdef PLATFORM_PS4
232 return "gui/layouts/new_ui/options/ps/video_tab.layout";
233#else
234#ifdef PLATFORM_WINDOWS
235 return "gui/layouts/new_ui/options/pc/video_tab.layout";
236#endif
237#endif
238 }
239
240 void Focus()
241 {
242#ifdef PLATFORM_PS4
244 SetFocus(m_FlipModeSelector.GetParent());
245#endif
246 }
247
249 {
250 m_Menu.ReloadOptions();
251 }
252
254 {
255 return false;
256 }
257
258 void Apply()
259 {
260
261 }
262
263 void Revert()
264 {
265#ifndef PLATFORM_CONSOLE
266 m_DisplayModeSelector.SetValue(m_DisplayModeOption.GetIndex(), false);
267 m_ResolutionSelector.SetValue(m_ResolutionOption.GetIndex(), false);
268 m_BrightnessSelector.SetValue(m_BrightnessOption.ReadValue(), false);
269 m_VSyncSelector.SetValue(m_VSyncOption.GetIndex(), false);
270 //m_ColorDepthSelector.SetValue( m_ColorDepthOption.GetIndex(), false );
271 m_OverallQualitySelector.SetValue(m_OverallQualityOption.GetIndex(), false);
272#endif
273
275#ifndef PLATFORM_CONSOLE
276 m_OverallQualitySelector.SetValue(m_OverallQualityOption.GetIndex(), false);
277#endif
278 }
279
281 {
282#ifdef PLATFORM_CONSOLE
283#ifdef PLATFORM_PS4
284 m_FlipModeSelector.SetValue(m_FlipModeOption.GetDefaultIndex(), false);
285#endif
286#else
287 m_DisplayModeSelector.SetValue(m_DisplayModeOption.GetDefaultIndex(), false);
288 m_ResolutionSelector.SetValue(m_ResolutionOption.GetDefaultIndex(), false);
289 m_BrightnessSelector.SetValue(m_BrightnessOption.GetDefault(), false);
290 m_VSyncSelector.SetValue(m_VSyncOption.GetDefaultIndex(), false);
291 int idx = m_OverallQualityOption.GetDefaultIndex();
292 m_OverallQualitySelector.SetValue(m_OverallQualityOption.GetDefaultIndex(), true);
293#endif
294
296 //DefaultValuesToCustom();
297 }
298
300 {
301 m_Options = options;
302
303#ifdef PLATFORM_CONSOLE
304#ifdef PLATFORM_PS4
305 m_FlipModeOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_OPTIONS_FLIPMODE));
306#endif
307#else
308 //Overall
309 m_OverallQualityOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_QUALITY_PREFERENCE));
310
311 //Screen
312 m_DisplayModeOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_OPTIONS_DISPLAY_MODE));
313 m_ResolutionOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_OPTIONS_RESOLUTION));
314 m_BrightnessOption = NumericOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_OPTIONS_BRIGHT_SLIDER));
315 m_VSyncOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_VSYNC_VALUE));
316 //m_ColorDepthOption = ListOptionsAccess.Cast( m_Options.GetOptionByType( OptionAccessType.AT_HDR_DETAIL ) );
317
318 //Scene
319 m_ObjectDetailOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_OBJECTS_DETAIL));
320 m_TerrainDetailOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_OPTIONS_TERRAIN));
321 m_TextureDetailOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_TEXTURE_DETAIL));
322 m_ShadowDetailOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_SHADOW_DETAIL));
323
324 //Rendering
325 m_TextureFilteringOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_ANISO_DETAIL));
326 m_TerrainSurfaceDetailOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_OPTIONS_TERRAIN_SHADER));
327
328 m_PPAAOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_OPTIONS_FXAA_VALUE));
329 m_HWAAOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_FSAA_DETAIL));
330 m_ATOCOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_ATOC_DETAIL));
331 m_AOOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_AMBIENT_OCCLUSION));
332 m_PPQualityOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_POSTPROCESS_EFFECTS));
333 m_SSRQualityOption = ListOptionsAccess.Cast(m_Options.GetOptionByType(OptionAccessType.AT_WATER_DETAIL));
334#endif
335 }
336
338 {
339 }
340
344
346 {
347#ifdef PLATFORM_CONSOLE
348#ifdef PLATFORM_PS4
349 m_FlipModeSelector.SetValue(m_FlipModeOption.GetIndex(), false);
350#endif
351#else
352 //Scene
353 m_ObjectDetailSelector.SetValue(m_ObjectDetailOption.GetIndex(), false);
354 m_TerrainDetailSelector.SetValue(m_TerrainDetailOption.GetIndex(), false);
355 m_TextureDetailSelector.SetValue(m_TextureDetailOption.GetIndex(), false);
356 m_ShadowDetailSelector.SetValue(m_ShadowDetailOption.GetIndex(), false);
357
358 //Rendering
359 m_TextureFilteringSelector.SetValue(m_TextureFilteringOption.GetIndex(), false);
360 m_TerrainSurfaceDetailSelector.SetValue(m_TerrainSurfaceDetailOption.GetIndex(), false);
361 m_PPAASelector.SetValue(m_PPAAOption.GetIndex(), false);
362 m_HWAASelector.SetValue(m_HWAAOption.GetIndex(), false);
363 if (m_HWAAOption.GetIndex() == 0)
364 m_ATOCSelector.Disable();
365 else
366 m_ATOCSelector.Enable();
367 m_ATOCSelector.SetValue(m_ATOCOption.GetIndex(), false);
368 m_AOSelector.SetValue(m_AOOption.GetIndex(), false);
369 m_PPQualitySelector.SetValue(m_PPQualityOption.GetIndex(), false);
370 m_SSRQualitySelector.SetValue(m_SSRQualityOption.GetIndex(), false);
371#endif
372 }
373
374 override bool OnMouseEnter(Widget w, int x, int y)
375 {
376 if (w && w.IsInherited(ScrollWidget))
377 return false;
378
379 m_Menu.ColorHighlight(w);
380
381 return true;
382 }
383
384 override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
385 {
386 if (w && w.IsInherited(ScrollWidget))
387 return false;
388
389 m_Menu.ColorNormal(w);
390 return true;
391 }
392
394 {
395#ifndef PLATFORM_CONSOLE
396 if (m_OverallQualityOption.GetIndex() != 5)
397 m_OverallQualitySelector.SetValue(5);
398#endif
399 }
400
401#ifdef PLATFORM_CONSOLE
402#ifdef PLATFORM_PS4
403 void OnFlipModeChanged(int value)
404 {
405 m_FlipModeOption.SetIndex(value);
407 m_Menu.OnChanged();
408 }
409#endif
410#else
412 {
413 m_OverallQualityOption.SetIndex(value);
414 m_OverallQualityOption.Test(); //here's the bastard!
415 m_Options.Test();
416 //SetOptions(m_Options);
417
419
420 //InitSelectors();
421 m_OverallQualityOption.SetIndex(value);
423 m_Menu.OnChanged();
424 }
425
427 {
428 m_DisplayModeOption.SetIndex(value);
429 m_Menu.OnChanged();
430 }
431
433 {
434 m_ResolutionOption.SetIndex(value);
435 m_Menu.OnChanged();
436 }
437
439 {
440 m_BrightnessOption.WriteValue(value);
441 m_Menu.OnChanged();
442 }
443
445 {
446 m_VSyncOption.SetIndex(value);
447 m_Menu.OnChanged();
448 }
449
451 {
452 //m_ColorDepthOption.SetIndex( value );
453 m_Menu.OnChanged();
454 }
455
457 {
458 m_ObjectDetailOption.SetIndex(value);
460 m_Menu.OnChanged();
461 }
462
464 {
465 m_TerrainDetailOption.SetIndex(value);
467 m_Menu.OnChanged();
468 }
469
471 {
472 m_TextureDetailOption.SetIndex(value);
474 m_Menu.OnChanged();
475 }
476
478 {
479 m_ShadowDetailOption.SetIndex(value);
481 m_Menu.OnChanged();
482 }
483
485 {
486 m_TextureFilteringOption.SetIndex(value);
488 m_Menu.OnChanged();
489 }
490
492 {
493 m_TerrainSurfaceDetailOption.SetIndex(value);
495 m_Menu.OnChanged();
496 }
497
499 {
500 m_PPAAOption.SetIndex(value);
502 m_Menu.OnChanged();
503 }
504
506 {
507 m_HWAAOption.SetIndex(value);
508 if (value == 0)
509 m_ATOCSelector.Disable();
510 else
511 m_ATOCSelector.Enable();
513 m_Menu.OnChanged();
514 }
515
517 {
518 m_ATOCOption.SetIndex(value);
520 m_Menu.OnChanged();
521 }
522
524 {
525 m_AOOption.SetIndex(value);
527 m_Menu.OnChanged();
528 }
529
531 {
532 m_PPQualityOption.SetIndex(value);
534 m_Menu.OnChanged();
535 }
536
538 {
539 m_SSRQualityOption.SetIndex(value);
541 m_Menu.OnChanged();
542 }
543#endif
544
545 override bool OnFocus(Widget w, int x, int y)
546 {
547 OptionsMenu menu = OptionsMenu.Cast(GetGame().GetUIManager().GetMenu());
548 if (menu)
549 menu.OnFocus(w, x, y);
550 if (w)
551 {
552 if (TextMapUpdateWidget(w.GetUserID()))
553 return true;
554
555 if (w.IsInherited(SliderWidget))
556 return true;
557 }
558 m_DetailsRoot.Show(false);
559 return (w != null);
560 }
561
563 {
564 bool connectivityInfoShown = key == OptionIDsScript.OPTION_CONNECTIVITY_INFO;
566 Param tmp = m_TextMap.Get(key);
567
568 m_DetailsBodyDefault.Show(!connectivityInfoShown);
569 m_DetailsBodyConnectivity.Show(connectivityInfoShown);
570
571 if (Class.CastTo(p, tmp))
572 {
573 m_DetailsRoot.Show(true);
574 m_DetailsText.Show(true);
575 m_DetailsLabel.SetText(p.param1);
576 m_DetailsText.SetText(p.param2);
577
578 m_DetailsText.Update();
579 m_DetailsLabel.Update();
580 m_DetailsRoot.Update();
581 m_DetailsBodyConnectivity.Update(); //...
582 return true;
583 }
584 return false;
585 }
586
588 {
590
591#ifdef PLATFORM_CONSOLE
592#ifdef PLATFORM_PS4
593 m_TextMap.Insert(OptionAccessType.AT_OPTIONS_FLIPMODE, new Param2<string, string>("#options_video_V-sync", "#options_video_V-sync_desc"));
594#endif
595#else
596 m_TextMap.Insert(OptionAccessType.AT_QUALITY_PREFERENCE, new Param2<string, string>("#options_video_quality", "#options_video_quality_desc"));
597 m_TextMap.Insert(OptionAccessType.AT_OPTIONS_DISPLAY_MODE, new Param2<string, string>("#options_video_display_mode", "#options_video_display_mode_desc"));
598 m_TextMap.Insert(OptionAccessType.AT_OPTIONS_RESOLUTION, new Param2<string, string>("#options_video_resolution", "#options_video_resolution_desc"));
599 m_TextMap.Insert(OptionAccessType.AT_OPTIONS_BRIGHT_SLIDER, new Param2<string, string>("#options_video_brightness", "#options_video_brightness_desc"));
600 m_TextMap.Insert(OptionAccessType.AT_VSYNC_VALUE, new Param2<string, string>("#options_video_V-sync", "#options_video_V-sync_desc"));
601 m_TextMap.Insert(OptionAccessType.AT_HDR_DETAIL, new Param2<string, string>("#options_video_color_depth", "#options_video_color_depth_desc"));
602 m_TextMap.Insert(OptionAccessType.AT_OBJECTS_DETAIL, new Param2<string, string>("#options_video_object_detail", "#options_video_object_detail_desc"));
603 m_TextMap.Insert(OptionAccessType.AT_OPTIONS_TERRAIN, new Param2<string, string>("#options_video_terrain_detail", "#options_video_terrain_detail_desc"));
604 m_TextMap.Insert(OptionAccessType.AT_TEXTURE_DETAIL, new Param2<string, string>("#options_video_texture_detail", "#options_video_texture_detail_desc"));
605 m_TextMap.Insert(OptionAccessType.AT_SHADOW_DETAIL, new Param2<string, string>("#options_video_shadow_detail", "#options_video_shadow_detail_desc"));
606 m_TextMap.Insert(OptionAccessType.AT_ANISO_DETAIL, new Param2<string, string>("#options_video_texture_filtering", "#options_video_texture_filtering_desc"));
607 m_TextMap.Insert(OptionAccessType.AT_OPTIONS_TERRAIN_SHADER, new Param2<string, string>("#options_video_terrain_surface_detail", "#options_video_terrain_surface_detail_desc"));
608 m_TextMap.Insert(OptionAccessType.AT_OPTIONS_FXAA_VALUE, new Param2<string, string>("#options_video_anti-aliasing", "#options_video_anti-aliasing_desc"));
609 m_TextMap.Insert(OptionAccessType.AT_FSAA_DETAIL, new Param2<string, string>("#options_video_anti-aliasing_hardware", "#options_video_anti-aliasing_hardware_desc"));
610 m_TextMap.Insert(OptionAccessType.AT_ATOC_DETAIL, new Param2<string, string>("#options_video_foliage_smoothing", "#options_video_foliage_smoothing_desc"));
611 m_TextMap.Insert(OptionAccessType.AT_AMBIENT_OCCLUSION, new Param2<string, string>("#options_video_ambient_occlusion", "#options_video_ambient_occlusion_desc"));
612 m_TextMap.Insert(OptionAccessType.AT_POSTPROCESS_EFFECTS, new Param2<string, string>("#options_video_post_process", "#options_video_post_process_desc"));
613 m_TextMap.Insert(OptionAccessType.AT_WATER_DETAIL, new Param2<string, string>("#STR_option_video_ssr_quality_tip_header", "#STR_option_video_ssr_quality_tip"));
614#endif
615 }
616}
Icon x
Icon y
ServerBrowserMenuNew m_Menu
Widget m_Root
Definition SizeToChild.c:85
Super root of all classes in Enforce script.
Definition EnScript.c:11
proto native void Test()
Tests every option, see OptionsAccess::Test.
proto native OptionsAccess GetOptionByType(int accessType)
Get option by AccessType.
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
map: item x vector(index, width, height)
Definition EnWidgets.c:651
ref ListOptionsAccess m_TextureDetailOption
void OnTerrainDetailChanged(int value)
ref OptionSelectorMultistate m_TextureFilteringSelector
ref OptionSelectorMultistate m_ResolutionSelector
ref OptionSelectorMultistate m_ObjectDetailSelector
void OnResolutionChanged(int value)
ref OptionSelectorMultistate m_TerrainSurfaceDetailSelector
void OnDisplayModeChanged(int value)
ref OptionSelectorMultistate m_HWAASelector
void ToggleDependentOptions(int mode, bool state)
void OptionsMenuVideo(Widget parent, Widget details_root, GameOptions options, OptionsMenu menu)
ref OptionSelectorMultistate m_ShadowDetailSelector
ref ListOptionsAccess m_AOOption
ref ListOptionsAccess m_TerrainSurfaceDetailOption
void SetOptions(GameOptions options)
ref OptionSelectorMultistate m_AOSelector
ref OptionSelectorMultistate m_DisplayModeSelector
void OnBrightnessChanged(float value)
void OnObjectDetailChanged(int value)
ref ListOptionsAccess m_DisplayModeOption
ref ListOptionsAccess m_ObjectDetailOption
CameraToolsMenu m_Menu
Definition CTEvent.c:8
ref OptionSelectorMultistate m_ATOCSelector
ref OptionSelectorMultistate m_PPQualitySelector
ref ListOptionsAccess m_PPAAOption
void OnTextureFilteringChanged(int value)
ref OptionSelectorMultistate m_VSyncSelector
ref ListOptionsAccess m_TextureFilteringOption
ref ListOptionsAccess m_SSRQualityOption
ref OptionSelectorMultistate m_SSRQualitySelector
ref OptionSelectorMultistate m_OverallQualitySelector
ref OptionSelectorMultistate m_TerrainDetailSelector
ref ListOptionsAccess m_ResolutionOption
void OnSSRQualityChanged(int value)
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
ref ListOptionsAccess m_PPQualityOption
ref OptionSelectorMultistate m_TextureDetailSelector
void OnOverallQualityChanged(int value)
void OnShadowDetailChanged(int value)
void OnTerrainSurfaceDetailChanged(int value)
ref map< int, ref Param2< string, string > > m_TextMap
void OnVSyncChanged(float value)
ref OptionSelectorSlider m_BrightnessSelector
ref OptionSelectorMultistate m_PPAASelector
ref ListOptionsAccess m_HWAAOption
override bool OnFocus(Widget w, int x, int y)
ref ListOptionsAccess m_VSyncOption
ref ListOptionsAccess m_ShadowDetailOption
ref ListOptionsAccess m_TerrainDetailOption
void OnColorDepthChanged(int value)
override bool OnMouseEnter(Widget w, int x, int y)
ref ListOptionsAccess m_OverallQualityOption
ref ListOptionsAccess m_ATOCOption
void OnTextureDetailChanged(int value)
ref NumericOptionsAccess m_BrightnessOption
OptionIDsScript
Used for script-based game options. For anything C++ based, you would most likely use "Option Access ...
Definition gameplay.c:1246
proto native CGame GetGame()
OptionAccessType
C++ OptionAccessType.
Definition gameplay.c:1182
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
proto native void SetFocus(Widget w)