So I tried and this doesn't work, or not correctly because it breaks something else. No matter what choice I select, the sentence is said by my character but after it behaves like it is the last choice that have been chosen !
I've tried with and without `from current`. With from current, a bug happens : the choice keeps repeating.
I've tried reversing the i.action and the Call too, without success.
I think the problem is here:
Code: Select all
for i in items:
button:
style "coal_choice_button"
text i.caption style "coal_nvl_caption"
action [i.action, Call('say_after_choice', i.caption), SetVariable("quick_menu", True)] ####### HERE
if "default" in i.args:
timer 0.02 repeat True action [If(countdown_time > 0,
true=[SetVariable('countdown_time', countdown_time-0.02), SetVariable("quick_menu", False)],
false=[i.action, Call('say_after_choice', i.caption), SetVariable("quick_menu", True)])]
bar value countdown_time range countdown_range style "coal_countdown_bar"
add SideImage() xalign 0.0 yalign 1.0
label say_after_choice(txt=last_choice):
$ renpy.say(after_choice, txt)
$ renpy.fix_rollback() #TODO might not be a great idea
return
I know it isn't perfect but I tried to make it as readable as possible.
Here is the full screen code:
Code: Select all
screen nvl(dialogue, items=None):
window:
style "nvl_window"
has vbox:
spacing gui.nvl_spacing
## Displays dialogue in either a vpgrid or the vbox.
if gui.nvl_height:
vpgrid:
cols 1
yinitial 1.0
use nvl_dialogue(dialogue)
else:
use nvl_dialogue(dialogue)
## Displays the menu, if given. The menu may be displayed incorrectly if
## config.narrator_menu is set to True, as it is above.
vbox:
spacing 10
for i in items:
button:
style "coal_choice_button"
text i.caption style "coal_nvl_caption"
action [i.action, SetVariable("quick_menu", True)]
if "default" in i.args:
timer 0.02 repeat True action [If(countdown_time > 0,
true=[SetVariable('countdown_time', countdown_time-0.02), SetVariable("quick_menu", False)],
false=[i.action, Call('say_after_choice', i.caption), SetVariable("quick_menu", True)])]
bar value countdown_time range countdown_range style "coal_countdown_bar"
add SideImage() xalign 0.0 yalign 1.0
label say_after_choice(txt=last_choice):
$ renpy.say(after_choice, txt)
$ renpy.fix_rollback() #TODO might not be a great idea
return