diff --git a/game/scripts/characters/hermione/events/items/collars.rpy b/game/scripts/characters/hermione/events/items/collars.rpy index fcd53c17..8a0323ee 100644 --- a/game/scripts/characters/hermione/events/items/collars.rpy +++ b/game/scripts/characters/hermione/events/items/collars.rpy @@ -652,6 +652,7 @@ label whore_scene: #(locked behind public reputation and last sex event) with d3 if not her_neckwear_whore_collar.unlocked: + $ her_neckwear_whore_collar.unlock() gen "Well then... Seeing as how you said thank you... I have a present for you." ("base", xpos="far_left", ypos="head") her @ cheeks blush "A present?" ("soft", "wink", "worried", "mid_soft", trans=d3) gen "Yes, it's a lovely piece of jewellery to commemorate your self-acceptance." ("base", xpos="far_left", ypos="head") diff --git a/game/scripts/interface/topbar.rpy b/game/scripts/interface/topbar.rpy index 4f4edb81..484b06e4 100644 --- a/game/scripts/interface/topbar.rpy +++ b/game/scripts/interface/topbar.rpy @@ -248,9 +248,9 @@ screen ui_menu(): label scene_gallery: menu: "-Watch Ball Ending 1-" if persistent.ending_01: - $ renpy.call_replay("ball_ending_E2", { "states.her.ev.yule_ball.variant": "personal" }) + $ renpy.call_replay("ball_ending_E2", scope={ "states.her.ev.yule_ball.variant": "personal" }) "-Watch Ball Ending 2-" if persistent.ending_02: - $ renpy.call_replay("ball_ending_E2", { "states.her.ev.yule_ball.variant": "public" }) + $ renpy.call_replay("ball_ending_E2", scope={ "states.her.ev.yule_ball.variant": "public" }) "-Never mind-": pass jump main_room_menu diff --git a/game/scripts/utility/engine.rpy b/game/scripts/utility/engine.rpy index ed22e322..d02a4e4a 100644 --- a/game/scripts/utility/engine.rpy +++ b/game/scripts/utility/engine.rpy @@ -336,3 +336,70 @@ init -100 python: expression = expression() return true if expression else false + + # Adds support for nested stores for replay scope + def _call_replay(label, scope={}): + renpy.display.focus.clear_focus() + + renpy.game.log.complete() + + old_log = renpy.game.log + renpy.game.log = renpy.python.RollbackLog() + + sb = renpy.python.StoreBackup() + renpy.python.clean_stores() + + context = renpy.execution.Context(True) + renpy.game.contexts.append(context) + + if renpy.display.interface is not None: + renpy.display.interface.enter_context() + + # This has to be here, to ensure the scope stuff works. + renpy.exports.execute_default_statement() + + for k, v in renpy.config.replay_scope.items(): + stores = k.split(".") + current_obj = renpy.store + + for store in stores[:-1]: + current_obj = getattr(current_obj, store) + + setattr(current_obj, stores[-1], v) + + for k, v in scope.items(): + stores = k.split(".") + current_obj = renpy.store + + for store in stores[:-1]: + current_obj = getattr(current_obj, store) + + setattr(current_obj, stores[-1], v) + + renpy.store._in_replay = label + + try: + + context.goto_label("_start_replay") + renpy.execution.run_context(False) + + except renpy.game.EndReplay: + pass + + finally: + + context.pop_all_dynamic() + + renpy.game.contexts.pop() + renpy.game.log = old_log + sb.restore() + + if renpy.game.interface and renpy.game.interface.restart_interaction and renpy.game.contexts: + renpy.game.contexts[-1].scene_lists.focused = None + + renpy.config.skipping = None + + if renpy.config.after_replay_callback: + renpy.config.after_replay_callback() + + renpy.call_replay = _call_replay