We have an option in our game to allow players to select a different textbox frame for higher contrast if desired. It's defined in this manner:
Code: Select all
screen say(who, what):
style_prefix "say"
window:
id "window"
if persistent.contrast:
$ style.say_window = style.window_contrast
else:
$ style.say_window = style.window
if who is not None:
window:
id "namebox"
if persistent.contrast:
style "namebox_contrast"
else:
style "namebox"Code: Select all
init python:
config.character_id_prefixes.append('namebox')
style window is default
style say_label is default
style say_dialogue is default
style say_thought is say_dialogue
style namebox is default
style namebox_label is say_label
style window:
xalign 0.5
xfill True
yalign gui.textbox_yalign
ysize gui.textbox_height
background Image("gui/textbox.png", xalign=0.5, yalign=1.0)
style window_contrast is window:
background Image("gui/textbox_contrast.png", xalign=0.5, yalign=1.0)
style namebox:
xpos gui.name_xpos
xanchor gui.name_xalign
xsize gui.namebox_width
ypos gui.name_ypos
ysize gui.namebox_height
background Frame("gui/namebox.png", gui.namebox_borders, tile=gui.namebox_tile, xalign=gui.name_xalign)
padding gui.namebox_borders.padding
style namebox_contrast is namebox:
background Frame("gui/namebox_contrast.png", gui.namebox_borders, tile=gui.namebox_tile, xalign=gui.name_xalign)I can't find any extensive documentation on how the rollback function works, so I'm not sure where I'm going wrong—or why the namebox displays correctly but the textbox doesn't. Thank you in advance for any help you can provide.
