Merge pull request 'Fix reload mods button' (#257) from ModsButton into master
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: #257 Reviewed-by: Mappening <mapanon@noreply.git.cavemanon.xyz>
This commit is contained in:
commit
6c92aea438
@ -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
|
||||
transclude
|
||||
|
||||
init python:
|
||||
def reload_game():
|
||||
persistent.reloading_mods = True
|
||||
renpy.reload_script()
|
Loading…
Reference in New Issue
Block a user