Italic text in the History screen? [SOLVED]

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
pastelciel
Regular
Posts: 26
Joined: Sun Nov 23, 2014 8:32 pm
Projects: 【Pitch Black Serenade】
Organization: 97Circle
itch: 97circle
Contact:

Italic text in the History screen? [SOLVED]

#1 Post by pastelciel »

I have the Narrator of my game speaking with italic font by default.

Code: Select all

define narrator = Character (what_italic=True, what_outlines=[ (2, "#40555B") ], ctc="ctc_animation", ctc_position="fixed")
But it won't show in the history screen. I'd like the history screen to show the Narrator's text in italic, but it only does it when I use the italic tag {i}{/i} directly in the dialogues.
Anyone knows how to fix this? Here's my code for the history screen.

Code: Select all

screen history():
    tag menu
    ## Avoid predicting this screen, as it can be very large.
    predict False
    add "gui/history_ground.png"
    vpgrid:
        style_prefix "history"
        cols 1
        yinitial 1.
        draggable True
        mousewheel True
        arrowkeys True
        scrollbars "vertical"
        yalign .5
        xalign .5
        ymaximum 561
        xmaximum 800

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

        #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 = ("outlinecolor", "i")
Last edited by pastelciel on Thu Oct 04, 2018 4:27 am, edited 1 time in total.
---------------------------------------------------------------------------------
【Pitch Black Serenade】 demo is out! ⇒ [itch.io]

philat
Eileen-Class Veteran
Posts: 1912
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Italic text in the History screen?

#2 Post by philat »

Replace "text what" with the following:

Code: Select all

text what:
    if "italic" in h.what_args:
        italic True

User avatar
pastelciel
Regular
Posts: 26
Joined: Sun Nov 23, 2014 8:32 pm
Projects: 【Pitch Black Serenade】
Organization: 97Circle
itch: 97circle
Contact:

Re: Italic text in the History screen?

#3 Post by pastelciel »

philat wrote: Wed Oct 03, 2018 9:23 pm Replace "text what" with the following:

Code: Select all

text what:
    if "italic" in h.what_args:
        italic True
Thank you very much!!
---------------------------------------------------------------------------------
【Pitch Black Serenade】 demo is out! ⇒ [itch.io]

Post Reply

Who is online

Users browsing this forum: Baidu [Spider], Milkymalk, wizard_jpg