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