I'm trying to customize a screen depending on an argument :
Code: Select all
screen characters: #parent screen
default param = None
frame:
xpos c_datas.cur_loc_x
ypos c_datas.cur_loc_y
textbutton "Camille" action SetScreenVariable("param","c_datas")
frame:
xpos d_datas.cur_loc_x
ypos d_datas.cur_loc_y
textbutton "Derek" action SetScreenVariable("param","d_datas")
if param: #test param status
frame:
align (0.5,0.5)
textbutton "[param]" action SetScreenVariable("param","d_datas")
if param:
use whisp(param)
screen whisp(param): #child screen
frame:
yalign 0.5
xalign 0.5
has vbox
text "What you have in mind"
for k,v in param._events_odds_dict[gt.tod]:
text "[k] ([v] %)"
text "What do you suggest ?"
for item in param._events_dict:
textbutton ("[item]") action SetVariable("param.whispered_event",item)
textbutton "OK" action [Function(param.suggestion , param.cur_event, param.whispered_event, 10), SetScreenVariable("param",None)]
Problem is, I can't find the way to set the variable "param" to replace the names of instances "c_datas" & "d_datas". I tried differents ways without results.
Someone has a clue to do that ?
Thanks a lot !