Skip to content

Commit

Permalink
fix stad-samos regression from refactor (#2796) + change imgui toggle…
Browse files Browse the repository at this point in the history
… to left-alt and make it customizable (#2848)
  • Loading branch information
ManDude committed Jul 29, 2023
1 parent 6599eb1 commit a9e0e36
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
8 changes: 7 additions & 1 deletion game/graphics/opengl_renderer/debug_gui.cpp
Expand Up @@ -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"

Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion game/graphics/pipelines/opengl.cpp
Expand Up @@ -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());
}
Expand Down
20 changes: 11 additions & 9 deletions game/settings/settings.cpp
Expand Up @@ -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) {
Expand All @@ -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() {
Expand Down
2 changes: 2 additions & 0 deletions game/settings/settings.h
Expand Up @@ -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 {
Expand All @@ -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();
};
Expand Down
1 change: 1 addition & 0 deletions goal_src/jak2/levels/stadium/stadium-obs.gc
Expand Up @@ -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)
Expand Down

0 comments on commit a9e0e36

Please sign in to comment.