Topic: 2024/10/31
There won't be a patch this week. The changes I'm making to the GUI code won't be done in time.
(The changes are low-level and if they work, you won't notice a difference. But it lays the groundwork for some future improvements.)
You are not logged in. Please login or register.
There won't be a patch this week. The changes I'm making to the GUI code won't be done in time.
(The changes are low-level and if they work, you won't notice a difference. But it lays the groundwork for some future improvements.)
If anyone is wondering what these changes are exactly, I am implementing layout code for the GUI.
Currently, aside from some very specific cases, controls are specified with X, Y, Width, and Height.
For example:
<Label X="0" Y="0" Width="200" Height="20" Text="A"/>
<Label X="0" Y="20" Width="200" Height="20" Text="B"/>
<Label X="0" Y="40" Width="200" Height="20" Text="C"/>
With the layout code, I can replace this with:
<VStack>
<Label Text="A"/>
<Label Text="B"/>
<Label Text="C"/>
</VStack>
The GUI code measures the controls and lays them out how I ask.
Why bother? I want to code in-game editors, and they are going to have complex user interfaces. I don't want anything so brittle that it looks wrong if I change font size, or is on a screen with a different aspect ratio, or has a translation where the text doesn't fit in the same size as it would for English. For a map editor, it's also important that ListBoxes be able to load art dynamically instead of all at once, so it can't just be a long list of pre-measured controls as it is now. It will be nice to be able to maximize or resize editors, too, and the current code just cannot do that.
This week, I've got Label, Picture, ScrollBar, and ScrollableControl working, as well as Stack layout.
Still broken are CheckBox, RadioBox, TextBox, all the skinned controls, forms, menus, a lot... It'll take some time. Everything is broken. I've put off making this change for a long time, because while necessary, it's not a small change, and importantly, it can't be done entirely incrementally.
Hey, progress is progress even if it's not immediately noticeable in game.
Questions about this GUI dev- Will this change support a more customizable GUI for gameplay elements as well? Eventually it would be really nice to have independent interface DPI scaling from the game view. e.g. having the game window one size, but being able to make the GUI resize depending on individual preference? Font size option would be really great as well.
Also, will there be more scriptable GUI support? I can imagine having more complex forms for misc interactions would be nice. Like being able to insert different buttons, check/radiobox, mini-icons, inventory slots and so on.
.
Well, for instance if we wanted more complex interaction with an object or NPC. Like a forge, or wood crafting bench, something like that. If there was an interface to add items, with options, displayed timers, and such, there could be more advanced add-ons to some skills.
I think Spy did something like this with higher level blacksmithing forge. But there isn't much interface support.
For more examples id be getting really specific because of the possibilities. I guess it can be coded
Doing that right will require server support, so will have to wait. I've definitely been pondering it.
That is the real reason NPC conversation windows no longer close instantly but instead wait for the server's command to close or continue to a new conversation dialog. It wasn't just an aesthetic tweak. That was a first step to making window state server-controlled, at least for a single modal window
Sure, no urgent need for scriptable GUI. One reason I bring it up is art for new "tools". They're larger wall tile sized things like a sharpening wheel, spinning wheel, press (for juice, oil or other extracts), and hope to get more.
They could be just decorations. But, I thought about how they could be much more interactive for skill use or other refining processes. I suppose they wouldn't necessarily need a GUI pop-up, perhaps it can be simplified. I'm getting ahead of myself here, just thinking about GUI could be used in specific things later on. And Scriptable just seems flexible. But this is coming from someone who struggles to make an "open door" script so take it as a grain of salt.
Currently installed 5 official extensions. Copyright © 2003–2009 PunBB.