oωo (owo-lib)

oωo (owo-lib)

Mod

A general utility, GUI and config library for modding on Fabric and Quilt

Client or server Library

2.97M downloads
854 followers
Follow Save
90% of ad revenue goes to creators. Go ad-free while supporting creators with Modrinth Plus. Subscribe today!
Filter loader...
Filter versions...
Filter channels...

Additions

  • CursorStyle now includes the whole range of standard cursors implemented by GLFW (#296, chyzman)

Fixes

  • Scissor coordinates are now clamped before passing them to OpenGL in the ScissorStack utility - this fixes a bunch of edge-cases with mods like Ok Boomer
  • Using a cursor style which is unsupported by the host OS no longer causes a crash when trying to dispose the screen (#301)

Fixes

  • Modifying the message of a CheckboxComponent now functions correctly again
  • The experimental derived components API, which breaks stack equality in 0.12.12, should now work without crashes and without that bug (#298)

Additions

  • An experimental API for deriving item stack components based on the user-provided components has been added (check OwoItem#deriveStackComponents). The current implementation only re-derives components when Item#postProcessComponents gets invoked and is subject to change

Changes

  • Config screen providers are now registered through the new ConfigScreenProviders class to avoid classloading issues (the old methods on ConfigScreen remain but are deprecated for removal). Along with this change, the config screen generated by a provider no longer needs to extend owo's ConfigScreen

Fixes

  • The SyncedProperty and screen handler messages APIs now properly pass registry context when serializing over the network
  • Recipe-specific remainders, which were not properly ported to 1.21, work again

Additions

  • Minecraft's ComponentTypes can now have both their codec and packet codec populated by calling .endec(...)
  • A new overload for CodecUtils.toEndec along with CodecUtils.toEndecWithRegistries allow creating endecs from both a codec and packetcodec (where the latter one uses a packetcodec of RegistryByteBuf)
  • The new Surface.panorama(...) allows using Minecraft's main menu panorama as an owo-ui surface
  • Sizing.Random

Changes

  • The OwoItemSettings-specific methods are now interface-injected onto all item settings and the previous class deprecated
  • EndecRecipeSerializer is no longer abstract, making subclassing unnecessary in most cases

Fixes

  • A number of changes were made to the endec library and owo's EdmOps to alleviate most (hopefully all) problems related to codec <-> endec interop when NBT is involved (Blodhgarm)
  • Wrapper item groups (which broke during the port 1.21) now work again
  • MinecraftEndecs.PACKET_BYTE_BUF no longer moves the reader index when encoding a buffer
  • A rare crash that could occur when causing input on a screen which failed loading its UI model has been fixed (#263, Zailer43)
  • Pressing ctrl+delete in a text field in owo-ui debug mode no longer crashes (#264, Zailer43)
  • Color.ofDye, which was improperly ported, now produces correct colors again (#273, Blodhgarm)
  • OverlayContainer no longer mounts its children incorrectly if it has a non-zero position (#278, kikugie)

This build is primarily a port of 0.12.9 to 1.21. This mandated a few other changes:

Endec changes

The Endec API is no longer built into owo-lib. Instead, owo now uses and ships the standalone endec library. This entails four major changes:

  • Endecs for Minecraft's types are no longer found on BuiltInEndecs but instead on MinecraftEndecs
  • DFU interop (namely, converting between codecs and endecs) is now handled through CodecUtils.toCodec/toEndec and related functions
  • A number of package changes, primarily io.wispforest.owo.serialization -> io.wispforest.endec
  • All JSON-related implementations are now named after the JSON library they use. In consequence, the previous JsonSerializer is now GsonSerializer and so on

Further Fixes

  • EdmOps no longer uses null as its empty value, fixing a number of edge cases with particular types of DFU codecs when doing interop
  • owo's ScreenHandler extensions don't require a HandledScreen anymore and now also support other screens which implement `ScreenHandlerProvider

Additions

  • SpriteComponent now supports sprites in the GUI atlas
  • SpriteComponent can now enable blending, using the same API as TextureComponent

Changes

  • When hovering selectable areas in a ColorPickerComponent, the curses now uses the MOVE style
  • The owo-config screen has been updated to Minecraft's new design language for option screens
  • owo-ui errors which occur during the game's initial loading phase are now logged verbosely to hopefully aid in discovering how they are caused

Fixes

  • owo-lib now works with (and requires) Fabric API 0.100.0+
  • The owo-config search field now also searches when pressing the numpad's enter key

Fixes

  • Joining a singleplayer world in an instance where no owo networking features are used no longer fails on the first attempt (#230)

This build fixes a crash (#229) that would occur either on boot or when joining a server (depending on other context) with 0.12.6 for 1.20.5

This release is primarily a (preliminary, hence beta) port of 0.12.6. However, prompted by the game's networking changes and further reliance on attaching registry references to serialization infrastructure, there have been major internal reworks to both the Networking API and Endec. The majority of these changes are transparent to users, with the exception of the occasional requirement to pass a SerializationContext into Endec methods (the documentation will be updated accordingly).

Additions

  • The new Endec#flatFieldOf function creates special struct fields which enable merging the fields of a StructEndec into another one through StructEndecBuilder.of

Fixes

  • Optionals now get serialized properly by the EdmSerializer
  • The EXPAND sizing method now works correctly in presence of a non-zero gap when used inside a FlowLayout (#219)

Additions

  • EdmElement instances which hold a MAP type can now be represented as an EdmMap (which, importantly, implements MapCarrier and can thus be used with KeyedEndec) using EdmElement#asMap (#209, Blodhgarm)
  • The components of a record used for owo networking (or, more specifically, for which an instance of RecordEndec is made) can now be annotated @NullableComponent to support null serialization (#216, Blodhgarm)

Fixes

  • When text with a click event of type OPEN_URL is clicked in an owo-ui label component, the resulting link confirmation screen now properly returns to the screen with label on it after the link has been confirmed/rejected by the user (#214)
  • The error message logged when an owo UI model hot reload fails no longer has mismatched format specifiers
  • Hud addition/removal requests are now processed in invocation order at the beginning of every frame rendered while in a world (this solves weird ordering problems with addition/removal and fixes requests not being processed while the Hud is hidden) (#213)

Additions

  • The line spacing applied to text rendered by owo-ui's label component is now configurable

Fixes

  • The previously broken BlockHitResult endec now encodes correctly and has been made publicly available as BuiltInEndecs.BLOCK_HIT_RESULT

Fixes

  • Tooltips of stacked sibling components now render properly again
  • A label which does not have an owo-ui tooltip but contains text with a hover event now renders that hover event again

Fixes

  • EdmIo now writes the type of each element in a sequence individually, since in general not all elements will have the same type - making some sequences that are valid at runtime unserializable

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 and BaseOwoHandledScreen) 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 again
  • BaseComponent.hovered is now only set to true 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 similar KeyedEndec used in conjunction with MapCarrier (which is interface-injected onto the same classes as NbtCarrier 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 the ReflectiveEndecBuilder) together with the interface-injected PacketByteBuf#write(Endec, Object) and PacketByteBuf#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 with CustomTextContentSerializer no longer exist - instead, simply implement the vanilla TextContent interface, create a TextContent.Type with the appropriate codec and register said type in the CustomTextRegistry as before

Fixes

  • ScissorStack now clamps the width/height passed to glScissor 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 inflations
  • ParentComponent#collectChildren, replaced by the more appropriately named but functionally identical ParentComponent#collectDescendants
  • OwoItemGroup#setSelectedTab, OwoItemGroup#getSelectedTab and OwoItemGroup#getSelectedTabIndex - use the new equivalents which are aware that multiple tabs can be selected
  • NinePatchRenderer and OwoNinePatchRenderers, long-replaced by NinePatchTexture and OwoNinePatchTextures

Fixes

  • Having librenderdoc available system-wide on Linux no longer causes a JVM crash due to a bug in JNA which we now circumvent (#197)

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% fill
  • UIParsing.registerFactory(...) can and should now be called with an indentifier instead of a plain string for the element name
  • ParentComponent#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

  • Component stacking is now properly undone to prevent messing with the global z-offset (#142)
  • owo-ui HUD components are now rendered with a z-offset of 100 by default to prevent overdraw by the chat overlay (#143)
  • The EULA reader now properly works in conjunction with YesCheat (#138)

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)

Project members

Wisp Forest

Wisp Forest

Organization

glisco

Owner

BasiqueEvangelist

Member

Blodhgarm

Member

Details

Licensed MIT
Published 3 years ago
Updated 5 days ago