In my settings screen, the toggle is defined this way using persistent data and it works as expected. This is the vbox and image buttons containing said settings in my preference screen.
Code: Select all
vbox:
style_prefix "radio"
label _("GRAPHICS")
imagebutton:
auto "gui/button/radio_%s_background.png"
foreground Text(_("Enable nudity"), style="custom_btn_txt")
hover_foreground Text(_("Enable nudity"), style="custom_btn_txt_hover")
action SetField(persistent, "h_content", 1)
imagebutton:
auto "gui/button/radio_%s_background.png"
foreground Text(_("Disable nudity"), style="custom_btn_txt")
hover_foreground Text(_("Disable nudity"), style="custom_btn_txt_hover")
action SetField(persistent, "h_content", 0)
Code: Select all
image bed = ConditionSwitch (
"h_content == 0","bed_censored.png",
"h_content == 1","bed.png",
"True", "blank.png"
)
Also, in my script, before the said scene shows, I use the following statement to make sure the value of h_content is correct:
Code: Select all
# script text here
$ h_content = persistent.h_content
scene bed with dissolve
# more script text here
Am I going on about this the wrong way for the images to switch automatically? I would really appreciate if anyone has an idea on how to solve this, that would really help - Thank you very much !!