Changelog
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
Files
90% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Metadata
Release channel
BetaVersion number
0.11.0+1.20Loaders
Game versions
1.20–1.20.1Downloads
103774Publication date
June 8, 2023 at 12:12 PMPublisher
glisco
Owner