elysiaenjoyerr wrote: ↑Sun Jan 12, 2025 3:21 pm
the only problem is that there's wasted space next to it
...
I messed around with the frame. When the xsize is smaller than the xsize of the image button, it cuts the buttons off. However, that's the only way I can get rid of the wasted space...
Wasted space?
If you mean to the left of the buttons, then what size they are?
You have
Code: Select all
imagebutton:
auto "archive_nvl_button_%s"
xysize (500, 180)
Are the button images really 500 px wide?
If not, set x size to the actual width of the image.
Like
xysize (280, 180) if the button is 280px wide.
Or, if the button images have large transparent borders on the left, cut them out from the image files.
Anyways, all the problems with the page layout could be solved by proper "pos" and "xysize", usually.
Another thing to take into account is accessibility. Players can set different font sizes. Hence it's best to test page elements (if they have text) with different font sizes (evoked by shift-A in game).
And talking about that... I realized I should probably have something that differentiates the buttons from each other. Is there a way to display a different text on every button to display what that story is? Or would they all have to be different buttons? I'm currently using imagebuttons, like this:
Code: Select all
for i in range(1, 19):
imagebutton:
auto "archive_nvl_button_%s"
focus_mask True
xysize (500, 180)
action [SetScreenVariable("nvl_index", "Testing")]
(You probably don't need "focus_mask True", as buttons are pretty much rectangular).
Yes, I imagine buttons to be different - either having "titles" of the stories, or pictures as titles.
For titles, it makes sense to use "button" instead of imagebutton, e.g.:
Code: Select all
for i in range(1, 19):
button:
# images:
background "archive_nvl_button_idle"
hover_background "archive_nvl_button_hover"
selected_background "archive_nvl_button_selected"
text "Button [i] (testing)":
align (.5, .5)
size 32
xysize (300, 180)
action [SetScreenVariable("nvl_index", "Testing")]
Then for the "NVL" part, you can just show text (like reading a book in Morrowind), doing something like this:
Code: Select all
define library = {
"A Dance in Fire, Book I":
"""Scene: The Imperial City, Cyrodiil
Date: 7 Frost Fall, 3E 397
It seemed as if the palace had always housed the Atrius Building Commission, the company of clerks and estate agents who authored and notarized nearly every construction of any note in the Empire. It had stood for two hundred and fifty years, since the reign of the Emperor Magnus, a plain-fronted and austere hall on a minor but respectable plaza in the Imperial City. Energetic and ambitious middle-class lads and ladies worked there, as well as complacent middle-aged ones like Decumus Scotti. No one could imagine a world without the Commission, least of all Scotti. To be accurate, he could not imagine a world without himself in the Commission.
"Lord Atrius is perfectly aware of your contributions," said the managing clerk, closing the shutter that demarcated Scotti's office behind him. "But you know that things have been difficult."
"Yes," said Scotti, stiffly.
""",
"A Game at Dinner":
"""Forward From The Publisher:
The history behind this letter is almost as interesting and dark as the story it tells. The original letter to the mysterious Dhaunayne was copied and began circulating around the Ashlands of Vvardenfell a few months ago. In time, a print found its way to the mainland and Prince Hlaalu Helseth's palace outside Almalexia. While the reader may conclude after reading this letter that the Prince would be furious about such a work, impugning his highness with great malevolence, quite the reverse was true. The Prince and his mother, Queen Barenziah, had it privately printed into bound copies and sent to libraries and booksellers throughout Morrowind.
As matter of record, the Prince and the Queen have not officially stated whether the letter is a work of pure imagination or based on an actual occurrence. The House Dres has publicly denounced the work, and indeed, no one named Dhaunayne, despite the suggestions in the letter, has ever been linked to the house. We leave the reader to interpret the letter as he or she believes.
-- Nerris Gan, Publisher
""",
}
And the script could be like
Code: Select all
define library = {
None: "",
"A Dance in Fire, Book I":
"""
Scene: The Imperial City, Cyrodiil
Date: 7 Frost Fall, 3E 397
It seemed as if the palace had always housed the Atrius Building Commission, the company of clerks and estate agents who authored and notarized nearly every construction of any note in the Empire. It had stood for two hundred and fifty years, since the reign of the Emperor Magnus, a plain-fronted and austere hall on a minor but respectable plaza in the Imperial City. Energetic and ambitious middle-class lads and ladies worked there, as well as complacent middle-aged ones like Decumus Scotti. No one could imagine a world without the Commission, least of all Scotti. To be accurate, he could not imagine a world without himself in the Commission.
"Lord Atrius is perfectly aware of your contributions," said the managing clerk, closing the shutter that demarcated Scotti's office behind him. "But you know that things have been difficult."
"Yes," said Scotti, stiffly.
"Lord Vanech's men have been giving us a lot of competition lately, and we must be more efficient if we are to survive. Unfortunately, that means releasing some of our historically best but presently underachieving senior clerks."
"I understand. Can't be helped."
"I'm glad that you understand," smiled the managing clerk, smiling thinly and withdrawing. "Please have your room cleared immediately."
<...>
""",
"A Game at Dinner":
"""
Forward From The Publisher:
The history behind this letter is almost as interesting and dark as the story it tells. The original letter to the mysterious Dhaunayne was copied and began circulating around the Ashlands of Vvardenfell a few months ago. In time, a print found its way to the mainland and Prince Hlaalu Helseth's palace outside Almalexia. While the reader may conclude after reading this letter that the Prince would be furious about such a work, impugning his highness with great malevolence, quite the reverse was true. The Prince and his mother, Queen Barenziah, had it privately printed into bound copies and sent to libraries and booksellers throughout Morrowind.
As matter of record, the Prince and the Queen have not officially stated whether the letter is a work of pure imagination or based on an actual occurrence. The House Dres has publicly denounced the work, and indeed, no one named Dhaunayne, despite the suggestions in the letter, has ever been linked to the house. We leave the reader to interpret the letter as he or she believes.
-- Nerris Gan, Publisher
***
Dark Liege Dhaunayne,
You asked for a detailed description of my experience last night and the reasons for my plea to House Dres for another assignment. I hope I have served you well in my capacity as informant in the court of Prince Helseth, a man who I have stated in many previous reports could teach Molag Bal how to scheme. As you know, I've spent nearly a year now working my way into his inner circle of advisors. He was in need of friendship when he first arrived in Morrowind and eagerly took to me and a few others. Still, he was disinclined to trust any of us, which is perhaps not surprising, given his tenuous position in Morrowind society.
For your unholiness's recollection, the Prince is the eldest son of Barenziah, who was once the Queen of Morrowind and once the Queen of the High Rock kingdom of Wayrest. At the death of her husband, Prince Helseth's stepfather, King Eadwyre, there was a power struggle between the Prince and Eadwyre's daughter, the Princess Elysana. Though details of what transpired are imperfect, it is clear that Elysana won the battle and became Queen, banishing Helseth and Barenziah. Barenziah's only other child, Morgiah, had already left court to marry and become Queen of the Summurset Isle kingdom of Firsthold.
<...>
""",
"And so on": "And so on (button 3 here)...",
}
image btn_bg:
Solid("#AA7", xysize=(280, 170))
on idle:
alpha 1.
Solid("#AA7", xysize=(280, 170))
on hover:
alpha 0.5
Solid("#884", xysize=(280, 170))
easein 0.1 alpha 1.
screen vpgrid_test():
default nvl_index = None
vpgrid:
cols 1
spacing 12
draggable True
mousewheel True
scrollbars "vertical"
xpos 40
vscrollbar_xsize 40
vscrollbar_xoffset -320
vscrollbar_base_bar Frame("gui/scrollbar/vertical_[prefix_]bar2.png")
vscrollbar_thumb Frame("gui/scrollbar/vertical_[prefix_]thumb2.png")
# for i in range(1, 20):
for k,v in library.items():
if k:
button:
xysize (280, 170)
add "btn_bg"
text k align (.5, .5)
action SetScreenVariable("nvl_index", k)
side "c r":
area (400, 100, 1400, 800)
viewport id "vp":
draggable True
mousewheel True
text "[library[nvl_index]]"
vbar value YScrollValue("vp")
label start:
call screen vpgrid_test
which means
dict "library" consists of books, where book titles are used as dict's keys and are shown as button titles; book texts are shown on the right.
Or, if you wish to have clickable dialogs on the right, then probably clicking a button on the left would take readers to the labels of those stories.
Something like
action Jump("story_123"), where
Code: Select all
label story123:
nvl_character_1 "Dialog line 1"
nvl_character_2 "Dialog line 2"
# etc.