Elaztek Developer Hub
Blamite Game Engine - blam!  00346.12.11.21.0529.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 
6 #include "../../debug_ui.h"
7 
9 {
25  {
26  public:
31 
36 
40  void Draw()
41  {
42  // Advanced (yet primitive) Engine configurator
43  if (show)
44  {
45  ImGui::Begin("Configuration Editor", &show);
46 
47  std::ifstream engine_conf("engine.config");
48 
49  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");
50 
51  if (ImGui::Button("open actual config editor"))
52  {
53  Blam::Resources::Console::RunCommandLine("toggle_imgui_window config_editor_modern");
54  }
55 
56  static bool read_only = false;
57  static char text[1024 * 16] =
58  "#################################"
59  "\n# Blamite Engine Configuration #"
60  "\n# (c) Elaztek Studios 2016 #"
61  "\n#################################"
62  "\nfpsMax: 60"
63  "\nbink - enabled : true"
64  "\nuseSwitches : true"
65  "\nuseMulti : true"
66  "\nuseSolo : true"
67  "\nuseLegacyFileStructure : false"
68  "\nuseDedicated : true"
69  "\ndedicatedHost : 343.host.elaztek.com"
70  "\ndedicatedFallback : i01.host.elaztek.com"
71  "\ndedicatedFallback2 : contingency.host.elaztek.com"
72  "\nui : default"
73  "\nmp3Enabled : true"
74  "\ncheckSignatures : true"
75  "\nenableElaztekExtended : true"
76  "\nlaunchMode : retail"
77  "\ninit - level : mainmenu"
78  "\ns_hsc_ver : 15267.10.13.16.0467.blamite"
79  "\nhavok_cloth_phys :"
80  "\nhavok_impact_phys :"
81  "\nhavok_physics_engine :"
82  "\nachi_enabled : true"
83  "\nvoice_server : ts.elaztek.com"
84  "\nvoice_default_channel : 57"
85  "\nshow_ts_window : false"
86  "\npoly_limit : 32767"
87  "\nr_wireframe : false"
88  "\nrender_preset : blam"
89  "\nfog : true"
90  "\nsys_font : fixedsys - embedded"
91  "\nconf - ver : 12";
92 
93 
94  ImGui::Checkbox("Read-only", &read_only);
96  ImGui::End();
97  }
98  }
99  };
100 }
ImGuiInputTextFlags_ReadOnly
@ ImGuiInputTextFlags_ReadOnly
Definition: imgui.h:769
Blam::DebugUI::Windows::ConfigEditor::Draw
void Draw()
Draws the window.
Definition: config_editor.hpp:40
ImGui::Checkbox
IMGUI_API bool Checkbox(const char *label, bool *v)
Definition: imgui_widgets.cpp:974
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
ImVec2
Definition: imgui.h:179
Blam::DebugUI::Windows::ConfigEditor::~ConfigEditor
~ConfigEditor()
Empty destructor.
Definition: config_editor.hpp:35
ImGui::Begin
IMGUI_API bool Begin(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
Definition: imgui.cpp:5397
Blam::DebugUI::Windows::ConfigEditor
An incomplete configuration editor, using raw text.
Definition: config_editor.hpp:24
Blam::Resources::Console::RunCommandLine
BLAM HRESULT RunCommandLine(std::string command_line)
Executed the provided string as a console command.
Definition: console.cpp:268
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
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::DebugUI::Windows::ConfigEditor::ConfigEditor
ConfigEditor()
Empty constructor.
Definition: config_editor.hpp:30
Blam::DebugUI::Windows
Legacy namespace to contain data for the legacy ImGUI console.
Definition: ui.h:14
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