Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
config_editor.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <fstream>
4 
7 
23 {
24 public:
28  void Draw()
29  {
30  // Advanced (yet primitive) Engine configurator
31  if (!show)
32  {
33  return;
34  }
35 
36  ImGui::Begin("Configuration Editor", &show);
37 
38  std::ifstream engine_conf("engine.config");
39 
40  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");
41 
42  if (ImGui::Button("open actual config editor"))
43  {
44  Blam::Resources::Console::RunCommandLine("toggle_imgui_window config_editor_modern");
45  }
46 
47  static bool read_only = false;
48  static char text[1024 * 16] =
49  "#################################"
50  "\n# Blamite Engine Configuration #"
51  "\n# (c) Elaztek Studios 2016 #"
52  "\n#################################"
53  "\nfpsMax: 60"
54  "\nbink - enabled : true"
55  "\nuseSwitches : true"
56  "\nuseMulti : true"
57  "\nuseSolo : true"
58  "\nuseLegacyFileStructure : false"
59  "\nuseDedicated : true"
60  "\ndedicatedHost : 343.host.elaztek.com"
61  "\ndedicatedFallback : i01.host.elaztek.com"
62  "\ndedicatedFallback2 : contingency.host.elaztek.com"
63  "\nui : default"
64  "\nmp3Enabled : true"
65  "\ncheckSignatures : true"
66  "\nenableElaztekExtended : true"
67  "\nlaunchMode : retail"
68  "\ninit - level : mainmenu"
69  "\ns_hsc_ver : 15267.10.13.16.0467.blamite"
70  "\nhavok_cloth_phys :"
71  "\nhavok_impact_phys :"
72  "\nhavok_physics_engine :"
73  "\nachi_enabled : true"
74  "\nvoice_server : ts.elaztek.com"
75  "\nvoice_default_channel : 57"
76  "\nshow_ts_window : false"
77  "\npoly_limit : 32767"
78  "\nr_wireframe : false"
79  "\nrender_preset : blam"
80  "\nfog : true"
81  "\nsys_font : fixedsys - embedded"
82  "\nconf - ver : 12";
83 
84  ImGui::Checkbox("Read-only", &read_only);
86  ImGui::End();
87  }
88 };
ImGuiInputTextFlags_ReadOnly
@ ImGuiInputTextFlags_ReadOnly
Definition: imgui.h:769
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::GetTextLineHeight
IMGUI_API float GetTextLineHeight()
Definition: imgui.cpp:6837
ImGui::End
IMGUI_API void End()
Definition: imgui.cpp:6016
console.h
BlamImGuiWindow
Class representing an ImGUI window.
Definition: imgui.h:31
ImVec2
Definition: imgui.h:179
ImGui::Begin
IMGUI_API bool Begin(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
Definition: imgui.cpp:5397
ImGuiInputTextFlags_AllowTabInput
@ ImGuiInputTextFlags_AllowTabInput
Definition: imgui.h:765
IM_ARRAYSIZE
#define IM_ARRAYSIZE(_ARR)
Definition: imgui.h:75
ImGui::InputTextMultiline
IMGUI_API bool InputTextMultiline(const char *label, char *buf, size_t buf_size, const ImVec2 &size=ImVec2(0, 0), ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
Definition: imgui_widgets.cpp:3074
Blam::Resources::Console::RunCommandLine
BLAM BlamResult RunCommandLine(std::string command_line)
Executed the provided string as a console command.
Definition: console.cpp:260
BlamImGuiWindow_ConfigEditor
An incomplete configuration editor, using raw text.
Definition: config_editor.hpp:22
imgui.h
ImGui::TextColored
IMGUI_API void TextColored(const ImVec4 &col, const char *fmt,...) IM_FMTARGS(2)
Definition: imgui_widgets.cpp:257
BlamImGuiWindow_ConfigEditor::Draw
void Draw()
Draws the window.
Definition: config_editor.hpp:28
ImGui::Button
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0))
Definition: imgui_widgets.cpp:644