After "tfperson.var1b = True", when opening the "the_openscreen" screen "[tfperson.Output]" is showing what intended right away, but advancing the dialogue doesn't seem to have any effect on the "if tfperson.var1b == True" for "[tfperson.var1a]" in the textbutton, that only shows when using the button and going back or after having opened and closed the "the_openscreen" and opening it again. It is intended to show straight away. So for some reason [tfperson.Output] has the information right away, but "[tfperson.var1a]" does not. How do I provide "[tfperson.var1a]" with the information so it shows straight away too, or whatever is the mistake I have made that doesn't make it show as intended?
Code: Select all
init python:
class TestFun:
def __init__(self, var1a, var1b):
self.var1a = var1a
self.var1b = var1b
@property
def Output(self):
var1b = self.var1b
var1a = self.var1a
self.var1a = var1a
if var1b == False:
var1a = "unknown"
if var1b == True:
var1a = (self.var1a)
return "var1a: " + str(var1a)
define tfperson = TestFun("VarOneAttA", False)
define j = Character("Jane")
label test4:
call variables
scene white
window show
show screen open_screen
j "After this line var1b to True"
$ tfperson.var1b = True
j "First line after"
j "2nd line after"
j "3rd line after"
j "4th line after"
j "5th line after"
j "6th line after"
## this is in it's own .rpy in the original
screen open_screen():
key 'keyup_K_c' action [Show('the_openscreen'), Hide('open_screen')]
vbox:
xalign 0.0 yalign 0.0
textbutton "Open Screen" action Show('the_openscreen'), Hide('open_screen')
screen the_openscreen():
tag tab_menu
modal True
frame:
xalign 0.25
yalign 0.5
xsize 1000
ysize 950
has vbox
hbox:
if tfperson_01 >= 1:
vbox:
## this part doesn't seem to change with going down the dialogue
## only after opening and closing the screen or using the button and going back
if tfperson.var1b == False:
textbutton _("Unknown") action Show('tfperson_01_screen') xalign 0.5
if tfperson.var1b == True:
textbutton _("[tfperson.var1a]") action Show('tfperson_01_screen') xalign 0.5
else:
null
hbox:
## this part is supposed to be only in the tfperson_01_screen
## put it there during testing and shows right away
text _p("""
[tfperson.Output]
""")
textbutton _("Back") action Show('the_openscreen')
textbutton _("Close") action Hide('the_openscreen'), Show('open_screen')
key 'keyup_K_c' action [Hide('the_openscreen'), Show('open_screen')]
screen tfperson_01_screen():
tag tab_menu
modal True
frame:
xalign 0.25
yalign 0.5
xsize 1000
ysize 950
has vbox
hbox:
text _p("""
[tfperson.Output]
""")
textbutton _("Back") action Show('the_openscreen')
## in the original this is in variables.rpy
label variables:
$ tfperson_01 = 0
$ tfperson_01 += 1