screen choice(items):
    style_prefix "choice"
    vbox:
        spacing 10
        yalign 0.6
        for n, i in enumerate(items, 1):
            if n < 10:
                key str(n) action i.action
                key "K_KP" + str(n) action i.action
                textbutton str(n) + ". {b}{/b}" + i.caption action i.action


init -500 screen ingamepreferences():
    tag menu
    add gui.ingame_menu_settings

    imagebutton auto "gui/new/menus/back_%s.png" xpos 1475 ypos 940 focus_mask None action Return()
    imagebutton auto "gui/new/menus/off_%s.png" xpos 1600 ypos 225 focus_mask None action Preference("display", "window")
    imagebutton auto "gui/new/menus/off2_%s.png" xpos 1600 ypos 345 focus_mask None action Preference("skip", "seen")
    imagebutton auto "gui/new/menus/on_%s.png" xpos 1350 ypos 225 focus_mask None action Preference("display", "fullscreen")
    imagebutton auto "gui/new/menus/on2_%s.png" xpos 1350 ypos 345 focus_mask None action Preference("skip", "all")

    imagemap:
        ground "gui/new/menus/menu_settings.png"
        idle "gui/new/menus/menu_settings.png"
        hover "gui/new/menus/menu_settings_hover.png"
        selected_idle "gui/new/menus/menu_settings_hover.png"
        selected_hover "gui/new/menus/menu_settings_selected_hover.png"
        hotbar (1350, 475, 450, 60) value Preference("text speed")
        hotbar (1350, 600, 450, 60) value Preference("auto-forward time")
        hotbar (1350, 725, 450, 60) value Preference("music volume")
        hotbar (1350, 850, 450, 60) value Preference("sound volume")

    use ShaddyAdditions


screen ShaddyAdditions():
    frame:
        # background Solid("#0000BF7F")
        align(0.002,0.998)
        xysize (1040,387)
        # add "#000"
        vbox:
            xcenter 0.5
            ycenter 0.5
            spacing 30
            hbox:
                spacing 50
                #xcenter 0.5
                #ycenter 0.5
                vbox:
                    style_prefix "navigation"
                    hbox:
                        spacing -5
                        text "R" outlines [(3, "#000")] style "shaddyPrefBody"
                        text "e" outlines [(3, "#000")] style "shaddyPrefBody"
                        text "n" outlines [(3, "#000")] style "shaddyPrefBody"
                        text "a" outlines [(3, "#000")] style "shaddyPrefBody"
                        text "m" outlines [(3, "#000")] style "shaddyPrefBody"
                        text "e" outlines [(3, "#000")] style "shaddyPrefBody"
                    #text _("RENAME") style "shaddyPrefBody"
                    textbutton _("Change") action [ui.callsinnewcontext("Rename"), Return()] 

                vbox:
                    style_prefix "radio"
                    hbox:
                        spacing 15
                        hbox:
                            spacing -5
                            text "Q" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "u" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "i" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "c" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "k" outlines [(3, "#000")] style "shaddyPrefBody"
                        hbox:
                            spacing -5
                            text "M" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "e" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "n" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "u" outlines [(3, "#000")] style "shaddyPrefBody"
                    #text ("QUICK MENU") style "shaddyPrefBody"
                    hbox:
                        textbutton "Enabled" action ToggleVariable("quick_menu", true_value=True, false_value=False)

            hbox:
                xcenter 0.5
                ycenter 0.5
                spacing 30
                vbox:
                    #style_prefix "slider"
                    hbox:
                        #xcenter 0.27
                        spacing 5
                        hbox:
                            spacing -5
                            text "T" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "e" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "x" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "t" outlines [(3, "#000")] style "shaddyPrefBody"
                        hbox:
                            spacing -5
                            text "S" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "i" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "z" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "e" outlines [(3, "#000")] style "shaddyPrefBody"
                            text ":" outlines [(3, "#000")] style "shaddyPrefBody"
                        hbox:
                            spacing -5
                            text _("%s" % (persistent.pref_text_size)) outlines [(3, "#000")] style "shaddyPrefBody"
                    #text _("TEXT SIZE: %s" % (persistent.pref_text_size)) xcenter 0.26 style "shaddyTextBody1"
                    bar value FieldValue(object=persistent, field='pref_text_size', range=(gui.text_size * 2), max_is_zero=False, style=u'slider', offset=0, step=1) xsize 450 #xcenter 0.5

                vbox:
                    #style_prefix "slider"
                    $ opacity = persistent.opacity * 100
                    hbox:
                        #xcenter 0.25
                        spacing 5
                        hbox:
                            spacing -5
                            text "T" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "e" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "x" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "t" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "b" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "o" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "x" outlines [(3, "#000")] style "shaddyPrefBody"
                        hbox:
                            spacing -5
                            text "O" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "p" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "a" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "c" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "i" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "t" outlines [(3, "#000")] style "shaddyPrefBody"
                            text "y" outlines [(3, "#000")] style "shaddyPrefBody"
                            text ":" outlines [(3, "#000")] style "shaddyPrefBody"
                        hbox:
                            spacing -5
                            text "[opacity:.0f]%" outlines [(3, "#000")] style "shaddyPrefBody"
                    #text _("Textbox Opacity: [opacity:.0f]%") style "shaddyTextBody1"
                    bar value FieldValue(persistent, "opacity", range=1.0, style="slider") xsize 450

    vbox:
        label _("")
### Shaddy Additions ###


init -500 screen quick_menu():
    zorder 100

    if quick_menu:
        hbox:
            style_prefix "quick"
            xalign 0.5
            yalign 1.0

            textbutton _("Back") action Rollback() text_style "shaddyQMenu"
            #textbutton _("History") action ShowMenu('history') text_style "shaddyQMenu"
            textbutton _("Skip") action Skip() alternate Skip(fast=True, confirm=True) text_style "shaddyQMenu"
            textbutton _("Auto") action Preference("auto-forward", "toggle") text_style "shaddyQMenu"
            #textbutton _("Save") action ShowMenu('save') text_style "shaddyQMenu"
            textbutton _("Q.S") action QuickSave() text_style "shaddyQMenu"
            textbutton _("Q.L") action QuickLoad() text_style "shaddyQMenu"
            textbutton _("Prefs") action ShowMenu('ingamepreferences') text_style "shaddyQMenu"


init -500 screen quick_menu():
    variant "touch"
    zorder 100

    if quick_menu:
        hbox:
            style_prefix "quick"

            xalign 0.5
            yalign 1.0

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


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

    window:
        id "window"
        #######Textbox transparency
        background Transform(style.window.background, alpha = persistent.opacity)
        ######

        if who is not None:

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

        text what id "what" size persistent.pref_text_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"):
        add SideImage() xalign 0.0 yalign 1.0


init -500 screen input(prompt):
    style_prefix "input"

    if renpy.variant("android"):

        window:
            background Transform(Image("gui/textbox.png", xalign=0.5, yalign=0), alpha=persistent.opacity)

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

            text prompt style "input_prompt" outlines [(3, "#000", 1, 1)]
            input id "input" outlines [(3, "#000", 1, 1)]

    else:

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

            has 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"


label Rename:
    scene black
    $ mc = renpy.input("Name your character! Max 10 characters", allow=" 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", length=10)
    if mc == "":
        "Please give your character a name that is between 2-10's characters long."
        jump Rename
    if mc is not None:
        $ check_name = len(mc)
        if check_name == 1:
            "You must name your character a minimum of 2 letters."
            jump Rename
    $ mc = mc.title()
    "Do you want to name you character [mc]?"
    menu:
        "Yes":
            pass
        "No":
            jump Rename
    return

style shaddyQMenu is button_text:
    size 20
    # outlines [(3,"#000",1,1)]

style shaddyPrefHeader is text:
    size 50
    outlines [(3,"#000",1,1)]
    color "#0ed6f9"
    font "mod_additions/212 Leahlee Sans.otf"

style shaddyPrefBody is text:
    size 40
    font "mod_additions/212 Leahlee Sans.otf"
    outlines [(3,"#000",1,1)]
    color "#0ed6f9"