From 0709368ea4aa54b8e6345e7e5418889cb73f25c4 Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Wed, 26 Jun 2024 16:10:44 +0100 Subject: [PATCH] Allow dolls on interface layer while in head position, tweak character transforms, fix male character transforms --- game/scripts/characters/astoria/common.rpy | 11 ++++++----- game/scripts/characters/cho/common.rpy | 12 ++++++------ game/scripts/characters/genie/common.rpy | 2 +- game/scripts/characters/hermione/common.rpy | 9 +++++---- game/scripts/characters/hooch/common.rpy | 11 ++++++----- game/scripts/characters/luna/common.rpy | 12 ++++++------ game/scripts/characters/snape/common.rpy | 2 +- game/scripts/characters/susan/common.rpy | 11 ++++++----- game/scripts/characters/tonks/common.rpy | 11 ++++++----- game/scripts/gui/say.rpy | 19 +++++++++++++++---- game/scripts/options.rpy | 3 ++- 11 files changed, 60 insertions(+), 43 deletions(-) diff --git a/game/scripts/characters/astoria/common.rpy b/game/scripts/characters/astoria/common.rpy index 17ba608d..dbdc7867 100644 --- a/game/scripts/characters/astoria/common.rpy +++ b/game/scripts/characters/astoria/common.rpy @@ -40,7 +40,7 @@ init python: def show(): astoria.show(force=True) - renpy.with_statement({"dolls": trans or d2}) + renpy.with_statement({"dolls": trans or d1}) face = {"mouth": mouth, "eyes": eyes, "eyebrows": eyebrows, "pupils": pupils, "cheeks": cheeks, "tears": tears} temp_face = renpy.game.context().temporary_attributes @@ -79,8 +79,10 @@ init python: astoria.xzoom = -1 if flip else 1 redraw = True - if redraw: + if redraw and not head_only: show() + elif head_only: + astoria.hide() # Figure out nickname if name_astoria_genie != "Astoria": @@ -91,10 +93,9 @@ init python: name_suffix = "" if what: - character.astoria_say(what, who_prefix=name_prefix, who_suffix=name_suffix, **kwargs) + side_doll = At(astoria.image, doll_transform(astoria.pos, astoria.zoom, astoria.xzoom)) if head_only else None + character.astoria_say(what, who_prefix=name_prefix, who_suffix=name_suffix, show_side_doll=side_doll, **kwargs) if temp_face: astoria.set_face(**last_face) - if head_only: - astoria.hide() diff --git a/game/scripts/characters/cho/common.rpy b/game/scripts/characters/cho/common.rpy index 98829360..96cb1242 100644 --- a/game/scripts/characters/cho/common.rpy +++ b/game/scripts/characters/cho/common.rpy @@ -38,7 +38,7 @@ init python in character: def show(): renpy.store.cho.show(force=True) - renpy.with_statement({"dolls": trans or renpy.store.d2}) + renpy.with_statement({"dolls": trans or renpy.store.d1}) face = {"mouth": mouth, "eyes": eyes, "eyebrows": eyebrows, "pupils": pupils, "cheeks": cheeks, "tears": tears} temp_face = renpy.game.context().temporary_attributes @@ -77,8 +77,10 @@ init python in character: renpy.store.cho.xzoom = -1 if flip else 1 redraw = True - if redraw: + if redraw and not head_only: show() + elif head_only: + renpy.store.cho.hide() # Figure out nickname if renpy.store.name_cho_genie != "Cho": @@ -89,10 +91,8 @@ init python in character: name_suffix = "" if what: - cho_say(what, who_prefix=name_prefix, who_suffix=name_suffix, **kwargs) + side_doll = At(renpy.store.cho.image, doll_transform(renpy.store.cho.pos, renpy.store.cho.zoom, renpy.store.cho.xzoom)) if head_only else None + cho_say(what, who_prefix=name_prefix, who_suffix=name_suffix, show_side_doll=side_doll, **kwargs) if temp_face: renpy.store.cho.set_face(**last_face) - - if head_only: - renpy.store.cho.hide() diff --git a/game/scripts/characters/genie/common.rpy b/game/scripts/characters/genie/common.rpy index 29c1d4e3..71a99886 100644 --- a/game/scripts/characters/genie/common.rpy +++ b/game/scripts/characters/genie/common.rpy @@ -36,7 +36,7 @@ init python: if renpy.showing("genie", layer=layer): renpy.show(variant, layer=layer, tag="genie", at_list=at_list) - renpy.with_statement({"dolls": trans or d2}) + renpy.with_statement({"dolls": trans or d1}) if flip is not None: states.gen.image.xzoom = -1 if flip else 1 diff --git a/game/scripts/characters/hermione/common.rpy b/game/scripts/characters/hermione/common.rpy index 70ffb61e..11a6dbee 100644 --- a/game/scripts/characters/hermione/common.rpy +++ b/game/scripts/characters/hermione/common.rpy @@ -33,7 +33,7 @@ init python: def show(): hermione.show(force=True) - renpy.with_statement({"dolls": trans or d2}) + renpy.with_statement({"dolls": trans or d1}) face = {"mouth": mouth, "eyes": eyes, "eyebrows": eyebrows, "pupils": pupils, "cheeks": cheeks, "tears": tears} temp_face = renpy.game.context().temporary_attributes @@ -72,8 +72,10 @@ init python: hermione.xzoom = -1 if flip else 1 redraw = True - if redraw: + if redraw and not head_only: show() + elif head_only: + hermione.hide() # Figure out nickname if name_hermione_genie != "Hermione": @@ -84,13 +86,12 @@ init python: name_suffix = "" if what: + side_doll = At(hermione.image, doll_transform(hermione.pos, hermione.zoom, hermione.xzoom)) if head_only else None character.hermione_say(what, who_prefix=name_prefix, who_suffix=name_suffix, **kwargs) if temp_face: hermione.set_face(**last_face) - if head_only: - hermione.hide() label too_much: stop music fadeout 2.0 diff --git a/game/scripts/characters/hooch/common.rpy b/game/scripts/characters/hooch/common.rpy index 2f2266f5..f04e01b0 100644 --- a/game/scripts/characters/hooch/common.rpy +++ b/game/scripts/characters/hooch/common.rpy @@ -24,7 +24,7 @@ init python: def show(): hooch.show(force=True) - renpy.with_statement({"dolls": trans or d2}) + renpy.with_statement({"dolls": trans or d1}) face = {"mouth": mouth, "eyes": eyes, "eyebrows": eyebrows, "pupils": pupils, "cheeks": cheeks, "tears": tears} temp_face = renpy.game.context().temporary_attributes @@ -63,14 +63,15 @@ init python: hooch.xzoom = -1 if flip else 1 redraw = True - if redraw: + if redraw and not head_only: show() + elif head_only: + hooch.hide() if what: - character.hooch_say(what, **kwargs) + side_doll = At(hooch.image, doll_transform(hooch.pos, hooch.zoom, hooch.xzoom)) if head_only else None + character.hooch_say(what, show_side_doll=side_doll, **kwargs) if temp_face: hooch.set_face(**last_face) - if head_only: - hooch.hide() diff --git a/game/scripts/characters/luna/common.rpy b/game/scripts/characters/luna/common.rpy index e4343ff4..8bbd747e 100644 --- a/game/scripts/characters/luna/common.rpy +++ b/game/scripts/characters/luna/common.rpy @@ -36,7 +36,7 @@ init python: def show(): luna.show(force=True) - renpy.with_statement({"dolls": trans or d2}) + renpy.with_statement({"dolls": trans or d1}) face = {"mouth": mouth, "eyes": eyes, "eyebrows": eyebrows, "pupils": pupils, "cheeks": cheeks, "tears": tears} temp_face = renpy.game.context().temporary_attributes @@ -75,8 +75,10 @@ init python: luna.xzoom = -1 if flip else 1 redraw = True - if redraw: + if redraw and not head_only: show() + elif head_only: + luna.hide() # Figure out nickname if name_luna_genie != "Luna": @@ -87,10 +89,8 @@ init python: name_suffix = "" if what: - character.luna_say(what, who_prefix=name_prefix, who_suffix=name_suffix, **kwargs) + side_doll = At(luna.image, doll_transform(luna.pos, luna.zoom, luna.xzoom)) if head_only else None + character.luna_say(what, who_prefix=name_prefix, who_suffix=name_suffix, show_side_doll=side_doll, **kwargs) if temp_face: luna.set_face(**last_face) - - if head_only: - luna.hide() diff --git a/game/scripts/characters/snape/common.rpy b/game/scripts/characters/snape/common.rpy index 57a627c8..37debde9 100644 --- a/game/scripts/characters/snape/common.rpy +++ b/game/scripts/characters/snape/common.rpy @@ -56,7 +56,7 @@ init python: renpy.show(name=tag, at_list=at_list, layer=layer, what=sprite, zorder=states.sna.image.zorder) - renpy.with_statement({"dolls": trans or d2}) + renpy.with_statement({"dolls": trans or d1}) if what: character.snape_say(what, **kwargs) diff --git a/game/scripts/characters/susan/common.rpy b/game/scripts/characters/susan/common.rpy index c0d5eaa7..9e41a297 100644 --- a/game/scripts/characters/susan/common.rpy +++ b/game/scripts/characters/susan/common.rpy @@ -35,7 +35,7 @@ init python: def show(): susan.show(force=True) - renpy.with_statement({"dolls": trans or d2}) + renpy.with_statement({"dolls": trans or d1}) face = {"mouth": mouth, "eyes": eyes, "eyebrows": eyebrows, "pupils": pupils, "cheeks": cheeks, "tears": tears} temp_face = renpy.game.context().temporary_attributes @@ -74,8 +74,10 @@ init python: susan.xzoom = -1 if flip else 1 redraw = True - if redraw: + if redraw and not head_only: show() + elif head_only: + tonks.hide() # Figure out nickname if name_susan_genie != "Susan": @@ -86,10 +88,9 @@ init python: name_suffix = "" if what: - character.susan_say(what, who_prefix=name_prefix, who_suffix=name_suffix, **kwargs) + side_doll = At(tonks.image, doll_transform(tonks.pos, tonks.zoom, tonks.xzoom)) if head_only else None + character.susan_say(what, who_prefix=name_prefix, who_suffix=name_suffix, show_side_doll=side_doll, **kwargs) if temp_face: susan.set_face(**last_face) - if head_only: - susan.hide() diff --git a/game/scripts/characters/tonks/common.rpy b/game/scripts/characters/tonks/common.rpy index 3d41aba8..7b659486 100644 --- a/game/scripts/characters/tonks/common.rpy +++ b/game/scripts/characters/tonks/common.rpy @@ -46,7 +46,7 @@ init python: def show(): tonks.show(force=True) - renpy.with_statement({"dolls": trans or d2}) + renpy.with_statement({"dolls": trans or d1}) face = {"mouth": mouth, "eyes": eyes, "eyebrows": eyebrows, "pupils": pupils, "cheeks": cheeks, "tears": tears} temp_face = renpy.game.context().temporary_attributes @@ -94,8 +94,10 @@ init python: tonks.xzoom = -1 if flip else 1 redraw = True - if redraw: + if redraw and not head_only: show() + elif head_only: + tonks.hide() # Figure out nickname if name_tonks_genie != "Tonks": @@ -106,7 +108,8 @@ init python: name_suffix = "" if what: - character.tonks_say(what, who_prefix=name_prefix, who_suffix=name_suffix, **kwargs) + side_doll = At(tonks.image, doll_transform(tonks.pos, tonks.zoom, tonks.xzoom)) if head_only else None + character.tonks_say(what, who_prefix=name_prefix, who_suffix=name_suffix, show_side_doll=side_doll, **kwargs) # Weird Engine quirk; `show_` prefix required to pass arguments to screen. if temp_face: tonks.set_face(**last_face) @@ -114,5 +117,3 @@ init python: if temp_hair: tonks.get_equipped("hair").set_color(last_hair) - if head_only: - tonks.hide() diff --git a/game/scripts/gui/say.rpy b/game/scripts/gui/say.rpy index cf511b50..a46d5430 100644 --- a/game/scripts/gui/say.rpy +++ b/game/scripts/gui/say.rpy @@ -23,7 +23,7 @@ screen nvl(dialogue, items=None): # config.all_character_callbacks.append(next_who) -screen say(who, what, side_image=None, icon=None): +screen say(who, what, side_doll=None, icon=None): style_prefix "say" layer "interface" zorder 0 @@ -55,7 +55,18 @@ screen say(who, what, side_image=None, icon=None): use quickbox - add SideImage() + # Note: Weird quirk. As per documentation; + # Keyword arguments passed to the say character + # beginning with ``show_`` have the prefix + # stripped off, and are passed to the screen as arguments. For + # example, the value of ``show_myflag`` will become the value of + # the ``myflag`` variable in the screen. (The ``myflag`` variable isn't + # used by default, but can be used by a custom say screen.) + + if side_doll: + add side_doll + else: + add SideImage() screen hider(): variant "pc" @@ -161,7 +172,7 @@ screen choice(items): vbox: $ start_index = column * 12 $ end_index = start_index + 12 - + for i, entry in enumerate(items[start_index:end_index], 1): $ scale = (1.0 * (28 / max(28, len(entry.caption)))) $ icon = entry.kwargs.get("icon", None) @@ -194,7 +205,7 @@ screen choice(items): if progress: bar value StaticValue(progress[0], progress[1]) offset (-16, 22) - + if progress[0] == progress[1]: text _("{wave}{size=20}Done!{/size}{/wave}") style "choice_progress" at transform: rotate 12.5 diff --git a/game/scripts/options.rpy b/game/scripts/options.rpy index c445e709..0f74f1bb 100644 --- a/game/scripts/options.rpy +++ b/game/scripts/options.rpy @@ -127,7 +127,7 @@ define config.fadeout_audio = 1.0 define config.default_music_volume = 0.8 define config.default_sfx_volume = 1.0 -# Transitions +# Transitions & Transforms define config.enter_transition = None define config.exit_transition = None define config.intra_transition = d1 @@ -145,6 +145,7 @@ define config.exit_yesno_transition = None define config.enter_replay_transition = None define config.exit_replay_transition = None define config.say_attribute_transition = None +define config.side_image_same_transform = d1 # Engine Compatibility define config.check_conflicting_properties = True