Additions
A new sizing method joins the owo-ui framework - Sizing.expand
. It works mostly the same as Sizing.fill
(and indeed identically in a few cases) with the important difference that it applies after all other sizing types and only takes into account the space that remains after all other components have been inflated according to their sizing.
Along with this, the new Components.spacer
can be used to, for example, easily push two components to opposite ends of their parent
Changes
- The
OverlayContainer
no longer closes itself when its child is clicked inbounds but doesn't consume the event. Further, it prevents the screen from closing when ESC is pressed and instead only closes itself and it consumes all scroll events to avoid scrolling through the overlay(#199) - owo-ui component trees inside one of the screen implementations provided by owo (
BaseOwoScreen
andBaseOwoHandledScreen
) can now process and consume ESC keypresses
Fixes
- Only the most specific tooltip at a given mouse pointer location is now rendered by an owo-ui tree, fixing overlapping tooltips in the config screen (#95) and preventing tooltips from showing on components that are hidden by an overlay (like a color picker)
EntityComponent.RenderablePlayerEntity
now correctly loads skins againBaseComponent.hovered
is now only set totrue
when the component is not obscured by another one (#199)- When moving around the handles of a color picker, which one is affected no longer depends on the cursor position but only on which one was clicked
Additions
The major addition this time around is the Endec serialization framework, an interoperable alternative to Mojang's own Codec. As outlined in the changes section, this supersedes a bunch of older owo APIs as well - notably networking. To get started with endec, check out the newly written documentation: https://docs.wispforest.io/owo/endec/
Changes
NbtKey
and all associated API has been removed entirely in favor of the new, Endec-based and functionally extremely similarKeyedEndec
used in conjunction withMapCarrier
(which is interface-injected onto the same classes asNbtCarrier
used to be)PacketBufSerializer
has been removed in its entirety and all dependent API updated to use Endecs instead. For writing data directly to a network buffer like the old API used to allow, use the equivalent Endec (potentially obtained from theReflectiveEndecBuilder
) together with the interface-injectedPacketByteBuf#write(Endec, Object)
andPacketByteBuf#read(Endec)
- As a consequence of the update to 1.20.3+, the custom text API has been simplified. Because the vanilla changes make them redundant,
CustomTextContent
along withCustomTextContentSerializer
no longer exist - instead, simply implement the vanillaTextContent
interface, create aTextContent.Type
with the appropriate codec and register said type in theCustomTextRegistry
as before
Fixes
ScissorStack
now clamps the width/height passed toglScissor
to prevent causing OpenGL errors in contexts with funky transformations- All buffers in the draw context used for layers are now forcefully flushed before the layer is rendered to stop tooltips going missing due to scissoring in the layer
- Forcefully flush all buffers after drawing an owo-ui tooltip (similar issues as above)
Finally, the following previously deprecated API elements have been removed:
BaseParentComponent#mountChild
, use the new two-argument version instead to prevent unnecessary inflationsParentComponent#collectChildren
, replaced by the more appropriately named but functionally identicalParentComponent#collectDescendants
OwoItemGroup#setSelectedTab
,OwoItemGroup#getSelectedTab
andOwoItemGroup#getSelectedTabIndex
- use the new equivalents which are aware that multiple tabs can be selectedNinePatchRenderer
andOwoNinePatchRenderers
, long-replaced byNinePatchTexture
andOwoNinePatchTextures
Additions
- Multiple tabs can now be selected simultaneously in a single OwoItemGroup (this behavior can be disabled for each group individually if not desired)
- The new
panelWithInset(...)
surface allows building interfaces in the style of the Social Interactions screen - Sizing with different methods (for instance, content and fixed sizing) can now be animated between (there are no immediate API changes as a result of this, merely one less runtime warning and a new feature)
- The base point (for layout calculations) and visual position (for rendering and interaction) of an owo-ui cmponent are now two separate concepts (this again comes without any breaking API changes, merely two new methods that should be called in the appropriate places)
- Items can now automatically have their usage statistic tracked by owo through setting
OwoItemSettings#trackUsageStat()
- [Experimental] Screens can now implement the
DisposableScreen
interface if they need to be notified when the player actually closes all screens (that is, returns to the game) instead of immediately when navigating to a different screen (which might then later navigate back to the first screen)
Changes
- Methods on owo-ui components which accept a collection of components now use upper-bounded generics instead of an explicit type to allow more specific collections at the call site
Sizing.fill()
can now be called with zero arguments to indicate 100% fillUIParsing.registerFactory(...)
can and should now be called with an indentifier instead of a plain string for the element nameParentComponent#childById(...)
is no longer @Nullable, as it is generally expected to return a component in its most common use-case (querying the constituents of a UI model)
Fixes
- Trimmed armor in an ItemComponent now renders properly (#152, Zailer43)
- Explicitly positioned owo-ui components are no longer inflated twice for each single layout pass
Fixes
- The
ltr-text-flow
algorithm for flow layouts no longer miscalculates its columns in some situations (#137) - Clearing the text field of a color config option no longer crashes the game (#128)
- The owo-config annotation processor should now generate type interfaces in a deterministic order every time its ran (#139)
Changes
OwoUIDrawContext.of(...)
now inherits the matrix- and scissor-stacks of the source context - this is more intuitive given how the method is named and used & fixes a few transform-related problems in owo-ui- The
ReiUIAdapter
now flushes the draw buffer when its finished rendering to prevent mysteriously empty tooltips - Item insertion order when transferring container->player inventory using
ScreenUtils.handleSlotTransfer(...)
has been reversed to match vanilla behavior
Additions
- A set of new interface-injected methods on
DrawContext
enable easy, fluent matrix-stack manipulation directly on the associated draw context (#136, Blodhgarm) - owo-ui now also provides exclusion zones to EMI (#103, Abbie5)
ItemOps.decrementPlayerHandItem(...)
and.emptyAwareDecrement(...)
gained new overloads which accept a count instead of always decrementing by 1 (#141, chyzman)
Additions
Cross-referencing in UI models
When instantiating templates in a UI model, you can use the new <template-name>@<ui-model-id>
syntax to reference a template from a different UI model. This allows much greater flexibility than before in modularizing and re-using templates across different screens.
Along with this change, the <components>
element in UI model definitions is no longer required.
UI
- The
blur()
surface now supports parsing from UI models BaseOwo*Screen
implementations now provide thecomponent(...)
shorthand forthis.adapter.rootComponent.childById(...)
- Layers can now align their components relative to Minecraft's handled screen coordinates using
alignComponentToHandledScreenCoordinates(...)
on the instance Surface.PANEL_INSET
was added, which renders an inset area to be used insideSurface.PANEL
- this looks very similar to the vanilla recipe book panel- Two new components,
smallCheckbox(...)
andslimSlider(...)
, were added - they function mostly identically to the already existing counterparts, but (as the name implies) take up less space and offer more customizability TextAreaComponent
, a third new component, is an extension of vanilla's newEditBoxWidget
for general-purpose use and optimized to play nicely within an owo-ui contextItemComponent
offers a new property,setTooltipFromStack
, which always keeps the component's tooltip in sync with the item stack it's displaying- The height of each line a
LabelComponent
can now be configured using the newlineHeight
property, which allows properly supporting non-standard fonts - Components can now be placed at fixed percentage across their parent without respecting the components own size using
Positioning.across()
StackLayout
respects much the same layout rules asFlowLayout
, but doesn't place components next to each other - instead it places them on top of each other, thus creating a stack of componentsContainers.ltrTextFlow(...)
creates a new type of FlowLayout, which works just likeComponents.horizontalFlow(...)
but wraps when it exceeds its own width - just like how left-to-right text is laid out in a document- Block, item, and entity components now support NBT (and in the case of blocks, block state data) when being parsed from a UI model
Config
Server-sided retrieval of a client's config options has been made more ergonomic. For this purpose, the generated config wrapper now exposes the key of each individual option through the .keys
object. Further, ConfigSynchronizer.getClientOptions
received a new override which directly accepts the config wrapper, enabling the following API:
var optionValue = ConfigSynchronizer.getClientOptions(player, MyMod.CONFIG).get(MyMod.CONFIG.keys.someOption);
Misc
- owo-sentinel now lists the mod which included it in addition to all mods that depend on owo, in an effort to reduce confusion when mod authors don't declare their dependency (BasiqueEvangelist, #123)
AutoRegistryContainer
provides two new convenience functions:.register(...)
, which is simply an alias forFieldRegistrationHandler.register(...)
.conform(...)
, which forcefully casts aClass<?>
to aClass<T>
for implementinggetTargetFieldType()
for parametrized classes
Changes
UI
HUD
now processes removal requests before add requests, allowing HUD components to be properly reloaded within the same frame- When the inspector draws slot indices in a handled screen, it now uses
H:
to denote the slot index in the handler andI:
to indicate that slot's index into its respective inventory - The
file(...)
UI model data source is now deprecated in favor of a new, configurable hot reload system which is only active in development. This way, you cannot accidentally ship your mod with the file data source enabled, causing it to crash in production NinePatchRenderer
was renamed toNinePatchTexture
and reworked to function in a data-driven manner. No old functionality has been removed yet, it was however deprecated. More details on how to use the new implementation will be added to the documentation shortly
Fixes
UI
ItemComponent
s once again use correct lighting on side-lit models and apply lighting properly when non-side-lit models are scaled downLabelComponent
now properly fetches the text style under the cursor when determining which hover and click events to executeTextFieldWidget
andEditBoxWidget
now have theirtick()
function called when wrapped by owo-ui, making their cursors blink properlyScrollContainer.scrollTo(...)
now works properly on horizontal containers and has a new overload for directly specifying the target scroll offset without supplying a component
Config
- owo-config screen providers are now once again properly listed in Mod Menu
Misc
ParticleSystemController
s no longer forcefully require handshaking when merely mentioned, fixing optional handshaking (BasiqueEvangelist, #123)- By utilizing new API within Roughly Enough Items, handled screens built with owo-ui now properly layer with the REI overlay - there should be no more over- and underdraw
Finally, the following previously deprecated API elements have been removed:
VerticalFlowLayout
andHorizontalFlowLayout
, which have been replaced by instantiatingFlowLayout
with the respective AlgorithmOptionComponent
andOptionComponents.createSlider
, which were replaced byOptionValueProvider
andOptionComponents.createRangeControls
respectivelSliderComponent#onChanged
, replaced by the respective event stream
Continuing the spirit of the last two releases, this build brings another very important fix - this time to config synchronization. The previous implementation had a bug where all synced options would be lost upon death of the player, which caused crashes specifically in conjunction with YIGD and Numismatic Overhaul
This should ideally be the last build that backports fixes from the 0.11 prereleases and therefor the last release for 1.19.4 before we move onto 1.20
Just like 0.10.4, this is another round of small fixes:
- Fabric API fixed their implementation of the screen render event, leading to owo's workaround now breaking rendering of owo-ui layers
- Lighting orientation on owo-ui item components was fixed, as proposed in #119
Similarly to 0.10.3, this build contains more changes to the core shader loading system.
The immediate effect of this is proper compatibility with the QSL implementation of Fabric's Core Shader API, although it should also make such incompatibilities much more unlikely to occur in the future
This build is indentical feature-wise to 0.10.3 for 1.19.3
Changes
The vertical and horizontal layout algorithms that were previously implemented in the respective subclasses of FlowLayout
have been factored out into two implementations of the new Algorithm
interface. The subclasses are temporarily preserved for backwards-compatibility but are deprecated and will be removed in the next major version.
Ideally you should already migrate your code to use the generic FlowLayout
class to prepare for the move
Fixes
- The injections into
ShaderProgram
are no longer required, which should fix compatibility with Satin on Quilt (#83) - Entity name tags are now rendered by default again, whereas before they would only appear after seeing an owo-ui entity component for the first time (#84)
- Vanilla text fields (and thereby owo text boxes) are once again
GreedyInputComponent
s - Yet another situation in which a scroll container could achieve a scroll value of
NaN
has been resolved
Additions
UI
- The new
ColorPickerComponent
presents an easy-to-use, self-contained way to choose a color. It visually presents a standard HSV picker, with a hue (and optionally alpha) slider and picker for value and saturation. The picker itself shows neither a color preview nor hex field - these can easily be added externally via the color selection event stream supplied by the picker - UI overlays like popup dialogs can now be easily realized via the new
OverlayContainer
, accessible viaContainers.overlay(...)
. This component, when added to some parent (in most cases the root), renders an overlay covering the entire parent and places its child in the center. By default, it automatically closes itself when a click event is received outside the child ItemComponent
features the newtooltipFromItem
utility method, which can be used to gather the full tooltip of an item stack, including extra tooltip data- Rendering of nametags in
EntityComponent
can now be toggled on a per-component basis - The new
openAsContextMenu
function onDropdownComponent
enables easy integration of context menus into any screen - Animations on component properties now provide the
finished()
event stream which emits every time the animation finishes a full run in either direction RenderEffectWrapper
, accessible viaContainers.renderEffect
offers a hassle-free way to apply arbitrary rendering effects to its children. Check out the component's javadoc for a more complete overview
Config
- owo-ui's
Color
type is now supported in configs. This means it will be properly serialized as a string representing the color in#AARRGGBB
format and displayed that way in the config screen. With this also comes an optional color picker, allowing your users to easily pick a color (optionally with alpha as well) - The Jankson serializer instance used by any given config wrapper can now be customized through the new, optional constructor parameter. This enables non-standard serialization of existing types and also allows serializing completely custom types
- The
@RangeConstraint
annotation has gained the newdecimalPlaces
parameter which controls how many decimal places are shown when this option is edited as a slider
Rendering
The Drawer
class has gained a few new rendering functions to fill in missing functionality:
- drawCircle and drawRing can be used to draw either a filled circle or ring with specific inner and outer radius respectively
- drawLine draws an arbitrary line as a quad instead of using OpenGL's line mode, which allows more correct control over thickness
Additionally, the new GlProgram
class and corresponding infrastructure enables usage of custom core shaders from mod namespaces. Two default programs are provided, although they are not currently part of stable public API:
- OwoClient.BLUR_PROGRAM applies an approximate gaussian blur to the area it draws over
- OwoClient.HSV_PROGRAM works much the same as the standard position-color program, but accepts the color attribute in HSVA format instead of RGBA
Changes
UI
- The HSV interface of
Color
has been improved: Constructing a color with a hue of 1 no longer causes it to become yellow instead of red and the newhsv()
getter can be used to convert from RGB to HSV easily - The REI exclusion zone provider now gathers the components directly from the UI adapter instead of simply assuming that it's available as the first drawable child of the screen - this should fix some edge cases in which the exclusion zones were broken due to a different widget somehow being inserted into the screen before the UI adapter
- The
RenderablePlayerEntity
inner class ofEntityComponent
is now publically accessible - this makes it easier to call methods on such entities and allows easily extending the class if so desired DropdownComponent.requiresHover
has been renamed tocloseWhenNotHovered
to more clearly communicate its purpose. The entire dropdown system has been slightly overhauled in general to be more visually pleasing and easier to use
Config
OptionComponentFactory.Result
now features two type parameters to more cleanly carry information about the contained components- All numeric, range-constrained config options can now be edited with either a slider or text field, at the discretion of the user
Fixes
UI
- Sprite components with ticked sprites should now properly animate with Sodium's "Only animate visible textures" option enabled (BasiqueEvangelist, #78)
- When cycling UI component focus with the Tab key, the first component no longer get skipped and the children of a grid layout are no longer focused in reverse order (#77)
- Fire and the nametags of entities are now properly aligned in
EntityComponent
- Buttons and checkboxes in dropdown can now be properly clicked on the entire width of the dropdown
- Layers now handle event parameters in a different way that works around a memory present in Fabric API's event system. This previously caused owo screen instances to be leaked, which is no longer the case (#81)
Misc
- Items from
OwoItemGroup
sub-tabs which are not the first one are now properly indexed for search in the creative inventory - owo-sentinel now one again has full functionality when running on the Quilt Loader