3 private const float HUD_BRIGHTNESS_MIN = -1.0;
4 private const float HUD_BRIGHTNESS_MAX = 0.0;
19#ifdef PLATFORM_CONSOLE
39 protected OptionsMenu
m_Menu;
48 m_DetailsBodyDefault = m_DetailsRoot.FindAnyWidget(
"settings_details_body");
49 m_DetailsBodyConnectivity = m_DetailsRoot.FindAnyWidget(
"settings_details_body_connectivity");
50 m_DetailsLabel =
TextWidget.Cast(m_DetailsRoot.FindAnyWidget(
"details_label"));
51 m_DetailsText =
RichTextWidget.Cast(m_DetailsRoot.FindAnyWidget(
"details_content"));
62 m_Root.FindAnyWidget(
"hud_brightness_setting_option").SetUserID(
OptionIDsScript.OPTION_HUD_BRIGHTNESS);
68 m_Root.FindAnyWidget(
"bleeding_indication_setting_option").SetUserID(
OptionIDsScript.OPTION_BLEEDINGINDICATION);
69 m_Root.FindAnyWidget(
"connectivity_setting_option").SetUserID(
OptionIDsScript.OPTION_CONNECTIVITY_INFO);
72#ifdef PLATFORM_CONSOLE
82 array<string> opt = {
"#options_controls_disabled",
"#options_controls_enabled" };
83 array<string> opt2 = {
"#options_controls_enabled",
"#options_controls_disabled" };
85 for (
int i = 0;
i < m_LanguageOption.GetItemsCount(); ++
i)
88 m_LanguageOption.GetItemText(
i,
text);
92 array<string> opt4 = {
"#options_pc_nopause_0",
"#options_pc_nopause_1",
"#options_pc_nopause_2" };
94 m_LanguageSelector =
new OptionSelectorMultistate(
m_Root.FindAnyWidget(
"language_setting_option"), m_LanguageOption.GetIndex(),
this,
false,
opt3);
95 m_FOVSelector =
new OptionSelectorSlider(
m_Root.FindAnyWidget(
"fov_setting_option"), m_FOVOption.ReadValue(),
this,
false, m_FOVOption.GetMin(), m_FOVOption.GetMax());
97 m_HUDBrightnessSelector =
new OptionSelectorSlider(
m_Root.FindAnyWidget(
"hud_brightness_setting_option"),
g_Game.GetProfileOptionFloat(
EDayZProfilesOptions.HUD_BRIGHTNESS),
this,
false, HUD_BRIGHTNESS_MIN, HUD_BRIGHTNESS_MAX);
98 m_ShowCrosshairSelector =
new OptionSelectorMultistate(
m_Root.FindAnyWidget(
"crosshair_setting_option"),
g_Game.GetProfileOptionBool(
EDayZProfilesOptions.CROSSHAIR),
this,
false,
opt);
99 m_ShowGameSelector =
new OptionSelectorMultistate(
m_Root.FindAnyWidget(
"game_setting_option"),
g_Game.GetProfileOptionBool(
EDayZProfilesOptions.GAME_MESSAGES),
this,
false,
opt2);
100 m_ShowAdminSelector =
new OptionSelectorMultistate(
m_Root.FindAnyWidget(
"admin_setting_option"),
g_Game.GetProfileOptionBool(
EDayZProfilesOptions.ADMIN_MESSAGES),
this,
false,
opt2);
101 m_ShowPlayerSelector =
new OptionSelectorMultistate(
m_Root.FindAnyWidget(
"player_setting_option"),
g_Game.GetProfileOptionBool(
EDayZProfilesOptions.PLAYER_MESSAGES),
this,
false,
opt2);
102 m_BleedingIndication =
new OptionSelectorMultistate(
m_Root.FindAnyWidget(
"bleeding_indication_setting_option"),
g_Game.GetProfileOptionBool(
EDayZProfilesOptions.BLEEDINGINDICATION),
this,
false,
opt);
103 m_ConnectivityInfo =
new OptionSelectorMultistate(
m_Root.FindAnyWidget(
"connectivity_setting_option"),
g_Game.GetProfileOptionBool(
EDayZProfilesOptions.CONNECTIVITY_INFO),
this,
false,
opt);
104 m_ShowQuickbarSelector =
new OptionSelectorMultistate(
m_Root.FindAnyWidget(
"quickbar_setting_option"),
g_Game.GetProfileOptionBool(
EDayZProfilesOptions.QUICKBAR),
this,
false,
opt);
106 m_LanguageSelector.m_OptionChanged.Insert(UpdateLanguageOption);
107 m_FOVSelector.m_OptionChanged.Insert(UpdateFOVOption);
108 m_ShowHUDSelector.m_OptionChanged.Insert(UpdateHUDOption);
109 m_HUDBrightnessSelector.m_OptionChanged.Insert(UpdateHUDBrightnessOption);
110 m_ShowCrosshairSelector.m_OptionChanged.Insert(UpdateCrosshairOption);
111 m_ShowGameSelector.m_OptionChanged.Insert(UpdateGameOption);
112 m_ShowAdminSelector.m_OptionChanged.Insert(UpdateAdminOption);
113 m_ShowPlayerSelector.m_OptionChanged.Insert(UpdatePlayerOption);
114 m_BleedingIndication.m_OptionChanged.Insert(UpdateBleedingIndication);
115 m_ConnectivityInfo.m_OptionChanged.Insert(UpdateConnectivityInfo);
116 m_ShowQuickbarSelector.m_OptionChanged.Insert(UpdateQuickbarOption);
118#ifdef PLATFORM_CONSOLE
120 m_BrightnessSelector =
new OptionSelectorSlider(
m_Root.FindAnyWidget(
"brightness_setting_option"), m_BrightnessOption.ReadValue(),
this,
false, m_BrightnessOption.GetMin(), m_BrightnessOption.GetMax());
123 m_ShowServerInfoSelector =
new OptionSelectorMultistate(
m_Root.FindAnyWidget(
"serverinfo_setting_option"),
g_Game.GetProfileOptionBool(
EDayZProfilesOptions.SERVERINFO_DISPLAY),
this,
false,
opt);
124 m_PauseSelector =
new OptionSelectorMultistate(
m_Root.FindAnyWidget(
"pause_setting_option"), m_PauseOption.GetIndex(),
this,
false,
opt4);
126 m_ShowServerInfoSelector.m_OptionChanged.Insert(UpdateServerInfoOption);
127 m_PauseSelector.m_OptionChanged.Insert(UpdatePauseOption);
131 m_Root.FindAnyWidget(
"game_settings_scroll").GetScreenSize(
x,
y);
132 m_Root.FindAnyWidget(
"game_settings_root").GetScreenSize(
x,
y2);
134 m_Root.FindAnyWidget(
"game_settings_scroll").SetAlpha(
f);
137 m_DetailsRoot.Show(
false);
146 m_FOVOption.Revert();
147 g_Game.SetUserFOV(m_FOVOption.ReadValue());
155#ifdef PLATFORM_CONSOLE
156 return "gui/layouts/new_ui/options/xbox/game_tab.layout";
158 return "gui/layouts/new_ui/options/pc/game_tab.layout";
164#ifdef PLATFORM_CONSOLE
165 SetFocus(m_LanguageSelector.GetParent());
179#ifdef PLATFORM_CONSOLE
190 MissionGameplay
mission = MissionGameplay.Cast(
GetGame().GetMission());
199#ifndef PLATFORM_CONSOLE
206#ifndef PLATFORM_CONSOLE
207 hud.ShowQuickBar(m_ShowQuickbarSelector.GetValue());
211 hud.ShowHud(m_ShowHUDSelector.GetValue());
233#ifndef PLATFORM_CONSOLE
235 menu.SetServerInfoVisibility(m_ShowServerInfoSelector.GetValue());
238 if (m_LanguageOption.IsChanged())
249 if (m_ShowHUDSelector)
254 if (m_ShowCrosshairSelector)
258 m_FOVSelector.SetValue(m_FOVOption.ReadValue(),
false);
259 g_Game.SetUserFOV(m_FOVOption.ReadValue());
261 if (m_LanguageOption)
262 m_LanguageSelector.SetValue(m_LanguageOption.GetIndex(),
false);
263 if (m_ShowGameSelector)
265 if (m_ShowAdminSelector)
267 if (m_ShowPlayerSelector)
269 if (m_BleedingIndication)
271 if (m_ConnectivityInfo)
274#ifdef PLATFORM_CONSOLE
275 if (m_BrightnessSelector)
276 m_BrightnessSelector.SetValue(m_BrightnessOption.ReadValue(),
false);
278 if (m_ShowQuickbarSelector)
280 if (m_ShowServerInfoSelector)
283 m_PauseSelector.SetValue(m_PauseOption.GetIndex(),
false);
289 g_Game.ResetProfileOptions();
291 if (m_ShowHUDSelector)
294 if (m_HUDBrightnessSelector)
297 g_Game.SetHudBrightness(m_HUDBrightnessSelector.GetValue());
300 if (m_ShowCrosshairSelector)
305 m_FOVOption.WriteValue(m_FOVOption.GetDefault());
306 m_FOVSelector.SetValue(m_FOVOption.ReadValue(),
false);
307 g_Game.SetUserFOV(m_FOVOption.GetDefault());
309 if (m_ShowGameSelector)
311 if (m_ShowAdminSelector)
313 if (m_ShowPlayerSelector)
315 if (m_BleedingIndication)
317 if (m_ConnectivityInfo)
320#ifdef PLATFORM_CONSOLE
321 if (m_BrightnessSelector)
323 m_BrightnessOption.WriteValue(m_BrightnessOption.GetDefault());
324 m_BrightnessSelector.SetValue(m_BrightnessOption.GetDefault(),
false);
327 if (m_ShowQuickbarSelector)
329 if (m_ShowServerInfoSelector)
333 m_PauseOption.SetIndex(m_PauseOption.GetDefaultIndex());
334 m_PauseSelector.SetValue(m_PauseOption.GetIndex(),
false);
352 m_FOVSelector.SetValue(m_FOVOption.ReadValue(),
false);
354 if (m_LanguageOption)
355 m_LanguageSelector.SetValue(m_LanguageOption.GetIndex(),
false);
357#ifdef PLATFORM_CONSOLE
359 if (m_BrightnessOption)
360 m_BrightnessSelector.SetValue(m_BrightnessOption.ReadValue(),
false);
370#ifdef PLATFORM_CONSOLE
371 m_QuickbarButton.Show(
false);
458#ifdef PLATFORM_CONSOLE
461 m_BrightnessOption.WriteValue(
value);
501 m_DetailsRoot.Show(
false);
507 MissionGameplay
mission = MissionGameplay.Cast(
GetGame().GetMission());
526 m_DetailsRoot.Show(
true);
527 m_DetailsText.Show(
true);
528 m_DetailsLabel.SetText(
p.param1);
529 m_DetailsText.SetText(
p.param2);
531 m_DetailsText.Update();
532 m_DetailsLabel.Update();
533 m_DetailsRoot.Update();
534 m_DetailsBodyConnectivity.Update();
553#ifdef PLATFORM_WINDOWS
577 if (m_HUDBrightnessSelector)
580 g_Game.SetHudBrightness(m_HUDBrightnessSelector.GetValue());
ServerBrowserMenuNew m_Menu
Super root of all classes in Enforce script.
proto native OptionsAccess GetOptionByType(int accessType)
Get option by AccessType.
GameplayEffectWidgets_base GetEffectWidgets()
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
OptionIDsScript
Used for script-based game options. For anything C++ based, you would most likely use "Option Access ...
proto native CGame GetGame()
OptionAccessType
C++ OptionAccessType.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.