Blamite Game Engine - blam!  00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
devtools_bar.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../debug_ui.h"
4 
5 #include <Strings/components/utils/io/io.h>
6 
9 
11 {
19  {
20  private:
21  bool devtools_bar = true;
22  bool main_menu = true;
23 
24  bool window_wrap = false;
25 
26  public:
27  DevToolsBar(bool show_in_window)
28  {
29  window_wrap = show_in_window;
30 
31  if (window_wrap)
32  {
33  main_menu = false;
34  }
35  }
36 
41  {
42  main_menu = false;
43  }
44 
48  void Draw()
49  {
50  devtools_bar = show;
51 
52  // Main Menu (titlebar)
53  if (devtools_bar)
54  {
55  if (main_menu)
56  {
57  ImGui::BeginMainMenuBar();
58  }
59  else
60  {
61  if (window_wrap)
62  {
63  ImGui::Begin("Old Menu", &show, ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize);
64  }
65 
66  ImGui::BeginMenuBar();
67  }
68 
69 
70  using namespace Blam::DebugUI::Windows;
71 
72  if (ImGui::BeginMenu("File"))
73  {
74  ImGui::MenuItem("Open .map file", NULL);
75  ImGui::MenuItem("Return to mainmenu", NULL);
76  if (ImGui::MenuItem("Open game dir", NULL)) BlamStrings::Utils::IO::OpenGameDirectory();
77  ImGui::Separator();
78  ImGui::MenuItem("Exit", NULL, duigvs("exit_via_menu"));
79  ImGui::EndMenu();
80  }
81  if (ImGui::BeginMenu("Tools"))
82  {
83  ImGui::MenuItem("Memory Editor", NULL);
84  ImGui::MenuItem("Object Info", NULL);
85  ImGui::MenuItem("Cheats", NULL);
86  ImGui::MenuItem("Logger", NULL, duigvs("logger"));
87  ImGui::Separator();
88  ImGui::MenuItem("Render Stack Editor", NULL, duigvs("render_stack_editor"));
89  ImGui::Separator();
90  if (ImGui::MenuItem("Take Screenshot", "F2")) Blam::TakeScreenshot();
91  ImGui::EndMenu();
92  }
93  if (ImGui::BeginMenu("Network Tools"))
94  {
95  ImGui::MenuItem("Chat", NULL, duigvs("chat_window"));
96  ImGui::MenuItem("Network Poker", NULL);
97  ImGui::MenuItem("Test Master Server Connection", NULL, duigvs("ip_test"));
98  ImGui::MenuItem("Advanced", NULL);
99  ImGui::EndMenu();
100  }
101  if (ImGui::BeginMenu("Config"))
102  {
103  ImGui::MenuItem("Engine Configuration (Raw)", NULL, duigvs("config_editor"));
104  ImGui::MenuItem("Engine Configuration", NULL, duigvs("config_editor_new"));
105  ImGui::MenuItem("Theme Selector", NULL, duigvs("theme_selector"));
106  ImGui::EndMenu();
107  }
108  if (ImGui::BeginMenu("Test"))
109  {
110  ImGui::MenuItem("Crash Test", NULL, duigvs("crash_test_ui"));
111  ImGui::MenuItem("Access Key Dialog", NULL, duigvs("license_startup_prompt"));
112  ImGui::MenuItem("Win32 Dialog", NULL);
113  ImGui::MenuItem("Forceload .map", NULL);
114  ImGui::Separator();
115  ImGui::MenuItem("ImGui Test Window", NULL, ((Windows::DirectX11Window*)GetDrawListItem("dx11_window"))->ShowTestWindow());
116  ImGui::MenuItem("DX11 Example Window", NULL, duigvs("dx11_window"));
117  ImGui::Separator();
118  ImGui::MenuItem("Discord Rich Presence", NULL, duigvs("discord_rpc_ui"));
119  ImGui::Separator();
120  ImGui::MenuItem("Direct2D Test Window", NULL, duigvs("d2d_test"));
121  ImGui::EndMenu();
122  }
123  if (ImGui::BeginMenu("Debug"))
124  {
125  ImGui::MenuItem("Show Coordinates", NULL);
126  ImGui::MenuItem("Show Runtime Counter", NULL);
127  ImGui::MenuItem("Show FPS", NULL, ((Windows::Stats*)GetDrawListItem("stats"))->ShowFPS());
128  ImGui::MenuItem("Show Network Info", NULL, duigvs("network_stats"));
129  ImGui::MenuItem("Show Usage Info", NULL);
130  ImGui::MenuItem("Show Stats", NULL, duigvs("stats"));
131  ImGui::MenuItem("Toggle Render Target Clearing", "F3 + R", BlamRendering::DirectX::RenderTargetClearing());
132  //ImGui::MenuItem("Console (v2 demo)", NULL, &show_testing_newconsole);
133  ImGui::EndMenu();
134  }
135  if (ImGui::BeginMenu("Help"))
136  {
137  ImGui::MenuItem("ImGui User Guide", NULL, duigvs("imgui_user_guide"));
138  ImGui::Separator();
139  ImGui::MenuItem("About ImGui", NULL, duigvs("imgui_info"));
140  ImGui::MenuItem("About Blamite", NULL, duigvs("engine_info"));
141  ImGui::EndMenu();
142  }
143 
144 
145  if (main_menu)
146  {
147  ImGui::EndMainMenuBar();
148  }
149  else
150  {
151  ImGui::EndMenuBar();
152 
153  if (window_wrap)
154  {
155  ImGui::Text("can't imagine why you'd need it, but here it is");
156 
157  ImGui::End();
158  }
159  }
160  }
161  }
162  };
163 }
Blam::DebugUI::Windows::DirectX11Window
Class for the default ImGUI DX11 sample window.
Definition: dx11_window.hpp:13
main_menu
BlamDebugMenu main_menu
The debug menu data.
Definition: debug_menu.cpp:18
stats.hpp
Blam::DebugUI::Widgets::DevToolsBar
Class for the original menu bar shown with ImGUI.
Definition: devtools_bar.hpp:18
dx11_window.hpp
Blam::TakeScreenshot
BLAM void TakeScreenshot()
Captures the current frame and saves it to a file.
Definition: screenshot.cpp:100
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::Widgets::DevToolsBar::DevToolsBar
DevToolsBar(bool show_in_window)
Definition: devtools_bar.hpp:27
Blam::DebugUI::Windows::Stats
This is the ImGUI-based implementation of the stats widget.
Definition: stats.hpp:23
Blam::DebugUI::GetDrawListItem
BLAM ImGUIDrawingGroup * GetDrawListItem(std::string key)
Retrieves a drawing group with the specified ID.
Definition: drawing_list.cpp:30
Blam::DebugUI::Widgets::DevToolsBar::Draw
void Draw()
Draws the menu bar contents.
Definition: devtools_bar.hpp:48
Blam::DebugUI::Windows
Legacy namespace to contain data for the legacy ImGUI console.
Definition: debug_ui.h:434
Blam::DebugUI::Widgets
Namespace containing general-purpose widgets used in multiple ImGUI drawing groups/windows.
Definition: devtools_bar.hpp:10
Text
@ Text
Master text object that wraps around both BitmapText and DWText.
Definition: render_stack.h:73
BlamRendering::DirectX::RenderTargetClearing
BLAM bool * RenderTargetClearing()
Retrieves whether or not to enable render target clearing.
Definition: render_manage.cpp:608
duigvs
#define duigvs(x)
Macro for Blam::DebugUI::GetVisibility().
Definition: debug_ui.h:19
Blam::DebugUI::Widgets::DevToolsBar::SetDrawModeNotMainMenu
void SetDrawModeNotMainMenu()
Instructs the menu to draw as a menu bar within a window, rather than as part of the main menu bar.
Definition: devtools_bar.hpp:40