transform _dm_auto_infoscreen_158_1:
    yoffset 30 alpha 0
    easein_back 0.3 yoffset 0 alpha 1

transform _dm_auto_infoscreen_219_2:
    yoffset 30 alpha 0
    easein_back 0.3 yoffset 0 alpha 1

transform _dm_auto_infoscreen_288_3:
    alpha 0.0
    ease 0.1 alpha 1

transform _dm_auto_infoscreen_317_4:
    yoffset 30 alpha 0
    easein_back 0.3 yoffset 0 alpha 1

transform _dm_auto_infoscreen_563_5:
    xoffset 20
    alpha 0.0
    pause 0.1
    ease 0.7 alpha 1.0 xoffset 0

transform _dm_auto_infoscreen_573_6:
    xoffset 20
    alpha 0.0
    pause 0.3
    ease 0.5 alpha 1.0 xoffset 0

transform _dm_auto_infoscreen_587_7:
    xoffset 20
    alpha 0.0
    pause 0.3
    ease 0.5 alpha 1.0 xoffset 0

transform _dm_auto_infoscreen_594_8:
    xoffset 20
    alpha 0.0
    pause 0.35
    ease 0.5 alpha 1.0 xoffset 0

transform _dm_auto_infoscreen_601_9:
    xoffset 20
    alpha 0.0
    pause 0.40
    ease 0.5 alpha 1.0 xoffset 0

transform _dm_auto_infoscreen_646_10:
    xoffset 30
    alpha 0.0
    pause 0.25
    ease 0.4 alpha 1.0 xoffset 0

transform _dm_auto_infoscreen_660_11:
    xoffset -30
    alpha 0.0
    pause 0.25
    ease 0.4 alpha 1.0 xoffset 0




transform _dm_auto_infoscreen_765_12:
    alpha 0.5 xoffset 50
    easein 0.3 alpha 1.0 xoffset 0

transform _dm_auto_infoscreen_785_13(delay=0.0):
    alpha 0 xoffset 30
    pause delay
    ease 0.15 alpha 1 xoffset 0

transform _dm_auto_infoscreen_901_14:
    on hover:
        linear 0.05 zoom 1.05
    on idle:
        linear 0.05 zoom 1.00




transform _dm_auto_infoscreen_928_15:
    alpha 0.0 zoom 1.05
    easein 0.3 zoom 1.0 alpha 1

transform _dm_auto_infoscreen_980_16:
    zoom 0.88

transform _dm_auto_infoscreen_993_17:
    alpha 0
    linear 0.15 alpha 1.0

transform _dm_auto_infoscreen_1060_18:
    alpha 0
    linear 0.3 alpha 1

transform _dm_auto_infoscreen_1073_19:
    alpha 0.0 xoffset -100
    ease 0.6 alpha 1 xoffset 0

transform _dm_auto_infoscreen_1095_20:
    alpha 0
    on show:
        ease 0.3 alpha 1 yoffset 0
    on hide:
        ease 0.2 alpha 0 yoffset 50

transform _dm_auto_infoscreen_1103_21:
    alpha 0.0 xoffset 50
    ease 0.3 alpha 1 xoffset 0

transform _dm_auto_infoscreen_1118_22:
    yoffset 50
    alpha 0
    on show:
        ease 0.4 alpha 1 yoffset 0
    on hide:
        ease 0.2 alpha 0 yoffset 50

transform _dm_auto_infoscreen_1135_23:
    zoom 0.85

transform _dm_auto_infoscreen_1145_24:
    alpha 0
    linear 0.15 alpha 1.0

transform _dm_auto_infoscreen_1181_25:
    alpha 0 xoffset 120
    on show:
        ease 0.3 alpha 1 xoffset 70
    on hide:
        ease 0.2 alpha 0 xoffset 120

transform _dm_auto_infoscreen_1213_26:
    alpha 0
    zoom 0.6
    yoffset 150
    on show:
        ease 0.3 alpha 1.0 zoom 0.9
    on hide:
        ease 0.2 alpha 0.0 zoom 0.6 yoffset 330

transform _dm_auto_infoscreen_1224_27:
    zoom 0.5
    easein_back 0.35 zoom 1

transform _dm_auto_infoscreen_1242_28:
    alpha 0
    zoom 0.6
    yoffset 300
    on show:
        ease 0.3 alpha 1.0 zoom 0.9 yoffset 150
    on hide:
        ease 0.2 alpha 0.0 zoom 0.6 yoffset 75

transform _dm_auto_infoscreen_1253_29:
    zoom 0.5
    easein_back 0.35 zoom 1

transform _dm_auto_infoscreen_1268_30:
    alpha 0.0 yoffset 20
    ease 0.4 alpha 1 yoffset 0
    on hide:
        ease 0.3 alpha 0 yoffset 20

transform _dm_auto_infoscreen_1294_31:
    zoom 0.75

transform _dm_auto_infoscreen_1302_32:
    zoom 0.75

transform _dm_auto_infoscreen_1319_33:
    zoom 0.5

transform _dm_auto_infoscreen_1324_34(item_alpha=1.0):
    alpha item_alpha

transform _dm_auto_infoscreen_1337_35:
    alpha 0
    linear 0.15 alpha 1.0

transform _dm_auto_infoscreen_1395_36:
    yoffset 50 alpha 0
    ease 0.4 yoffset 0 alpha 1
    on hide:
        ease 0.3 alpha 0 yoffset 50

transform _dm_auto_infoscreen_1413_37:
    yoffset 50 alpha 0
    ease 0.4 yoffset 0 alpha 1
    on hide:
        ease 0.3 alpha 0 yoffset 50

transform _dm_auto_infoscreen_1438_38:
    zoom 0.95

transform _dm_auto_infoscreen_1446_39:
    on hover:
        linear 0.04 zoom 1.12
    on idle:
        linear 0.06 zoom 1

transform _dm_auto_infoscreen_1460_40:
    alpha 0 zoom 1.1
    ease 0.2 alpha 1 zoom 1.0

transform _dm_auto_infoscreen_1474_41:
    rotate 180
    on hover:
        linear 0.04 zoom 1.15 alpha 0.85
    on idle:
        linear 0.06 zoom 1 alpha 1

transform _dm_auto_infoscreen_1486_42:
    on hover:
        linear 0.04 zoom 1.15 alpha 0.85
    on idle:
        linear 0.06 zoom 1 alpha 1

init python:
    import math

    class ImgButton:
        def __init__(self, name, icon_name, label_name, condition, args=None):
            self.name       = name
            self.icon_name  = icon_name
            self.label_name = label_name
            self.condition  = condition
            self.args       = args

define map_screen_close_button = True
define char_info_page_count = 4
define char_info_page = 1
define hide_support_buttons = False
define going_to_location_label = ""
define config.overlay_screens = ['replay_ui']
define inv_scroll_ui_adjust = ui.adjustment()
define tsl_scroll_ui_adjust = ui.adjustment()
define shp_scroll_ui_adjust = ui.adjustment()
define magic_notes_toggle = True
define show_item_info = False
define map_button_size = 256
define map_button_space = 8

define goto_map_home_locations = [
    
    ("True", ("my_room", "scene_my_room")),
    ("day_count > 1", ("sister_room", "scene_going_sister_room")),
    ("day_count > 1", ("mom_room", "scene_mom_room")),
    ("is_event_active('event_sada_come_back_home')", ("sada_room", "scene_sada_room")),
    ("True", ("living_room", "scene_living_room")),
    ("True", ("bath_room", "scene_bath_room")),
    ("True", ("dinner_room", "scene_dinner_room")),
    ("True", ("house_front", "scene_go_outside")),]

define goto_map_outside_public_locations = [
    
    ("day_count > 1", ("outside_park", "scene_town_park")),
    ("day_count > 1", ("outside_mine", "scene_outside_mine")),
    ("is_event_active('ask_sister_where_mom')", ("outside_castle_front", "scene_outside_castle_front")),
    ("meet_yasuko", ("outside_store", "scene_outside_store")),
    ("location_outside_clinic", ("outside_clinic", "scene_outside_clinic")),
    ("location_town_school", ("outside_school", "scene_town_school")),
    ("location_wisdom_lake", ("outside_lake", "scene_wisdom_lake")),
    
    ("location_wisdom_lake", ("outside_old_temple", "scene_old_temple")),
    ("is_completed('event_onsen_with_taka') or is_event_active('event_okemia_want_to_get_luna_back')", ("outside_onsen", "scene_onsen_and_spa")),]

define goto_map_outside_personal_locations = [
    
    ("location_taka_home", ("taka_home", "scene_taka_home")),
    ("location_okemia_mojo", ("okemia_mojo", "scene_okemia_mojo")),
    ("location_nami_home", ("nami_home", "scene_nami_home")),]

define magic_notes_timeslots = [
    "timeslot_airi",
    "timeslot_momoko",
    "timeslot_sada",
    "timeslot_nami",
    "timeslot_yasuko",
    "timeslot_taka",
    "timeslot_okemia",
    "timeslot_chizue",
    "timeslot_misa",
    "timeslot_emica",
    "timeslot_mihina",
    "timeslot_yamiyo",]

transform ui_button(_alpha=0.8, _zoomDelta=0.05):
    alpha _alpha

    on hover:
        linear 0.05 zoom 1.05 + _zoomDelta alpha 1
    on idle:
        linear 0.075 zoom 1 alpha _alpha

transform book_of_dark_magic_in:
    zoom 1.1 alpha 0.0 align (0.5, 0.5)
    ease 0.25 zoom 1.0 alpha 1.0

transform book_of_dark_magic_out:
    alpha 0 additive 1
    pause 0.25
    zoom 1.0 alpha 1.0 align (0.5, 0.5)
    ease 0.3 zoom 1.05 alpha 0.0

transform rotation_back_90:
    rotate -90

transform menu_fade_in:
    on start:
        zoom 1.02 alpha 0.0 yoffset 20
        easein_back 0.3 zoom 1.0 alpha 1.0 yoffset 0

    on replaced:
        zoom 1.02 alpha 0.0 yoffset 20
        easein_back 0.3 zoom 1.0 alpha 1.0 yoffset 0

    on hide:
        ease 0.2 zoom 0.98 alpha 0.0


image corruption_frame:
    "map_corruption1" with fdissolve
    0.2
    "map_corruption2" with fdissolve
    0.2
    "map_corruption3" with fdissolve
    0.2
    "map_corruption4" with fdissolve
    0.2
    "map_corruption5" with fdissolve
    0.2
    "map_corruption6" with fdissolve
    0.2
    "map_corruption7" with fdissolve
    0.2
    "map_corruption8" with fdissolve
    0.2
    repeat

screen goto_map_outside():
    if day_time_index >= 4:
        zorder 1000
        add "vignette"

    zorder 0
    add Frame(Solid("#00000060"), xsize=config.screen_width, ysize=config.screen_height)

    frame:
        background Solid("#000000B0")
        xalign 0.999
        yalign 0.001
        xpadding 15

        has hbox
        hbox:
            text "[day_time]" size 34 bold True

    if map_screen_close_button:

        imagebutton:
            xpos 15
            ypos 15
            idle "close"
            hover "close"
            action [Call("set_goto_location", ""),  Return()]


    text "{b}Public area{/b}" size 64 ypos 25 xalign 0.5

    vbox:
        ypos 125
        xalign 0.5
        xanchor 0.5

        at _dm_auto_infoscreen_158_1
        $ map_index = 0
        $ list_len = len(goto_map_outside_public_locations)
        for row in range(0, int(list_len / 4) + 1):
            null height map_button_space

            hbox:
                xalign 0.5

                for col in range(0, 5):
                    if map_index < list_len:
                        $ map_location = goto_map_outside_public_locations[map_index]
                        $ map_index += 1
                        $ location_name = location[map_location[1][0]]

                        if eval(map_location[0]):
                            if my_location == location_name:
                                fixed:
                                    xsize map_button_size
                                    ysize map_button_size

                                    add "map_" + map_location[1][0] alpha 0.7
                                    add "map_location" xalign 0.5 yalign 0.5
                                    text location_name size 25 align (0.5, 0.89) outlines gui.choice_button_text_outlines

                            else:
                                fixed:
                                    xsize map_button_size
                                    ysize map_button_size

                                    imagebutton:
                                        idle "map_" + map_location[1][0]
                                        action [Call("set_goto_location", map_location[1][1]),  Return()]
                                    text location_name size 25 align (0.5, 0.89) outlines gui.choice_button_text_outlines

                                    if has_location_corruption(location_name):
                                        add "corruption_frame"

                                    if has_location_event(map_location[1][0]):
                                        add "event_icon" align (0.11, 0.06) anchor (0.5, 0.5) at mouse_click
                        else:
                            fixed:
                                xsize map_button_size
                                ysize map_button_size

                                add "map_" + map_location[1][0] alpha 0.6
                                add "map-locked" xalign 0.5 yalign 0.5 alpha 0.7
                                text location_name size 25 align (0.5, 0.89) outlines gui.choice_button_text_outlines

                null width map_button_space


    text "{b}Personal area{/b}" size 64 ypos 665 xalign 0.5

    vbox:
        ypos 750
        xalign 0.5
        xanchor 0.5

        at _dm_auto_infoscreen_219_2
        $ map_index = 0
        $ list_len = len(goto_map_outside_personal_locations)
        for row in range(0, int(list_len / 4) + 1):
            null height map_button_space

            hbox:
                for col in range(0, 4):
                    if map_index < list_len:
                        $ map_location = goto_map_outside_personal_locations[map_index]
                        $ map_index += 1
                        $ location_name = location[map_location[1][0]]

                        if eval(map_location[0]):
                            if my_location == location_name:
                                fixed:
                                    xsize map_button_size
                                    ysize map_button_size

                                    add "map_" + map_location[1][0] alpha 0.7
                                    add "map_location" xalign 0.5 yalign 0.5
                                    text location_name size 25 align (0.5, 0.89) outlines gui.choice_button_text_outlines
                            else:
                                fixed:
                                    xsize map_button_size
                                    ysize map_button_size

                                    imagebutton:
                                        idle "map_" + map_location[1][0]
                                        action [Call("set_goto_location", map_location[1][1]),  Return()]
                                    text location_name size 25 align (0.5, 0.89) outlines gui.choice_button_text_outlines

                                    if has_location_corruption(location_name):
                                        add "corruption_frame"

                                    if has_location_event(map_location[1][0]):
                                        add "event_icon" align (0.11, 0.06) anchor (0.5, 0.5) at mouse_click
                        else:
                            fixed:
                                xsize map_button_size
                                ysize map_button_size

                                add "map_" + map_location[1][0] alpha 0.6
                                add "map-locked" xalign 0.5 yalign 0.5 alpha 0.7
                                text location_name size 25 align (0.5, 0.89) outlines gui.choice_button_text_outlines

                null width map_button_space

                if not is_in_home(my_location):
                    fixed:
                        xsize map_button_size
                        ysize map_button_size

                        imagebutton:
                            idle "map_back_home"
                            action [Call("set_goto_location", "scene_living_room"),  Return()]

                        text "{b}Back home{/b}" size 25 align (0.5, 0.89) outlines gui.choice_button_text_outlines

screen goto_map_home():
    if day_time_index >= 4:
        zorder 1000
        add "vignette"

    zorder 0
    add Frame(Solid("#00000060"), xsize=config.screen_width, ysize=config.screen_height):

        at _dm_auto_infoscreen_288_3
    frame:
        background Solid("#000000B0")
        xalign 0.999
        yalign 0.001
        xpadding 15

        has hbox
        hbox:
            text "[day_time]" size 34 bold True

    if map_screen_close_button:

        imagebutton:
            xpos 15
            ypos 15
            idle "close"
            hover "close"
            action [Call("set_goto_location", ""),  Return()]

    text "{b}Home{/b}" size 64 ypos 80 xalign 0.5

    vbox:
        ypos 185
        xalign 0.5
        xanchor 0.5

        at _dm_auto_infoscreen_317_4
        $ map_index = 0
        $ list_len = len(goto_map_home_locations)
        for row in range(0, int(list_len / 4) + 1):
            null height map_button_space

            hbox:
                for col in range(0, 4):
                    if map_index < list_len:
                        $ map_location = goto_map_home_locations[map_index]
                        $ map_index += 1
                        $ location_name = location[map_location[1][0]]

                        if eval(map_location[0]):
                            if my_location == location_name:
                                fixed:
                                    xsize map_button_size
                                    ysize map_button_size

                                    add "map_" + map_location[1][0] alpha 0.7
                                    add "map_location" xalign 0.5 yalign 0.5
                                    text location_name size 25 align (0.5, 0.89) outlines gui.choice_button_text_outlines
                            else:
                                fixed:
                                    xsize map_button_size
                                    ysize map_button_size

                                    imagebutton:
                                        idle "map_" + map_location[1][0]
                                        action [Call("set_goto_location", map_location[1][1]),  Return()]

                                    text location_name size 25 align (0.5, 0.89) outlines gui.choice_button_text_outlines

                                    if has_location_corruption(location_name):
                                        add "corruption_frame"

                                    if has_location_event(map_location[1][0]):
                                        add "event_icon" align (0.11, 0.06) anchor (0.5, 0.5) at mouse_click
                        else:
                            fixed:
                                xsize map_button_size
                                ysize map_button_size

                                add "map_" + map_location[1][0] alpha 0.6
                                add "map-locked" xalign 0.5 yalign 0.5 alpha 0.7
                                text location_name size 25 align (0.5, 0.89) outlines gui.choice_button_text_outlines
                    null width map_button_space

        fixed:
            xsize map_button_size
            ysize map_button_size

            imagebutton:
                idle "map_go_out"
                action [Call("set_goto_location", "scene_go_outside", True),  Return()]

            text "{b}Go outside{/b}" size 25 align (0.5, 0.89) outlines gui.choice_button_text_outlines

label set_goto_location(location_label, clear_my_location=False):
    $ going_to_location_label = location_label

    if clear_my_location:
        $ my_location = ""

    return

label show_goto_map_outside:
    call screen goto_map_outside
    return

label show_goto_map_home:
    call screen goto_map_home
    return

screen replay_ui:
    if _in_replay:
        use quick_menu

        imagebutton:
            xpos 65
            ypos 65
            anchor (0.5, 0.5)
            idle "close"
            action EndReplay(confirm=False)

            at ui_button(0.45)

        if not renpy.is_skipping():
            imagebutton:
                xpos 65
                ypos 160
                anchor (0.5, 0.5)
                idle "skip"
                action Skip()
                at ui_button(0.45)
        else:
            imagebutton:
                xpos 65
                ypos 160
                anchor (0.5, 0.5)
                idle "skipping"
                action Skip()
                at ui_button(0.75)





screen ui_button():
    zorder 1001









    if not _in_replay:
        if info_screen and day_count > 1:
            imagebutton:
                xpos 65
                ypos 65
                anchor (0.5, 0.5)
                idle "face"
                hover "face"
                action Call("show_info_screen_context", from_current=True)
                at ui_button

            imagebutton:
                xpos 65
                ypos 175
                anchor (0.5, 0.5)
                idle "todo"
                hover "todo"
                action Call("show_magic_notes_context", from_current=True)
                at ui_button

            imagebutton:
                xpos 65
                ypos 280
                anchor (0.5, 0.5)
                idle "save"
                hover "save"
                action ShowMenu("save")
                at ui_button

            imagebutton:
                xpos 65
                ypos 380
                anchor (0.5, 0.5)
                idle "bom"
                hover "bom"
                action Call("open_book_of_dark_magic_context", from_current=True)
                at ui_button
        else:

            imagebutton:
                xpos 65
                ypos 65
                anchor (0.5, 0.5)
                idle "save"
                hover "save"
                action ShowMenu("save")
                at ui_button

            if show_return_home_button:
                imagebutton:
                    xpos 65
                    ypos 160
                    anchor (0.5, 0.5)
                    idle "home"
                    hover "home"
                    action Jump('return_to_my_room')
                    at ui_button

            imagebutton:
                xpos 65
                ypos (show_return_home_button and 265) or 170
                anchor (0.5, 0.5)
                idle "visibility"
                hover "visibility"
                action HideInterface()
                at ui_button

label return_to_my_room:
    $ show_return_home_button = False
    scene black with fdissolve

    "You can return to this scene when you go to bed."
    call gap () from _call_gap_11310

    jump scene_my_room

label increase_time_button:
    $ info_screen = False
    $ click_point = False

    if day_time_index >= 5:
        call jumping_to_my_room ()


    $ renpy.checkpoint()

    scene black with Dissolve(0.4)
    call increase_time ()

    pause 0.15
    $ info_screen = True

    if going_to_location_label != None:
        call jumping_to_place ()
    else:

        jump scene_my_room

    return

screen timeofday_screen():
    zorder 1000

    if info_screen:
        if day_time_index >= 4:
            add "vignette"
        if is_drunk:
            add "im_drunk"


        frame:
            background Solid("#000000C0")
            xalign 0.999
            yalign 0.999
            xpadding 15

            has hbox
            add "place" zoom 0.4 xpos -5 alpha 0.85 yalign 0.5
            text "[my_location]" size 34 yalign 0.5


        imagebutton:
            idle "time_panel"
            pos (1635, -3)

            at _dm_auto_infoscreen_563_5
            action Jump("increase_time_button")
        frame:
            background None
            pos (1695, 15)

            at _dm_auto_infoscreen_573_6
            has vbox
            $ dlc_image1 = "time_" + str(day_time_index)
            $ dlc_image2 = (day_time_index < 5 and "time_i_" + str(day_time_index + 1)) or "time_sleep"
            vbox:
                xalign 0.99
                xsize 250
                hbox:
                    add dlc_image1 zoom 0.65 align (0.5, 0.99):

                        at _dm_auto_infoscreen_587_7
                    null width 7
                    add "next3" align (0.5, 0.6):
                        at _dm_auto_infoscreen_594_8
                    null width 7
                    add dlc_image2 zoom 0.6 align (0.5, 0.99):
                        at _dm_auto_infoscreen_601_9
                text "[day_time]" size 24 text_align 0.99 xalign 0.99 xoffset -52
                text "[day_of_week]" size 38 yoffset -13 text_align 0.99 xalign 0.99 xoffset -52




label open_book_of_dark_magic_context:
    $ renpy.call_in_new_context("open_book_of_dark_magic")
    return

label open_book_of_dark_magic:
    call play_sound ('book_of_dark_magic', 0.4) from _call_play_sound_797
    call screen book_of_dark_magic_page
    $ show_version_cover = False
    return

screen book_of_dark_magic_page():
    zorder 0
    add Frame(Solid("#00000060"), xsize=config.screen_width, ysize=config.screen_height)

    add "book_of_dark_magic" at book_of_dark_magic_in
    add "book_of_dark_magic" at book_of_dark_magic_out


    imagebutton:
        xpos 15
        ypos 15
        idle "close"
        hover "close"
        action Return()

    textbutton "Open":
        align (0.085, 0.5)
        xsize 260
        ysize 75
        text_color "#ffffff"
        text_outlines gui.choice_button_text_outlines
        style "bom_button"
        action [Return(), ui.callsinnewcontext("open_bol", True)]

        at _dm_auto_infoscreen_646_10
    textbutton "Open":
        align (0.915, 0.5)
        xsize 260
        ysize 75
        text_color "#ffffff"
        text_outlines gui.choice_button_text_outlines
        style "bom_button"
        action [Return(), ui.callsinnewcontext("open_bom", True)]

        at _dm_auto_infoscreen_660_11
label show_info_screen_context:
    $ renpy.call_in_new_context("show_info_screen")
    return

label show_info_screen:
    call play_sound ('book_openning', 0.5)
    call screen information_screen
    return

screen information_screen():
    if day_time_index >= 4:
        zorder 1000
        add "vignette"

    zorder 1000
    add Frame(Solid("#00000060"), xsize=config.screen_width, ysize=config.screen_height)


    $ char_infos = [
        
        ("Airi",          "face_mom",           mom_consumed),
        ("Momoko",        "face_sister",        sister_consumed),
        ("Nami",          "face_nami",          nami_consumed),
        ("Red Witch",     "face_red_witch",     red_witch_consumed),
        ("Ruriko",        "face_ruriko",        ruriko_consumed),
        ("Yasuko",        "face_yasuko",        yasuko_consumed_r1),
        ("Yasue",         "face_yasue",         yasue_consumed_r1),
        ("Namie",         "face_nurse",         nurse_consumed),
        ("Hitomu",        "face_doctor",        doctor_consumed),
        ("Taka",          "face_taka",          taka_consumed),
        ("Kimiko",        "face_kimiko",        kimiko_consumed),
        ("Kimika",        "face_queen",         kimika_consumed),
        ("Yumi",          "face_yumi",          yumi_consumed),
        ("Luna",          "face_guardian",      "-"),
        ("Okemia",        "face_fighter",       okemia_consumed),
        ("Emica",         "face_emica",         emica_consumed),
        ("Sada",          "face_sada",          sada_consumed),
        ("Yamiyo",        "face_dark_fairly",   yamiyo_consumed),
        ("Kana",          "face_kana",          "-"),
        ("Hanako",        "face_ffairy",        "-"),
        ("Tomo",          "face_nun",           tomo_consumed),
        ("Azumi",         "face_azumi",         "-"),
        ("Chizue",        "face_chizue",        chizue_consumed),
        ("Misa",            "face_waitress",      misa_consumed_r1),
        ("Hitomi",        "face_hitomi",        hitomi_consumed),
        ("Mei",           "face_mei",           "-"),
        ("Raylene",       "face_raylene",       "-"),
        ("Nana",          "face_nana",          nana_consumed),
        ("Kaida",         "face_kaida",         "-"),
        ("Haya",          "face_haya",          "-"),
        ("Head Chef",     "face_head_chef",     "-"),
        (chizue_ma,       "face_shop_keeper",   chizue_ma_consumed),
        (mihina,          "face_mihina",        mihina_consumed),
        (tsuki,           "fade_tsuki",         tsuki_consumed),
        (df_queen,        "df_queen",           "-"),
        (ren,             "face_ren",           "-"),
        (misaki,          "face_misaki",           "-"),
        (pam,             "face_pamela",           "-"),
        (sophie,          "face_sophie",           "-"),
        (sayuri,          "face_sayuri",           "-"),
        (kaori,           "face_kaori",            "-"),
        ("?",             "face_woman7",           "-"),
        ("?",             "face_woman4",        "-"),
        ("?",             "face_woman5",        "-"),
        ("?",             "face_woman6",        "-"),
        ("?",             "face_woman1",        "-"),
        ("?",             "face_woman2",        "-"),
    ]

    $ ar_length              = len(char_infos)
    $ max_row                = 4
    $ char_info_page_count   = int(math.ceil(ar_length / 15)) + 1





    frame:
        xpos 545
        ypos 12
        xalign 0
        yalign 0
        xpadding 15
        ypadding 10
        xsize 1370
        ysize 1061
        background Solid("#00000080")


        text "Corruptions:" bold True size 32
        text "[char_info_page]/[char_info_page_count]" size 32 xalign 0.89

        vbox:
            xalign 0.0
            ypos 50
            ysize 1060

            at _dm_auto_infoscreen_765_12
            for row in range(0, max_row - 1):
                hbox:
                    ysize 325
                    ypos row * -17

                    $ start_index = (char_info_page - 1) * 15 + (row * 5)
                    for i in range(start_index, start_index + 5):
                        if i < ar_length:
                            $ char_name = str(char_infos[i][0]).replace('{b}', '').replace('{/b}', '')
                            $ soul_consume = char_infos[i][2]

                            viewport:
                                draggable False
                                mousewheel False
                                xsize 260
                                ysize 325

                                at _dm_auto_infoscreen_785_13((i - start_index) * 0.025)
                                $ char_image_name = char_infos[i][1]
                                add char_image_name zoom 0.7 xalign 0.5 ypos -22

                                if get_bol_unlocked(char_name):
                                    imagebutton:
                                        xalign 0.0525
                                        yalign 0.04
                                        idle "heart"
                                        action Call('open_bol_video', c_index=get_bol_index(char_name))

                                    text "Lover" size 20 xalign 0.0475 yalign 0.055 outlines gui.choice_button_text_outlines

                                if soul_consume != "-":
                                    bar range 100 value soul_consume ymaximum 5 xmaximum 250 xalign 0.5 ypos 274
                                    text "[soul_consume]%" size 30 xalign 0.5 ypos 273
                                else:
                                    bar range 100 value 0 ymaximum 5 xmaximum 250 xalign 0.5 ypos 274
                                    text "N/A" size 30 xalign 0.5 ypos 273

                                label char_name xalign 0.5 yalign 0.9 ypos 252 text_font "Lobster-Regular.ttf" text_text_align 0.5 text_line_spacing -12 text_size 38 text_outlines [ (absolute(2), "#FFF", absolute(0), absolute(0)) ]

                            null width 10

    imagebutton:
        xalign 1.00525
        yalign -0.0275
        idle "next2"
        hover "next2_pressed"
        action [SetVariable("char_info_page", (char_info_page + 1 <= char_info_page_count and char_info_page + 1) or 1), Show("information_screen"), Play("sound", 'sfx/book_openning2.mp3')]


    frame:
        xalign 0.01
        yalign 0.0238
        xpadding 15
        background Solid("#00000080")

        has vbox
        null height 105
        null width 490

        text "My Stats:" bold True size 34

        grid 2 7:
            xspacing 10

            text "Name:" color gui.accent_color bold True
            hbox:
                text "{b}[my_name]{/b}" size 30
                textbutton "[[Edit]" text_size 28 align (0.5, 0.5) action Call("user_name_input_prompt")

            text "Money:" color gui.accent_color bold True
            text "[my_money]" size 30

            text "Body:" color gui.accent_color bold True
            if my_clean:
                text "Clean" size 30
            else:
                text "Dirty" size 30

            text "Mana:" color gui.accent_color bold True
            text "{:.0f}/{:.0f}".format(my_mana, max_mana + mana_capacity) size 30

            text "Magic:" color gui.accent_color bold True
            text "[my_magicskill]/3" size 30

            text "Knowledge:" color gui.accent_color bold True
            text "[my_knowledge]/2" size 30

            text "Strength:" color gui.accent_color bold True
            text "[my_strength]/10" size 30


    imagebutton:
        xpos 15
        ypos 15
        idle "close"
        hover "close"
        action Return()

    if not hide_support_buttons:
        imagebutton:
            xanchor 0
            xpos 235
            ypos 15
            idle "discord"
            hover "discord"
            action OpenURL("https://discord.gg/wEnVjMb")

        imagebutton:
            xanchor 0
            xpos 125
            ypos 15
            idle "patreon"
            hover "patreon"
            action OpenURL("https://www.patreon.com/join/f_lord?")

    frame:
        yanchor 0
        xalign 0.01
        yalign 0.51
        xpadding 15
        xsize 520
        ysize 522
        background Solid("#00000080")

        imagebutton:
            align (0.5, 0.5)
            idle "button_inventory"
            hover "button_inventory"
            action Call("open_my_inventory")

            at _dm_auto_infoscreen_901_14
label show_inventory(_inventory_id, _inv_bg_img, _inv_title):
    $ show_item_info = False
    call play_sound (randomInt(0, 3) == 1 and 'cloth1' or 'cloth2')
    call screen inventory_screen(_inventory_id, _inv_bg_img, _inv_title)
    return

style item_button:
    align (0.5, 0.925)
    xsize 150
    ysize 60
    background Solid("#0000005b")
    hover_background Solid("#ff168ac4")

screen inventory_screen(_inventory_id, _inv_bg_img, _inv_title):
    frame:
        background Solid("#00000060")
        xalign 0.5
        yalign 0.5

        at _dm_auto_infoscreen_928_15
        add _inv_bg_img align (0.5, 0.5)
        text _inv_title xalign 0.5 ypos 30 size 66

        if show_item_info:
            imagebutton:
                align (0.885, 0.045)
                idle "item_info2"
                action [ToggleVariable("show_item_info", True, False), Play("sound", "sfx/book_openning2.mp3")]
        else:
            imagebutton:
                align (0.885, 0.045)
                idle "item_info"
                action [ToggleVariable("show_item_info", True, False), Play("sound", "sfx/book_openning2.mp3")]

        python:
            _inventory = get_inventory(_inventory_id)
            item_counts = {}
            for item_id in _inventory:
                if not(item_id in ITEMS):
                    continue
                
                if item_id in item_counts:
                    item_counts[item_id] += 1
                else:
                    item_counts[item_id] = 1

            has_item_shown = len(_inventory) > 0

        vpgrid id "vp":
            rows 2
            draggable True
            mousewheel True
            align (0.5, 0.6)
            yoffset -7
            spacing 0
            xsize 1460
            ysize 800
            xadjustment inv_scroll_ui_adjust

            for item_id in item_counts:
                $ amount = item_counts[item_id]
                $ item = ITEMS[item_id]

                frame:
                    background None
                    align (0.5, 0.5)
                    xsize 440
                    ysize 440

                    at _dm_auto_infoscreen_980_16
                    add "item_badge2" align (0.5, 0.5)
                    add item.icon align (0.5, 0.5)

                    if amount > 1:
                        text "x" + str(amount) bold True text_align 1.0 align (1.0, 0.5) size 40 xpos 390 ypos 60 outlines gui.choice_button_text_outlines

                    if show_item_info:
                        frame:
                            align (0.5, 0.5)
                            background None

                            at _dm_auto_infoscreen_993_17
                            add "item_info_bg" align (0.5, 0.5)
                            vbox:
                                align (0.5, 0.5)
                                xmaximum 400
                                text item.name text_align 0.5 align (0.5, 0.5) outlines gui.choice_button_text_outlines

                                if item.hint != None:
                                    text item.hint text_align 0.5 align (0.5, 0.5) outlines gui.choice_button_text_outlines

                    if "consumable" in item.type or ("openbook" in item.type and (_inventory_id == 'player' or _inventory_id == location['my_room'])) or (item.type == "openbook"):
                        textbutton ("openbook" in item.type and "Read") or "Use":
                            style "item_button"
                            text_size 34
                            text_bold True
                            text_color "#ffffff"
                            action Call("use_item", item_id, from_current=True)

                    elif item.type == "collectable_jn":
                        textbutton "Collect":
                            style "item_button"
                            text_size 34
                            text_bold True
                            text_color "#ffffff"
                            action Call("collect_journey_page", item_id, from_current=True)

                    elif "transferable" in item.type or ("quest" in item.type and _inventory_id != 'player'):
                        textbutton _inventory_id != "player" and "Pick" or "Place":
                            style "item_button"
                            text_size 34
                            text_bold True
                            text_color "#ffffff"
                            action _inventory_id != "player" and Call("pick_item", item_id, _inventory_id, 'player', from_current=True) or Call("pick_item", item_id, 'player', my_location, from_current=True)

            if len(item_counts) % 2 != 0:
                null width 1

        if not has_item_shown:
            frame:
                align (0.5, 0.5)
                xsize 300
                ysize 100
                background Solid("#00000049")

                text "{b}Empty.{/b}" align (0.5, 0.5) size 44

        imagebutton:
            xpos 15
            ypos 15
            idle "close"
            hover "close"
            action Return("inventory")




screen shop_items_screen(shop_info):
    modal True
    timer 0.05 action [Play("sound", "sfx/cloth2.mp3"), SetVariable("show_item_info", False)]

    frame:
        background Solid("#00000060")
        xalign 0.5
        yalign 0.5

        at _dm_auto_infoscreen_1060_18
    imagebutton:
        xalign 0.985
        ypos 25
        idle "close"
        action Return()

    hbox:
        align (0.0, 0.0)
        xpos 140 ypos 110

        at _dm_auto_infoscreen_1073_19
        label shop_info["title"] text_size 80 text_outlines gui.choice_button_text_outlines

        null width 4

        if show_item_info:
            imagebutton:
                align (0.5, 0.5)
                yoffset 5
                idle "item_info2"
                action [ToggleVariable("show_item_info", True, False), Play("sound", "sfx/book_openning2.mp3")]
        else:
            imagebutton:
                align (0.5, 0.5)
                yoffset 5
                idle "item_info"
                action [ToggleVariable("show_item_info", True, False), Play("sound", "sfx/book_openning2.mp3")]

    add "store_shelf_bg" ypos 75 xoffset -300:

        at _dm_auto_infoscreen_1095_20
    text "Money: {color=#ffd230}[my_money]{/color}" size 36 xpos 1220 ypos 155 text_align 1.0 align (1.0, 0.0) outlines gui.choice_button_text_outlines:

        at _dm_auto_infoscreen_1103_21
    vpgrid id "vp":
        rows 1
        draggable True
        mousewheel True
        ypos 210
        xpos 200
        spacing 0
        xsize 920
        ysize 800
        xadjustment shp_scroll_ui_adjust


        at _dm_auto_infoscreen_1118_22
        for item_id in shop_info["items"]:
            $ item = ITEMS[item_id]

            frame:
                background None
                align (0.5, 0.0)
                yoffset -30
                xsize 440
                ysize 800

                at _dm_auto_infoscreen_1135_23
                add "item_badge1" align (0.5, 0.5)
                add item.icon align (0.5, 0.5)

                if show_item_info:
                    frame:
                        align (0.5, 0.5)
                        background None

                        at _dm_auto_infoscreen_1145_24
                        add "item_info_bg" align (0.5, 0.5)
                        text item.name xmaximum 400 text_align 0.5 align (0.5, 0.5) outlines gui.choice_button_text_outlines
                frame:
                    align (0.5, 0.5)
                    yoffset 270
                    xsize 410
                    ysize 85
                    background Frame("gui/button/choice_idle_background.png", 20, 0)

                    if item.cost > 0:
                        if item.stackable:
                            textbutton str(item.stack) + "pc. = {b}{color=#ffd230}$" + str(item.stack*item.cost) + "{/color}{/b}" align (0.5, 0.5) text_size 42 action SetField(item, "stack", item.stack > 4 and 1 or item.stack + 1)
                        elif item.stack < 1:
                            text "{b}{color=#a8a8a8}SOLD OUT{/color}{/b}" align (0.5, 0.5) size 42
                        else:
                            text "{b}{color=#ffd230}$" + str(item.cost) + "{/color}{/b}" align (0.5, 0.5) size 42
                    else:
                        text "{color=#ffd230}FREE{/color}" align (0.5, 0.5) size 42

                if item.stack > 0:
                    textbutton "Buy":
                        text_bold True
                        text_size 44
                        text_color "#dddddd"
                        align (0.5, 0.5)
                        yoffset 361
                        xsize 410
                        ysize 88
                        action Call(shop_info["callback"], item_id, item.stack)
                        style "bom_button"

    add shop_info["owner_idle"]:

        at _dm_auto_infoscreen_1181_25
    frame:
        align (0.75, 0.02)
        xsize 370
        ysize 210
        background Frame("speak_bubble.png", 20, 0)

        text shop_info["speak_bubble"] align (0.5, 0.385) size 31 color "#0c0c0c"

label add_item_animation(item_id, amount, title="New Item"):
    call screen add_item_screen(item_id, amount, title)
    return

label remove_item_animation(item_id):
    call play_sound ('zipper', 0.5)
    call screen remove_item_screen(item_id)
    return

screen add_item_screen(item_id, amount, title="New Item"):
    $ item = ITEMS[item_id]
    timer 1.1 action Return()

    frame:
        background None
        align (0.5, 0.5)


        at _dm_auto_infoscreen_1213_26
        add "item_badge2" align (0.5, 0.5)
        add item.icon align (0.5, 0.5):

            at _dm_auto_infoscreen_1224_27
        if amount > 1:
            text "x" + str(amount) bold True text_align 1.0 size 38 align (0.575, 0.65) outlines gui.choice_button_text_outlines

        label title text_bold True text_size 44 yoffset -254 align (0.5, 0.5) text_outlines gui.choice_button_text_outlines
        text item.name yoffset 260 align (0.5, 0.5)

screen remove_item_screen(item_id):
    $ item = ITEMS[item_id]
    timer 1.1 action Return()

    frame:
        background None
        align (0.5, 0.5)


        at _dm_auto_infoscreen_1242_28
        add "item_badge2" align (0.5, 0.5)
        add item.icon align (0.5, 0.5):

            at _dm_auto_infoscreen_1253_29
        label "Remove Item" text_bold True text_size 44 yoffset -254 align (0.5, 0.5) text_outlines gui.choice_button_text_outlines
        text item.name yoffset 260 align (0.5, 0.5)

screen require_items_screen(req_items):
    zorder 1005
    modal True

    frame:
        background Solid("#000000ad")
        button action Return(False)


        at _dm_auto_infoscreen_1268_30
        add "outline" align (0.5, 0.5)

        text "REQUIRED ITEM":
            align (0.5, 0.225) text_align 0.5 size 32 bold True color "#ffffffcb"
            outlines gui.choice_button_text_outlines

        frame:
            background None
            align (0.5, 0.5)
            xsize 700
            ysize 350

            text "I need to acquire this item to continue." align (0.5, 0.0) color "#ffffff9a" size 28

            if show_item_info:
                imagebutton:
                    align (0.95, 0.0)
                    yoffset -11
                    idle "item_info2"
                    action [ToggleVariable("show_item_info", True, False), Play("sound", "sfx/book_openning2.mp3")]

                    at _dm_auto_infoscreen_1294_31
            else:
                imagebutton:
                    align (0.95, 0.0)
                    yoffset -11
                    idle "item_info"
                    action [ToggleVariable("show_item_info", True, False), Play("sound", "sfx/book_openning2.mp3")]
                    at _dm_auto_infoscreen_1302_32
            hbox:
                align (0.5, 0.8)
                spacing 4

                $ item_counts = dict((i, req_items.count(i)) for i in req_items)
                for item_id in item_counts:
                    $ item = ITEMS[item_id]
                    $ count = item_counts[item_id]
                    $ required_item_alpha = 1.0 if (has_item({item_id: count}) or _in_replay) else 0.4

                    frame:
                        background None
                        align (0.5, 0.5)
                        xsize 440
                        ysize 440

                        at _dm_auto_infoscreen_1319_33
                        frame:
                            background None

                            at _dm_auto_infoscreen_1324_34(required_item_alpha)
                            add "item_badge2" align (0.5, 0.5)
                            add item.icon align (0.5, 0.5)

                            if count > 1:
                                text "x" + str(count) bold True text_align 1.0 align (1.0, 0.5) size 50 xpos 390 ypos 60 outlines gui.choice_button_text_outlines

                        if show_item_info:
                            frame:
                                align (0.5, 0.5)
                                background None

                                at _dm_auto_infoscreen_1337_35
                                add "item_info_bg" align (0.5, 0.5)
                                text item.name xmaximum 400 text_align 0.5 size 44 align (0.5, 0.5) outlines gui.choice_button_text_outlines
        $ is_unlockable = has_item(req_items) or _in_replay
        textbutton is_unlockable and "Accept" or "Requirement Not Met":
            align (0.5, 0.755)
            text_color is_unlockable and "#ffffff" or "#ffffff71"
            text_size 31
            text_bold True
            text_outlines gui.choice_button_text_outlines
            xsize 450
            ypadding 20
            style is_unlockable and "bom_button" or "choice_button"
            action is_unlockable and Return(True)

label show_require_items(req_items, auto_remove=True):
    $ show_item_info = False

    call screen require_items_screen(req_items)
    $ is_unlockable = _return
    if is_unlockable and auto_remove:
        python:
            for req_item in req_items:
                my_inventory.remove(req_item)

    $ item_counts = None
    return is_unlockable



define img_menu_selection = ""
define img_menu_page = 1

label show_image_menu(img_menu_items, menu_title):
    $ img_menu_page = 1

    call screen image_menu_ui(img_menu_items, menu_title)

    if img_menu_selection != "":
        $ renpy.jump(img_menu_selection)
    return

label choose_image_menu(img_menu_item):
    if img_menu_selection != img_menu_item.label_name:
        $ img_menu_selection = img_menu_item.label_name
        scene black with dissolve

    $ current_view      = 1
    $ animation_speed   = 1

    $ renpy.jump(img_menu_item.label_name)

screen image_menu_ui(img_menu_items, menu_title):
    add "sp_background":
        align (0.5, 0.5)

        at _dm_auto_infoscreen_1395_36
    imagebutton:
        xalign 0.965
        ypos 65
        anchor (0.5, 0.5)
        idle "close"
        action Return()
        at ui_button(0.45)

    frame:
        background None
        ypos 310


        at _dm_auto_infoscreen_1413_37
        text menu_title align (0.5, 0.32) bold True size 48

        hbox:
            spacing -55
            align (0.5, 0.5)

            $ ar_length              = len(img_menu_items)
            $ max_row                = 4
            $ char_info_page_count   = int(math.ceil(ar_length / max_row)) + 1

            for i in range((img_menu_page - 1) * max_row, img_menu_page * max_row):
                if i < ar_length:
                    $ img_menu = img_menu_items[i]

                    frame:
                        background None
                        align (0.5, 0.5)
                        xsize 440
                        ysize 800

                        at _dm_auto_infoscreen_1438_38
                        frame:
                            xsize 383
                            ysize 314
                            align (0.5, 0.5)
                            background None

                            at _dm_auto_infoscreen_1446_39
                        if img_menu.condition == None or eval(img_menu.condition):
                            imagebutton:
                                align (0.5, 0.5)
                                idle img_menu.icon_name
                                action Call("choose_image_menu", img_menu)

                            if img_menu.label_name == img_menu_selection:
                                add "sp_selected" align (0.5, 0.5):

                                    at _dm_auto_infoscreen_1460_40
                        else:
                            add img_menu.icon_name align (0.5, 0.5)
                            add "sp_locked" align (0.5, 0.5)

        if ar_length > 4:
            imagebutton:
                align (0.5, 0.5)
                xoffset -800
                idle "next_circle"
                action SetVariable("img_menu_page", img_menu_page - 1 == 0 and char_info_page_count or img_menu_page - 1)

                at _dm_auto_infoscreen_1474_41
            imagebutton:
                align (0.5, 0.5)
                xoffset 800
                idle "next_circle"
                action SetVariable("img_menu_page", img_menu_page * 4 >= len(img_menu_items) and 1 or img_menu_page + 1)

                at _dm_auto_infoscreen_1486_42
# Decompiled by unrpyc: https://github.com/CensoredUsername/unrpyc
