Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_VideoSettingsConsoleSubMenu.c
Go to the documentation of this file.
1
class
SCR_VideoSettingsConsoleSubMenu
:
SCR_SettingsSubMenuBase
2
{
3
protected
const
int
COMBO_OPTION_QUALITY
= 0;
4
protected
const
int
COMBO_OPTION_PERFORMANCE
= 1;
5
6
protected
EPlatform
m_ePlatform
;
7
SCR_SettingsManagerVideoModule
m_SettingsVideoModule
;
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
19
m_SettingsVideoModule
=
SCR_SettingsManagerVideoModule
.Cast(settingsManager.
GetModule
(
ESettingManagerModuleType
.SETTINGS_MANAGER_VIDEO));
20
if
(!
m_SettingsVideoModule
)
21
Print
(
"VideoSettingsConsoleSubMenu: Video settings manager module not found!"
,
LogLevel
.WARNING);
22
23
m_ePlatform
=
System
.GetPlatform();
24
SetupQualityPreset
();
25
26
m_aSettingsBindings
.Clear();
27
m_aSettingsBindings
.Insert(
new
SCR_SettingBindingGameplay
(
"SCR_GameplaySettings"
,
"m_b2DScopes"
,
"ScopeMode"
));
28
29
LoadSettings
();
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
{
44
if
(!
m_SettingsVideoModule
)
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)
88
qualityPreset.
SetCurrentItem
(
COMBO_OPTION_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)
91
qualityPreset.
SetCurrentItem
(
COMBO_OPTION_PERFORMANCE
);
92
93
qualityPreset.m_OnChanged.Insert(
OnQualityPresetChanged
);
94
}
95
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition
SCR_DestructionSynchronizationComponent.c:17
LoadSettings
void LoadSettings()
Definition
SCR_HintManagerComponent.c:455
ESettingManagerModuleType
ESettingManagerModuleType
Definition
SCR_SettingsManager.c:3
BaseContainer
Definition
BaseContainer.c:13
ResourceName
Definition
ResourceName.c:13
SCR_ComboBoxComponent
Definition
SCR_ComboBoxComponent.c:2
SCR_ComboBoxComponent::SetCurrentItem
override bool SetCurrentItem(int i, bool playSound=false, bool animate=false)
Definition
SCR_ComboBoxComponent.c:242
SCR_ScriptedWidgetComponent::m_wRoot
Widget m_wRoot
Definition
SCR_ScriptedWidgetComponent.c:9
SCR_SettingBindingGameplay
Definition
SCR_SettingBindingGameplay.c:2
SCR_SettingsManager
Definition
SCR_SettingsManager.c:11
SCR_SettingsManager::GetModule
SCR_SettingsManagerModuleBase GetModule(ESettingManagerModuleType moduleType)
Definition
SCR_SettingsManager.c:28
SCR_SettingsManagerVideoModule
Definition
SCR_SettingsManagerVideoModule.c:2
SCR_SettingsSubMenuBase
Definition
SCR_SettingsSubMenuBase.c:2
SCR_SettingsSubMenuBase::m_aSettingsBindings
ref array< ref SCR_SettingsBindingBase > m_aSettingsBindings
Definition
SCR_SettingsSubMenuBase.c:3
SCR_VideoSettingsConsoleSubMenu
Definition
SCR_VideoSettingsConsoleSubMenu.c:2
SCR_VideoSettingsConsoleSubMenu::ChangePreset
void ChangePreset(EPlatform platform, int itemIndex)
Definition
SCR_VideoSettingsConsoleSubMenu.c:42
SCR_VideoSettingsConsoleSubMenu::m_SettingsVideoModule
SCR_SettingsManagerVideoModule m_SettingsVideoModule
Definition
SCR_VideoSettingsConsoleSubMenu.c:7
SCR_VideoSettingsConsoleSubMenu::OnQualityPresetChanged
void OnQualityPresetChanged(SCR_ComboBoxComponent combobox, int itemIndex)
Definition
SCR_VideoSettingsConsoleSubMenu.c:33
SCR_VideoSettingsConsoleSubMenu::COMBO_OPTION_PERFORMANCE
const int COMBO_OPTION_PERFORMANCE
Definition
SCR_VideoSettingsConsoleSubMenu.c:4
SCR_VideoSettingsConsoleSubMenu::m_ePlatform
EPlatform m_ePlatform
Definition
SCR_VideoSettingsConsoleSubMenu.c:6
SCR_VideoSettingsConsoleSubMenu::COMBO_OPTION_QUALITY
const int COMBO_OPTION_QUALITY
Definition
SCR_VideoSettingsConsoleSubMenu.c:3
SCR_VideoSettingsConsoleSubMenu::SetupQualityPreset
void SetupQualityPreset()
Definition
SCR_VideoSettingsConsoleSubMenu.c:73
SCR_VideoSettingsConsoleSubMenu::OnTabCreate
override void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout, int index)
Definition
SCR_VideoSettingsConsoleSubMenu.c:10
System
Definition
System.c:13
Widget
Definition
Widget.c:13
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
EPlatform
EPlatform
Definition
EPlatform.c:13
scripts
Game
UI
Menu
SettingsMenu
SCR_VideoSettingsConsoleSubMenu.c
Generated by
1.17.0