From 00da7e885585b1f87e50a43e880a966ac0af104e Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Wed, 15 Nov 2023 15:59:06 +0100 Subject: [PATCH] Simplify generic CG code (cherry picked from commit 40ddb2918515cee48114cdada4cdb79d6535db6f) --- game/scripts/cg/common.rpy | 43 +++++++++++++------------------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/game/scripts/cg/common.rpy b/game/scripts/cg/common.rpy index 763d6243..55b8765f 100644 --- a/game/scripts/cg/common.rpy +++ b/game/scripts/cg/common.rpy @@ -1,4 +1,3 @@ - init 5 python: def her_cg_doll(st, at): return hermione.image, None @@ -25,35 +24,21 @@ image CG cho_doll = DynamicDisplayable(cho_cg_doll) image CG ast_doll = DynamicDisplayable(ast_cg_doll) image CG sus_doll = DynamicDisplayable(sus_cg_doll) -image CG luna = Fixed( - "images/CG/common/bg.webp", - AlphaMask(Composite((2160, 1200), (880, -180), Transform("CG lun_doll", zoom=1.2)), "images/CG/common/mask.webp"), - ) +transform CG_masker(child): + contains: + "images/CG/common/bg.webp" + contains: + AlphaMask( + Fixed(Transform(child, zoom=1.2, pos=(880, -180)), xfit=True, yfit=True), + "images/CG/common/mask.webp", + ) -image CG hermione = Fixed( - "images/CG/common/bg.webp", - AlphaMask(Composite((2160, 1200), (880, -180), Transform("CG her_doll", zoom=1.2)), "images/CG/common/mask.webp"), - ) - -image CG tonks = Fixed( - "images/CG/common/bg.webp", - AlphaMask(Composite((2160, 1200), (880, -180), Transform("CG ton_doll", zoom=1.2)), "images/CG/common/mask.webp"), - ) - -image CG cho = Fixed( - "images/CG/common/bg.webp", - AlphaMask(Composite((2160, 1200), (880, -180), Transform("CG cho_doll", zoom=1.2)), "images/CG/common/mask.webp"), - ) - -image CG astoria = Fixed( - "images/CG/common/bg.webp", - AlphaMask(Composite((2160, 1200), (880, -180), Transform("CG ast_doll", zoom=1.2)), "images/CG/common/mask.webp"), - ) - -image CG susan = Fixed( - "images/CG/common/bg.webp", - AlphaMask(Composite((2160, 1200), (880, -180), Transform("CG sus_doll", zoom=1.2)), "images/CG/common/mask.webp"), - ) +image CG luna = At("CG lun_doll", CG_masker) +image CG hermione = At("CG her_doll", CG_masker) +image CG tonks = At("CG ton_doll", CG_masker) +image CG cho = At("CG cho_doll", CG_masker) +image CG astoria = At("CG ast_doll", CG_masker) +image CG susan = At("CG sus_doll", CG_masker) # Snape CG screen snape_groping():