################################################################################
## Initialization
################################################################################

init offset = -1

$ quick_menu = True
$ suppress_overlay = False
################################################################################
## Styles
################################################################################

style default:
    properties gui.text_properties()
    language gui.language

style input:
    properties gui.text_properties("input", accent=True)
    adjust_spacing False

style hyperlink_text:
    properties gui.text_properties("hyperlink", accent=True)
    hover_underline True

style gui_text:
    properties gui.text_properties("interface")


style button:
    properties gui.button_properties("button")

style button_text is gui_text:
    properties gui.text_properties("button")
    yalign 0.5


style label_text is gui_text:
    properties gui.text_properties("label", accent=True)

style prompt_text is gui_text:
    properties gui.text_properties("prompt")


style bar:
    ysize gui.bar_size
    left_bar Frame("gui/bar/left.png", gui.bar_borders, tile=gui.bar_tile)
    right_bar Frame("gui/bar/right.png", gui.bar_borders, tile=gui.bar_tile)

style vbar:
    xsize gui.bar_size
    top_bar Frame("gui/bar/top.png", gui.vbar_borders, tile=gui.bar_tile)
    bottom_bar Frame("gui/bar/bottom.png", gui.vbar_borders, tile=gui.bar_tile)

style scrollbar:
    ysize gui.scrollbar_size
    base_bar Frame("gui/scrollbar/horizontal_[prefix_]bar.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)
    thumb Frame("gui/scrollbar/horizontal_[prefix_]thumb.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)

style vscrollbar:
    xsize gui.scrollbar_size
    base_bar Frame("gui/scrollbar/vertical_[prefix_]bar.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile)
    thumb Frame("gui/scrollbar/vertical_[prefix_]thumb.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile)

style slider:
    ysize gui.slider_size
    base_bar Frame("gui/slider/horizontal_[prefix_]bar.png", gui.slider_borders, tile=gui.slider_tile)
    thumb "gui/slider/horizontal_[prefix_]thumb.png"

style vslider:
    xsize gui.slider_size
    base_bar Frame("gui/slider/vertical_[prefix_]bar.png", gui.vslider_borders, tile=gui.slider_tile)
    thumb "gui/slider/vertical_[prefix_]thumb.png"


style frame:
    padding gui.frame_borders.padding
    background Frame("gui/frame.png", gui.frame_borders, tile=gui.frame_tile)



################################################################################
## In-game screens
################################################################################


## Say screen ##################################################################
##
## The say screen is used to display dialogue to the player. It takes two
## parameters, who and what, which are the name of the speaking character and
## the text to be displayed, respectively. (The who parameter can be None if no
## name is given.)
##
## This screen must create a text displayable with id "what", as Ren'Py uses
## this to manage text display. It can also create displayables with id "who"
## and id "window" to apply style properties.
##
## https://www.renpy.org/doc/html/screen_special.html#say

screen say(who, what):
    style_prefix "say"

    window:
        id "window"
        if what != "" and what != None:
            background Transform(Image("gui/faces/textboxb.png", xalign=0.5, yalign=1.0), alpha=persistent.opacity1)

        if who is not None:

            window:
                id "namebox"
                style "namebox"
                text who id "who"

        text what id "what" size persistent.mytext_size


    ## If there's a side image, display it above the text. Do not display on the
    ## phone variant - there's no room.
    if not renpy.variant("small") and what != "" and what != None and persistent.opacity3 >= 0.099:
        add Transform(SideImage(), alpha=persistent.opacity3) xalign 0.01 yalign 0.98 #DLD Side



## Make the namebox available for styling through the Character object.
init python:
    config.character_id_prefixes.append('namebox')

style window is default
style say_label is default
style say_dialogue is default
style say_thought is say_dialogue

style namebox is default
style namebox_label is say_label


style window:
    xalign 0.5
    xfill True
    yalign gui.textbox_yalign
    ysize gui.textbox_height

    background Image("gui/textbox.png", xalign=0.5, yalign=1.0)

style namebox:
    xpos gui.name_xpos
    xanchor gui.name_xalign
    xsize gui.namebox_width
    ypos gui.name_ypos
    ysize gui.namebox_height

    background Frame("gui/namebox.png", gui.namebox_borders, tile=gui.namebox_tile, xalign=gui.name_xalign)
    padding gui.namebox_borders.padding

style say_label:
    properties gui.text_properties("name", accent=True)
    xalign gui.name_xalign
    yalign 0.5

style say_dialogue:
    properties gui.text_properties("dialogue")

    xpos gui.dialogue_xpos
    xsize gui.dialogue_width
    ypos gui.dialogue_ypos

style block1_multiple2_say_window:
    yalign 0.78

style block2_multiple2_say_window:
    yalign 1.0

style block1_multiple3_say_window:
    yalign 0.56

style block2_multiple3_say_window:
    yalign 0.78

style block3_multiple3_say_window:
    yalign 1.0

## Input screen ################################################################
##
## This screen is used to display renpy.input. The prompt parameter is used to
## pass a text prompt in.
##
## This screen must create an input displayable with id "input" to accept the
## various input parameters.
##
## https://www.renpy.org/doc/html/screen_special.html#input

screen input(prompt):
    style_prefix "input"

    window:
        background Transform(Image("gui/faces/textboxb.png", xalign=0.5, yalign=1.0), alpha=persistent.opacity1)

        vbox:
            xalign gui.dialogue_text_xalign
            xpos gui.dialogue_xpos
            xsize gui.dialogue_width
            ypos gui.dialogue_ypos

            text prompt style "input_prompt"
            input id "input"

style input_prompt is default

style input_prompt:
    xalign gui.dialogue_text_xalign
    properties gui.text_properties("input_prompt")

style input:
    xalign gui.dialogue_text_xalign
    xmaximum gui.dialogue_width


## Choice screen ###############################################################
##
## This screen is used to display the in-game choices presented by the menu
## statement. The one parameter, items, is a list of objects, each with caption
## and action fields.
##
## https://www.renpy.org/doc/html/screen_special.html#choice

screen choice(items):
    style_prefix "choice"

    vbox:
        for i in items:
            textbutton i.caption action i.action background Transform(Image("gui/textboxch4.png", xalign=0.0, yalign=1.0), alpha=persistent.opacity2)


## When this is true, menu captions will be spoken by the narrator. When false,
## menu captions will be displayed as empty buttons.
define config.narrator_menu = True


style choice_vbox is vbox
style choice_button is button
style choice_button_text is button_text

style choice_vbox:
    xalign 0.0        #default was 0.5
    ypos 405
    yanchor 0.5

    spacing gui.choice_spacing

style choice_button is default:
    properties gui.button_properties("choice_button")

style choice_button_text is default:
    properties gui.button_text_properties("choice_button")


## Quick Menu screen ###########################################################
##
## The quick menu is displayed in-game to provide easy access to the out-of-game
## menus.

screen quick_menu():

    # Bind Alt+Shift+M to toggle Quick Menu, set suppress_overlay to False no matter what

    key "alt_shift_K_m" action [ If(suppress_overlay, SetVariable('quick_menu', True ), If(quick_menu, SetVariable('quick_menu', False ), SetVariable('quick_menu', True ))), SetVariable('suppress_overlay', False ) ]

    zorder 100
    if quick_menu:
        hbox:
            style_prefix "quick"
            xalign 1.0
            yalign 1.0
            textbutton _("◀-|") action Rollback() xpos -40
            textbutton _("▶▶") action Skip() alternate Skip(fast=True, confirm=True) xpos -30
            if _preferences.afm_enable:
                textbutton _("a ■") action Preference("auto-forward", "disable") xpos -20 # display stop button when enabled
            else :
                textbutton _("a ▶") action Preference("auto-forward", "enable") xpos -20 # display play button when disabled
            textbutton ("▼") action If(renpy.get_screen("say"), HideInterface(), None) xoffset -10
        hbox:
            style_prefix "quick"
            xalign 0.0025
            yalign 1.0
            textbutton _("Hist") action ShowMenu('history')
            textbutton _("Save") action ShowMenu('save')
            textbutton _("Load") action ShowMenu('load')
            textbutton _("Q.S") action QuickSave()
            textbutton _("Q.L") action QuickLoad()
            textbutton _("Prefs") action ShowMenu('preferences')
            textbutton _("Stats") action (ui.callsinnewcontext("phshow_stats_menu"))
            textbutton _("Save Name") action (ui.callsinnewcontext("phsave_name"))

## This code ensures that the quick_menu screen is displayed in-game, whenever
## the player has not explicitly hidden the interface.
init python:
    config.overlay_screens.append("quick_menu")

default quick_menu = True

style quick_button is default
style quick_button_text is button_text

style quick_button:
    properties gui.button_properties("quick_button")

style quick_button_text:
    properties gui.button_text_properties("quick_button")


################################################################################
## Main and Game Menu Screens
################################################################################

## Navigation screen ###########################################################
##
## This screen is included in the main and game menus, and provides navigation
## to other menus, and to start the game.

screen navigation():

    vbox:
        style_prefix "navigation"

        xpos gui.navigation_xpos
        yalign 0.5

        spacing gui.navigation_spacing

        if main_menu:

            textbutton _("Start") action Start()
            if not _in_replay: #DLD start any episode
                textbutton _("Start Any Episode") action [ShowMenu("ph_advstart")]

        else:

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

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

            if not _in_replay:
                textbutton _("{size=30}Change MC Name") action ShowMenu("changemcname")
                textbutton _("Stats") action (ui.callsinnewcontext("phshow_stats_menu"))
                textbutton _("Save Name") action (ui.callsinnewcontext("phsave_name"))

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

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

        if not _in_replay:
            textbutton ("Gallery") action [ui.callsinnewcontext("ph_setupgal"), ShowMenu("GalleryStart")] #DLD change for new Gallery


        if _in_replay:

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

        elif not main_menu:

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

        textbutton _("About") action ShowMenu("about")

        if renpy.variant("pc"):

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

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


style navigation_button is gui_button
style navigation_button_text is gui_button_text

style navigation_button:
    size_group "navigation"
    properties gui.button_properties("navigation_button")

style navigation_button_text:
    properties gui.button_text_properties("navigation_button")


## Main Menu screen ############################################################
##
## Used to display the main menu when Ren'Py starts.
##
## https://www.renpy.org/doc/html/screen_special.html#main-menu

screen main_menu():

    ## This ensures that any other menu screen is replaced.
    tag menu

    style_prefix "main_menu"

    add gui.main_menu_background

    ## This empty frame darkens the main menu.
    frame:
        pass

    ## The use statement includes another screen inside this one. The actual
    ## contents of the main menu are in the navigation screen.
    use navigation

    if gui.show_name:

        vbox:
            text "[config.name!t]":
                style "main_menu_title"

            text "[config.version]":
                style "main_menu_version"


style main_menu_frame is empty
style main_menu_vbox is vbox
style main_menu_text is gui_text
style main_menu_title is main_menu_text
style main_menu_version is main_menu_text

style main_menu_frame:
    xsize 420
    yfill True

    background "gui/overlay/main_menu.png"

style main_menu_vbox:
    xalign 1.0
    xoffset -30
    xmaximum 1200
    yalign 1.0
    yoffset -30

style main_menu_text:
    properties gui.text_properties("main_menu", accent=True)

style main_menu_title:
    properties gui.text_properties("title")

style main_menu_version:
    properties gui.text_properties("version")


## Game Menu screen ############################################################
##
## This lays out the basic common structure of a game menu screen. It's called
## with the screen title, and displays the background, title, and navigation.
##
## The scroll parameter can be None, or one of "viewport" or "vpgrid". When
## this screen is intended to be used with one or more children, which are
## transcluded (placed) inside it.

screen game_menu(title, scroll=None, yinitial=0.0):

    style_prefix "game_menu"

    if main_menu:
        add gui.main_menu_background
    else:
        add gui.game_menu_background

    frame:
        style "game_menu_outer_frame"

        hbox:

            ## Reserve space for the navigation section.
            frame:
                style "game_menu_navigation_frame"

            frame:
                style "game_menu_content_frame"

                if scroll == "viewport":

                    viewport:
                        yinitial yinitial
                        scrollbars "vertical"
                        mousewheel True
                        draggable True

                        side_yfill True

                        vbox:
                            transclude

                elif scroll == "vpgrid":

                    vpgrid:
                        cols 1
                        yinitial yinitial

                        scrollbars "vertical"
                        mousewheel True
                        draggable True

                        side_yfill True

                        transclude

                else:

                    transclude

    use navigation

    textbutton _("Return"):
        style "return_button"

        action Return()

    label title

    if main_menu:
        key "game_menu" action ShowMenu("main_menu")


style game_menu_outer_frame is empty
style game_menu_navigation_frame is empty
style game_menu_content_frame is empty
style game_menu_viewport is gui_viewport
style game_menu_side is gui_side
style game_menu_scrollbar is gui_vscrollbar

style game_menu_label is gui_label
style game_menu_label_text is gui_label_text

style return_button is navigation_button
style return_button_text is navigation_button_text

style game_menu_outer_frame:
    bottom_padding 45
    top_padding 180

    background "gui/overlay/game_menu.png"

style game_menu_navigation_frame:
    xsize 420
    yfill True

style game_menu_content_frame:
    left_margin 60
    right_margin 30
    top_margin 15

style game_menu_viewport:
    xsize 1380

style game_menu_vscrollbar:
    unscrollable gui.unscrollable

style game_menu_side:
    spacing 15

style game_menu_label:
    xpos 75
    ysize 180

style game_menu_label_text:
    size gui.title_text_size
    color gui.accent_color
    yalign 0.5

style return_button:
    xpos gui.navigation_xpos
    yalign 1.0
    yoffset -45


## About screen ################################################################
##
## This screen gives credit and copyright information about the game and Ren'Py.
##
## There's nothing special about this screen, and hence it also serves as an
## example of how to make a custom screen.

screen about():

    tag menu

    ## This use statement includes the game_menu screen inside this one. The
    ## vbox child is then included inside the viewport inside the game_menu
    ## screen.
    use game_menu(_("About"), scroll="viewport"):

        style_prefix "about"

        vbox:

            label "[config.name!t]"
            text _("Version [config.version!t]\n")

            ## gui.about is usually set in options.rpy.
            if gui.about:
                text "[gui.about!t]\n"

            text _("Made with {a=https://www.renpy.org/}Ren'Py{/a} [renpy.version_only].\n\n[renpy.license!t]")


## This is redefined in options.rpy to add text to the about screen.
define gui.about = ""


style about_label is gui_label
style about_label_text is gui_label_text
style about_text is gui_text

style about_label_text:
    size gui.label_text_size


## Load and Save screens #######################################################
##
## These screens are responsible for letting the player save the game and load
## it again. Since they share nearly everything in common, both are implemented
## in terms of a third screen, file_slots.
##
## https://www.renpy.org/doc/html/screen_special.html#save https://
## www.renpy.org/doc/html/screen_special.html#load

screen save():

    tag menu

    use file_slotsb(_("Save"))


screen load():

    tag menu

    use file_slots(_("Load"))


screen phgamenamescreen:

    tag menu

    add "gui/hbox.jpg":
         xalign 0.5
         yalign 0.5
    hbox:
        label _("{size=30}Save Name:"):
            xpos(670)
            ypos 530

        input:
            default save_name
            length 29
            xpos(680)
            ypos 530



screen file_slots(title):

    default page_name_value = FilePageNameInputValue(pattern=_("Page {}"), auto=_("Automatic saves"), quick=_("Quick saves"))

    use game_menu(title):

        fixed:

            ## This ensures the input will get the enter event before any of the
            ## buttons do.
            order_reverse True

            ## The page name, which can be edited by clicking on a button.
            button:
                style "page_label"

                key_events True
                xalign 0.5
                action page_name_value.Toggle()

                input:
                    style "page_label_text"
                    value page_name_value

            ## The grid of file slots.
            grid gui.file_slot_cols gui.file_slot_rows:
                style_prefix "slot"

                xalign 0.5
                yalign 0.5

                spacing gui.slot_spacing

                for i in range(gui.file_slot_cols * gui.file_slot_rows):

                    $ slot = i + 1

                    button:
                        action FileAction(slot)

                        has vbox

                        add FileScreenshot(slot) xalign 0.5

                        text FileTime(slot, format=_("{#file_time}%A, %B %d %Y, %H:%M"), empty=_("empty slot")):
                            style "slot_time_text"

                        text FileSaveName(slot):
                            style "slot_name_text"

                        key "save_delete" action FileDelete(slot)

            ## Buttons to access other pages.
            hbox:
                style_prefix "page"

                xalign 0.5
                yalign 1.0

                spacing gui.page_spacing

                textbutton _("<<") action [ui.callsinnewcontext("ph_pageback10")]
                textbutton _("<") action FilePagePrevious()

                if config.has_autosave:
                    textbutton _("{#auto_page}A") action FilePage("auto")

                if config.has_quicksave:
                    textbutton _("{#quick_page}Q") action FilePage("quick")

                ## range(1, 10) gives the numbers from 1 to 9.
                if persistent._file_page.isdigit() and int(persistent._file_page) > 9:
                    for page in range((int(int(persistent._file_page)/10)*10), (int(int(persistent._file_page)/10)*10)+10 ):
                        textbutton "[page]" action FilePage(page)
                else:
                    for page in range(1, 10):
                        textbutton "[page]" action FilePage(page)

                textbutton _(">") action FilePageNext()
                textbutton _(">>") action [ui.callsinnewcontext("ph_pageup10")]

screen file_slotsb(title):

    default page_name_value = FilePageNameInputValue(pattern=_("Page {}"), auto=_("Automatic saves"), quick=_("Quick saves"))

    use game_menu(title):

        fixed:

            ## This ensures the input will get the enter event before any of the
            ## buttons do.
            order_reverse True

            ## The page name, which can be edited by clicking on a button.
            button:
                style "page_label"

                key_events True
                xalign 0.5
                action page_name_value.Toggle()

                input:
                    style "page_label_text"
                    value page_name_value

            ## The grid of file slots.
            grid gui.file_slot_cols gui.file_slot_rows:
                style_prefix "slot"

                xalign 0.5
                yalign 0.5

                spacing gui.slot_spacing

                for i in range(gui.file_slot_cols * gui.file_slot_rows):

                    $ slot = i + 1

                    button:
                        action [ui.callsinnewcontext("phsave_nameb"), FileAction(slot)]

                        has vbox

                        add FileScreenshot(slot) xalign 0.5

                        text FileTime(slot, format=_("{#file_time}%A, %B %d %Y, %H:%M"), empty=_("empty slot")):
                            style "slot_time_text"

                        text FileSaveName(slot):
                            style "slot_name_text"

                        key "save_delete" action FileDelete(slot)

            ## Buttons to access other pages.
            hbox:
                style_prefix "page"

                xalign 0.5
                yalign 1.0

                spacing gui.page_spacing

                textbutton _("<<") action [ui.callsinnewcontext("ph_pageback10")]
                textbutton _("<") action FilePagePrevious()

                if config.has_autosave:
                    textbutton _("{#auto_page}A") action FilePage("auto")

                if config.has_quicksave:
                    textbutton _("{#quick_page}Q") action FilePage("quick")

                ## range(1, 10) gives the numbers from 1 to 9.
                if persistent._file_page.isdigit() and int(persistent._file_page) > 9:
                    for page in range((int(int(persistent._file_page)/10)*10), (int(int(persistent._file_page)/10)*10)+10 ):
                        textbutton "[page]" action FilePage(page)
                else:
                    for page in range(1, 10):
                        textbutton "[page]" action FilePage(page)

                textbutton _(">") action FilePageNext()
                textbutton _(">>") action [ui.callsinnewcontext("ph_pageup10")]


style page_label is gui_label
style page_label_text is gui_label_text
style page_button is gui_button
style page_button_text is gui_button_text

style slot_button is gui_button
style slot_button_text is gui_button_text
style slot_time_text is slot_button_text
style slot_name_text is slot_button_text

style page_label:
    xpadding 75
    ypadding 5

style page_label_text:
    text_align 0.5
    layout "subtitle"
    hover_color gui.hover_color

style page_button:
    properties gui.button_properties("page_button")

style page_button_text:
    properties gui.button_text_properties("page_button")

style slot_button:
    properties gui.button_properties("slot_button")

style slot_button_text:
    properties gui.button_text_properties("slot_button")


## Preferences screen ##########################################################
##
## The preferences screen allows the player to configure the game to better suit
## themselves.
##
## https://www.renpy.org/doc/html/screen_special.html#preferences

screen preferences():

    tag menu

    use game_menu(_("Preferences"), scroll="viewport"):

        vbox:

            hbox:
                box_wrap True

                if renpy.variant("pc"):

                    vbox:
                        style_prefix "radio"
                        label _("Display")
                        textbutton _("Window") action Preference("display", "window")
                        textbutton _("Fullscreen") action Preference("display", "fullscreen")
                        text ""
                        label _("Ask For\nSave Name")
                        textbutton _("[persistent.phnameatsave]") action [ui.callsinnewcontext("phsave_toggle")]

                vbox:
                    style_prefix "radio"
                    label _("Rollback Side")
                    textbutton _("Disable") action Preference("rollback side", "disable")
                    textbutton _("Left") action Preference("rollback side", "left")
                    textbutton _("Right") action Preference("rollback side", "right")

                vbox:
                    style_prefix "check"
                    label _("Skip")
                    textbutton _("Unseen Text") action Preference("skip", "toggle")
                    textbutton _("After Choices") action Preference("after choices", "toggle")
                    textbutton _("Transitions") action InvertSelected(Preference("transitions", "toggle"))

                vbox:
                    label _("Transparency")
                    $ opacity1 = persistent.opacity1 * 100
                    $ opacity2 = persistent.opacity2 * 100
                    $ opacity3 = persistent.opacity3 * 100

                    label _("{size=30}Dialog [opacity1:.0f]%") text_layout "nobreak"
                    bar value FieldValue(persistent, "opacity1", range=1.0, style="slider") xsize 300
                    label _("{size=30}Choice [opacity2:.0f]%") text_layout "nobreak"
                    bar value FieldValue(persistent, "opacity2", range=1.0, style="slider") xsize 300
                    label _("{size=30}Side Image [opacity3:.0f]%") text_layout "nobreak"
                    bar value FieldValue(persistent, "opacity3", range=1.0, style="slider") xsize 300
                    text "{size=10} "
                    label _("Text Size {size=[persistent.mytext_size]}[persistent.mytext_size]") text_layout "nobreak"
                    bar value FieldValue(persistent, "mytext_size", range=50, offset=10, style="slider") xsize 300
                    textbutton _("Reset") action [SetVariable("persistent.mytext_size", 30),SetVariable("persistent.opacity1", 0.85),SetVariable("persistent.opacity2", 0.85),SetVariable("persistent.opacity3", 1.0)]
                vbox:
                    style_prefix "pref"
                    label _("Language")
                    textbutton "English" action Language(None)
                    textbutton "Spanish" action Language("spanish")

            null height (4 * gui.pref_spacing)

            hbox:
                style_prefix "slider"
                box_wrap True

                vbox:

                    label _("Text Speed")

                    bar value Preference("text speed")

                    label _("Auto-Forward Time")

                    bar value Preference("auto-forward time")

                vbox:

                    if config.has_music:
                        label _("Music Volume")

                        hbox:
                            bar value Preference("music volume")

                    if config.has_sound:

                        label _("Sound Volume")

                        hbox:
                            bar value Preference("sound volume")

                            if config.sample_sound:
                                textbutton _("Test") action Play("sound", config.sample_sound)


                    if config.has_voice:
                        label _("Voice Volume")

                        hbox:
                            bar value Preference("voice volume")

                            if config.sample_voice:
                                textbutton _("Test") action Play("voice", config.sample_voice)

                    if config.has_music or config.has_sound or config.has_voice:
                        null height gui.pref_spacing

                        textbutton _("Mute All"):
                            action Preference("all mute", "toggle")
                            style "mute_all_button"


style pref_label is gui_label
style pref_label_text is gui_label_text
style pref_vbox is vbox

style radio_label is pref_label
style radio_label_text is pref_label_text
style radio_button is gui_button
style radio_button_text is gui_button_text
style radio_vbox is pref_vbox

style check_label is pref_label
style check_label_text is pref_label_text
style check_button is gui_button
style check_button_text is gui_button_text
style check_vbox is pref_vbox

style slider_label is pref_label
style slider_label_text is pref_label_text
style slider_slider is gui_slider
style slider_button is gui_button
style slider_button_text is gui_button_text
style slider_pref_vbox is pref_vbox

style mute_all_button is check_button
style mute_all_button_text is check_button_text

style pref_label:
    top_margin gui.pref_spacing
    bottom_margin 3

style pref_label_text:
    yalign 1.0

style pref_vbox:
    xsize 338

style radio_vbox:
    spacing gui.pref_button_spacing

style radio_button:
    properties gui.button_properties("radio_button")
    foreground "gui/button/check_[prefix_]foreground.png"

style radio_button_text:
    properties gui.button_text_properties("radio_button")

style check_vbox:
    spacing gui.pref_button_spacing

style check_button:
    properties gui.button_properties("check_button")
    foreground "gui/button/check_[prefix_]foreground.png"

style check_button_text:
    properties gui.button_text_properties("check_button")

style slider_slider:
    xsize 525

style slider_button:
    properties gui.button_properties("slider_button")
    yalign 0.5
    left_margin 15

style slider_button_text:
    properties gui.button_text_properties("slider_button")

style slider_vbox:
    xsize 675


## History screen ##############################################################
##
## This is a screen that displays the dialogue history to the player. While
## there isn't anything special about this screen, it does have to access the
## dialogue history stored in _history_list.
##
## https://www.renpy.org/doc/html/history.html

screen history():

    tag menu

    ## Avoid predicting this screen, as it can be very large.
    predict False

    use game_menu(_("History"), scroll=("vpgrid" if gui.history_height else "viewport"), yinitial=1.0):

        style_prefix "history"

        for h in _history_list:

            window:

                ## This lays things out properly if history_height is None.
                has fixed:
                    yfit True

                if h.who:

                    label h.who:
                        style "history_name"

                        ## Take the color of the who text from the Character, if
                        ## set.
                        if "color" in h.who_args:
                            text_color h.who_args["color"]

                $ what = renpy.filter_text_tags(h.what, allow=gui.history_allow_tags)
                text what

        if not _history_list:
            label _("The dialogue history is empty.")


## This determines what tags are allowed to be displayed on the history screen.

define gui.history_allow_tags = set()


style history_window is empty

style history_name is gui_label
style history_name_text is gui_label_text
style history_text is gui_text

style history_text is gui_text

style history_label is gui_label
style history_label_text is gui_label_text

style history_window:
    xfill True
    ysize gui.history_height

style history_name:
    xpos gui.history_name_xpos
    xanchor gui.history_name_xalign
    ypos gui.history_name_ypos
    xsize gui.history_name_width

style history_name_text:
    min_width gui.history_name_width
    text_align gui.history_name_xalign

style history_text:
    xpos gui.history_text_xpos
    ypos gui.history_text_ypos
    xanchor gui.history_text_xalign
    xsize gui.history_text_width
    min_width gui.history_text_width
    text_align gui.history_text_xalign
    layout ("subtitle" if gui.history_text_xalign else "tex")

style history_label:
    xfill True

style history_label_text:
    xalign 0.5


## Help screen #################################################################
##
## A screen that gives information about key and mouse bindings. It uses other
## screens (keyboard_help, mouse_help, and gamepad_help) to display the actual
## help.

screen help():

    tag menu

    default device = "keyboard"

    use game_menu(_("Help"), scroll="viewport"):

        style_prefix "help"

        vbox:
            spacing 23

            hbox:

                textbutton _("Keyboard") action SetScreenVariable("device", "keyboard")
                textbutton _("Mouse") action SetScreenVariable("device", "mouse")

                if GamepadExists():
                    textbutton _("Gamepad") action SetScreenVariable("device", "gamepad")

            if device == "keyboard":
                use keyboard_help
            elif device == "mouse":
                use mouse_help
            elif device == "gamepad":
                use gamepad_help


screen keyboard_help():
    hbox:
        label _("Enter")
        text _("Advances dialogue and activates the interface.")
    hbox:
        label _("Space")
        text _("Advances dialogue without selecting choices.")
    hbox:
        label _("Arrow Keys")
        text _("Navigate the interface.")
    hbox:
        label _("Escape")
        text _("Accesses the game menu.")
    hbox:
        label _("Ctrl")
        text _("Skips dialogue while held down.")
    hbox:
        label _("Tab")
        text _("Toggles dialogue skipping.")
    hbox:
        label _("Page Up")
        text _("Rolls back to earlier dialogue.")
    hbox:
        label _("Page Down")
        text _("Rolls forward to later dialogue.")
    hbox:
        label "H"
        text _("Hides the user interface.")
    hbox:
        label "S"
        text _("Takes a screenshot.")
    hbox:
        label "V"
        text _("Toggles assistive {a=https://www.renpy.org/l/voicing}self-voicing{/a}.")
    hbox:
        label "Alt+Shift+M"
        text _("Toggles quick menu.")

screen mouse_help():

    hbox:
        label _("Left Click")
        text _("Advances dialogue and activates the interface.")

    hbox:
        label _("Middle Click")
        text _("Hides the user interface.")

    hbox:
        label _("Right Click")
        text _("Accesses the game menu.")

    hbox:
        label _("Mouse Wheel Up\nClick Rollback Side")
        text _("Rolls back to earlier dialogue.")

    hbox:
        label _("Mouse Wheel Down")
        text _("Rolls forward to later dialogue.")


screen gamepad_help():

    hbox:
        label _("Right Trigger\nA/Bottom Button")
        text _("Advances dialogue and activates the interface.")

    hbox:
        label _("Left Trigger\nLeft Shoulder")
        text _("Rolls back to earlier dialogue.")

    hbox:
        label _("Right Shoulder")
        text _("Rolls forward to later dialogue.")


    hbox:
        label _("D-Pad, Sticks")
        text _("Navigate the interface.")

    hbox:
        label _("Start, Guide")
        text _("Accesses the game menu.")

    hbox:
        label _("Y/Top Button")
        text _("Hides the user interface.")

    textbutton _("Calibrate") action GamepadCalibrate()


style help_button is gui_button
style help_button_text is gui_button_text
style help_label is gui_label
style help_label_text is gui_label_text
style help_text is gui_text

style help_button:
    properties gui.button_properties("help_button")
    xmargin 12

style help_button_text:
    properties gui.button_text_properties("help_button")

style help_label:
    xsize 375
    right_padding 30

style help_label_text:
    size gui.text_size
    xalign 1.0
    text_align 1.0



################################################################################
## Additional screens
################################################################################


## Confirm screen ##############################################################
##
## The confirm screen is called when Ren'Py wants to ask the player a yes or no
## question.
##
## https://www.renpy.org/doc/html/screen_special.html#confirm

screen confirm(message, yes_action, no_action):

    ## Ensure other screens do not get input while this screen is displayed.
    modal True

    zorder 200

    style_prefix "confirm"

    add "gui/overlay/confirm.png"

    frame:

        vbox:
            xalign .5
            yalign .5
            spacing 45

            label _(message):
                style "confirm_prompt"
                xalign 0.5

            hbox:
                xalign 0.5
                spacing 150

                textbutton _("Yes") action yes_action
                textbutton _("No") action no_action

    ## Right-click and escape answer "no".
    key "game_menu" action no_action


style confirm_frame is gui_frame
style confirm_prompt is gui_prompt
style confirm_prompt_text is gui_prompt_text
style confirm_button is gui_medium_button
style confirm_button_text is gui_medium_button_text

style confirm_frame:
    background Frame([ "gui/confirm_frame.png", "gui/frame.png"], gui.confirm_frame_borders, tile=gui.frame_tile)
    padding gui.confirm_frame_borders.padding
    xalign .5
    yalign .5

style confirm_prompt_text:
    text_align 0.5
    layout "subtitle"

style confirm_button:
    properties gui.button_properties("confirm_button")

style confirm_button_text:
    properties gui.button_text_properties("confirm_button")


## Skip indicator screen #######################################################
##
## The skip_indicator screen is displayed to indicate that skipping is in
## progress.
##
## https://www.renpy.org/doc/html/screen_special.html#skip-indicator

screen skip_indicator():

    zorder 100
    style_prefix "skip"

    frame:

        hbox:
            spacing 9

            text _("Skipping")

            text "▸" at delayed_blink(0.0, 1.0) style "skip_triangle"
            text "▸" at delayed_blink(0.2, 1.0) style "skip_triangle"
            text "▸" at delayed_blink(0.4, 1.0) style "skip_triangle"


## This transform is used to blink the arrows one after another.
transform delayed_blink(delay, cycle):
    alpha .5

    pause delay

    block:
        linear .2 alpha 1.0
        pause .2
        linear .2 alpha 0.5
        pause (cycle - .4)
        repeat


style skip_frame is empty
style skip_text is gui_text
style skip_triangle is skip_text

style skip_frame:
    ypos gui.skip_ypos
    background Frame("gui/skip.png", gui.skip_frame_borders, tile=gui.frame_tile)
    padding gui.skip_frame_borders.padding

style skip_text:
    size gui.notify_text_size

style skip_triangle:
    ## We have to use a font that has the BLACK RIGHT-POINTING SMALL TRIANGLE
    ## glyph in it.
    font "DejaVuSans.ttf"


## Notify screen ###############################################################
##
## The notify screen is used to show the player a message. (For example, when
## the game is quicksaved or a screenshot has been taken.)
##
## https://www.renpy.org/doc/html/screen_special.html#notify-screen

screen notify(message):

    zorder 100
    style_prefix "notify"

    frame at notify_appear:
        text "[message!tq]"

    timer 3.25 action Hide('notify')


transform notify_appear:
    on show:
        alpha 0
        linear .25 alpha 1.0
    on hide:
        linear .5 alpha 0.0


style notify_frame is empty
style notify_text is gui_text

style notify_frame:
    ypos gui.notify_ypos

    background Frame("gui/notify.png", gui.notify_frame_borders, tile=gui.frame_tile)
    padding gui.notify_frame_borders.padding

style notify_text:
    properties gui.text_properties("notify")


## NVL screen ##################################################################
##
## This screen is used for NVL-mode dialogue and menus.
##
## https://www.renpy.org/doc/html/screen_special.html#nvl


screen nvl(dialogue, items=None):

    window:
        style "nvl_window"

        has vbox:
            spacing gui.nvl_spacing

        ## Displays dialogue in either a vpgrid or the vbox.
        if gui.nvl_height:

            vpgrid:
                cols 1
                yinitial 1.0

                use nvl_dialogue(dialogue)

        else:

            use nvl_dialogue(dialogue)

        ## Displays the menu, if given. The menu may be displayed incorrectly if
        ## config.narrator_menu is set to True, as it is above.
        for i in items:

            textbutton i.caption:
                action i.action
                style "nvl_button"

    if not renpy.variant("small") and what != "" and what != None and persistent.opacity3 >= 0.099:
        add Transform(SideImage(), alpha=persistent.opacity3) xalign 0.01 yalign 0.98 #DLD Side


screen nvl_dialogue(dialogue):

    for d in dialogue:

        window:
            id d.window_id

            fixed:
                yfit gui.nvl_height is None

                if d.who is not None:

                    text d.who:
                        id d.who_id

                text d.what:
                    id d.what_id


## This controls the maximum number of NVL-mode entries that can be displayed at
## once.
define config.nvl_list_length = gui.nvl_list_length

style nvl_window is default
style nvl_entry is default

style nvl_label is say_label
style nvl_dialogue is say_dialogue

style nvl_button is button
style nvl_button_text is button_text

style nvl_window:
    xfill True
    yfill True

    background "gui/nvl.png"
    padding gui.nvl_borders.padding

style nvl_entry:
    xfill True
    ysize gui.nvl_height

style nvl_label:
    xpos gui.nvl_name_xpos
    xanchor gui.nvl_name_xalign
    ypos gui.nvl_name_ypos
    yanchor 0.0
    xsize gui.nvl_name_width
    min_width gui.nvl_name_width
    text_align gui.nvl_name_xalign

style nvl_dialogue:
    xpos gui.nvl_text_xpos
    xanchor gui.nvl_text_xalign
    ypos gui.nvl_text_ypos
    xsize gui.nvl_text_width
    min_width gui.nvl_text_width
    text_align gui.nvl_text_xalign
    layout ("subtitle" if gui.nvl_text_xalign else "tex")

style nvl_thought:
    xpos gui.nvl_thought_xpos
    xanchor gui.nvl_thought_xalign
    ypos gui.nvl_thought_ypos
    xsize gui.nvl_thought_width
    min_width gui.nvl_thought_width
    text_align gui.nvl_thought_xalign
    layout ("subtitle" if gui.nvl_text_xalign else "tex")

style nvl_button:
    properties gui.button_properties("nvl_button")
    xpos gui.nvl_button_xpos
    xanchor gui.nvl_button_xalign

style nvl_button_text:
    properties gui.button_text_properties("nvl_button")



################################################################################
## Mobile Variants
################################################################################

style pref_vbox:
    variant "medium"
    xsize 675

## Since a mouse may not be present, we replace the quick menu with a version
## that uses fewer and bigger buttons that are easier to touch.
screen quick_menu():
    variant "touch"

    zorder 100

    hbox:
        style_prefix "quick"

        xalign 0.5
        yalign 1.0

        textbutton _("Back") action Rollback()
        textbutton _("Skip") action Skip() alternate Skip(fast=True, confirm=True)
        textbutton _("Auto") action Preference("auto-forward", "toggle")
        textbutton _("Menu") action ShowMenu()


style window:
    variant "small"
    background "gui/phone/textbox.png"

style radio_button:
    variant "small"
    foreground "gui/phone/button/check_[prefix_]foreground.png"

style check_button:
    variant "small"
    foreground "gui/phone/button/check_[prefix_]foreground.png"

style nvl_window:
    variant "small"
    background "gui/phone/nvl.png"

style main_menu_frame:
    variant "small"
    background "gui/phone/overlay/main_menu.png"

style game_menu_outer_frame:
    variant "small"
    background "gui/phone/overlay/game_menu.png"

style game_menu_navigation_frame:
    variant "small"
    xsize 510

style game_menu_content_frame:
    variant "small"
    top_margin 0

style pref_vbox:
    variant "small"
    xsize 600

style bar:
    variant "small"
    ysize gui.bar_size
    left_bar Frame("gui/phone/bar/left.png", gui.bar_borders, tile=gui.bar_tile)
    right_bar Frame("gui/phone/bar/right.png", gui.bar_borders, tile=gui.bar_tile)

style vbar:
    variant "small"
    xsize gui.bar_size
    top_bar Frame("gui/phone/bar/top.png", gui.vbar_borders, tile=gui.bar_tile)
    bottom_bar Frame("gui/phone/bar/bottom.png", gui.vbar_borders, tile=gui.bar_tile)

style scrollbar:
    variant "small"
    ysize gui.scrollbar_size
    base_bar Frame("gui/phone/scrollbar/horizontal_[prefix_]bar.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)
    thumb Frame("gui/phone/scrollbar/horizontal_[prefix_]thumb.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)

style vscrollbar:
    variant "small"
    xsize gui.scrollbar_size
    base_bar Frame("gui/phone/scrollbar/vertical_[prefix_]bar.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile)
    thumb Frame("gui/phone/scrollbar/vertical_[prefix_]thumb.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile)

style slider:
    variant "small"
    ysize gui.slider_size
    base_bar Frame("gui/phone/slider/horizontal_[prefix_]bar.png", gui.slider_borders, tile=gui.slider_tile)
    thumb "gui/phone/slider/horizontal_[prefix_]thumb.png"

style vslider:
    variant "small"
    xsize gui.slider_size
    base_bar Frame("gui/phone/slider/vertical_[prefix_]bar.png", gui.vslider_borders, tile=gui.slider_tile)
    thumb "gui/phone/slider/vertical_[prefix_]thumb.png"

style slider_pref_vbox:
    variant "small"
    xsize None

style slider_pref_slider:
    variant "small"
    xsize 900

#############################################################################
#######   STATS Screen - Stat Debug Screen                            #######
##############GIMP###########################################################

screen button:
#    if Stats_Screen:
        vbox xalign 0.1 yalign 0.1:
            textbutton "Stats" action ui.callsinnewcontext("aff_screen_label")
            # you can also use an image button:
#            imagebutton:
#                idle "button_idle.png"
#                hover "button_hover.png"
#                action ui.callsinnewcontext("aff_screen_label")

screen aff_screen:
    frame:
        has vbox
        text "Monica Relationship:      [Monica] points"
        text "Monica Lust:                    [MonicaL] points"
        text "Jenna Relationship:       [Jenna] points"
        text "Jenna Lust:                [JennaL] points"
        text "Katie Relationship:       [Katie] points"
        text "Katie Lust:                  [KatieL] points"
        text "Zarah Relationship:       [Zarah] points"
        text "Zarah Lust:                  [ZarahL] points"
        text "Jolina Relationship:      [Jolina] points"
        text "Jolina Lust:                    [JolinaL] points"
        text "Debbie Relationship:       [Debbie] points"
        text "Debbie Lust:                [DebbieL] points"
        text "Lily Relationship:       [Lily] points"
        text "Lily Lust:                  [LilyL] points"
        text "Angel Relationship:       [Angel] points"
        text "Angel Lust:                  [AngelL] points"
        text "Wanda Control:              [Wanda] points"

        textbutton "Return" action Return()

label aff_screen_label:
    call screen aff_screen
    return

################Use for bars instead of points
#screen aff_screen:
#    frame:
#        has vbox
#        hbox:
#            label "Bob: " xminimum 100
#            bar range bob_max value bob_points xmaximum 400
#        hbox:
#            label "Larry: " xminimum 100
#            bar range larry_max value larry_points xmaximum 400
#        textbutton "Return" action Return()
#
#label aff_screen_label:
#    call screen aff_screen
#    return

#############################################################################
#######   STATS Screen - Episode 2                                    #######
##############GIMP###########################################################

label Day1_screen_label:
    window hide
    $MonicaSTM=19
    $MonicaLSTM=16
    $KatieSTM=15
    $KatieLSTM=7
    $JennaSTM=20
    $JennaLSTM=4
    $ZarahSTM=4
    $ZarahLSTM=19
    call screen EpAll_screen
    return

#############################################################################
#######   STATS Screen - Episode 3                                    #######
##############GIMP###########################################################

label Ep3_screen_label:
    $EpisodeOn=3
    window hide
    $MonicaSTM=23
    $MonicaLSTM= 28
    $KatieSTM= 21
    $KatieLSTM= 14
    $JennaSTM= 25
    $JennaLSTM= 10
    $ZarahSTM= 4
    $ZarahLSTM= 21
    $JolinaSTM= 1
    $JolinaLSTM= 10
    $DebbieSTM= 1
    $LilySTM= 1
    call screen EpAll_screen
    return

#############################################################################
#######   STATS Screen - Episode 4                                    #######
##############GIMP###########################################################

label Ep4_screen_label:
    window hide
    $EpisodeOn=4
    $JolinaSTM= 1
    $JolinaLSTM= 10
    $MonicaSTM=23
    $MonicaLSTM= 37
    $KatieSTM=24
    $KatieLSTM= 22
    $JennaSTM= 30
    $JennaLSTM= 16
    $ZarahSTM= 11
    $ZarahLSTM= 26
    $DebbieSTM= 6
    $DebbieLSTM= 8
    $LilySTM= 3
    $LilyLSTM= 2
    call screen EpAll_screen
    return

#############################################################################
#######   STATS Screen - Episode 5                                    #######
##############GIMP###########################################################

label Ep5_screen_label:
    window hide
    $EpisodeOn=5
    $JolinaSTM= 1
    $JolinaLSTM= 10
    $JennaSTM= 30
    $JennaLSTM= 16
    $ZarahSTM= 11
    $ZarahLSTM= 26
    $DebbieSTM= 6
    $DebbieLSTM= 8
    $LilySTM= 3
    $LilyLSTM= 2
    $MonicaSTM= 46
    $MonicaLSTM= 65
    $KatieSTM= 32
    $KatieLSTM= 31
    $AngelSTM= 11
    $AngelLSTM= 11
    $WandaSTM= 17
    call screen EpAll_screen
    return

#############################################################################
#######   STATS Screen - Episode 6                                    #######
##############GIMP###########################################################

label Ep6_screen_label:
    window hide
    $EpisodeOn=6
    $JolinaSTM= 1
    $JolinaLSTM= 10
    $DebbieSTM= 6
    $DebbieLSTM= 8
    $LilySTM= 3
    $LilyLSTM= 2
    $MonicaSTM= 60
    $MonicaLSTM= 76
    $KatieSTM= 39
    $KatieLSTM= 42
    $JennaSTM= 45
    $JennaLSTM= 32
    $ZarahSTM= 20
    $ZarahLSTM= 42
    $AngelSTM= 15
    $AngelLSTM= 14
    $WandaSTM= 22
    call screen EpAll_screen
    return

#############################################################################
#######   STATS Screen - Episode 7                                    #######
##############GIMP###########################################################

label Ep7_screen_label:
    window hide
    $EpisodeOn=7
    $JolinaSTM= 1
    $JolinaLSTM= 10
    $ZarahSTM= 20
    $ZarahLSTM= 42
    $AngelSTM= 15
    $AngelLSTM= 14
    $WandaSTM= 22
    $MonicaSTM= 69
    $MonicaLSTM= 83
    $KatieSTM= 59
    $KatieLSTM= 60
    $JennaSTM= 48
    $JennaLSTM= 34
    $DebbieSTM=18
    $DebbieLSTM= 23
    $LilySTM= 7
    $LilyLSTM= 2
    $BellaSTM= 4
    call screen EpAll_screen
    return

#############################################################################
#######   STATS Screen - Episode 8                                    #######
##############GIMP###########################################################

label Ep8_screen_label:
    window hide
    $EpisodeOn=8
    $JolinaSTM= 1
    $JolinaLSTM= 10
    $ZarahSTM= 20
    $ZarahLSTM= 42
    $AngelSTM= 15
    $AngelLSTM= 14
    $WandaSTM= 22
    $MonicaSTM= 69
    $MonicaLSTM= 83
    $JennaSTM= 48
    $JennaLSTM= 34
    $BellaSTM= 4

    $KatieSTM= 88
    $KatieLSTM= 85
    $DebbieSTM= 33
    $DebbieLSTM= 29
    $LilySTM= 25
    $LilyLSTM= 13
    $SammySTM= 11
    $NatashaSTM= 19
    call screen EpAll_screen
    return

#############################################################################
#######   STATS Screen - Episode 9                                    #######
##############GIMP###########################################################

label Ep9_screen_label:
    window hide
    $EpisodeOn=9
    $SammySTM= 11
    $NatashaSTM= 19
    $JolinaSTM= 1
    $JolinaLSTM= 10
    $ZarahSTM= 20
    $ZarahLSTM= 42
    $AngelSTM= 15
    $AngelLSTM= 14
    $WandaSTM= 22
    $DebbieSTM= 33
    $DebbieLSTM= 29
    $LilySTM= 25
    $LilyLSTM= 13
    $MonicaSTM= 81
    $MonicaLSTM= 104
    $KatieSTM= 103
    $KatieLSTM= 101
    $JennaSTM= 77
    $JennaLSTM= 61
    $BellaSTM= 21
    $BellaLSTM= 31
    call screen EpAll_screen
    return

#############################################################################
#######   STATS Screen - Episode 10                                    #######
##############GIMP###########################################################

label Ep10_screen_label:
    window hide
    $EpisodeOn=10
    $SammySTM= 11
    $NatashaSTM= 19
    $ZarahSTM= 20
    $ZarahLSTM= 42
    $WandaSTM= 22
    $DebbieSTM= 33
    $DebbieLSTM= 29
    $BellaSTM= 21
    $BellaLSTM= 31
    $MonicaSTM= 115
    $MonicaLSTM= 124
    $JennaSTM= 100
    $JennaLSTM= 83
    $KatieSTM=113
    $KatieLSTM= 106
    $AngelSTM= 45
    $AngelLSTM= 39
    $JolinaSTM= 21
    $JolinaLSTM= 21
    $LilySTM= 60
    $LilyLSTM= 42
    call screen EpAll_screen
    return

#############################################################################
#######   STATS Screen - Episode 11                                   #######
##############GIMP###########################################################

label Ep11_screen_label:
    window hide
    $EpisodeOn=11
    $SammySTM= 11
    $NatashaSTM= 19
    $WandaSTM= 22
    $DebbieSTM= 33
    $DebbieLSTM= 29
    $BellaSTM= 21
    $BellaLSTM= 31
    $JolinaSTM= 21
    $JolinaLSTM= 21
    $LilySTM= 60
    $LilyLSTM= 42
    $MonicaSTM= 163
    $MonicaLSTM= 148
    $JennaSTM= 121
    $JennaLSTM= 110
    $KatieSTM= 145
    $KatieLSTM= 125
    $AngelSTM= 64
    $AngelLSTM= 52
    $ZarahSTM= 52
    $ZarahLSTM= 70
    call screen EpAll_screen
    return

#############################################################################
#######   STATS Screen - Episode 12                                   #######
##############GIMP###########################################################

label Ep12_screen_label:
    $EpisodeOn=12
    window hide
    $SammySTM= 11
    $NatashaSTM= 19
    $WandaSTM= 22
    $MonicaSTM= 163
    $MonicaLSTM= 148
    $AngelSTM= 64
    $AngelLSTM= 52
    $ZarahSTM= 52
    $ZarahLSTM= 70
    $JennaSTM= 137
    $JennaLSTM= 120
    $KatieSTM= 159
    $KatieLSTM= 149
    $JolinaSTM= 37
    $JolinaLSTM= 35
    $DebbieSTM= 59
    $DebbieLSTM= 64
    $LilySTM= 72
    $LilyLSTM= 63
    $ElaineSTM= 61
    $ElaineLSTM= 37
    $BellaSTM= 53
    $BellaLSTM= 56
    call screen EpAll_screen
    return


#############################################################################
#######   STATS Screen - Episode 13                                   #######
##############GIMP###########################################################

label Ep13_screen_label:
    $EpisodeOn=13
    window hide
    $SammySTM= 11
    $NatashaSTM= 19
    $ZarahSTM= 52
    $ZarahLSTM= 70
    $JolinaSTM= 37
    $JolinaLSTM= 35
    $BellaSTM= 53
    $BellaLSTM= 56
    $MonicaSTM= 178
    $MonicaLSTM= 163
    $JennaSTM= 138
    $JennaLSTM= 121
    $KatieSTM= 179
    $KatieLSTM= 175
    $DebbieSTM= 68
    $DebbieLSTM= 80
    $LilySTM= 103
    $LilyLSTM= 92
    $ElaineSTM= 96
    $ElaineLSTM= 74
    $AngelSTM= 107
    $AngelLSTM= 94
    $WandaSTM= 24
    call screen EpAll_screen
    return

#############################################################################
#######   STATS Screen - Episode 14                                   #######
##############GIMP###########################################################

label Ep14_screen_label:
    $EpisodeOn=14
    window hide
    $SammySTM= 11
    $NatashaSTM= 19
    $ZarahSTM= 52
    $ZarahLSTM= 70
    $DebbieSTM= 68
    $DebbieLSTM= 80
    $LilySTM= 103
    $LilyLSTM= 92
    $AngelSTM= 107
    $AngelLSTM= 94
    $WandaSTM= 24
    $MonicaSTM= 194
    $MonicaLSTM= 172
    $JennaSTM= 191
    $JennaLSTM= 163
    $KatieSTM= 180
    $KatieLSTM= 176
    $ElaineSTM= 142
    $ElaineLSTM= 107
    $BellaSTM= 62
    $BellaLSTM= 56
    $JolinaSTM= 107
    $JolinaLSTM= 63
    call screen EpAll_screen
    return

#############################################################################
#######   STATS Screen - Episode 15                                   #######
##############GIMP###########################################################

label Ep15_screen_label:
    $EpisodeOn=15
    window hide
    $SammySTM= 11
    $NatashaSTM= 19
    $DebbieSTM= 68
    $DebbieLSTM= 80
    $LilySTM= 103
    $LilyLSTM= 92
    $ElaineSTM= 142
    $ElaineLSTM= 107
    $BellaSTM= 62
    $BellaLSTM= 56
    $JolinaSTM= 107
    $JolinaLSTM= 63
    $MonicaSTM= 442
    $MonicaLSTM= 0
    $JennaSTM= 380
    $JennaLSTM= 0
    $KatieSTM= 241
    $KatieLSTM= 204
    $ZarahSTM= 72
    $ZarahLSTM= 87
    $AngelSTM= 155
    $AngelLSTM= 110
    $WandaSTM= 68
    call screen EpAll_screen
    return

#############################################################################
#######   STATS Screen - Episode 16                                   #######
##############GIMP###########################################################

label Ep16_screen_label:
    $EpisodeOn=16
    window hide
    $SammySTM= 11
    $NatashaSTM= 19
    $LilySTM= 103
    $LilyLSTM= 92
    $MonicaSTM= 442
    $MonicaLSTM= 0
    $ZarahSTM= 71
    $ZarahLSTM= 87
    $AngelSTM= 155
    $AngelLSTM= 110
    $WandaSTM= 68
    $JennaSTM= 395
    $JennaLSTM= 0
    $KatieSTM= 455
    $KatieLSTM= 0
    $DebbieSTM= 132
    $DebbieLSTM= 133
    $ElaineSTM= 185
    $ElaineLSTM= 144
    $BellaSTM= 97
    $BellaLSTM= 98
    $JolinaSTM= 182
    $JolinaLSTM= 108
    $TheresaSTM= 36
    call screen EpAll_screen
    return

#############################################################################
#######   STATS Screen - Episode 17                                   #######
##############GIMP###########################################################

label Ep17_screen_label:
    $EpisodeOn=17
    window hide
    $AngelSTM= 155
    $AngelLSTM= 110
    $BellaSTM= 146
    $BellaLSTM= 106
    $DebbieSTM= 132
    $DebbieLSTM= 133
    $ElaineSTM= 224
    $ElaineLSTM= 179
    $JennaSTM= 474
    $JennaLSTM= 170
    $JolinaSTM= 202
    $JolinaLSTM= 117
    $KatieSTM= 515
    $KatieLSTM= 204
    $LilySTM= 211
    $LilyLSTM= 148
    $MonicaSTM= 485
    $MonicaLSTM= 183
    $NatashaSTM= 19
    $SammySTM= 11
    $TheresaSTM= 36
    $WandaSTM= 68
    $ZarahSTM= 71
    $ZarahLSTM= 87
    call screen EpAll_screen
    return

#############################################################################
#######   STATS Screen - Episode 18                                   #######
##############GIMP###########################################################

label Ep18_screen_label:
    $EpisodeOn=18
    window hide
    $AngelSTM= 155
    $AngelLSTM= 110
    $BellaSTM= 146
    $BellaLSTM= 106
    $DebbieSTM= 153
    $DebbieLSTM= 154
    $ElaineSTM= 224
    $ElaineLSTM= 179
    $JennaSTM= 474
    $JennaLSTM= 170
    $JolinaSTM= 202
    $JolinaLSTM= 117
    $KatieSTM= 544
    $KatieLSTM= 204
    $LilySTM= 239
    $LilyLSTM= 153
    $MonicaSTM= 591
    $MonicaLSTM= 183
    $NatashaSTM= 19
    $SammySTM= 11
    $TheresaSTM= 100
    $WandaSTM= 68
    $ZarahSTM= 131
    $ZarahLSTM= 140
    call screen EpAll_screen
    return

############################################################################
#######   STATS Screen - Episode 19                                   #######
##############GIMP###########################################################

label Ep19_screen_label:
    $EpisodeOn=19
    window hide
    $AngelSTM= 155
    $AngelLSTM= 110
    $BellaSTM= 204
    $BellaLSTM= 129
    $DebbieSTM= 229
    $DebbieLSTM= 198
    $ElaineSTM= 266
    $ElaineLSTM= 218
    $JennaSTM= 482
    $JennaLSTM= 170
    $JolinaSTM= 202
    $JolinaLSTM= 117
    $KatieSTM= 613
    $KatieLSTM= 204
    $LilySTM= 290
    $LilyLSTM= 180
    $MonicaSTM= 591
    $MonicaLSTM= 183
    $NatashaSTM= 19
    $SammySTM= 11
    $TheresaSTM= 100
    $WandaSTM= 136
    $ZarahSTM= 131
    $ZarahLSTM= 140
    call screen EpAll_screen
    return



label phshow_stats_menu:

    if EpisodeOn <= 2:
        call Day1_screen_label from _call_Day1_screen_label_1
    if EpisodeOn > 2:
        call expression "Ep"+str(EpisodeOn)+"_screen_label" from _call_expression
    return

style phtext: #Ep16_screenph
    font "ComicHelvetic_Heavy.otf"
    outlines [ (2, "#000") ]

screen EpAll_screen: #Ep16_screenph

    add "Gui/Stats.jpg":
        xpos 298
        ypos 155
    vbox:
        xalign 0.5
        ypos 90
        text "{=phtext}{size=40}{color=#003399}Stats for Episode [EpisodeOn]{/size}" outlines [ (absolute(2), "#FFFFFF")]
    vbox:
        xpos 380
        ypos 300
        text "{=phtext}{color=#c8ffc8}Angel" outlines [ (absolute(2), "#FF0000")]
        text "{size=18}"
        text "{=phtext}{color=#a22a10}Bella" outlines [ (absolute(2), "#FFFFFF")]
        text "{size=18}"
        text "{=phtext}{color=#b5287f}Debbie" outlines [ (absolute(2), "#FFFFFF")]
        text "{size=18}"
        text "{=phtext}{color=#c8ffc8}Elaine" outlines [ (absolute(2), "#0000FF")]
        text "{size=18}"
        text "{=phtext}{color=#fda948}Jenna" outlines [ (absolute(2), "#AA00FF")]
        text "{size=18}"
        text "{=phtext}{color=#927e74}Jolina" outlines [ (absolute(2), "#FFFFFF")]
        text "{size=18}"
        text "{=phtext}{color=#9f8fcc}Katie" outlines [ (absolute(2), "#FFFFFF")]
        text "{size=18}"
        text "{=phtext}{color=#588ebd}Lily" outlines [ (absolute(2), "#FFFFFF")]
        text "{size=18}"
        text "{=phtext}{color=#e12421}Monica" outlines [ (absolute(2), "#FFFFFF")]
    vbox:
        xpos 565
        ypos 300
        if AngelSTM <= 0:
            text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        else:
            text "{=phtext}{color=#c8ffc8}[Angel] / [AngelSTM]" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        text "{size=18}"
        if BellaSTM <= 0:
            text "{=phtext}{color=#a22a10}" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        else:
            text "{=phtext}{color=#a22a10}[Bella] / [BellaSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        if DebbieSTM <= 0:
            text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        else:
            text "{=phtext}{color=#b5287f}[Debbie] / [DebbieSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        if ElaineSTM <= 0:
            text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        else:
            text "{=phtext}{color=#c8ffc8}[Elaine] / [ElaineSTM]" outlines [ (absolute(2), "#0000FF")] xalign 0.5
        text "{size=18}"
        if JennaSTM <= 0:
            text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        else:
            text "{=phtext}{color=#fda948}[Jenna] / [JennaSTM]" outlines [ (absolute(2), "#AA00FF")] xalign 0.5
        text "{size=18}"
        if JolinaSTM <= 0:
            text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        else:
            text "{=phtext}{color=#927e74}[Jolina] / [JolinaSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        if KatieSTM <= 0:
            text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        else:
            text "{=phtext}{color=#9f8fcc}[Katie] / [KatieSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        if LilySTM <= 0:
            text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        else:
            text "{=phtext}{color=#588ebd}[Lily] / [LilySTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        if MonicaSTM <= 0:
            text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        else:
            text "{=phtext}{color=#e12421}[Monica] / [MonicaSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{=phtext}{color=#000000}1000 / 1000" outlines [ (absolute(2), "#000000")] xalign 0.5
    vbox:
        xpos 765
        ypos 300
        if AngelLSTM <= 0:
            text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        else:
            text "{=phtext}{color=#c8ffc8}[AngelL] / [AngelLSTM]" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        text "{size=18}"
        if BellaLSTM <= 0:
            text "{=phtext}{color=#a22a10}" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        else:
            text "{=phtext}{color=#a22a10}[BellaL] / [BellaLSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        if DebbieLSTM <= 0:
            text "{=phtext}{color=#b5287f}" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        else:
            text "{=phtext}{color=#b5287f}[DebbieL] / [DebbieLSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        if ElaineLSTM <= 0:
            text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#0000FF")] xalign 0.5
        else:
            text "{=phtext}{color=#c8ffc8}[ElaineL] / [ElaineLSTM]" outlines [ (absolute(2), "#0000FF")] xalign 0.5
        text "{size=18}"
        if JennaLSTM <= 0:
            text "{=phtext}{color=#fda948}" outlines [ (absolute(2), "#AA00FF")] xalign 0.5
        else:
            text "{=phtext}{color=#fda948}[JennaL] / [JennaLSTM]" outlines [ (absolute(2), "#AA00FF")] xalign 0.5
        text "{size=18}"
        if JolinaLSTM <= 0:
            text "{=phtext}{color=#927e74}" outlines [ (absolute(2), "#FFFFFF")]
        else:
            text "{=phtext}{color=#927e74}[JolinaL] / [JolinaLSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        if KatieLSTM <= 0:
            text "{=phtext}{color=#9f8fcc}" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        else:
            text "{=phtext}{color=#9f8fcc}[KatieL] / [KatieLSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        if LilyLSTM <= 0:
            text "{=phtext}{color=#588ebd}" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        else:
            text "{=phtext}{color=#588ebd}[LilyL] / [LilyLSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        if MonicaLSTM <= 0:
            text "{=phtext}{color=#e12421}" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        else:
            text "{=phtext}{color=#e12421}[MonicaL] / [MonicaLSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        text "{=phtext}{color=#b5287f}" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{=phtext}{color=#000000}1000 / 1000" outlines [ (absolute(2), "#000000")] xalign 0.5
    vbox:
        xpos 1020
        ypos 300
        text "{=phtext}{color=#b5287f}Wanda" outlines [ (absolute(2), "#FFFFFF")]
        text "{size=18}"
        text "{=phtext}{color=#939941}Zarah" outlines [ (absolute(2), "#FFFFFF")]
        text "{size=18}"
        text ""
        text "{size=18}"
        text ""
        text "{size=18}"
        text ""
        text "{size=18}"
        text ""
        text "{=phtext}{size=18}"
        text "{=phtext}{color=#a22a10}Natasha" outlines [ (absolute(2), "#FFFFFF")]
        text "{size=18}"
        text "{=phtext}{color=#588ebd}Sammy" outlines [ (absolute(2), "#FFFFFF")]
        text "{size=18}"
        text "{=phtext}{color=#c8ffc8}Theresa" outlines [ (absolute(2), "#AA00FF")]
    vbox:
        xpos 1190
        ypos 300
        if WandaSTM <= 0:
            text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        else:
            text "{=phtext}{color=#b5287f}[Wanda] / [WandaSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        if ZarahSTM <= 0:
            text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        else:
            text "{=phtext}{color=#939941}[Zarah] / [ZarahSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        text ""
        text "{size=18}"
        text ""
        text "{size=18}"
        text ""
        text "{size=18}"
        text ""
        text "{=phtext}{size=18}"
        if NatashaSTM <= 0:
            text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        else:
            text "{=phtext}{color=#a22a10}[Natasha] / [NatashaSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        if SammySTM <= 0:
            text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        else:
            text "{=phtext}{color=#588ebd}[Sammy] / [SammySTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        if TheresaSTM <= 0:
            text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        else:
            text "{=phtext}{color=#c8ffc8}[Theresa] / [TheresaSTM]" outlines [ (absolute(2), "#AA00FF")] xalign 0.5
        text "{=phtext}{color=#000000}1000 / 1000" outlines [ (absolute(2), "#000000")] xalign 0.5
    vbox:
        xpos 1380
        ypos 300
        text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#FF0000")] xalign 0.5
        text "{size=18}"
        if ZarahLSTM <= 0:
            text "{=phtext}" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        else:
            text "{=phtext}{color=#939941}[ZarahL] / [ZarahLSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        text ""
        text "{size=18}"
        text ""
        text "{size=18}"
        text ""
        text "{size=18}"
        text ""
        text "{=phtext}{size=18}"
        if NatashaLSTM > 0:
            text "{=phtext}{color=#a22a10}[NatashaL] / [NatashaLSTM]" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        else:
            text "{=phtext}{color=#a22a10}" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        text "{=phtext}{color=#588ebd}" outlines [ (absolute(2), "#FFFFFF")] xalign 0.5
        text "{size=18}"
        text "{=phtext}{color=#c8ffc8}" outlines [ (absolute(2), "#AA00FF")] xalign 0.5
        text "{=phtext}{color=#000000}1000 / 1000" outlines [ (absolute(2), "#000000")] xalign 0.5
    vbox:
        xalign 0.5
        ypos 800
        textbutton "{size=40}Continue{/size}" action Return()

label changemcname:
    $player_name = renpy.input("Please enter your Name (Maximum 10 characters)") #(See change AFTER screen advancement!)",player_name.strip(),length=10)
    $player_name = player_name.strip()
    if player_name == "":
        "No name entered.  Your name will default to NoName"
        $player_name="NoName"
    return
    $MC = player_name

label phsave_toggle:
    if persistent.phnameatsave == "Off":
        $persistent.phnameatsave = "On"
    else:
        $persistent.phnameatsave = "Off"
    python:
        style.rebuild()
    return

label phsave_name:
    call screen phgamenamescreen
    $save_name = _return
#    $save_name = renpy.input("Please enter save name:",save_name)
    return

label phsave_nameb:
    if persistent.phnameatsave == "On":
        call screen phgamenamescreen
        $save_name = _return
    return

label ph_pageup10:
    if persistent._file_page.isdigit():
        $persistent._file_page = str(int(persistent._file_page) + 10)
    else:
        $persistent._file_page = "10"
    python:
        renpy.restart_interaction()
    return

label ph_pageback10:
    if persistent._file_page.isdigit():
        if int(persistent._file_page) - 10 > 0:
            $persistent._file_page = str(int(persistent._file_page) - 10)
        else:
            $persistent._file_page = "1"
        python:
            renpy.restart_interaction()
    return


label ph_setmaxstats:
    $Monica = 194
    $MonicaL = 172
    $Jenna = 191
    $JennaL = 163
    $Katie = 180
    $KatieL =  176
    $Elaine =  142
    $ElaineL =  107
    $Bella =  62
    $BellaL =  56
    $Jolina =  107
    $JolinaL =  63
    $Debbie =  68
    $DebbieL =  80
    $Lily = 103
    $LilyL =  92
    $Angel =  107
    $AngelL =  94
    $Wanda =  24
    $Zarah =  71
    $ZarahL =  81
    return

############################################################################
#######                 Phalzyr Advanced Start                       #######
############################################################################
style mytextbutton:
    color gui.idle_color
    hover_color gui.hover_color

screen ph_advstart:

    tag menu

    use game_menu(_("{size=40}Start Any Episode"), scroll="viewport"):

        vbox:
            hbox:
                box_wrap True
                vbox:
                    xsize 600
                    text "{outlinecolor=#FFFFFF}{color=#0000AA}{size=40}General Options" outlines [ (absolute(1), "#000000")]
                    textbutton "{size=30}Player name: {color=#0099cc}[persistent.ph_skip_name]{/size}" action [ui.callsinnewcontext("ph_skip_name"), ShowMenu("ph_advstart")]
                    textbutton "{size=30}Episode to start at: {color=#0099cc}[ph_advstart_ept]{/size}" action [ui.callsinnewcontext("ph_toggleadvep"), ShowMenu("ph_advstart")]
                    null height 10
                    bar:
                        thumb "gui/slider/horizontal_idle_thumb.png"
                        value VariableValue("ph_advstart_ept",persistent.ph_advstart_ept-2,offset=2)
                        xysize (350,38)
                    text " "
                    text "{outlinecolor=#FFFFFF}{color=#0000AA}{size=30}Debbie (Help or not)" outlines [ (absolute(1), "#000000")]
                    if persistent.ph_advstart_d2 == 1:
                        textbutton _("{color=#00FF00}Help her with Lily (Lesb)") action [SetVariable("persistent.ph_advstart_d2",1), ShowMenu("ph_advstart")]
                    else:
                        textbutton _("Help her with Lily (Lesb)") text_style "mytextbutton" action [SetVariable("persistent.ph_advstart_d2",1), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_d2 == 2:
                        textbutton _("{color=#00FF00}Help her with Lily (3some)") action [SetVariable("persistent.ph_advstart_d2",2), ShowMenu("ph_advstart")]
                    else:
                        textbutton _("Help her with Lily (3some)") text_style "mytextbutton" action [SetVariable("persistent.ph_advstart_d2",2), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_d2 == 3:
                        textbutton _("{color=#00FF00}Help her with Lily (4some)") action [SetVariable("persistent.ph_advstart_d2",3), ShowMenu("ph_advstart")]
                    else:
                        textbutton _("Help her with Lily (4some)") text_style "mytextbutton" action [SetVariable("persistent.ph_advstart_d2",3), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_d2 == 4:
                        textbutton _("{color=#00FF00}Won't help her") action [SetVariable("persistent.ph_advstart_d2",4), ShowMenu("ph_advstart")]
                    else:
                        textbutton _("Won't help her") text_style "mytextbutton" action [SetVariable("persistent.ph_advstart_d2",4), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_d2 == 5:
                        textbutton _("{color=#00FF00}Want Debbie yourself") action [SetVariable("persistent.ph_advstart_d2",5), ShowMenu("ph_advstart")]
                    else:
                        textbutton _("Want Debbie yourself") text_style "mytextbutton" action [SetVariable("persistent.ph_advstart_d2",5), ShowMenu("ph_advstart")]
                    text " "
                    text "{outlinecolor=#FFFFFF}{color=#0000AA}{size=30}Katie (Change or not)" outlines [ (absolute(1), "#000000")]
                    if persistent.ph_advstart_k2 == 1:
                        textbutton _("{color=#00FF00}No Change") action [SetVariable("persistent.ph_advstart_k2",1), ShowMenu("ph_advstart")]
                    else:
                        textbutton _("No Change") text_style "mytextbutton" action [SetVariable("persistent.ph_advstart_k2",1), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_k2 == 2:
                        textbutton _("{color=#00FF00}Tone it down") action [SetVariable("persistent.ph_advstart_k2",2), ShowMenu("ph_advstart")]
                    else:
                        textbutton _("Tone it down") text_style "mytextbutton" action [SetVariable("persistent.ph_advstart_k2",2), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_k2 == 3:
                        textbutton _("{color=#00FF00}Change") action [SetVariable("persistent.ph_advstart_k2",3), ShowMenu("ph_advstart")]
                    else:
                        textbutton _("Change") text_style "mytextbutton" action [SetVariable("persistent.ph_advstart_k2",3), ShowMenu("ph_advstart")]
                vbox:
                    xsize 610
                    text "{outlinecolor=#FFFFFF}{color=#0000AA}{size=40}Relationships" outlines [ (absolute(1), "#000000")]
                    if persistent.ph_advstart_a == 1:
                        textbutton "{size=30}Angel:     {color=#0099cc}Romancing{/size}" action [ui.callsinnewcontext("ph_toggleadva"), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_a == 2:
                        textbutton "{size=30}Angel:     {color=#0099cc}Friendly{/size}" action [ui.callsinnewcontext("ph_toggleadva"),   ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_a == 3:
                        textbutton "{size=30}Angel:     {color=#0099cc}Neutral{/size}" action [ui.callsinnewcontext("ph_toggleadva"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_a == 4:
                        textbutton "{size=30}Angel:     {color=#0099cc}Broke Up{/size}" action [ui.callsinnewcontext("ph_toggleadva"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_b == 1:
                        textbutton "{size=30}Bella:     {color=#0099cc}Romancing (Serious){/size}" action [ui.callsinnewcontext("ph_toggleadvb"), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_b == 2:
                        textbutton "{size=30}Bella:     {color=#0099cc}Casual Sex{/size}" action [ui.callsinnewcontext("ph_toggleadvb"),   ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_b == 3:
                        textbutton "{size=30}Bella:     {color=#0099cc}Neutral{/size}" action [ui.callsinnewcontext("ph_toggleadvb"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_b == 4:
                        textbutton "{size=30}Bella:     {color=#0099cc}Rejected Her{/size}" action [ui.callsinnewcontext("ph_toggleadvb"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_c == 1:
                        textbutton "{size=30}Jolina:     {color=#0099cc}Romancing (Serious){/size}" action [ui.callsinnewcontext("ph_toggleadvc"), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_c == 2:
                        textbutton "{size=30}Jolina:     {color=#0099cc}Casual Sex{/size}" action [ui.callsinnewcontext("ph_toggleadvc"),   ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_c == 3:
                        textbutton "{size=30}Jolina:     {color=#0099cc}Neutral{/size}" action [ui.callsinnewcontext("ph_toggleadvc"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_c == 4:
                        textbutton "{size=30}Jolina:     {color=#0099cc}Broke Up{/size}" action [ui.callsinnewcontext("ph_toggleadvc"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_d == 1:
                        textbutton "{size=30}Debbie:     {color=#0099cc}Romancing{/size}" action [ui.callsinnewcontext("ph_toggleadvd"), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_d == 2:
                        textbutton "{size=30}Debbie:     {color=#0099cc}Friendly Break Up{/size}" action [ui.callsinnewcontext("ph_toggleadvd"),   ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_d == 3:
                        textbutton "{size=30}Debbie:     {color=#0099cc}Neutral{/size}" action [ui.callsinnewcontext("ph_toggleadvd"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_d == 4:
                        textbutton "{size=30}Debbie:     {color=#0099cc}Angry Break Up{/size}" action [ui.callsinnewcontext("ph_toggleadvd"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_e == 1:
                        textbutton "{size=30}Elaine:     {color=#0099cc}Romancing{/size}" action [ui.callsinnewcontext("ph_toggleadve"), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_e == 2:
                        textbutton "{size=30}Elaine:     {color=#0099cc}Friendly{/size}" action [ui.callsinnewcontext("ph_toggleadve"),   ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_e == 3:
                        textbutton "{size=30}Elaine:     {color=#0099cc}Guilt Path{/size}" action [ui.callsinnewcontext("ph_toggleadve"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_e == 4:
                        textbutton "{size=30}Elaine:     {color=#0099cc}Angry{/size}" action [ui.callsinnewcontext("ph_toggleadve"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_j == 1:
                        textbutton "{size=30}Jenna:     {color=#0099cc}Romancing (Love){/size}" action [ui.callsinnewcontext("ph_toggleadvj"), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_j == 2:
                        textbutton "{size=30}Jenna:     {color=#0099cc}Romancing (No Love){/size}" action [ui.callsinnewcontext("ph_toggleadvj"),   ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_j == 3:
                        textbutton "{size=30}Jenna:     {color=#0099cc}Neutral{/size}" action [ui.callsinnewcontext("ph_toggleadvj"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_j == 4:
                        textbutton "{size=30}Jenna:     {color=#0099cc}Broke Up{/size}" action [ui.callsinnewcontext("ph_toggleadvj"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_k == 1:
                        textbutton "{size=30}Katie:     {color=#0099cc}Romancing (Love){/size}" action [ui.callsinnewcontext("ph_toggleadvk"), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_k == 2:
                        textbutton "{size=30}Katie:     {color=#0099cc}Friends With Benefits{/size}" action [ui.callsinnewcontext("ph_toggleadvk"),   ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_k == 3:
                        textbutton "{size=30}Katie:     {color=#0099cc}Neutral{/size}" action [ui.callsinnewcontext("ph_toggleadvk"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_k == 4:
                        textbutton "{size=30}Katie:     {color=#0099cc}Broke Up{/size}" action [ui.callsinnewcontext("ph_toggleadvk"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_l == 1:
                        textbutton "{size=30}Lily:     {color=#0099cc}Romancing (Girlfriend){/size}" action [ui.callsinnewcontext("ph_toggleadvl"), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_l == 2:
                        textbutton "{size=30}Lily:     {color=#0099cc}Romancing (Casual Sex){/size}" action [ui.callsinnewcontext("ph_toggleadvl"),   ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_l == 3:
                        textbutton "{size=30}Lily:     {color=#0099cc}Friends{/size}" action [ui.callsinnewcontext("ph_toggleadvl"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_l == 4:
                        textbutton "{size=30}Lily:     {color=#0099cc}Not Friends{/size}" action [ui.callsinnewcontext("ph_toggleadvl"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_m == 1:
                        textbutton "{size=30}Monica:     {color=#0099cc}Romancing{/size}" action [ui.callsinnewcontext("ph_toggleadvm"), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_m == 2:
                        textbutton "{size=30}Monica:     {color=#0099cc}Friendly{/size}" action [ui.callsinnewcontext("ph_toggleadvm"),   ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_m == 3:
                        textbutton "{size=30}Monica:     {color=#0099cc}Neutral{/size}" action [ui.callsinnewcontext("ph_toggleadvm"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_m == 4:
                        textbutton "{size=30}Monica:     {color=#0099cc}Broke Up{/size}" action [ui.callsinnewcontext("ph_toggleadvm"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_n == 1:
                        textbutton "{size=30}Natasha:     {color=#0099cc}Fucked (Anal){/size}" action [ui.callsinnewcontext("ph_toggleadvn"), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_n == 2:
                        textbutton "{size=30}Natasha:     {color=#0099cc}Fucked (No Anal){/size}" action [ui.callsinnewcontext("ph_toggleadvn"),   ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_n == 3:
                        textbutton "{size=30}Natasha:     {color=#0099cc}Didn't Fuck{/size}" action [ui.callsinnewcontext("ph_toggleadvn"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_r == 1:
                        textbutton "{size=30}Roger:     {color=#0099cc}Full Revenge (Sammy){/size}" action [ui.callsinnewcontext("ph_toggleadvr"), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_r == 2:
                        textbutton "{size=30}Roger:     {color=#0099cc}No Sammy{/size}" action [ui.callsinnewcontext("ph_toggleadvr"),   ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_y == 1:
                        textbutton "{size=30}Theresa:     {color=#0099cc}Interested (Dom){/size}" action [ui.callsinnewcontext("ph_toggleadvy"), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_y == 2:
                        textbutton "{size=30}Theresa:     {color=#0099cc}Interested (Sub){/size}" action [ui.callsinnewcontext("ph_toggleadvy"), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_y >= 3:
                        textbutton "{size=30}Theresa:     {color=#0099cc}Not Interested{/size}" action [ui.callsinnewcontext("ph_toggleadvy"),   ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_w == 1:
                        textbutton "{size=30}Wanda:     {color=#0099cc}Sexual{/size}" action [ui.callsinnewcontext("ph_toggleadvw"), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_w >= 2:
                        textbutton "{size=30}Wanda:     {color=#0099cc}Neutral{/size}" action [ui.callsinnewcontext("ph_toggleadvw"),  ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_z == 1:
                        textbutton "{size=30}Zarah:     {color=#0099cc}Interested{/size}" action [ui.callsinnewcontext("ph_toggleadvz"), ShowMenu("ph_advstart")]
                    if persistent.ph_advstart_z >= 2:
                        textbutton "{size=30}Zarah:     {color=#0099cc}Not Interested{/size}" action [ui.callsinnewcontext("ph_toggleadvz"),   ShowMenu("ph_advstart")]
        vbox:
            ypos 30
            hbox:
                box_wrap True
                xsize 1200
                xalign 0.5
                null height 20
                textbutton _("{size=40}Start with above options!") action [ui.callsinnewcontext("ph_advstartset"), Start()]

label ph_advstartset:
    $persistent.ph_advstart_ep = ph_advstart_ept
    return

label ph_skip_name:
    $persistent.ph_skip_name = renpy.input("Please enter your Name (Maximum 10 characters)", persistent.ph_skip_name, length=10)
    $persistent.ph_skip_name = persistent.ph_skip_name.strip()
    if persistent.ph_skip_name == "":
        $persistent.ph_skip_name = "NoName"
    return

label ph_advexit:
    $persistent.ph_advstart_ep = 1
    return

label ph_toggleadvep: #ph_advstart_ept
    $ph_advstart_ept += 1
    if ph_advstart_ept > persistent.ph_advstart_ept:
        $ph_advstart_ept = 2
    return

label ph_toggleadva:
    $persistent.ph_advstart_a += 1
    if persistent.ph_advstart_a > 4:
        $persistent.ph_advstart_a = 1
    return

label ph_toggleadvb:
    $persistent.ph_advstart_b += 1
    if persistent.ph_advstart_b > 4:
        $persistent.ph_advstart_b = 1
    return

label ph_toggleadvc:
    $persistent.ph_advstart_c += 1
    if persistent.ph_advstart_c > 4:
        $persistent.ph_advstart_c = 1
    return

label ph_toggleadvd:
    $persistent.ph_advstart_d += 1
    if persistent.ph_advstart_d > 4:
        $persistent.ph_advstart_d = 1
    return

label ph_toggleadvd2:
    $persistent.ph_advstart_d += 1
    if persistent.ph_advstart_d > 5:
        $persistent.ph_advstart_d = 1
    return

label ph_toggleadve:
    $persistent.ph_advstart_e += 1
    if persistent.ph_advstart_e > 4:
        $persistent.ph_advstart_e = 1
    return

label ph_toggleadvj:
    $persistent.ph_advstart_j += 1
    if persistent.ph_advstart_j > 4:
        $persistent.ph_advstart_j = 1
    return

label ph_toggleadvk:
    $persistent.ph_advstart_k += 1
    if persistent.ph_advstart_k > 4:
        $persistent.ph_advstart_k = 1
    return

label ph_toggleadvl:
    $persistent.ph_advstart_l += 1
    if persistent.ph_advstart_l > 4:
        $persistent.ph_advstart_l = 1
    return

label ph_toggleadvm:
    $persistent.ph_advstart_m += 1
    if persistent.ph_advstart_m > 4:
        $persistent.ph_advstart_m = 1
    return

label ph_toggleadvn:
    $persistent.ph_advstart_n += 1
    if persistent.ph_advstart_n > 3:
        $persistent.ph_advstart_n = 1
    return

label ph_toggleadvr:
    $persistent.ph_advstart_r += 1
    if persistent.ph_advstart_r > 2:
        $persistent.ph_advstart_r = 1
    return

label ph_toggleadvw:
    $persistent.ph_advstart_w += 1
    if persistent.ph_advstart_w > 2:
        $persistent.ph_advstart_w = 1
    return

label ph_toggleadvy:
    $persistent.ph_advstart_y += 1
    if persistent.ph_advstart_y > 4:
        $persistent.ph_advstart_y = 1
    return

label ph_toggleadvz:
    $persistent.ph_advstart_z += 1
    if persistent.ph_advstart_z > 2:
        $persistent.ph_advstart_z = 1
    return

############################################################################
#######             END of Phalzyr Advanced Start                    #######
############################################################################

    style say_dialogue:
        color "#FFFFFF"
        outlines [ (absolute(2), "#000", absolute(1), absolute(1)) ]

    #########
    ## name box text outline
    style say_label:
        outlines [ (absolute(2), "#000", absolute(1), absolute(1)) ]

    #########
    ## input prompt text style
    style input_prompt:
        color "#FFFFFF"
        outlines [ (absolute(2), "#000", absolute(1), absolute(1)) ]

    #########
    ## input text style
    style input:
        color "#FFFFFF"
        outlines [ (absolute(2), "#000", absolute(1), absolute(1)) ]

    #########
    ## choice button text style
    style choice_button_text:
        idle_color "#FFFFFF"
        hover_color "#00FF00"
        insensitive_color "#808080"
        outlines [ (absolute(2), "#000", absolute(1), absolute(1)) ]

    #########
    ## quick menu button text style
    style quick_button_text:
        font "DejaVuSans.ttf"
        size 18
        idle_color "#8885"
        hover_color "#0F0F"
        insensitive_color "#4445"
        outlines [ (absolute(1), "#000A", absolute(0), absolute(0)) ]
        hover_outlines [ (absolute(1), "#000F", absolute(0), absolute(0)) ]

    #########
    ## text box background
    style window:
        background None

    #########
    ## name box background
    style namebox:
        background None

    #########
    ## choice button background
    style choice_button:
        background None

    #########
    ## enable quick menu
