Right now, I currently have a drink-crafting screen that shows 4 ingredients and a list of the 3 ingredients you've chosen. It also has a 'restart' imagebutton that does everything it's supposed to do upon being clicked (reset all ingredient values to 0, clear the screen of the listed ingredients) but it also closes the screen and progresses the script.
I'd love to find a way to keep the drinktime screen active and on-screen no matter how many times the Reset button is clicked (or at least, until the Player presses the Brew button.) Thank you!
Here is all of the code for drink-making screen:
Code: Select all
screen drinktime:
tag drinktime
add "images/UI/brewbg.png" at my_center
imagebutton:
xpos 220
ypos 250
auto "images/UI/milk_%s.png"
action SetVariable("milk", milk + 1), SetVariable("drink1_ingredients", drink1_ingredients + 1), If(drink1_ingredients == 0, Show("milk1")), If(drink1_ingredients == 1, Show("milk2")), If(drink1_ingredients == 2, Show("milk3"))
imagebutton:
xpos 220
ypos 580
auto "images/UI/honey_%s.png"
action SetVariable("honey", honey + 1), SetVariable("drink1_ingredients", drink1_ingredients + 1), If(drink1_ingredients == 0, Show("honey1")), If(drink1_ingredients == 1, Show("honey2")), If(drink1_ingredients == 2, Show("honey3"))
imagebutton:
xpos 560
ypos 250
auto "images/UI/coffee_%s.png"
action SetVariable("coffee", coffee + 1), SetVariable("drink1_ingredients", drink1_ingredients + 1), If(drink1_ingredients == 0, Show("coffee1")), If(drink1_ingredients == 1, Show("coffee2")), If(drink1_ingredients == 2, Show("coffee3")), SetVariable("drink1_coffee", True)
imagebutton:
xpos 560
ypos 580
auto "images/UI/tea_%s.png"
action SetVariable("tea", tea + 1), SetVariable("drink1_ingredients", drink1_ingredients + 1), If(drink1_ingredients == 0, Show("tea1")), If(drink1_ingredients == 1, Show("tea2")), If(drink1_ingredients == 2, Show("tea3"))
## Below is the Restart Button!
imagebutton:
xpos 1025
ypos 380
idle "images/UI/restart.png"
action SetVariable("milk", 0), SetVariable("tea", 0), SetVariable("coffee", 0), SetVariable("honey", 0), SetVariable("drink1_ingredients", 0), SetVariable("drink1_coffee", False), Call("HideIngredients")
## Below is the Brew Button!
imagebutton:
xpos 1000
ypos 427
auto "images/UI/brew_%s.png"
action If(drink1_ingredients == 3, Jump("drinkconstruction")) and Call("HideIngredients")