fix stad-samos regression from refactor (#2796) + change imgui toggle to left-alt and make it customizable (#2848)

This commit is contained in:
ManDude
2023-07-29 02:26:42 +01:00
committed by GitHub
parent 6599eb1c91
commit a9e0e36e64
5 changed files with 22 additions and 11 deletions
+7 -1
View File
@@ -6,7 +6,9 @@
#include "common/global_profiler/GlobalProfiler.h"
#include "game/graphics/gfx.h"
#include "game/system/hid/sdl_util.h"
#include "third-party/fmt/core.h"
#include "third-party/imgui/imgui.h"
#include "third-party/imgui/imgui_style.h"
@@ -162,7 +164,11 @@ void OpenGlDebugGui::draw(const DmaStats& dma_stats) {
}
ImGui::EndMenu();
}
ImGui::Text("Press F12 to hide this menu");
ImGui::Text("Press F11 to toggle this toolbar");
ImGui::Text(fmt::format("Press {} to toggle this toolbar",
sdl_util::get_keyboard_button_name(Gfx::g_debug_settings.hide_imgui_key,
InputModifiers()))
.c_str());
}
ImGui::EndMainMenuBar();
+1 -1
View File
@@ -326,7 +326,7 @@ GLDisplay::GLDisplay(SDL_Window* window, SDL_GLContext gl_context, bool is_main)
m_display_manager->set_input_manager(m_input_manager);
// Register commands
m_input_manager->register_command(CommandBinding::Source::KEYBOARD,
CommandBinding(SDLK_F12, [&]() {
CommandBinding(Gfx::g_debug_settings.hide_imgui_key, [&]() {
if (!Gfx::g_debug_settings.ignore_hide_imgui) {
set_imgui_visible(!is_imgui_visible());
}
+11 -9
View File
@@ -8,15 +8,16 @@
namespace game_settings {
void to_json(json& j, const DebugSettings& obj) {
j = json{{"version", obj.version},
{"show_imgui", obj.show_imgui},
{"imgui_font_size", obj.imgui_font_size},
{"monospaced_font", obj.monospaced_font},
{"alternate_style", obj.alternate_style},
{"ignore_hide_imgui", obj.ignore_hide_imgui},
{"text_filters", obj.text_filters},
{"text_check_range", obj.text_check_range},
{"text_max_range", obj.text_max_range}};
json_serialize(version);
json_serialize(show_imgui);
json_serialize(imgui_font_size);
json_serialize(monospaced_font);
json_serialize(alternate_style);
json_serialize(ignore_hide_imgui);
json_serialize(text_filters);
json_serialize(text_check_range);
json_serialize(text_max_range);
json_serialize(hide_imgui_key);
}
void from_json(const json& j, DebugSettings& obj) {
@@ -29,6 +30,7 @@ void from_json(const json& j, DebugSettings& obj) {
json_deserialize_if_exists(text_filters);
json_deserialize_if_exists(text_check_range);
json_deserialize_if_exists(text_max_range);
json_deserialize_if_exists(hide_imgui_key);
}
DebugSettings::DebugSettings() {
+2
View File
@@ -4,6 +4,7 @@
#include "common/util/json_util.h"
#include "game/system/hid/input_bindings.h"
#include "game/system/hid/sdl_util.h"
#include "game/tools/filter_menu/filter_menu.h"
namespace game_settings {
@@ -21,6 +22,7 @@ struct DebugSettings {
std::vector<DebugTextFilter> text_filters = {};
bool text_check_range = false;
float text_max_range = 0;
u32 hide_imgui_key = SDLK_LALT;
void save_settings();
};
@@ -2074,6 +2074,7 @@ This commonly includes things such as:
- collision information
- loading the skeleton group / bones
- sounds"
(stack-size-set! (-> obj main-thread) #x180) ;; added
(let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others))))
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) cshape-reaction-default)