define galleryDict = [
    ["images/01/riabed03.jpg", "", "galleryscene1", "Ria Sex"],
    ["images/02/bathlily08.jpg", "", "galleryscene2", "Lily Bath"],
    ["images/02/carriasuck.jpg", "", "galleryscene3", "Ria Fantasy"],
    ["images/02/bathria16.jpg", "", "galleryscene4", "Ria Bath"],
    ["images/02/officeend01.jpg", "", "galleryscene5", "Angel BJ"],
    ["images/03/3085.jpg", "", "galleryscene6", "Office Rumour?"],
    ["images/03/3101.jpg", "", "galleryscene7", "Lily Sex"],
    ["images/03/3198b.jpg", "", "galleryscene8", "Ria & Lily BJ"],
    ["images/035/4021.jpg", "", "galleryscene9", "MC's Nightmare"],
    ["images/035/4098.jpg", "", "galleryscene10", "Ria Mast."],
    ["images/035/4111b.jpg", "", "galleryscene11", "Lily Carl Sex"],
    ["images/035/4194.jpg", "", "galleryscene12", "Lizzy BJ"],
    # ["images/04/lizsex/cafesex01.jpg","","galleryscene13","Lizzy Job Visit"],
    # ["images/04/4299.jpg","","galleryscene14","Ria Dessert"],
    # ["images/05/hangtodd/5031b.jpg","","galleryscene15","Ria Todd"],
    # ["images/05/hotelroom/hr02.jpg","","galleryscene16","Hotel Room with Lily"],
    # ["images/05/gotobutiq01/meganmcblow040.jpg","","galleryscene17","Megan Changing Room Fun"]
    ]
define galleryDict1 = [
    ["images/04/lizsex/cafesex01.jpg","","galleryscene13","Lizzy Job Visit"],
    ["images/04/4299.jpg","","galleryscene14","Ria Dessert"],
    ["images/05/hangtodd/5031b.jpg","","galleryscene15","Ria Todd"],
    ["images/05/hotelroom/hr02.jpg","","galleryscene16","Hotel Room with Lily"],
    ["images/05/gotobutiq01/meganmcblow040.jpg","","galleryscene17","Megan Changing Room Fun"],
    ["images/05/staylilyhome/hl13.jpg","","galleryscene18","Tequila Ria"],
    ["images/05/cafeliz/05lcafeliz12.jpg","","galleryscene19","Lizzy Titfuck"],
    ["images/05/beforeparty/beforeparty11.jpg","","galleryscene20","Kitchen Fantasy"],
    ["images/051/lovestory/lovestory128.jpg","","galleryscene21","Gina Fuckbuddy"],
    ["images/051/partyangel/partyangel04.jpg","","galleryscene22","Angel In Restroom"],
    ["images/051/partylily/gowithlily15a.jpg","","galleryscene23","Lily In Restroom"],
    ["images/052/thomasoffice/corrup/5242a.jpg","","galleryscene24", "Seducing Mr.Thomas"]
]
define galleryDict2 = [
["images/051/lovestory/lovestory178.jpg","","galleryscene25","Love Story"],
["images/054/riagohomeaftertho/6316.jpg","","galleryscene26","Looking for Lily?"],
["images/054/visitdaniel2/danielsex1/6199.jpg","","galleryscene27","Stronger Relationship?"]
]


default persistent.gallerynamechange = False
label gallerynote:
    scene black
    show text "WARNING: CONTAINS SPOILERS."
    pause (5.0)
    hide text
    label galleryname:
    scene black
    if not persistent.gallerynamechange:
        $ persistent.galleryname = renpy.input("Enter your name:").strip()
        if persistent.galleryname == "":
            $ persistent.galleryname = "Ted"
        $ persistent.gallerynamechange = True
        return
    else:
        return

label galleryrename:
    scene black
    $ persistent.galleryname = renpy.input("Enter your name:").strip()
    if persistent.galleryname == "":
        $ persistent.galleryname = "Ted"
    $ persistent.gallerynamechange = True
    return

screen gallerymodnavigation():
    add "#000"
    add "gui/main_menu.png" alpha 0.2
    hbox:
        xalign 0.5
        ypos 40
        spacing 30
        hbox:
            spacing -5
            text "R"  at delayed_blink(0.0, 2.0) outlines [(3, "#000")] color "#fff" size 80 style "LHeading"
            text "e" at delayed_blink(0.1, 2.0) outlines [(3, "#000")] color "#fff" size 80 style "LHeading"
            text "p" at delayed_blink(0.2, 2.0) outlines [(3, "#000")] color "#fff" size 80 style "LHeading"
            text "l" at delayed_blink(0.3, 2.0) outlines [(3, "#000")] color "#fff" size 80 style "LHeading"
            text "a" at delayed_blink(0.4, 2.0) outlines [(3, "#000")] color "#fff" size 80 style "LHeading"
            text "y" at delayed_blink(0.5, 2.0) outlines [(3, "#000")] color "#fff" size 80 style "LHeading"
        hbox:
            spacing -5
            text "G" at delayed_blink(1.0, 2.0) outlines [(3, "#000")] color "#fff" size 80 style "LHeading"
            text "a" at delayed_blink(1.1, 2.0) outlines [(3, "#000")] color "#fff" size 80 style "LHeading"
            text "l" at delayed_blink(1.2, 2.0) outlines [(3, "#000")] color "#fff" size 80 style "LHeading"
            text "l" at delayed_blink(1.3, 2.0) outlines [(3, "#000")] color "#fff" size 80 style "LHeading"
            text "e" at delayed_blink(1.4, 2.0) outlines [(3, "#000")] color "#fff" size 80 style "LHeading"
            text "r" at delayed_blink(1.5, 2.0) outlines [(3, "#000")] color "#fff" size 80 style "LHeading"
            text "y" at delayed_blink(1.6, 2.0) outlines [(3, "#000")] color "#fff" size 80 style "LHeading"

    textbutton "Return" text_outlines [(2, "#000")] text_color "#fff" text_hover_color "#005b7a" xalign 0.08 yalign 0.02 action Return()
    textbutton "Change Name" text_outlines [(2, "#000")] text_color "#fff" text_hover_color "#005b7a" xalign 0.9 yalign 0.02 action [ui.callsinnewcontext("galleryrename")]


screen gallerymod():
    tag menu
    use gallerymodnavigation
    $ ttr = GetTooltip()
    textbutton "Next Page" text_outlines [(2, "#000")] text_color "#fff" text_hover_color "#005b7a" xalign 0.9 yalign 0.9 action ShowMenu("gallerymod1")
    vpgrid:
        cols 4
        ypos 180
        xalign 0.5
        xspacing 50
        yspacing 25
        draggable True
        mousewheel True
        # scrollbars "vertical"
        for a in galleryDict:
            frame:
                if not ttr == a[0]:
                    background None
                fixed:
                    xysize(384, 216)
                    imagebutton:
                        idle Transform(im.Blur(a[0], 10), zoom=0.2)
                        hover Transform(a[0], zoom=0.2)
                        tooltip a[0]
                        action Replay(a[2], scope={"mc":persistent.galleryname}, locked=False)
                    if ttr == a[0]:
                        text "{}".format(a[3]):
                            outlines [(2, "#000")]
                            xcenter 0.5
                            ycenter 0.5

screen gallerymod1():
    tag menu
    use gallerymodnavigation
    $ ttr = GetTooltip()
    textbutton "Next Page" text_outlines [(2, "#000")] text_color "#fff" text_hover_color "#005b7a" xalign 0.9 yalign 0.9 action ShowMenu("gallerymod2")
    # textbutton "Next Page" text_outlines [(2, "#000")] text_color "#fff" text_hover_color "#005b7a" xalign 0.9 yalign 0.9 action ShowMenu("gallerymod1")
    vpgrid:
        cols 4
        ypos 180
        xalign 0.5
        xspacing 50
        yspacing 25
        draggable True
        mousewheel True
        # scrollbars "vertical"
        for a in galleryDict1:
            frame:
                if not ttr == a[0]:
                    background None
                fixed:
                    xysize(384, 216)
                    imagebutton:
                        idle Transform(im.Blur(a[0], 10), zoom=0.2)
                        hover Transform(a[0], zoom=0.2)
                        tooltip a[0]
                        action Replay(a[2], scope={"mc":persistent.galleryname}, locked=False)
                    if ttr == a[0]:
                        text "{}".format(a[3]):
                            outlines [(2, "#000")]
                            xcenter 0.5
                            ycenter 0.5

style LHeading:
    font "slheading.ttf"
    color "#ff8c00"
    size 85


screen gallerymod2():
    tag menu
    use gallerymodnavigation
    $ ttr = GetTooltip()

    # textbutton "Next Page" text_outlines [(2, "#000")] text_color "#fff" text_hover_color "#005b7a" xalign 0.9 yalign 0.9 action ShowMenu("gallerymod1")
    vpgrid:
        cols 4
        ypos 180
        xalign 0.5
        xspacing 50
        yspacing 25
        draggable True
        mousewheel True
        # scrollbars "vertical"
        for a in galleryDict2:
            frame:
                if not ttr == a[0]:
                    background None
                fixed:
                    xysize(384, 216)
                    imagebutton:
                        idle Transform(im.Blur(a[0], 10), zoom=0.2)
                        hover Transform(a[0], zoom=0.2)
                        tooltip a[0]
                        action Replay(a[2], scope={"mc":persistent.galleryname}, locked=False)
                    if ttr == a[0]:
                        text "{}".format(a[3]):
                            outlines [(2, "#000")]
                            xcenter 0.5
                            ycenter 0.5


screen navigation():

    vbox:
        style_prefix "navigation"

        xpos gui.navigation_xpos
        yalign 0.5

        spacing gui.navigation_spacing

        if main_menu:

            textbutton _("Start") action Start()

        else:

            textbutton _("History") action ShowMenu("history")

            textbutton _("Characters") action ShowMenu("charinfo")

            textbutton _("Save") action ShowMenu("save")

        textbutton _("Load") action ShowMenu("load")

        textbutton "Gallery" action [ui.callsinnewcontext("galleryname"), ShowMenu("gallerymod")]

        textbutton _("Preferences") action ShowMenu("preferences")

        if _in_replay:

            textbutton _("End Replay") action EndReplay(confirm=True)

        elif not main_menu:

            textbutton _("Main Menu") action MainMenu()


        if renpy.variant("pc") or (renpy.variant("web") and not renpy.variant("mobile")):

            ## Help isn't necessary or relevant to mobile devices.
            textbutton _("Help") action ShowMenu("help")

        if renpy.variant("pc"):

            ## The quit button is banned on iOS and unnecessary on Android and
            ## Web.
            textbutton _("Quit") action Quit(confirm=not main_menu)

        textbutton(""):
            area(-20, 50, 300, 150)
            background "gui/button/patreon.png"
            hover_background "gui/button/patreon1.png"

            action OpenURL("https://www.patreon.com/intensivecaregames")
