mirror of
https://git.cavemanon.xyz/Cavemanon/SnootGame.git
synced 2025-01-22 17:26:20 +01:00
Merge pull request 'Fix reload mods button' (#257) from ModsButton into master
Reviewed-on: https://git.cavemanon.xyz/Cavemanon/SnootGame/pulls/257 Reviewed-by: Mappening <mapanon@noreply.git.cavemanon.xyz>
This commit is contained in:
commit
6c92aea438
1 changed files with 7 additions and 10 deletions
|
@ -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"
|
$ 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 mod_metadata = {}
|
||||||
default reload_game = False
|
|
||||||
default mod_button_enabled = True
|
default mod_button_enabled = True
|
||||||
default mod_button_alpha = 1.0
|
default mod_button_alpha = 1.0
|
||||||
default mod_screenshot_list = None
|
default mod_screenshot_list = None
|
||||||
|
@ -705,14 +704,7 @@ screen mod_menu():
|
||||||
|
|
||||||
spacing 8
|
spacing 8
|
||||||
|
|
||||||
use mod_menu_top_buttons(main_menu_button_img, _("Reload Mods"), SetScreenVariable("reload_game", True)):
|
use mod_menu_top_buttons(main_menu_button_img, _("Reload Mods"), Function(reload_game))
|
||||||
# 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, _("Return"), ShowMenu("extras"))
|
use mod_menu_top_buttons(main_menu_button_img, _("Return"), ShowMenu("extras"))
|
||||||
|
|
||||||
viewport:
|
viewport:
|
||||||
|
@ -1093,3 +1085,8 @@ screen mod_menu_top_buttons(image, text, action):
|
||||||
activate_sound "audio/ui/snd_ui_click.wav"
|
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 a new issue