[BUG] multilevel use/transclude
Posted: Sun Sep 12, 2021 12:58 am
Got hit by weird bug, using rather complex screen with multiple levels of use/transclude, below is simplified example.
Adding $pass to certain place fixes it.
Tested on 7.4.6 and 11-sep nightly.
P.S.: While at this, is there any chance of allowing recursive screens? For example complex layout where some parts may contain similar sublayouts, using recursive approach it would require single screen.
Adding $pass to certain place fixes it.
Tested on 7.4.6 and 11-sep nightly.
Code: Select all
## how to replicate: open "Help" screen, click left "Increase" button, see variable not changing
screen box2():
vbox:
align (0.25,0.5)
# $pass
transclude
screen box1():
use box2:
transclude
screen box2x():
vbox:
align (0.75,0.5)
$pass
transclude
screen box1x():
use box2x:
transclude
screen help():
tag menu
default some_var=1
default some_varx=9001
use box1:
vbox:
text "BUGGED: [some_var]"
textbutton "Increase" action SetScreenVariable("some_var",some_var+1)
use box1x:
vbox:
text "WORKING: [some_varx]"
textbutton "Increase" action SetScreenVariable("some_varx",some_varx+1)
textbutton "Return":
action Return()
keysym "game_menu"
label start:
"test"
return