From 2a275c246817132147e917166346c92b38689288 Mon Sep 17 00:00:00 2001 From: Legalo Date: Thu, 31 Oct 2024 20:36:31 -0300 Subject: [PATCH] Fix reload mods button --- game/src/mod_menu.rpy | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/game/src/mod_menu.rpy b/game/src/mod_menu.rpy index 0344d70..8edb71d 100644 --- a/game/src/mod_menu.rpy +++ b/game/src/mod_menu.rpy @@ -690,7 +690,6 @@ screen mod_menu(): $ main_menu_button_img = "gui/button/menubuttons/template_idle_epilogue.png" if persistent.use_epilogue_menu else "gui/button/menubuttons/template_idle.png" default mod_metadata = {} - default reload_game = False default mod_button_enabled = True default mod_button_alpha = 1.0 default mod_screenshot_list = None @@ -705,14 +704,7 @@ screen mod_menu(): spacing 8 - use mod_menu_top_buttons(main_menu_button_img, _("Reload Mods"), SetScreenVariable("reload_game", True)): - # For some reason, Function() will instantly reload the game upon entering the mod menu, and put it in an infinite loop, so doing this python jank - # is the only way - if reload_game: - python: - reload_game = False - persistent.reloading_mods = True - renpy.reload_script() + use mod_menu_top_buttons(main_menu_button_img, _("Reload Mods"), Function(reload_game)) use mod_menu_top_buttons(main_menu_button_img, _("Return"), ShowMenu("extras")) viewport: @@ -1092,4 +1084,9 @@ screen mod_menu_top_buttons(image, text, action): action action activate_sound "audio/ui/snd_ui_click.wav" - transclude \ No newline at end of file + transclude + +init python: + def reload_game(): + persistent.reloading_mods = True + renpy.reload_script() \ No newline at end of file