Skip to content

Commit

Permalink
fix mods menu not working while dead
Browse files Browse the repository at this point in the history
  • Loading branch information
apple1417 committed Jan 5, 2024
1 parent 5a5f5a3 commit 1d30db3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/bl3_mod_menu/outer_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ def add_menu_item_hook(
always_minus_one: int,
) -> int:
"""Hook to inject the outermost mods option."""

# Add the mods option right before quit
if callback_name == "OnQuitClicked":
global last_mods_menu_idx
last_mods_menu_idx = add_menu_item(self, "MODS", "OnInviteListClearClicked", False, -1)

if callback_name in hide_menu_options and hide_menu_options[callback_name].value:
# Surprisingly, just setting the return value to -1 just works, no menu item is drawn and
# nothing seems to go wrong
Expand All @@ -82,10 +88,6 @@ def add_menu_item_hook(
# Show the item properly
idx = add_menu_item(self, text, callback_name, big, always_minus_one)

if callback_name in ("OnStoreClicked", "OnPhotoModeClicked"):
global last_mods_menu_idx
last_mods_menu_idx = add_menu_item(self, "MODS", "OnInviteListClearClicked", False, -1)

return idx


Expand Down

0 comments on commit 1d30db3

Please sign in to comment.