Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SettingsManagerVideoModule.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
3 {
4  protected BaseContainer m_DisplayUserSettings;
5  protected UserSettings m_VideoUserSettings;
6  protected BaseContainer m_VideoSettings;
7 
8  protected const int COMBO_OPTION_QUALITY = 0;
9  protected const int COMBO_OPTION_PERFORMANCE = 1;
10 
11  //------------------------------------------------------------------------------------------------
12  void SetConsolePreset(int presetIndex)
13  {
14  //todo: marian: split into methods and use switch
15  m_DisplayUserSettings = GetGame().GetEngineUserSettings().GetModule("DisplayUserSettings");
16  m_VideoUserSettings = GetGame().GetEngineUserSettings().GetModule("VideoUserSettings");
17  m_VideoSettings = GetGame().GetGameUserSettings().GetModule("SCR_VideoSettings");
18 
19  if (!m_DisplayUserSettings || !m_VideoUserSettings || !m_VideoSettings)
20  return;
21 
22  if (presetIndex == EVideoQualityPreset.SERIES_S_PRESET_QUALITY)
23  {
24  m_DisplayUserSettings.Set("OverallQuality", EVideoQualityPreset.SERIES_S_PRESET_QUALITY);
25  m_VideoUserSettings.Set("ResolutionScale", 0.7);
26  m_VideoUserSettings.Set("Fsaa", 2);
27  m_VideoSettings.Set("m_bNearDofEffect", false);
28  m_VideoSettings.Set("m_iDofType", DepthOfFieldTypes.SIMPLE);
29  m_VideoUserSettings.Set("MaxFps", 30);
30  m_VideoUserSettings.Set("Vsynch", true);
31  m_VideoSettings.Set("m_iLastUsedPreset", EVideoQualityPreset.SERIES_S_PRESET_QUALITY);
32  }
33  else if (presetIndex == EVideoQualityPreset.SERIES_S_PRESET_PERFORMANCE)
34  {
35  m_DisplayUserSettings.Set("OverallQuality", EVideoQualityPreset.SERIES_S_PRESET_PERFORMANCE);
36  m_VideoUserSettings.Set("ResolutionScale", 0.60);
37  m_VideoUserSettings.Set("Fsaa", 0);
38  m_VideoSettings.Set("m_bNearDofEffect", false);
39  m_VideoSettings.Set("m_iDofType", DepthOfFieldTypes.SIMPLE);
40  m_VideoUserSettings.Set("MaxFps", 60);
41  m_VideoUserSettings.Set("Vsynch", true);
42  m_VideoSettings.Set("m_iLastUsedPreset", EVideoQualityPreset.SERIES_S_PRESET_PERFORMANCE);
43  }
44  else if (presetIndex == EVideoQualityPreset.SERIES_X_PRESET_QUALITY)
45  {
46  m_DisplayUserSettings.Set("OverallQuality", EVideoQualityPreset.SERIES_X_PRESET_QUALITY);
47  m_VideoUserSettings.Set("ResolutionScale", 0.75);
48  m_VideoUserSettings.Set("Fsaa", 2);
49  m_VideoSettings.Set("m_bNearDofEffect", false);
50  m_VideoSettings.Set("m_iDofType", DepthOfFieldTypes.BOKEH);
51  m_VideoUserSettings.Set("MaxFps", 30);
52  m_VideoUserSettings.Set("Vsynch", true);
53  m_VideoSettings.Set("m_iLastUsedPreset", EVideoQualityPreset.SERIES_X_PRESET_QUALITY);
54  }
55  else if (presetIndex == EVideoQualityPreset.SERIES_X_PRESET_PERFORMANCE)
56  {
57  m_DisplayUserSettings.Set("OverallQuality", EVideoQualityPreset.SERIES_X_PRESET_PERFORMANCE);
58  m_VideoUserSettings.Set("ResolutionScale", 0.50);
59  m_VideoUserSettings.Set("Fsaa", 2);
60  m_VideoSettings.Set("m_bNearDofEffect", false);
61  m_VideoSettings.Set("m_iDofType", DepthOfFieldTypes.SIMPLE);
62  m_VideoUserSettings.Set("MaxFps", 60);
63  m_VideoUserSettings.Set("Vsynch", true);
64  m_VideoSettings.Set("m_iLastUsedPreset", EVideoQualityPreset.SERIES_X_PRESET_PERFORMANCE);
65  }
66 
67  GetGame().ApplySettingsPreset();
68  GetGame().UserSettingsChanged();
69  }
70 
71  //------------------------------------------------------------------------------------------------
73  {
74  SetModuleType(ESettingManagerModuleType.SETTINGS_MANAGER_VIDEO);
75  }
76 }
77 
78 //------------------------------------------------------------------------------------------------
79 enum EVideoQualityPreset
80 {
85 };
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_SettingsManagerModuleBase
void SCR_SettingsManagerModuleBase()
Definition: SCR_SettingsManager.c:65
SetModuleType
void SetModuleType(ESettingManagerModuleType managerType)
Definition: SCR_SettingsManager.c:59
SCR_SettingsManagerVideoModule
Definition: SCR_SettingsManagerVideoModule.c:2
SERIES_X_PRESET_PERFORMANCE
SCR_SettingsManagerVideoModule SERIES_X_PRESET_PERFORMANCE
SERIES_S_PRESET_QUALITY
SCR_SettingsManagerVideoModule SERIES_S_PRESET_QUALITY
DepthOfFieldTypes
DepthOfFieldTypes
Definition: SCR_DepthOfFieldEffect.c:1
SERIES_S_PRESET_PERFORMANCE
SCR_SettingsManagerVideoModule SERIES_S_PRESET_PERFORMANCE
SERIES_X_PRESET_QUALITY
SCR_SettingsManagerVideoModule SERIES_X_PRESET_QUALITY
ESettingManagerModuleType
ESettingManagerModuleType
Definition: SCR_SettingsManager.c:2