From 53548aecdb4ff2812b44039f310659c3b909d59a Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Tue, 21 May 2024 20:35:01 +0100 Subject: [PATCH] Fix {w} text tag affecting textbox animation. --- game/scripts/gui/say.rpy | 45 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/game/scripts/gui/say.rpy b/game/scripts/gui/say.rpy index ff9dfdb8..8e6e7c97 100644 --- a/game/scripts/gui/say.rpy +++ b/game/scripts/gui/say.rpy @@ -35,7 +35,9 @@ screen say(who, what, side_image=None, icon=None): id "textbox" style "textbox" - at gui_say_show_hide + # Ren'py will flicker the box on {w} tags, + # so we use a func. + at gui_say_show_hide(what) # Ren'py hard crashes without textbox windows, # this is the workaround that just works. @@ -205,38 +207,35 @@ transform gui_perspective_hover: easein 0.1 matrixtransform ScaleMatrix(1.05, 1.05, 1.05) easeout 0.1 matrixtransform ScaleMatrix(1.0, 1.0, 1.0) -transform gui_say_show_hide: - show_cancels_hide False - on start: +transform gui_say_show_hide(what): + show_cancels_hide True + on show: alpha 0 zoom 1.05 pause 0.1 easein 0.1 zoom 1.00 alpha 1 + on replace: + alpha 1.0 + zoom 1.0 on hide: - easeout 0.1 zoom 0.95 alpha 0 + # easeout 0.1 zoom 0.95 alpha 0 + function renpy.partial(gui_say_hide, what) -# transform gui_say_show_hide: -# show_cancels_hide False -# on show: -# function gui_say_show -# # on hide: -# # easeout 0.1 zoom 0.95 alpha 0 +init python: + def gui_say_hide(what, trans, st, at): + if st > 0.1: + return None -# init python: -# def gui_say_show(trans, st, at): -# if at > 0.1: -# return None + if "{w}" in what: + return None -# if _last_say_who == _next_say_who: -# return None - -# warper = _warper.easein(at / 0.1) -# trans.alpha = renpy.atl.interpolate(warper, 0.0, 1.0, renpy.atl.PROPERTIES["alpha"]) -# trans.zoom = renpy.atl.interpolate(warper, 1.05, 1.0, renpy.atl.PROPERTIES["zoom"]) -# return 0.01 + warper = _warper.easein(st / 0.1) + trans.alpha = renpy.atl.interpolate(warper, 1.0, 0.0, renpy.atl.PROPERTIES["alpha"]) + trans.zoom = renpy.atl.interpolate(warper, 1.0, 0.95, renpy.atl.PROPERTIES["zoom"]) + return 0.01 transform gui_choice_show_hide: - show_cancels_hide False + show_cancels_hide True on start: events False xoffset -100