Skip to content

Commit

Permalink
Overlay: add option to hide pause menu
Browse files Browse the repository at this point in the history
  • Loading branch information
emoose committed Dec 8, 2024
1 parent 6b6b224 commit 14fb009
Showing 1 changed file with 43 additions and 3 deletions.
46 changes: 43 additions & 3 deletions src/hooks_graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,45 @@ int ExclusionsStageNum = 0; // stageid the exclusions are setup for, if stageid
int NumObjects = 0;

bool DrawDistanceIncreaseEnabled = false;
bool EnablePauseMenu = true;

class PauseMenuVisibility : public Hook
{
inline static SafetyHookInline sprani_hook = {};
static void sprani_dest()
{
if (EnablePauseMenu)
sprani_hook.call();
}

inline static SafetyHookInline pauseframedisp_hook = {};
static void __fastcall pauseframedisp_dest(void* thisptr, void* unused)
{
if (EnablePauseMenu)
pauseframedisp_hook.thiscall(thisptr);
}

public:
std::string_view description() override
{
return "PauseMenuVisibility";
}

bool validate() override
{
return Settings::OverlayEnabled;
}

bool apply() override
{
sprani_hook = safetyhook::create_inline(Module::exe_ptr(0x28170), sprani_dest);
pauseframedisp_hook = safetyhook::create_inline(Module::exe_ptr(0x8C5F0), pauseframedisp_dest);
return true;
}

static PauseMenuVisibility instance;
};
PauseMenuVisibility PauseMenuVisibility::instance;

void Overlay_DrawDistOverlay()
{
Expand All @@ -20,6 +59,7 @@ void Overlay_DrawDistOverlay()
ImGui::Begin("Draw Distance Debugger");

ImGui::Checkbox("Countdown timer enabled", Game::Sumo_CountdownTimerEnable);
ImGui::Checkbox("Pause menu enabled", &EnablePauseMenu);

// get max column count
int num_columns = 0;
Expand All @@ -33,10 +73,10 @@ void Overlay_DrawDistOverlay()
static ImGuiTableFlags table_flags = ImGuiTableFlags_NoSavedSettings | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersInnerH | ImGuiTableFlags_HighlightHoveredColumn;

ImGui::Text("Usage:");
ImGui::Text("- When an ugly LOD object appears, pause the game with ESC and press F11 to bring up this window");
ImGui::Text("- Reduce the Draw Distance below to the lowest value which still has the LOD object appearing");
ImGui::Text("- If an ugly LOD object appears, pause game with ESC and press F11 to bring up this window");
ImGui::Text("- Reduce Draw Distance below to lowest value that still has the LOD object appearing");
ImGui::Text("- Once you find the draw-distance that shows the object, click each node checkbox to disable nodes");
ImGui::Text("- After you find the node responsible, you can use \"Copy to clipboard\" below to copy the IDs of them, or hover over the node");
ImGui::Text("- After finding the node responsible, you can use \"Copy to clipboard\" below to copy the IDs of them, or hover over the node");
ImGui::Text("- Post the IDs for LODs you find in the \"DrawDistanceIncrease issue reports\" github thread and we can add exclusions for them!");
ImGui::NewLine();

Expand Down

0 comments on commit 14fb009

Please sign in to comment.