Most of the time, I want the screen to be amodal so that players can check their progress without interrupting play. However, during the Q&A parts, the screen should be modal so that interactions with the screen don't accidentally impact the general game-play.
I've been able to change other aspects of the screen using kwargs - e.g.
Code: Select all
screen g01_tasks (tasks_size=g01_tasks_small, tasks_vis=True):
zorder 5
if tasks_vis:
imagemap:
at tasks_size
Code: Select all
screen g01_tasks (m=False, tasks_size=g01_tasks_small, tasks_vis=True):
zorder 5
modal m
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/game_ch01.rpy", line 300, in script
call screen game_ch01_entry with Dissolve (3.0)
File "renpy/common/000statements.rpy", line 560, in execute_call_screen
store._return = renpy.call_screen(name, *args, **kwargs)
File "game/inits.rpy", line 129, in openG01Tasks
renpy.show_screen("g01_tasks", m=False, tasks_vis=True)
File "game/screens.rpy", line 133, in <module>
modal m
NameError: name 'm' is not defined
Code: Select all
screen g01_tasks (m=True, tasks_size=g01_tasks_small, tasks_vis=True):
zorder 5
if m==True:
modal True
else:
modal False
If necessary, I could make 2 identical screens and swap them out, but I'm hoping for a more efficient solution.
As always, any suggestions would be most appreciated.