Make imagebuttons unclickable under choice menus
Posted: Wed Jun 01, 2022 8:40 pm
Hello everyone ! Sorry for bothering you again but I have 0 idea on how to fix that problem. :/
I have a shop screen with several clickable imagebuttons (only the diary here, and the "back" one) :

When you click on a item, a choice menu appear :

The problem is the action won't be completed if when clicking on the "Yeah" option, the mouse cursor is still on the imagebutton. The first and second screens just repeat themselves until I click somewhere else. Only then, the purchase is deemed completed and the item disappear from the shelves.
Any way to correct that problem ? Like, by making the imagebutton unclickable when a choice menu appear ? :/
My code, for what it's worth :
I have a shop screen with several clickable imagebuttons (only the diary here, and the "back" one) :

When you click on a item, a choice menu appear :

The problem is the action won't be completed if when clicking on the "Yeah" option, the mouse cursor is still on the imagebutton. The first and second screens just repeat themselves until I click somewhere else. Only then, the purchase is deemed completed and the item disappear from the shelves.
Any way to correct that problem ? Like, by making the imagebutton unclickable when a choice menu appear ? :/
My code, for what it's worth :
Code: Select all
screen magasin_hotspot():
add "bg/bg magasin_vente.png"
add "candiceshop" at right
add "candiceshop_eye neutre" at right
add "candiceshop_mouth parle" at right
imagebutton: #Bouton retour
focus_mask True
xpos 10
ypos 400
idle "imagebutton_retour.png"
action [Hide("magasin_hotspot"), Jump("shop_1_choix")]
if diary_shop == True: #diary
imagebutton:
focus_mask True
xpos 400
ypos 40
idle "diary_icon.png"
action Jump("diary_conv")Code: Select all
label shop_buy:
show screen magasin_hotspot
show screen money_display
c "Take your time."
label diary_conv:
menu:
c "An old diary. Found it on the floor. Most of the pages are torn, but heh. Selling it anyway... 100 Gold."
"Yeah":
if money_points >= 100:
c "Thank you !"
play sound "audio/jingle_tresor2.wav"
d "{color=#ad2c05}{font=fonts/BaksoSapi.otf}{size=+8}You got a diary !{/size}{/font}\nWhat it is all about...{/color}"
$ diary_shop = False
$ money_points -= 100
$ got_diary = True
$ got_diary_shop = True
$ first_time_diary = True
$ first_time_diary_buffalo = True
jump shop_buy
else:
c "You don't have enough money, you doofus !"
jump shop_buy
"no":
c "Alright."
jump shop_buy