Changelog
Additions
UI
- Cursor styling functionality from
OwoUIAdapter
is now available globally via the new CursorAdapter abstraction, which also provides the implementation for owo-ui - The new configure method on
Component
enables inline configuration of component properties which don't return the component itself. Due to limitations with Java's generic parameters, it is required to manually specify the type of component you're configuring when calling this method, like so:Components.label(...).<LabelComponent>configure(label -> label.mouseDown().subscribe(...))
.
Additionally, any state change events emitted during execution of such a configuration closure are delayed until the closure has completed - this enables large performance improvements when configuring multiple properties of a mounted component, including adding/removing children, as everything is consolidated into a single layout pass - The flow layout has gained the new gap property, which adds the specified amount of dead space between each child
- Collapsible containers now expose the
onToggled
event stream as well as their current state - All components can now easily look up the root component in their respective tree using the new
root()
method - Text box max length can now be defined in XML with the
max-length
element - The new popFramesAndDraw method on
ScissorStack
, allows escaping up to the given amount of clipping frames and execute the supplied draw call - owo-ui colors can now generate a hex color string via the asHexString method
- Entity components can now have an additional dynamic transform applied before rendering the entity
Components#textBox(...)
no longer creates and returns aTextFieldWidget
, instead it creates a TextBoxComponent. This is owo-ui's extension of the vanilla text field, which properly sizes itself if the background is disabled and provides the onChanged event stream. This stream only emits events when the text in the box actually changes, unlike the vanilla change listener
Config
- The config screen now includes a search bar which allows searching through all options and sections by name and value. This search function acts like search in a text editor - you enter your query, then press enter, after which you can inspect all matches individually by pressing enter again
- The new client-side
/owo-config
command can open all config screens for which a provider is registered, even when modmenu is not installed Set<T>
is now a supported type for config options
UI - Layers
Built on top of owo-ui, a new system called Layers has been introduced. This generic API allows adding, or layering if you will, owo-ui components onto arbitrary existing screens. It comes with a helper system that allows easily locating existing vanilla widgets on the screen, as well as the option to align your own components relative to them
Screen Handler Properties and Messages
The new createProperty
along with addServerboundMessage
and addClientboundMessage
methods injected into ScreenHandler
allow for a significant simplification of screen networking. Everything owo can serialize by default is supported out of the box for properties, which automatically get synchronized to the client, and for messages the same rules apply as for standard packets in an OwoNetChannel
. As always, if a serializer is missing you can add your own via PacketBufSerializer.register(...)
This system should completely eliminate the need for externally defined networking, everything can be done directly inside the screen handler
Changes
ItemGroup API
- Existing item groups can now be extended with additional sub-tabs and buttons via mod data
- The name of a sub-tab is now displayed after the name of the item group, given that the tab does not have the new
primary
attribute - Each sub-tab can now declare its contained items more rigorously, as they now define a callback which gets executed to populate the group
- [1.19.3 only]
OwoItemGroup
s now define their icon in terms of an owoIcon
, meaning you are no longer restricted to just item stacks
UI
- Sliders have been migrated to use event streams just like other input events and gained the new
slideEnd
event stream which gets invoked when the user releases the slider handle apply_ContentSizing
inBaseComponent
has been replaced bydetermnine_ContentSizing
which now returns the content size instead of applying it directly
Moreover, the layout algorithm has received a major optimization that improves layout times in complex screens by up to 560%
Config
- Additionally to the existing method, enum config options can now be translated on a per-config instead of a per-option level
- When adding a new entry to a list config option while it isn't expanded, the list now opens itself and focuses the new entry (#68)
- The previously private mechanism for registering config screen providers used by the
@Modmenu
annotation has been made public asConfigScreen#registerProvider
. This means that any potential custom config screen implementations can now be easily registered without needing an additional dependency on modmenu
Misc
- The
owo.forceDisableDebug
system property is now deprecated and superseded by simply settingowo.debug
tofalse
Fixes
UI
- Scrollbars can no longer exceed the size of the container
- When dragging the scrollbar in a precisely filled scroll container, the content no longer becomes invisible
- All button renderers now properly draw with depth testing enabled
- Text boxes, more specifically
TextFieldWidget
, now properly respond to focus events - The UI Interaction sound event is no longer added to the respective registry, which means that client-side mods which use owo no longer cause registry sync to fail (#72)
- Animations on parent components no longer update twice per frame
Config
- Section headers applied to
@Nest
options now show up properly - The config screen no longer attempts to apply constraints placed on
List
config options to that lists elements (#69) - owo is inherently funny
Misc
- owo no longer crashes when run on a dev server
Removed deprecated elements
TexturedButtonComponent
, superseded byButtonComponent.Renderer#texture(...)
- All methods in
Components
which returnedButtonWidget
, superseded byButtonComponent
ScreenUtils#generateSlotGrid
andScreenUtils#generatePlayerSlots
, superseded bySlotGenerator
ScrollContainer.scrollbarColor
, superseded byScrollContainer.Scrollbar#color(...)
Files
90% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Metadata
Release channel
BetaVersion number
0.9.0+1.19Loaders
Game versions
1.19–1.19.2Downloads
583Publication date
November 22, 2022 at 9:22 PMPublisher
glisco
Owner