I thought I knew what I needed to do to fix this, as a somewhat similar problem had come up with the time display a few updates ago, and some wonderful members here shared their wisdom to fix it, but after trying to apply the same idea, it did not work.
This might be a bit overkill, but I'm including the complete hud code here:
Code: Select all
screen hud():
vbox:
fixed:
imagebutton xalign 1.0 ypos 5:
idle "gui/ships_log_cover_idle.png"
hover "gui/ships_log_cover_hover.png"
action [Show("shipslog_hud"), Hide("hud")]# Show("statpage_hud") ##, Show("statshide_hud")
$ money_string = format_money(money)
imagebutton xalign 0.01 ypos 990:
idle "gui/treasure_chest_closed_gui_idle.png"
hover "gui/treasure_chest_closed_gui_hover.png"
action [Show ("booty2_hud"), Hide("hud")]
imagebutton auto "gui/map_closed_%s.png":
xalign 0.99
ypos 875
action [Show("location2_hud"), Hide("hud")]
# $ daycount = day
$ day_number = (day%7)
$ day_name_values = ("Wed", "Thur", "Fri", "Sat", "Sun", "Mon", "Tue")
$ dayn = day_name_values[day_number]
$ dtime_number = (dtime%5)
$ dtime_name_values = ("Morn", "Midday", "Sunset", "Night", "Nocturn")
$ dtimen = dtime_name_values[dtime_number]
$ daynumber_str = __("{color=#C0C0C0}{size=-20}%s{/size}{/color}") % (day)
$ daytime_str = __("{color=#C0C0C0}{size=-24}%s %s{/size}{/color}") % (dayn, dtimen)
# $ dtime_number = (dtime%6)
# $ dtime_name_values = ("Early morning", "Morn", "Midday", "Sunset", "Night", "Late night")
# $ dtimen = dtime_name_values[dtime_number]
# imagebutton xalign 0.298 ypos 0:
# idle "gui/abtn_forward.png"
# hover "gui/abtn_forward_over.png"
# action Call("advancetime")
fixed:
if dtime < 1 and time_adv == True:
imagebutton auto "gui/pocketwatch_timeofdaysunrise_gui_%s.png":
xalign 0.01
ypos 5
action SetVariable("dtime", dtime + 1)
elif dtime < 1 and time_adv == False:
imagebutton auto "gui/pocketwatch_timeofdaysunrise_gui_noadv_%s.png":
xalign 0.01
ypos 5
action NullAction()
elif dtime >= 1 and dtime < 2 and time_adv == True:
imagebutton auto "gui/pocketwatch_timeofdaymidday_gui_%s.png":
xalign 0.01
ypos 5
action SetVariable("dtime", dtime + 1)
elif dtime >= 1 and dtime < 2 and time_adv == False:
imagebutton auto "gui/pocketwatch_timeofdaymidday_gui_noadv_%s.png":
xalign 0.01
ypos 5
action NullAction()
elif dtime >= 2 and dtime < 3 and time_adv == True:
imagebutton auto "gui/pocketwatch_timeofdayevening_gui_%s.png":
xalign 0.01
ypos 5
action SetVariable("dtime", dtime + 1)
elif dtime >= 2 and dtime < 3 and time_adv == False:
imagebutton auto "gui/pocketwatch_timeofdayevening_gui_noadv_%s.png":
xalign 0.01
ypos 5
action NullAction()
elif dtime >= 3 and dtime < 4 and time_adv == True:
imagebutton auto "gui/pocketwatch_timeofdaynight_gui_%s.png":
xalign 0.01
ypos 5
action SetVariable("dtime", dtime + 1)
elif dtime >= 3 and dtime < 4 and time_adv == False:
imagebutton auto "gui/pocketwatch_timeofdaynight_gui_noadv_%s.png":
xalign 0.01
ypos 5
action NullAction()
# action Jump("sleep_now_captains_bed_1")
elif dtime >= 4:
imagebutton auto "gui/pocketwatch_timeofdaynight_gui_noadv_%s.png":
xalign 0.01
ypos 5
action NullAction()
# textbutton _("{b}{color=#C0C0C0}{size=-20}[day]{/size}{/color}{/b}") xalign 0.04 ypos 33
textbutton daynumber_str xalign 0.04 ypos 33
# textbutton _("{color=#C0C0C0}{size=-24}[dayn] [dtimen]{/size}{/color}") xalign 0.02 ypos 90
textbutton daytime_str xalign 0.02 ypos 90
# textbutton _("{color=#C0C0C0}{size=+24}[dtime]{/size}{/color}") xalign 0.5 ypos 90
# Show("stats"), Show("booty"), Show("location")
screen no_time_adv_hud():
vbox:
fixed:
imagebutton xalign 1.0 ypos 5:
idle "gui/ships_log_cover_idle.png"
hover "gui/ships_log_cover_hover.png"
action [Show("shipslog_hud"), Hide("no_time_adv_hud")]# Show("statpage_hud") ##, Show("statshide_hud")
imagebutton xalign 0.01 ypos 990:
idle "gui/treasure_chest_closed_gui_idle.png"
hover "gui/treasure_chest_closed_gui_hover.png"
action [Show ("booty2_hud"), Hide("no_time_adv_hud")]
imagebutton auto "gui/map_closed_%s.png":
xalign 0.99
ypos 875
action [Show("location2_hud"), Hide("no_time_adv_hud")]
$ day_number = (day%7)
$ day_name_values = ("Wed", "Thur", "Fri", "Sat", "Sun", "Mon", "Tue")
$ dayn = day_name_values[day_number]
$ dtime_number = (dtime%5)
$ dtime_name_values = ("Morn", "Midday", "Sunset", "Night", "Nocturn")
$ dtimen = dtime_name_values[dtime_number]
$ daynumber_str = __("{color=#C0C0C0}{size=-20}%s{/size}{/color}") % (day)
$ daytime_str = __("{color=#C0C0C0}{size=-24}%s %s{/size}{/color}") % (dayn, dtimen)
# $ dtime_number = (dtime%6)
# $ dtime_name_values = ("Early morning", "Morn", "Midday", "Sunset", "Night", "Late night")
# $ dtimen = dtime_name_values[dtime_number]
# imagebutton xalign 0.298 ypos 0:
# idle "gui/abtn_forward.png"
# hover "gui/abtn_forward_over.png"
# action Call("advancetime")
fixed:
if dtime < 1:
imagebutton auto "gui/pocketwatch_timeofdaysunrise_gui_noadv_%s.png":
xalign 0.01
ypos 5
action NullAction()
# action SetVariable("dtime", dtime + 1)
if dtime > 0 and dtime < 2:
imagebutton auto "gui/pocketwatch_timeofdaymidday_gui_noadv_%s.png":
xalign 0.01
ypos 5
action NullAction()
# action SetVariable("dtime", dtime + 1)
if dtime > 1 and dtime < 3:
imagebutton auto "gui/pocketwatch_timeofdayevening_gui_noadv_%s.png":
xalign 0.01
ypos 5
action NullAction()
# action SetVariable("dtime", dtime + 1)
if dtime > 2:
imagebutton auto "gui/pocketwatch_timeofdaynight_gui_noadv_%s.png":
xalign 0.01
ypos 5
action NullAction()
# action Jump("sleep_now_captains_bed_1")
textbutton _("{b}{color=#C0C0C0}{size=-20}[day]{/size}{/color}{/b}") xalign 0.043 ypos 33
textbutton _("{color=#C0C0C0}{size=-24}[dayn] [dtimen]{/size}{/color}") xalign 0.02 ypos 90
# textbutton _("{color=#C0C0C0}{size=+24}[dtime]{/size}{/color}") xalign 0.5 ypos 90
# Show("stats"), Show("booty"), Show("location")
screen shipslog_hud():
imagebutton auto "gui/clear_overlay_%s.png":
xalign 0.5
yalign 0.5
action NullAction()
default flag_var = False # default value of screen variable
# add 'ships_log_opening_anim_1' # show your animation
add 'ships_log_contents'
if not flag_var:
timer 1.35 action SetScreenVariable("flag_var", True) repeat False
else: # show some buttons
# fixed:
# imagebutton auto "gui/clear_overlay_%s.png":
# xalign 0.5
# yalign 0.5
# action NullAction()
#
# add "ships_log_opening_anim_1" #(delay = 5)
# imagebutton auto "gui/ships_log_inside_%s.png":
# xalign 0.5
# yalign 0.5
# action NullAction()
# textbutton _("[name]") text_color "#000000" text_hover_color "#980002" xpos 550 ypos 150 action ui.callsinnewcontext ("call_panstat")
vbox:
xalign 0.5 ypos 905
textbutton "Close":
text_color "#000000"
text_hover_color "#ffffff"
action [Hide("shipslog_hud"), SetVariable ("ships_log_contents_open", True), SetVariable ("ships_log_inner_pages_forward", True), Hide("statpage_hud"), Hide ("panstats"), Hide ("brittastats"), Hide ("sagastats"), Hide ("signestats"), Hide ("ranstats"), Hide ("katyastats"), Hide ("catstats"), Show("hud")]#, Hide("statshide")
vbox:
textbutton "Character Stats":
text_color "#000000"
text_hover_color "#c8ffc8"
xpos 450 ypos 150
action [Hide("shipslog_hud"), Show ("statpage_hud")] #ui.callsinnewcontext ("call_panstat")
# vbox:
# textbutton "Pass":
# text_color "#000000"
# text_hover_color "#c8ffc8"
# xpos 450 ypos 225
# action [Hide("shipslog_hud"), Jump("code")]
screen statshide_hud():
vbox:
xalign 0.5 ypos 905
textbutton "Close":
text_color "#000000"
text_hover_color "#ffffff"
action [Hide("statpage"), Hide ("panstats"), Hide ("brittastats"), Hide ("sagastats"), Hide ("signestats"), Hide ("ranstats"), Hide ("katyastats"), Hide ("catstats"), Hide("statshide_hud"), Show("hud")]
screen booty2_hud():
fixed:
$ money_string = format_money(money)
imagebutton auto "gui/clear_overlay_%s.png":
xalign 0.5
yalign 0.5
action NullAction()
if money <= 0: # no money :-( money_string
imagebutton auto "gui/treasure_chest_open_gui_1_%s.png":
xalign 0.5
yalign 0.5
action [Show ("hud"), Hide ("booty2_hud")]
elif money > 0 and money < 5000: # $1 -> $4,999
imagebutton auto "gui/treasure_chest_open_gui_2_%s.png":
xalign 0.5
yalign 0.5
action [Show ("hud"), Hide ("booty2_hud")]
elif money > 4999 and money < 25000: # $5,000 -> $24,999
imagebutton auto "gui/treasure_chest_open_gui_3_%s.png":
xalign 0.5
yalign 0.5
action [Show ("hud"), Hide ("booty2_hud")]
elif money > 24999 and money < 100000: # $25,0000 -> $99,999
imagebutton auto "gui/treasure_chest_open_gui_4_%s.png":
xalign 0.5
yalign 0.5
action [Show ("hud"), Hide ("booty2_hud")]
elif money >= 100000: # $100,000+ NEED TO MAKE AT LEAST ONE MORE IMAGE FOR MORE
imagebutton auto "gui/treasure_chest_open_gui_5_%s.png":
xalign 0.5
yalign 0.5
action [Show ("hud"), Hide ("booty2_hud")]
textbutton _("{color=#000000}{size=+20}[money_string]{/size}{/color}") xalign 0.5 yalign 0.29 #textbutton _("{color=#000000}{size=+20}$[money]{/size}{/color}") xalign 0.5 yalign 0.29
screen location2_hud():
$ location_number = (location%4)
$ location_name_values = ("Universitetö", "At Sea", "Ránsö", "Unknown")
$ locationn = location_name_values[location_number]
vbox:
fixed:
imagebutton auto "gui/clear_overlay_%s.png":
xalign 0.5
yalign 0.5
action NullAction()
imagebutton auto "gui/map_open_%s.png":
xalign 0.5
yalign 0.5
action [Show("hud"), Hide("location2_hud")]
textbutton _("{color=#000000}[locationn]{/color}") xalign 0.48 ypos 535