WIP: feat!: tree scene hierarchy and single-pass layout system #88
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mupen64/ugui!88
Loading…
Reference in a new issue
No description provided.
Delete branch "simple-layout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
TODO
Breaking Changes
UID slot changes
Various controls now use more UID slots due to internal changes.
button- 2 slotstoggle_button- 2 slotscarrousel_button- 4 slotscombobox- 9 slotsspinner- 9 slotstabcontrol-n(children) * 2 + 1Tip: if you find yourself having to fix UID-related breakage often, space out the UIDs in your scene by
100- it's easy to keep an eye on and reasonably safe against future breakage.Reserved UID
UID
math.minintegeris now reserved by ugui and can't be used by library consumers. If you're using that UID, change it to something else.Control references
While not explicitly documented anywhere, previous versions of ugui somewhat tolerated holding on to a
Controlinstance after it's consumed byugui.control(or one of the control placing functions likeugui.button).This behavior is now out the window: reading back from control tables after they're consumed is undefined behavior.
Barely any library consumers rely on this behavior, but if you do, you can re-architect your script to store data in a safe local context instead of smuggling it through ugui.
Templated controls
ugui.controlas well as all control spawning functions (e.g.ugui.button) now have an additional parameter,fn.fnis a callback that's called immediately after the control was placed. Any controls placed within the callback will be parented to the newly placed control.It's important to note that the controls themselves decide when
fnis called. Therefore, it behaves more like a slot, similar to WPF'sContentPresenter.Many controls now place children by default, but this isn't something public API consumers should care about.
Control.rectangleThe
Control.rectanglefield has been deprecated.Any usages of it will be internally translated to margins and sizes (see below).
Control positioning and sizing
The positioning and sizing of controls is now controlled via the
Control.margin,Control.align,Control.size, andControl.paddingproperties. See the docs.Note the
Smart[...]units.Units
A unit system has been introduced. If you're familiar with CSS units, these are basically a barebones version of that.
See the docs for more.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.