Questions about 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
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Questions about the History Screen [SOLVED]

#1 Post by TellerFarsight »

Alright so I'm trying to fiddle with the history screen to make it a smaller window inside another screen. I just sort of extracted the default code out and put it in a new screen to see what happened, but the result is pictured below. What should I do to fix this? Any styles here are still there in the code, still whatever they said by default.

Code: Select all

screen page2():
    tag menu
    predict False
    viewport:
        xpos 80
        ypos 80
        yinitial 1.0
        scrollbars "vertical"
        mousewheel True
        draggable True
        xsize 400
        ysize 400
        side_yfill False
        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.")
Untitled.png
Last edited by TellerFarsight on Tue Jun 05, 2018 10:50 pm, edited 1 time in total.
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: Questions about the History Screen

#2 Post by mitoky »

I had the exact same problem few days ago! You have to add a vbox. + i noticed "for h in _history_list:" is missing. it should be like this:

Code: Select all

screen page2():
    tag menu
    predict False
    viewport:
        xpos 80
        ypos 80
        yinitial 1.0
        scrollbars "vertical"
        mousewheel True
        draggable True
        xsize 400
        ysize 400
        side_yfill False
        for h in _history_list:
        vbox:
            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.")

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Questions about the History Screen

#3 Post by kivik »

mitoky wrote: Mon Jun 04, 2018 2:26 am I had the exact same problem few days ago! You have to add a vbox. + i noticed "for h in _history_list:" is missing. it should be like this:
Double check your code, you've left two versions of for h in _history_list in there :P

TellerFarsight:

As mitoky said, you need the vbox: because Renpy's screen language doesn't display stuff like conventional text processor - it doesn't assume that each line of text goes underneath another, without explicitly being told so (vbox to go line by line to bottom, hbox for column by column to the right).

It's worth refreshing your knowledge of the screen language by reading the screen language page and understand what each of the properties are for.

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: Questions about the History Screen

#4 Post by mitoky »

kivik wrote: Mon Jun 04, 2018 9:00 am
mitoky wrote: Mon Jun 04, 2018 2:26 am I had the exact same problem few days ago! You have to add a vbox. + i noticed "for h in _history_list:" is missing. it should be like this:
Double check your code, you've left two versions of for h in _history_list in there :P

TellerFarsight:

As mitoky said, you need the vbox: because Renpy's screen language doesn't display stuff like conventional text processor - it doesn't assume that each line of text goes underneath another, without explicitly being told so (vbox to go line by line to bottom, hbox for column by column to the right).

It's worth refreshing your knowledge of the screen language by reading the screen language page and understand what each of the properties are for.
Whoops, you are right! Thanks for pointing that out!
I thought were was none as it was moved into the viewport and i didntvsaw.
Delete that one inside the viewport and leave the one inside the vbox!

User avatar
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Re: Questions about the History Screen

#5 Post by TellerFarsight »

Oh, duh, of course that's it! I was working on it pretty late before I went to sleep, so I wasn't really thinking straight. I just grabbed a chunk of code and moved it to see what happened, so I didn't really have the energy to figure it out. Thanks! I'll try it out when I get home (I'm at work rn) and I assume it'll work, but I'm concerned about the appearance of the textbox there. Hopefully that'll disappear when I change it, but why is it here now?
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

User avatar
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Re: Questions about the History Screen

#6 Post by TellerFarsight »

Ok, so that did work, but like I thought, for some reason the textbox also appeared. I decided to put the history style_prefix in and work backwards from there instead.
The code is still the same, but I put style_prefix "history" back where it is by default, and vbox where you guys suggested.
What I have now is this:
Untitled.png
I want to extend the window of the history screen further to the right and further down. Also, the scrollbar's thumb image that I have is a small green square, and I want it to remain a square instead of tiling out to what you see in the picture. Any suggestions for either of these problems?
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

User avatar
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Re: Questions about the History Screen

#7 Post by TellerFarsight »

Alright never mind about the viewport size, I found that with the inspector.
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

Post Reply

Who is online

Users browsing this forum: Google [Bot], Kocker