Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
sysdebuggui.h
Go to the documentation of this file.
1/* Conquer Space
2 * Copyright (C) 2021-2025 Conquer Space
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#include <algorithm>
20#include <functional>
21#include <map>
22#include <string>
23#include <utility>
24#include <vector>
25
27
28#define sysdebuggui_parameters \
29 cqsp::engine::Application &app, common::Universe &universe, scripting::ScriptInterface &script_interface, \
30 const std::string_view &args, CommandOutput &input
31
32namespace cqsp::client::systems {
34 public:
35 explicit SysDebugMenu(engine::Application &app);
36
37 void Init();
38 void DoUI(int delta_time);
39 void DoUpdate(int delta_time);
40
41 private:
42 void CqspMetricsWindow();
43 void ShowWindows();
44 void CreateMenuBar();
45 void DrawConsole();
46 void ConsoleInput();
47 void DrawAssetWindow();
48
49 bool to_show_window = false;
51 bool to_show_imgui_about = false;
53 bool reclaim_focus = false;
54 bool scroll_to_bottom = true;
57
58 std::string command;
59 std::string asset_search;
60 std::vector<std::string> items;
61
62 typedef std::vector<std::string> CommandOutput;
63 typedef std::function<void(sysdebuggui_parameters)> DebugCommand_t;
64 std::map<std::string, std::pair<std::string, DebugCommand_t>, std::less<>> commands;
65 std::vector<ImVec2> fps_history;
66 float fps_history_len = 10;
67
68 std::map<std::string, std::vector<ImVec2>> history_maps;
69};
70} // namespace cqsp::client::systems
Definition: sysdebuggui.h:33
bool to_show_asset_window
Definition: sysdebuggui.h:56
std::function< void(sysdebuggui_parameters)> DebugCommand_t
Definition: sysdebuggui.h:63
void DoUpdate(int delta_time)
Definition: sysdebuggui.cpp:270
std::string command
Definition: sysdebuggui.h:58
std::map< std::string, std::pair< std::string, DebugCommand_t >, std::less<> > commands
Definition: sysdebuggui.h:64
bool to_show_implot_metrics
Definition: sysdebuggui.h:52
void CreateMenuBar()
Definition: sysdebuggui.cpp:127
void DrawAssetWindow()
Definition: sysdebuggui.cpp:215
void ConsoleInput()
Definition: sysdebuggui.cpp:177
std::vector< std::string > CommandOutput
Definition: sysdebuggui.h:62
void Init()
Definition: sysdebuggui.cpp:81
void DrawConsole()
Definition: sysdebuggui.cpp:153
bool to_show_metrics_window
Definition: sysdebuggui.h:50
bool to_show_window
Definition: sysdebuggui.h:49
void DoUI(int delta_time)
Definition: sysdebuggui.cpp:250
std::map< std::string, std::vector< ImVec2 > > history_maps
Definition: sysdebuggui.h:68
float fps_history_len
Definition: sysdebuggui.h:66
bool to_show_imgui_about
Definition: sysdebuggui.h:51
std::string asset_search
Definition: sysdebuggui.h:59
bool to_show_cqsp_metrics
Definition: sysdebuggui.h:55
std::vector< std::string > items
Definition: sysdebuggui.h:60
std::vector< ImVec2 > fps_history
Definition: sysdebuggui.h:65
bool reclaim_focus
Definition: sysdebuggui.h:53
void ShowWindows()
Definition: sysdebuggui.cpp:109
void CqspMetricsWindow()
Definition: sysdebuggui.cpp:83
SysDebugMenu(engine::Application &app)
Definition: sysdebuggui.cpp:32
bool scroll_to_bottom
Definition: sysdebuggui.h:54
Definition: application.h:48
Definition: goodviewer.cpp:25
#define sysdebuggui_parameters
Definition: sysdebuggui.h:28