This is what I want:
(Except the height of Return, that is fine already in the second screenshot)
So you see everything on the bg.
The history screen is in front.
There's a custom scrollbar on the side.
(I searched but couldn't find it for the new coding, I do not want to change the existing images, I want this screen to have its own one
The text is nicely underneath each other.
If you change the screen it uses game_menu but I want to have different settings for different screens so using game_menu is not doable.
I tried to add the viewport and the vpgrid to the history screen itself.
Here's my code:
Code: Select all
screen history(scroll=("vpgrid" if gui.history_height else "viewport"), yinitial=0.0):
## Avoid predicting this screen, as it can be very large.
predict False
style_prefix "history"
frame:
style "history_outer_frame"
hbox:
frame:
style "history_content_frame"
if scroll == "viewport":
viewport:
yinitial yinitial
scrollbars "vertical"
mousewheel True
draggable True
side_yfill True
vbox:
transclude
elif scroll == "vpgrid":
vpgrid:
cols 1
yinitial yinitial
scrollbars "vertical"
mousewheel True
draggable True
side_yfill True
transclude
else:
transclude
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.")
textbutton _("Return"):
xalign 0.5
yalign 0.9
action Return()
## This determines what tags are allowed to be displayed on the history screen.
define gui.history_allow_tags = set()
style history_outer_frame is empty
style history_content_frame is empty
style history_side is gui_side
style history_window is empty
style history_name is gui_label
style history_name_text is gui_label_text
style history_text is gui_text
style history_scrollbar is gui_vscrollbar
style history_label is gui_label
style history_label_text is gui_label_text
style history_outer_frame:
xanchor gui.history_outer_frame_xalign
background "gui/overlay/history_bg.png"
style history_content_frame:
left_margin 40
right_margin 20
top_margin 0
style history_viewport:
xsize 500
style history_vscrollbar:
unscrollable gui.unscrollable
style history_side:
spacing 540
style history_window:
xfill True
ysize gui.history_height
style history_name:
xpos gui.history_name_xpos
xanchor gui.history_name_xalign
ypos gui.history_name_ypos
xsize gui.history_name_width
style history_name_text:
min_width gui.history_name_width
text_align gui.history_name_xalign
style history_text:
xpos gui.history_text_xpos
ypos gui.history_text_ypos
xanchor gui.history_text_xalign
xsize gui.history_text_width
min_width gui.history_text_width
text_align gui.history_text_xalign
layout ("subtitle" if gui.history_text_xalign else "tex")
style history_label:
xfill True
style history_label_text:
xalign 0.5
Code: Select all
define config.history_length = 10
## The height of a history screen entry, or None to make the height variable at
## the cost of performance.
define gui.history_height = 250
define gui.history_outer_frame_xalign = -0.28
## The position, width, and alignment of the label giving the name of the
## speaking character.
define gui.history_name_xpos = 65
define gui.history_name_ypos = 0
define gui.history_name_width = 150
define gui.history_name_xalign = 1.0
## The position, width, and alignment of the dialogue text.
define gui.history_text_xpos = 100
define gui.history_text_ypos = 2
define gui.history_text_width = 450
define gui.history_text_xalign = 0.0
Also sorry for the awful coding.
I messed around with it for hours, it probably looks messed up.
Thank you in advance and again I am so sorry.
EDIT: I.. scrolled up and suddenly saw where the scrollbars are getting their .png.
Second EDIT: Nvm, I can't get it to work.