16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 00:59:18 +02:00
This commit is contained in:
2026-05-24 21:48:05 +02:00
parent 5b51188dfe
commit 2c599cb419
46 changed files with 2034 additions and 85 deletions

View File

@@ -24,6 +24,7 @@ http://mozilla.org/MPL/2.0/.
#include "entitysystem/components/RenderComponents.h"
#include "imgui/imgui_impl_glfw.h"
#include "DevConsole/devconsole.h"
GLFWwindow *ui_layer::m_window{nullptr};
ImGuiIO *ui_layer::m_imguiio{nullptr};
@@ -105,6 +106,8 @@ ui_layer::ui_layer()
if (Global.loading_log)
add_external_panel(&m_logpanel);
m_logpanel.size = {700, 400};
add_external_panel(&dev::Console);
}
ui_layer::~ui_layer() {}
@@ -319,6 +322,15 @@ bool ui_layer::on_key(int const Key, int const Action)
return true;
}
// Backtick (`) toggles the developer console
if (Key == GLFW_KEY_GRAVE_ACCENT)
{
dev::Console.is_open = !dev::Console.is_open;
if (dev::Console.is_open)
dev::Console.focus_input();
return true;
}
if (Key == GLFW_KEY_F9)
{
m_logpanel.is_open = !m_logpanel.is_open;
@@ -744,6 +756,7 @@ void ui_layer::render_menu_contents()
if (ImGui::BeginMenu(STR_C("Windows")))
{
ImGui::MenuItem(STR_C("Log"), "F9", &m_logpanel.is_open);
ImGui::MenuItem(STR_C("Developer Console"), "`", &dev::Console.is_open);
if (DebugModeFlag)
{
ImGui::MenuItem(STR_C("ImGui Demo"), nullptr, &m_imgui_demo);