# Fiery Passions [v0.6.1] [HotGameDev]
# Rollback+CheatMod+Gallery Unlocker by pepplez @ F95zone

define pep_modversion ="2.4"
init 9 python:
    import os
    os.environ["RENPY_SKIP_SPLASHSCREEN"] = "1"
    renpy.config.auto_save = False
    config.console = True
    config.developer = True
    renpy.config.quit_action = Quit(confirm=False)
    
    # set rollback to 128 steps
    config.rollback_enabled = True
    config.rollback_length = 128
    config.hard_rollback_limit = 128

    # force rollback
    def _force_enable_rollback():
        config.rollback_enabled = True
    config.after_load_callbacks.append(_force_enable_rollback)
    
    # Gallery
    gallery_unlock_all()
    
    # lockpick click everywhere
    _old_event = LockpickGame.event

    def pep_lockpicker(self, ev, x, y, st):
        result = _old_event(self, ev, x, y, st)

        if result in ("fail", "success"):
            return "success"

        return result

    LockpickGame.event = pep_lockpicker
    print (f"[pepplez] CheatMod v{pep_modversion} loaded.")

init 9 screen money:
    zorder 100
    frame:
        style "fp_money_pill"
        at ui_fade(0.0, 0.3)
        has hbox
        yfill True
        spacing 18
        add Pic("coin") yalign 0.5
        text "[money]" style "fp_hud_money" yalign 0.5
        textbutton _("+") style "pep_textbutton":
            align(0.5, 0.5)
            at ui_fade(0.0, 0.3)
            action SetVariable("money", money+100)


    if lockpick <=0:
        textbutton _("{size=-20}Get Lockpick{/size}") style "pep_textbutton": 
            xpos 400 
            ypos 30
            at screen_fade
            action SetVariable("lockpick",1)


    if energy in [2, 3, 4] and not location =="beach":
        # text location:
            # yalign 1.0
        button:
            style "fp_hud_round"
            pos (1575, 27)
            action Call("rest")
            at screen_fade
            add "gui/fp/icons/hourglass.png" at ico(40) align (0.5, 0.5)


# real skip button
init 9 screen nsfw_skip_button():
    zorder 150

    button:
        style "nsfw_skip_btn"
        xpos 1887
        xanchor 1.0
        ypos 27
        # action Show("nsfw_skip_confirm", transition=Dissolve(0.2))
        action Return()
        at screen_fade
        has hbox
        align (0.5, 0.5)
        spacing 12
        text _("Пропустить") style "nsfw_skip_btn_text" yalign 0.5
        add "gui/fp/icons/skip.png" at ico(28, FP_BRASS, FP_DARK) yalign 0.5


init 9 screen fp_quick_buttons():
    hbox:
        pos (1620, 789)
        xanchor 1.0
        yanchor 0.5
        spacing 24
        button:
            style "fp_quick"
            tooltip _("Rollback")
            action Rollback()
            add "gui/fp/icons/history.png" at ico(32) align (0.5, 0.5)
        button:
            style "fp_quick"
            tooltip _("История")
            action ShowMenu("history")
            add "gui/fp/icons/history.png" at ico(32) align (0.5, 0.5)
        button:
            style "fp_quick"
            tooltip _("Авто")
            action Preference("auto-forward", "toggle")
            add "gui/fp/icons/auto.png" at ico(32) align (0.5, 0.5)
        button:
            style "fp_quick"
            tooltip _("Скрыть")
            action HideInterface()
            add "gui/fp/icons/hide.png" at ico(32) align (0.5, 0.5)

    $ _qtip = GetTooltip("say")
    if _qtip:

        frame:
            style "fp_quick_tip_box"
            at ui_fade(0.0, 0.15)
            text _qtip style "fp_quick_tip"

style pep_textbutton:
    background Gimg("round84")
    hover_background Gimg("round84_hot")
    activate_sound audio.click
    xysize (84, 84)
    padding (0, 0)

style pep_textbutton_text:
    xalign 0.5
    yalign 0.5
    text_align 0.5
    xanchor 0.5
    yanchor 0.5