I have a quest log screen that got to small for all my quests. So I had to modify it with a scrollbar. It's all working fine except for some cosmetic problem:
Two questions:
1. Is
2. What is an elegant way to hide the scrollbar if the list of quest names is not that long. My only idea is to count the number of quest names in the list and add a switch like this to the screen:
if quest_name_count < 12:
*show version without scrollbar*
else:
*show version with scrollbar*
relevant code from that quest log:
Two questions:
1. Is
You must be registered to see the links
still the proper way to use scrollbars? Because this code makes me want to puke... more indentations please!2. What is an elegant way to hide the scrollbar if the list of quest names is not that long. My only idea is to count the number of quest names in the list and add a switch like this to the screen:
if quest_name_count < 12:
*show version without scrollbar*
else:
*show version with scrollbar*
relevant code from that quest log:
Code:
## QUESTNAMES:
vbox:
text "Name:" color gui.accent_color size 60
frame:
background None
side ("c r"):
area (0,0,300,595)
viewport id "questnames":
draggable True mousewheel True
vbox:
xmaximum 300
xfill True
for i in log.activetab():
textbutton i.title() text_hover_color gui.hover_color action SetField(log, "qvar", i) background None xpadding 0.0 text_size 40
vbar value YScrollValue("questnames")