define persistent.gallery_unlocked = False
define persistent.unlock_list = []

init python:
    def unlock_version(ver):
        persistent.unlock_list.append(ver)

screen gallery_continue:
    add Transform("#000000", alpha=0.75) at phone_fade
    text "Click to Continue" size 50 yoffset 25 color "#FFFFFF" outlines [ (1.5, "#000000", 0, 0) ] xalign 0.5 yalign 0.5

screen gallery_code_unlocked:
    modal True
    add Transform("#000000", alpha=0.75) at phone_fade
    vbox:
        xalign 0.5
        yalign 0.5
        spacing 25
        text "v[game_version] is Unlocked" size 50 color "#FFFFFF" outlines [ (4, "#000000", 0, 0) ] xalign 0.5
        text "Please Enjoy!" size 40 color "#FFFFFF" outlines [ (4, "#000000", 0, 0) ] xalign 0.5
        text "Check {i}https://www.patreon.com/LovestoryGames {/i}for updates and new versions!" size 25 color "#FFFFFF" outlines [ (4, "#000000", 0, 0) ] xalign 0.5
        textbutton "CLOSE":
            action [Show("ver_checker"),Hide("gallery_code_unlocked")]


            text_xalign .5
            xalign 0.5

            style "nav_button"

screen gallery_code:
    modal True
    timer 0.01 action [SetVariable("correct2","N/A"),Function(entry_reset_func,""),Show("code_search")]
    add Transform("#000000", alpha=0.75) at phone_fade
    vbox:
        xalign 0.5
        yalign 0.5
        yoffset 175
        text "Password available under the MEMBERSHIP tab at" size 15 color "#FFFFFF" outlines [ (1.5, "#000000", 0, 0) ] xalign 0.5


        text "{i}https://www.patreon.com/LovestoryGames" size 15 color "#FFFFFF" outlines [ (1.5, "#000000", 0, 0) ] xalign 0.5

        textbutton "PASSWORD HERE":
            action OpenURL("https://www.patreon.com/LovestoryGames/membership")


            text_xalign .5
            xalign 0.5

            style "nav_button"
        text ""
        if not main_menu and chapter_check == "":
            textbutton "CLOSE":
                action [Show("ver_checker"),SetVariable("correct2","N/A"),Function(code_reset_func,""),Hide("gallery_code"),Hide("code_search"),Hide("gallery_code"),Jump("start")]


                text_xalign .5
                xalign 0.5

                style "nav_button"
        elif not main_menu and chapter_check != "":
            textbutton "CLOSE":
                action [Show("ver_checker"),SetVariable("correct2","N/A"),Function(code_reset_func,""),MainMenu()]


                text_xalign .5
                xalign 0.5

                style "nav_button"
        else:
            textbutton "CLOSE":
                action [Show("ver_checker"),SetVariable("correct2","N/A"),Function(code_reset_func,""),Hide("gallery_code"),Hide("code_search"),Hide("gallery_code")]


                text_xalign .5
                xalign 0.5

                style "nav_button"

    if code.name == persistent.current_news["patreon"]:
        timer 0.01 repeat True action [SetVariable("correct2","correct"),Show("gallery_code"),Show("code_search")]
    elif code.name == "":
        pass
    else:
        timer 0.01 repeat True action [SetVariable("correct2","error"),Show("gallery_code"),Show("code_search")]

init python:
    def code_box_func(newstring):
        global correct2
        code.name = newstring

    def code_reset_func(newstring):
        code.name = ""

define code_search = ""
define code = Character(code_search)
default correct2 = "N/A"
screen code_search:
    zorder 101
    default box_select = False
    default code_select = "NONE"
    if False and correct2 == "error":
        frame:
            background None
            xalign 0.5
            yoffset 200
            text "Wrong Code!" size 40 xalign 0.5 bold True color "#FFFFFF"
            textbutton "Try Again":
                action [Function(code_reset_func,""),SetVariable("correct2","N/A"),SetScreenVariable("box_select",True)]


                text_xalign .5
                xalign 0.5
                yoffset 125

                style "nav_button"
    elif True or correct2 == "correct":
        frame:
            background None
            xalign 0.5
            yoffset 200
            text "Code Correct" size 40 xalign 0.5 bold True color "#FFFFFF"
            if not main_menu:
                textbutton "Unlock Content":
                    action [Function(unlock_version,game_version),SetVariable("persistent.cur_d",pc_doy),
                    SetVariable("persistent.gallery_unlocked",True),SetVariable("correct2","N/A"),Function(code_reset_func,""),Hide("gallery_code"),Hide("code_search"),Show("gallery_continue")]


                    text_xalign .5
                    xalign 0.5
                    yoffset 125

                    style "nav_button"
            else:
                textbutton "Unlock Gallery":
                    action [Function(unlock_version,game_version),SetVariable("persistent.cur_d",pc_doy),
                    SetVariable("persistent.gallery_unlocked",True),SetVariable("correct2","N/A"),Function(code_reset_func,""),Hide("gallery_code"),Hide("code_search"),ShowMenu("extras")]


                    text_xalign .5
                    xalign 0.5
                    yoffset 125

                    style "nav_button"
    elif correct2 == "N/A":
        if code_select != "NONE":
            frame:
                background None
                xalign 0.5
                yoffset 200
                textbutton "CONFIRM":
                    action [Hide("code_search"),Show("code_search"),SetScreenVariable("box_select",False)]


                    text_xalign .5
                    xalign 0.5
                    yoffset 185

                    style "nav_button"
                add Transform(Solid("#FFFFFF", xysize=(1000, 95)),alpha=0.25) xalign 0.5 yoffset 67
                imagebutton:
                    idle Transform(Solid("#FFFFFF", xysize=(1000, 95)),alpha=0.5)
                    xalign 0.5 yoffset 67
                    action SetScreenVariable("box_select",True)
                text "Password:" size 40 xalign 0.5 bold True color "#FFFFFF"
                if box_select == True:
                    frame:
                        xysize (1000,500)
                        xalign 0.5
                        yoffset 75

                        background None
                        input default code.name changed code_box_func xalign 0.5 xoffset 0 text_align 0.5 size 75

                else:
                    frame:
                        xysize (1000,500)
                        xalign 0.5
                        yoffset 75

                        background None
                        text code.name xalign 0.5 xoffset 0 text_align 0.5 size 75


        else:
            timer 0.01 action SetScreenVariable("code_select", "N/A")
# Decompiled by unrpyc: https://github.com/CensoredUsername/unrpyc
