Elaztek Developer Hub
Blamite Game Engine - blam!  00310.02.05.21.0336.blamite
The core library for the Blamite Game Engine.
config_editor_new.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../../debug_ui.h"
5 
7 {
23  {
24  public:
29 
34 
35  void Draw()
36  {
37  // Simple (yet elaborate) Engine configurator
38  if (show)
39  {
40  ImGui::Begin("Configuration Editor (New)", &show);
41 
42  static int fps_limit = 60; //fpsMax
43  static bool bink_enabled = true; //bink-enabled
44  static bool use_switches = true; //useSwitches
45  static bool use_mp = true; //useMulti
46  static bool use_solo = true; //useSolo
47  static bool old_folder_structure = true; //useLegacyFileStructure
48  static bool dedicated_server = true; //useDedicated
49  static char dedicated_host[255] = "343.host.elaztek.com"; //dedicatedHost
50  static char dedicated_fallback_1[255] = "i01.host.elaztek.com"; //dedicatedFallback
51  static char dedicated_fallback_2[255] = "contingency.host.elaztek.com"; //dedicatedFallback2
52  const char* ui[] = { "default", "classic", "halo3", "imgui" }; //ui
53  static int ui_active = 0;
54  static bool use_mp3 = true; //mp3Enabled
55  static bool check_signatures = true; //checkSignatures
56  static bool use_esef = true; //enableElaztekExtended
57  const char* launch_mode[] = { "retail", "alpha", "beta", "dev", "press", "safemode", "debug", "screen" }; //launchMode
58  static int launch_active = 0;
59  static char default_level[255] = "levels/ui/mainmenu/mainmenu"; //init-level
60  static char s_hsc_ver[255] = "%latest%"; //s_hsc_ver
61  static bool havok_cloth_phys = true; //havok_cloth_phys
62  static bool havok_impact_phys = true; //havok_impact_phys
63  const char* phys_mode[] = { "havok", "h2v", "contingencycryengine", "madness", "none", "spaaace" }; //havok_physics_engine
64  static int phys_active = 0;
65  static bool achi_enabled = true; //achi_enabled
66  static char voip_server[255] = "voice.inf.elaztek.com"; //voice_server
67  static int voip_channel = 1; //voice_default_channel
68  static bool show_voip_window = false; //show_ts_window
69  static int poly_limit = 32767; //poly_limit
70  static bool r_wireframe = false; //r_wireframe
71  const char* render_preset[]{ "blam", "halo", "halo2", "halo3", "omaha", "storm", "osiris" }; //render_preset
72  static int render_preset_active = 0;
73  static bool r_fog = true; //fog
74  static char sys_font[255] = "fixedsys"; //sys_font
75  static int conf_ver = 1; //conf_ver
76 
77 
78  //fpsMax
79  ImGui::DragInt("fpsMax", &fps_limit, 1);
80  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Limits the framerate of the engine.\nDo not set above 60 or else Havok becomes very sad :c");
81  //ImGui::SameLine(); ShowHelpMarker("The maximum rate of frames per second.\nThe game will never go over this.");
82 
83  //bink-enabled
84  ImGui::Checkbox("bink-enabled", &bink_enabled);
85  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells the game whether or not to play intro videos.");
86 
87  //useSwitches
88  ImGui::Checkbox("useSwitches", &use_switches);
89  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells the game whether or not to obey Command Line switches");
90 
91  //useMulti
92  ImGui::Checkbox("useMulti", &use_mp);
93  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells the game whether or not to detect anything in levels/multi/");
94 
95  //useSolo
96  ImGui::Checkbox("useSolo", &use_solo);
97  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells the game whether or not to detect anything in levels/solo/");
98 
99  //useLegacyFileStructure
100  ImGui::Checkbox("useLegacyFileStructure", &old_folder_structure);
101  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells the game whether or not to use the old file structure.");
102 
103  //useDedicated
104  ImGui::Checkbox("useDedicated", &dedicated_server);
105  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells the game whether or not it should try to connect to the Elaztek dedicated servers.");
106 
107  //dedicatedHost
108  ImGui::InputText("dedicatedHost", dedicated_host, IM_ARRAYSIZE(dedicated_host));
109  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("The hostname of the Elaztek dedicated server.\nCan only be changed in a developer environment.");
110 
111  //dedicatedFallback
112  ImGui::InputText("dedicatedFallback", dedicated_fallback_1, IM_ARRAYSIZE(dedicated_fallback_1));
113  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("The hostname of the first Elaztek fallback server.\nCan only be changed in a developer environment.");
114 
115  //dedicatedFallback2
116  ImGui::InputText("dedicatedFallback2", dedicated_fallback_2, IM_ARRAYSIZE(dedicated_fallback_2));
117  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("The hostname of the second Elaztek fallback server.\nCan only be changed in a developer environment.");
118 
119  //ui
120  ImGui::Combo("ui", &ui_active, ui, IM_ARRAYSIZE(ui));
121  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("The type of UI style to use");
122 
123  //mp3Enabled
124  ImGui::Checkbox("mp3Enabled", &use_mp3);
125  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells the game whether or not to play MP3 format audio");
126 
127  //checkSignatures
128  ImGui::Checkbox("checkSignatures", &check_signatures);
129  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells the game whether or not to check file signatures.\nTurning this off will disable multiplayer.");
130 
131  //enableElaztekExtended
132  ImGui::Checkbox("enableElaztekExtended", &use_esef);
133  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells the game whether or not to use Elaztek platform extended features");
134 
135  //launchMode
136  ImGui::Combo("launchMode", &launch_active, launch_mode, IM_ARRAYSIZE(launch_mode));
137  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells the game what type of launch mode to use");
138 
139  //init-level
140  ImGui::InputText("init-level", default_level, IM_ARRAYSIZE(default_level));
141  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells the game which level to load by default\n(works with both directory structure types)");
142 
143  //s_hsc_ver
144  ImGui::InputText("s_hsc_ver", s_hsc_ver, IM_ARRAYSIZE(s_hsc_ver));
145  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells the engine what version of HSC to use\n(Changing this can cause HUGE problems)");
146 
147  //havok_cloth_phys
148  ImGui::Checkbox("havok_cloth_phys", &havok_cloth_phys);
149  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells Havok whether or not to use cloth physics");
150 
151  //havok_impact_phys
152  ImGui::Checkbox("havok_impact_phys", &havok_impact_phys);
153  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells Havok whether or not to use advanced impact physics (causes crashes!)");
154 
155  //havok_physics_engine
156  ImGui::Combo("havok_physics_engine", &phys_active, phys_mode, IM_ARRAYSIZE(phys_mode));
157  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells Havok which physics engine to use");
158 
159  //achi_enabled
160  ImGui::Checkbox("achi_enabled", &achi_enabled);
161  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells the engine whether or not to use achievements");
162 
163  //voice_server
164  ImGui::InputText("voice_server", voip_server, IM_ARRAYSIZE(voip_server));
165  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells the engine the IP of the voice server to use (TS3)");
166 
167  //voice_default_channel
168  ImGui::InputInt("voice_default_channel", &voip_channel);
169  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Tells the engine what the default channel should be");
170 
171  //show_ts_window
172  ImGui::Checkbox("show_ts_window", &show_voip_window);
173  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("If enabled, a TS3 channel browser window will show at\nlaunch, so you can change your channel freely");
174 
175  //poly_limit
176  ImGui::DragInt("poly_limit", &poly_limit, 1);
177  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("The maximum poly count to render");
178 
179  //r_wireframe
180  ImGui::Checkbox("r_wireframe", &r_wireframe);
181  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Whether or not to draw wireframe");
182 
183  //render_preset
184  ImGui::Combo("render_preset", &render_preset_active, render_preset, IM_ARRAYSIZE(render_preset));
185  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Render presets");
186 
187  //fog
188  ImGui::Checkbox("fog", &r_fog);
189  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Whether or not to use fog");
190 
191  //sys_font
192  ImGui::InputText("sys_font", sys_font, IM_ARRAYSIZE(sys_font));
193  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Which font to use for debug text");
194 
195  //conf-ver
196  ImGui::InputInt("conf-ver", &conf_ver);
197  ImGui::SameLine(); Blam::DebugUI::Widgets::ShowHelpMarker("Version of the config file, used to determine if\nan update is available that affects the config");
198 
199  if (ImGui::Button("Save (write to engine.config)", ImVec2(120, 0))) {}
200 
201  ImGui::End();
202  }
203  }
204  };
205 }
Blam::DebugUI::Widgets::ShowHelpMarker
BLAM void ShowHelpMarker(const char *desc)
Shows a help indicator.
Definition: widgets.cpp:7
Blam::DebugUI::Windows::ConfigEditorNew::~ConfigEditorNew
~ConfigEditorNew()
Empty destructor.
Definition: config_editor_new.hpp:33
Blam::DebugUI::Windows::ConfigEditorNew
Class for a GUI config editor.
Definition: config_editor_new.hpp:22
widgets.h
Blam::DebugUI::ImGUIDrawingGroup::show
bool show
Controls whether or not the group should be shown. May not be used in all groups.
Definition: debug_ui.h:362
Blam::DebugUI::ImGUIDrawingGroup
Class representing an ImGUI drawing group/draw list item.
Definition: debug_ui.h:359
Blam::DebugUI::Windows::ConfigEditorNew::ConfigEditorNew
ConfigEditorNew()
Empty constructor.
Definition: config_editor_new.hpp:28
Blam::DebugUI::Windows
Legacy namespace to contain data for the legacy ImGUI console.
Definition: debug_ui.h:434
Blam::DebugUI::Windows::ConfigEditorNew::Draw
void Draw()
Draws the contents of the group.
Definition: config_editor_new.hpp:35