I am in the process of trying to implement a "night mode" linked to buttons on my menu's imagemap. I've figured out how to connect the screen being displayed to the state of a specific variable, but I haven't been able to figure out how to use this to change the color dialogue text.
Here is what I have so far:
Variable defined:
Code: Select all
default persistent.night_mode = "False"
Code: Select all
screen preferences():
imagemap:
ground 'gui/MenuButtons.png'
hover 'gui/MenuHover.png'
selected_idle 'gui/MenuSelect.png'
selected_hover 'gui/MenuSelect.png'
hotspot (475, 340, 127, 93) action Quit(confirm=False)
hotspot (502, 98, 111, 47) action Preference("music mute", "enable")
hotspot (406, 98, 72, 47) action Preference("music mute", "disable")
hotspot (258, 472, 132, 92) action Return()
hotspot (445, 253, 154, 42) action SetVariable("persistent.night_mode", True)
hotspot (43, 250, 100, 49) action SetVariable("persistent.night_mode", False)
Code: Select all
screen callmenu ():
imagemap:
ground "gui/showmenu.png"
hover "gui/showmenuhover.png"
idle "gui/showmenu.png"
selected_idle "gui/showmenuselect.png"
selected_hover "gui/showmenuselect.png"
hotspot (0, 1, 637, 104)action ShowMenu("preferences")hovered
if persistent.night_mode:
add "images/bg alts.png"
else:
add "images/bg main.png"
I've tried variations of a couple of solutions posted on the forum, but none of them seem to work.
Utilizing style preferences, as suggested in these posts, hasn't worked because "StylePreference' is not a keyword argument or valid child for the hotspot statement"
viewtopic.php?t=47179
viewtopic.php?t=47012
I've tried applying if/else statements to the say screen as suggested in these posts, but I keep being told that
Code: Select all
color
Code: Select all
text_color
Code: Select all
screen say(who, what):
style_prefix "say"
window:
id "window"
if who is not None:
window:
id "namebox"
style "namebox"
text who id "who"
text what id "what"
if persistent.night_mode:
color "000000"
else:
color "ffffff"
https://lemmasoft.renai.us/forums/view ... ns#p492879
Is there something else I should try?
Any help would be appreciated.