Menu Option Highlight Issue
Posted: Wed Mar 24, 2021 11:41 am
So I have some screens working in my game. When I click on a menu item, it highlights to show it's selected. But I found that the menu items stay highlighted even after leaving the menu.
Here's a video to show what I mean.
https://youtu.be/PlT-owi2OYk
Here's the code for the move menu (The menu used in the video.)
I want the option to stop being highlighted after leaving the menu.
I appreciate any suggestions.
Here's a video to show what I mean.
https://youtu.be/PlT-owi2OYk
Here's the code for the move menu (The menu used in the video.)
Code: Select all
screen move_menu():
tag act0
default selected_item = None
default selected_location = None
add "ui/menu_list.png" at fastFade:
pos (1089, 354)
fixed at fastFade:
xysize (416, 426)
pos (1101, 366)
vpgrid:#vbox:
cols 1
spacing -4
draggable True
mousewheel True
scrollbars "vertical"
xpos 0 #147
ypos 0 #57
side_xalign 0.0
for location_item in location_list:
textbutton location_item.name xysize (401, 50):
bottom_margin 10
right_margin 5
left_padding 10 #25
text_size 25
text_color "fff"
background "#222"
hover_background "#f00"
selected_background "#960000"
action (SetVariable("selected_location", location_item.name)), (SetScreenVariable("selected_item", location_item))
fixed at fastFade:
xysize (391,230) #(369, 208)
xpos 1530 #1538
ypos 355 #366
if selected_item:
add "inv_bg":
yalign 0.5 xalign 0.5
add selected_item.pic:
yalign 0.5 xalign 0.5
fixed at fastFade:
# xysize (273, 175)
xpos 1530
ypos 587
if selected_item:
frame:
textbutton "Go" action Hide("move_menu"), Hide("action_menu"), Jump("location_manager")
else:
null
# text "Go"
imagebutton pos (1240, 823) at fastFade:
idle "ui/travel_button.png" hover "ui/travel_button.png" action Hide("move_menu")
I appreciate any suggestions.