From b1719c4b2121c35318c46f8fc941b9189f024630 Mon Sep 17 00:00:00 2001 From: Map Date: Sun, 6 Oct 2024 19:53:53 -0500 Subject: [PATCH] make the mod toggle button disappear if the mod doesn't have any valid scripts loaded --- game/src/mod_menu.rpy | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/game/src/mod_menu.rpy b/game/src/mod_menu.rpy index 286cc5e..24bb1fb 100644 --- a/game/src/mod_menu.rpy +++ b/game/src/mod_menu.rpy @@ -753,6 +753,7 @@ screen mod_menu(): action Function(swapMods, i, i-1) else: add Null(30,30) at truecenter + # Enablin/disabling mods button button: at truecenter @@ -762,16 +763,18 @@ screen mod_menu(): if not renpy.variant(["mobile", "steam_deck"]): ysize 65 - action Function(toggle_persistent_mods, i) - activate_sound "audio/ui/snd_ui_click.wav" add "gui/button/menubuttons/checkbox.png" xalign 0.5 yalign 0.5 - if persistent.enabled_mods[i][1]: - idle_foreground Transform("gui/button/menubuttons/check.png",xalign=0.5,yalign=0.5,matrixcolor=TintMatrix("#00ff40")) - hover_foreground Transform("gui/button/menubuttons/check.png",xalign=0.5,yalign=0.5,matrixcolor=TintMatrix("#ffffff")) - else: - idle_foreground Transform("gui/button/menubuttons/cross.png",xalign=0.5,yalign=0.5,matrixcolor=TintMatrix("#db1a1a")) - hover_foreground Transform("gui/button/menubuttons/cross.png",xalign=0.5,yalign=0.5,matrixcolor=TintMatrix("#ffffff")) + if x["Scripts"]: + action Function(toggle_persistent_mods, i) + activate_sound "audio/ui/snd_ui_click.wav" + if persistent.enabled_mods[i][1]: + idle_foreground Transform("gui/button/menubuttons/check.png",xalign=0.5,yalign=0.5,matrixcolor=TintMatrix("#00ff40")) + hover_foreground Transform("gui/button/menubuttons/check.png",xalign=0.5,yalign=0.5,matrixcolor=TintMatrix("#ffffff")) + else: + idle_foreground Transform("gui/button/menubuttons/cross.png",xalign=0.5,yalign=0.5,matrixcolor=TintMatrix("#db1a1a")) + hover_foreground Transform("gui/button/menubuttons/cross.png",xalign=0.5,yalign=0.5,matrixcolor=TintMatrix("#ffffff")) + # Move mod down button if i!=len(mod_menu_metadata)-1: