Can a screen be made non-interactive while "saying"?
Posted: Fri Mar 01, 2019 3:15 pm
The scenario is a player character reading a food menu. The player can click on items in the menu and some will lead to an order being made and the story progressing (a jump statement), some will trigger a small exposition dialogue about not liking an item, while continuing to "look" at the menu.
Using show screen with the menu and call screen on an empty screen (pass) solves the issue with call screen being transient which was causing the menu to disappear during the exposition. However the problem now is items on the menu remain interactive while the exposition plays, ideally I'd like to disable interactivity of the screen during this to prevent clicking another item until the current exposition is concluded.
I wasn't able to find anything obvious when it came to disabling a whole screen, so my next thought was to see if a second (transparent) screen could be shown on top to intercept interactions. Both an empty modal screen and a non-modal screen containing a full screen (transparent) imagebutton with a NullAction resulted in the menu screen being disabled successfully ... unfortunately they also blocked being able to progress through the dialogue. >_<
I can't help but feel I must be missing a trick here, but I can't find any obvious freeze/disable screen flag I could toggle. :/
P.S. I know individual elements can have a boolean sensitive flag set, however in addition to having to be set on everything individually, it also triggers an undesirable appearance change. Some menu items will already be insensitive because the player can't afford them, having everything switch between appearing affordable and not while the dialogue plays wouldn't be ideal at all. :(
P.P.S. I also tried adding modal True to the say screen in screens.rpy thinking it'd make dialogue the only thing able to be interacted with, unfortunately this too disabled all forms of progression. :(
Here's the sample I've been playing with:
Thanks!
Using show screen with the menu and call screen on an empty screen (pass) solves the issue with call screen being transient which was causing the menu to disappear during the exposition. However the problem now is items on the menu remain interactive while the exposition plays, ideally I'd like to disable interactivity of the screen during this to prevent clicking another item until the current exposition is concluded.
I wasn't able to find anything obvious when it came to disabling a whole screen, so my next thought was to see if a second (transparent) screen could be shown on top to intercept interactions. Both an empty modal screen and a non-modal screen containing a full screen (transparent) imagebutton with a NullAction resulted in the menu screen being disabled successfully ... unfortunately they also blocked being able to progress through the dialogue. >_<
I can't help but feel I must be missing a trick here, but I can't find any obvious freeze/disable screen flag I could toggle. :/
P.S. I know individual elements can have a boolean sensitive flag set, however in addition to having to be set on everything individually, it also triggers an undesirable appearance change. Some menu items will already be insensitive because the player can't afford them, having everything switch between appearing affordable and not while the dialogue plays wouldn't be ideal at all. :(
P.P.S. I also tried adding modal True to the say screen in screens.rpy thinking it'd make dialogue the only thing able to be interacted with, unfortunately this too disabled all forms of progression. :(
Here's the sample I've been playing with:
Code: Select all
label start:
scene expression Solid('ccc')
show screen foodmenu()
while True:
call screen blank
return
label end:
'You won the game!'
return
label chicken:
hide screen foodmenu
'The {color=770}chicken{/color} sounds good'
'OM NOM NOM'
jump end
label fish:
# show screen nope_modal() # blocked dialogue progression
# show screen nope_null() # blocked dialogue progression
'Ewww {color=077}fish{/color}? I think not!'
# hide screen nope_null
# hide screen nope_modal
return
screen blank():
pass
screen foodmenu():
vbox:
textbutton 'Chicken' action Jump('chicken')
textbutton 'Fish' action Call('fish')
screen nope_modal():
modal True
screen nope_null():
imagebutton idle Fixed() action NullAction()