Oops... Kinda forgot that there were many buttons and that using only one variable will trigger the other. Try this instead.
Code: Select all
screen choice(items):
style_prefix "choice"
default hovered_button = "" ## Create a variable that will store a somewhat unique identifier for each buttons
frame:
xsize None
ysize None
xpadding 20
ypadding 20
xalign 0.5
yalign 0.4
background Frame("gui/menu_frame.png", 44, 44)
vbox:
yalign 0.41
$ choice_number = 1 # This is the unique identifier that will be stored in the hovered_button variable.
for i in items:
if " (grey)" in i.caption:
button:
action i.action
style "menu_choice_grey_button"
text i.caption.replace(" (grey)", "") style "menu_choice_grey_text"
else:
button:
xysize (575, 80)
action i.action
hovered SetScreenVariable("hovered_button", "choice_" + choice_number)
unhovered SetScreenVariable("hovered_button", "")
showif hovered_button == "choice_" + choice_number:
add "gui/menuchoice.png" at choicehover
else:
add "gui/menuchoice_blank.png"
text i.caption xalign 0.5 yalign 0.5 style "choice_button_text"
$ choice_number += 1