make the mod toggle button disappear if the mod doesn't have any valid scripts loaded

This commit is contained in:
Map 2024-10-06 19:53:53 -05:00
parent 5eb39a7c3c
commit b1719c4b21

View file

@ -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: