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