Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_VideoSettingsConsoleSubMenu.c
Go to the documentation of this file.
2{
3 protected const int COMBO_OPTION_QUALITY = 0;
4 protected const int COMBO_OPTION_PERFORMANCE = 1;
5
8
9 //------------------------------------------------------------------------------------------------
10 override void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout, int index)
11 {
12 super.OnTabCreate(menuRoot, buttonsLayout, index);
13
14 SCR_SettingsManager settingsManager = GetGame().GetSettingsManager();
15
16 if (!settingsManager)
17 return;
18
21 Print("VideoSettingsConsoleSubMenu: Video settings manager module not found!", LogLevel.WARNING);
22
23 m_ePlatform = System.GetPlatform();
25
26 m_aSettingsBindings.Clear();
27 m_aSettingsBindings.Insert(new SCR_SettingBindingGameplay("SCR_GameplaySettings", "m_b2DScopes", "ScopeMode"));
28
30 }
31
32 //------------------------------------------------------------------------------------------------
33 protected void OnQualityPresetChanged(SCR_ComboBoxComponent combobox, int itemIndex)
34 {
35 if (m_ePlatform != EPlatform.XBOX_SERIES_X && m_ePlatform != EPlatform.XBOX_SERIES_S && m_ePlatform != EPlatform.PS5 && m_ePlatform != EPlatform.PS5_PRO)
36 return;
37
38 ChangePreset(m_ePlatform, itemIndex);
39 }
40
41 //------------------------------------------------------------------------------------------------
42 protected void ChangePreset(EPlatform platform, int itemIndex)
43 {
45 return;
46
47 if (platform == EPlatform.XBOX_SERIES_S && itemIndex == COMBO_OPTION_QUALITY)
48 m_SettingsVideoModule.SetConsolePreset(EVideoQualityPreset.SERIES_S_PRESET_QUALITY);
49
50 if (platform == EPlatform.XBOX_SERIES_S && itemIndex == COMBO_OPTION_PERFORMANCE)
51 m_SettingsVideoModule.SetConsolePreset(EVideoQualityPreset.SERIES_S_PRESET_PERFORMANCE);
52
53 if (platform == EPlatform.XBOX_SERIES_X && itemIndex == COMBO_OPTION_QUALITY)
54 m_SettingsVideoModule.SetConsolePreset(EVideoQualityPreset.SERIES_X_PRESET_QUALITY);
55
56 if (platform == EPlatform.XBOX_SERIES_X && itemIndex == COMBO_OPTION_PERFORMANCE)
57 m_SettingsVideoModule.SetConsolePreset(EVideoQualityPreset.SERIES_X_PRESET_PERFORMANCE);
58
59 if (platform == EPlatform.PS5 && itemIndex == COMBO_OPTION_QUALITY)
60 m_SettingsVideoModule.SetConsolePreset(EVideoQualityPreset.PS5_QUALITY);
61
62 if (platform == EPlatform.PS5 && itemIndex == COMBO_OPTION_PERFORMANCE)
63 m_SettingsVideoModule.SetConsolePreset(EVideoQualityPreset.PS5_PERFORMANCE);
64
65 if (platform == EPlatform.PS5_PRO && itemIndex == COMBO_OPTION_QUALITY)
66 m_SettingsVideoModule.SetConsolePreset(EVideoQualityPreset.PS5_PRO_QUALITY);
67
68 if (platform == EPlatform.PS5_PRO && itemIndex == COMBO_OPTION_PERFORMANCE)
69 m_SettingsVideoModule.SetConsolePreset(EVideoQualityPreset.PS5_PRO_PERFORMANCE);
70 }
71
72 //------------------------------------------------------------------------------------------------
73 protected void SetupQualityPreset()
74 {
75 SCR_ComboBoxComponent qualityPreset = SCR_ComboBoxComponent.GetComboBoxComponent("QualityPreset", m_wRoot);
76 if (!qualityPreset)
77 return;
78
79 int lastPreset;
80
81 BaseContainer videoSettings = GetGame().GetGameUserSettings().GetModule("SCR_VideoSettings");
82 if (!videoSettings)
83 return;
84
85 videoSettings.Get("m_iLastUsedPreset", lastPreset);
86
87 if (lastPreset == EVideoQualityPreset.SERIES_X_PRESET_QUALITY || lastPreset == EVideoQualityPreset.SERIES_S_PRESET_QUALITY || lastPreset == EVideoQualityPreset.PS5_QUALITY || lastPreset == EVideoQualityPreset.PS5_PRO_QUALITY)
89
90 if (lastPreset == EVideoQualityPreset.SERIES_X_PRESET_PERFORMANCE || lastPreset == EVideoQualityPreset.SERIES_S_PRESET_PERFORMANCE || lastPreset == EVideoQualityPreset.PS5_PERFORMANCE || lastPreset == EVideoQualityPreset.PS5_PRO_PERFORMANCE)
92
93 qualityPreset.m_OnChanged.Insert(OnQualityPresetChanged);
94 }
95};
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
void LoadSettings()
ESettingManagerModuleType
override bool SetCurrentItem(int i, bool playSound=false, bool animate=false)
SCR_SettingsManagerModuleBase GetModule(ESettingManagerModuleType moduleType)
ref array< ref SCR_SettingsBindingBase > m_aSettingsBindings
void ChangePreset(EPlatform platform, int itemIndex)
SCR_SettingsManagerVideoModule m_SettingsVideoModule
void OnQualityPresetChanged(SCR_ComboBoxComponent combobox, int itemIndex)
override void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout, int index)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
EPlatform
Definition EPlatform.c:13