Clicking an icon causes it to rise and expand, and clicking it again reverses the movements, closing and lowering.
HOWEVER, if I then click the button again, it merely hides and shows it in place, no more nice rising opening or lowering closing.
Probably something obvious I missed, but would appreciate suggestions.
Code: Select all
init offset = -1
##Screen Overlay##
init python:
def konokolifted_function(trans, st, at):
SetScreenVariable("konoko_lifted", True)
def konokolowered_function(trans, st, at):
SetScreenVariable("konoko_lowered", True)
SetScreenVariable("konoko_hidden", True)
transform konoko_lift:
yoffset 900
easein_quint 1.0 yoffset 0
function konokolifted_function
transform konoko_lower:
yoffset 0
pause 0.9
easeout_quint 1.0 yoffset 900
function konokolowered_function
transform konoko_open:
"gui/hud/KonokoScreen1.png"
xzoom 0
pause 0.9
ease_quad 1.0 xzoom 1.01
pause 0.02
xzoom 1.0
transform konoko_close:
"gui/hud/KonokoScreen1.png"
xzoom 1.0
xzoom 1.01
pause 0.02
ease_quad 1.0 xzoom 0
screen hud_overlay():
#tag hud
default textbox_down = True
default konoko_hidden = True
default konoko_shown = False
default konoko_lifted = False
default konoko_lowered = True
default konoko_startup = True
default fuelquantity = "{size=30}{k=-2}00{/k}{/size}"
default partsquantity = "{size=30}{k=-2}00{/k}{/size}"
default ruyenquantity = "{size=30}{k=-2}0000{/k}{/size}"
frame:
xpadding 0
ypadding 0
left_margin 19
top_margin 19
background None
xalign 0.0
yalign 0.0
hbox:
add im.Alpha("gui/hud/ShortBlackBoxes.png", 0.4)
xsize 314
ysize 46
hbox:
add im.Alpha("gui/hud/LongBlackBox.png", 0.4)
xsize 315
ysize 29
ypos 60
hbox:
add im.Alpha("gui/hud/LongBlackBox.png", 0.4)
xsize 315
ysize 29
ypos 92
hbox:
xpos 210
ypos 125
imagebutton:
auto "gui/hud/KonokoButton1_%s.png"
focus_mask None
if konoko_hidden == True and konoko_lowered == True:
action [SetScreenVariable("konoko_hidden", False), SetScreenVariable("konoko_lowered", False)]
elif konoko_hidden == False and konoko_lowered == False:
action [SetScreenVariable("konoko_hidden", True), SetScreenVariable("konoko_lowered", True), SetScreenVariable("konoko_startup", False)]
hbox:
xpos 5
ypos 8
imagebutton:
auto "gui/hud/Fuel2_%s.png"
focus_mask None
action NullAction
hbox:
yoffset -1
xoffset 12
text fuelquantity
hbox:
xpos 99
ypos 7
imagebutton:
auto "gui/hud/Parts2_%s.png"
focus_mask None
action NullAction
hbox:
yoffset -1
xoffset 8
text partsquantity
hbox:
xpos 194
ypos 8
imagebutton:
auto "gui/hud/Ruyen2_%s.png"
focus_mask None
action NullAction
hbox:
xanchor 0
yoffset -1
xoffset 2
text ruyenquantity
if textbox_down == True:
vbox:
xsize 1230
ysize 262
xalign 0.5
yalign 1.0
imagebutton:
auto "gui/hud/DialogBox_%s.png"
focus_mask True
action SetScreenVariable("textbox_down", False)
else:
vbox:
xsize 1228
ysize 34
xalign 0.5
yalign 1.0
yoffset -8
imagebutton:
auto "gui/hud/DialogBoxHidden_%s.png"
focus_mask True
action SetScreenVariable("textbox_down", True)
frame:
xpadding 0
ypadding 0
background None
xalign 0.5
yalign 0.4
hbox: ## Starts closed and out of sight.
xoffset -370
yoffset 900
add "gui/hud/KonokoLeft1.png"
add "gui/hud/KonokoScreen1.png" at konoko_close
imagebutton:
auto "gui/hud/KonokoRight1_%s.png"
focus_mask True
action NullAction
SetScreenVariable("konoko_startup", True)
if konoko_hidden == False and konoko_lowered == False: ## i.e. konoko should be open and visible
hbox at konoko_lift:
add "gui/hud/KonokoLeft1.png"
add "gui/hud/KonokoScreen1.png" at konoko_open
imagebutton:
auto "gui/hud/KonokoRight1_%s.png"
focus_mask True
action [SetScreenVariable("konoko_hidden", True), SetScreenVariable("konoko_lowered", True), SetScreenVariable("konoko_startup", False)]
pass
if konoko_hidden == True and konoko_lowered == True and konoko_startup == False:
hbox at konoko_lower:
add "gui/hud/KonokoLeft1.png"
add "gui/hud/KonokoScreen1.png" at konoko_close
imagebutton:
auto "gui/hud/KonokoRight1_%s.png"
focus_mask True
action [SetScreenVariable("konoko_hidden", False), SetScreenVariable("konoko_lowered", False)]
pass
add "gui/hud/ScreenOutline.png"