From e0e9d23d2a1ae2c7556e4a7fc616cc2c4b635080 Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Thu, 2 Mar 2023 23:06:16 +0000 Subject: [PATCH] Bug fixes and improvements * Fixed wardrobe not initializing in replay context * Fixed unequip all clothes cheat * Fixed example mod file structure * Fixed ability to rollback to the broken past during the game's start * Simplified initialization * Simplified mods module importing and parsing, reducing possible number of fail points * Moved audio channel registration to options (config) file * Added default zorder for `cg` image tag * Added rpym format to .editorconfig --- .editorconfig | 2 +- .../default}/clothes/hair/ponytail/0.webp | 0 .../default}/clothes/hair/ponytail/1.webp | 0 .../clothes/hair/ponytail/outline.webp | 0 .../characters/tonks/events/clothing.rpy | 2 +- game/scripts/doll/init.rpy | 2 ++ game/scripts/interface/cheats.rpy | 2 +- game/scripts/mods.rpy | 7 ++-- game/scripts/options.rpy | 5 +++ game/scripts/script.rpy | 34 +++++++++---------- 10 files changed, 28 insertions(+), 26 deletions(-) rename game/mods/MyMod/characters/hermione/{ => poses/default}/clothes/hair/ponytail/0.webp (100%) rename game/mods/MyMod/characters/hermione/{ => poses/default}/clothes/hair/ponytail/1.webp (100%) rename game/mods/MyMod/characters/hermione/{ => poses/default}/clothes/hair/ponytail/outline.webp (100%) diff --git a/.editorconfig b/.editorconfig index 837a07bc..8e6efedc 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,6 +9,6 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true -[*.{py,rpy}] +[*.{py,rpy,rpym}] indent_size = 4 indent_style = space diff --git a/game/mods/MyMod/characters/hermione/clothes/hair/ponytail/0.webp b/game/mods/MyMod/characters/hermione/poses/default/clothes/hair/ponytail/0.webp similarity index 100% rename from game/mods/MyMod/characters/hermione/clothes/hair/ponytail/0.webp rename to game/mods/MyMod/characters/hermione/poses/default/clothes/hair/ponytail/0.webp diff --git a/game/mods/MyMod/characters/hermione/clothes/hair/ponytail/1.webp b/game/mods/MyMod/characters/hermione/poses/default/clothes/hair/ponytail/1.webp similarity index 100% rename from game/mods/MyMod/characters/hermione/clothes/hair/ponytail/1.webp rename to game/mods/MyMod/characters/hermione/poses/default/clothes/hair/ponytail/1.webp diff --git a/game/mods/MyMod/characters/hermione/clothes/hair/ponytail/outline.webp b/game/mods/MyMod/characters/hermione/poses/default/clothes/hair/ponytail/outline.webp similarity index 100% rename from game/mods/MyMod/characters/hermione/clothes/hair/ponytail/outline.webp rename to game/mods/MyMod/characters/hermione/poses/default/clothes/hair/ponytail/outline.webp diff --git a/game/scripts/characters/tonks/events/clothing.rpy b/game/scripts/characters/tonks/events/clothing.rpy index 246c57fe..167b9aba 100644 --- a/game/scripts/characters/tonks/events/clothing.rpy +++ b/game/scripts/characters/tonks/events/clothing.rpy @@ -130,7 +130,7 @@ label tonks_summon_setup: menu: "-Those clothes stay off!-": - $ tonks.unequip("all") + $ tonks.unequip("clothes") ton "*Hmm*?" ("soft", "narrow", "raised", "down", hair="horny", cheeks="heavy_blush") gen "That's right... If they're so bothersome, why bother wearing them at all?" ("base", xpos="far_left", ypos="head") diff --git a/game/scripts/doll/init.rpy b/game/scripts/doll/init.rpy index 756e48d3..ab865391 100644 --- a/game/scripts/doll/init.rpy +++ b/game/scripts/doll/init.rpy @@ -13,3 +13,5 @@ init python: outfit_last = outfit = get_character_outfit(c, type="last") outfit_last.save() + + config.start_callbacks.append(wardrobe_init) diff --git a/game/scripts/interface/cheats.rpy b/game/scripts/interface/cheats.rpy index 355ab861..79bfd7ba 100644 --- a/game/scripts/interface/cheats.rpy +++ b/game/scripts/interface/cheats.rpy @@ -327,7 +327,7 @@ label cheats: "-Unequip all clothes-": python: for i in CHARACTERS: - getattr(renpy.store, i).unequip("all") + getattr(renpy.store, i).unequip("clothes") ">All characters are now naked." diff --git a/game/scripts/mods.rpy b/game/scripts/mods.rpy index 0b8cd87a..5e494166 100644 --- a/game/scripts/mods.rpy +++ b/game/scripts/mods.rpy @@ -170,8 +170,5 @@ init python: # define config.exception_handler = exception_handler -init: - $ import_mods() - $ config.after_load_callbacks.append(parse_mods) - - + config.start_callbacks.extend([import_mods, parse_mods]) + config.after_load_callbacks.append(parse_mods) diff --git a/game/scripts/options.rpy b/game/scripts/options.rpy index 88e0b651..0350cf9b 100644 --- a/game/scripts/options.rpy +++ b/game/scripts/options.rpy @@ -21,6 +21,10 @@ init python: settings.default("animations", True) settings.default("updates", True) + renpy.music.register_channel("background", "sfx", True) + renpy.music.register_channel("bg_sounds", "sfx", True) + renpy.music.register_channel("weather", "weather", True) + # Configuration # https://www.renpy.org/doc/html/config.html @@ -77,6 +81,7 @@ define config.tag_zorder = { "xray_child": -1, "xray_overlay": -1, "xray_mask": -1, + "cg": 17, } # Saving and loading diff --git a/game/scripts/script.rpy b/game/scripts/script.rpy index 91b7704b..cfe458fe 100644 --- a/game/scripts/script.rpy +++ b/game/scripts/script.rpy @@ -1,11 +1,19 @@ # The game starts here label start: - call game_init + if not renpy.android: + show screen tooltip + + python: + version = version_float() + + renpy.block_rollback() + jump start_wt label start_quick: - call game_init + if not renpy.android: + show screen tooltip python: game.difficulty = 2 @@ -14,11 +22,13 @@ label start_quick: map_unlocked = True game.cheats = True + renpy.block_rollback() + jump skip_to_hermione -# Quickstart for developer mode label start_dev: - call game_init + if not renpy.android: + show screen tooltip python: game.difficulty = 2 @@ -82,18 +92,6 @@ label start_dev: if not x.hidden: x.unlock() + renpy.block_rollback() + jump skip_to_hermione - -label game_init: - $ version = version_float() - $ wardrobe_init() - $ parse_mods() - - if not renpy.android: - show screen tooltip - return - -init python: - renpy.music.register_channel("background", "sfx", True) - renpy.music.register_channel("bg_sounds", "sfx", True) - renpy.music.register_channel("weather", "weather", True)