init offset = -1

screen history():
    tag menu
    predict False

    use game_menu(_("History")):
        style_prefix "history"
        frame align .5,.5 background None ysize 800:
            viewport:
                # xfill False
                yinitial 1.0
                mousewheel True
                draggable True
                pagekeys True
                frame background "#fff4" xfill True:
                    vbox spacing 30 align .5,1.0:
                        for h in _history_list:
                            fixed fit_first True:
                                frame xsize 800:
                                    $ what = renpy.filter_text_tags(h.what, allow=gui.history_allow_tags)
                                    text what
                                if h.who:
                                    text h.who:
                                        substitute False
                                        xalign 0.0 xanchor 1.0 xoffset 30
                                        ## Take the color of the who text from the Character, if
                                        ## set.
                                        # if "color" in h.who_args:
                                        #     text_color h.who_args["color"]
                    if not _history_list:
                        text _("The dialogue history is empty.")

## This determines what tags are allowed to be displayed on the history screen.
define gui.history_allow_tags = { "alt", "noalt" }


# style history_text is zero