Skip to content

Releases: ZachHembree/RichHudFramework.Client

Fix TextBox Exception and Unload Edge Case

24 Feb 17:19
Compare
Choose a tag to compare

• Fixed bug that could cause a TextBox to throw an out-of-range exception if formatting or content were changed externally.
• Added checks for edge case that could throw a null ref exception on unload

Text and Cursor Fixes

26 Feb 21:03
Compare
Choose a tag to compare

Additions

• Added universal InputEnabled flag to HudElement base for enabling/disabling input updates for any element type
• Added implicit conversion for RichText to ToolTip

Fixes

• Fixed bug causing reported cursor position to be out of sync for custom HUD spaces
• Fixed bug causing TextBox caret to jump back to start
• NamedSliderBox now clips name text to prevent overlap with value
• Fixed face range calculation in PolyBoard types causing incorrect triangles to be drawn for a given slice
• Stabilized input for RadialSelectionBox and increased sensitivity range
• Fixed null ref exception in TextBuilder lined formatter
• Fixed null ref exception preventing client reload on crash
• Fixed typo in IRichChar accessor index

Other Changes

• Removed HudSpaceNode.DrawCursorInHudSpace. The captured draw matrix is out of sync and not easily fixed, so I've removed this feature for now.
• BindGroupInitializer now accepts empty binds

Billboard Pooling, Text Renderer Optimizations & Misc. Library Changes

18 Feb 11:45
Compare
Choose a tag to compare

This update is focused on taking advantage of the changes made in SE's billboard API in v1.200, while also including a few bug fixes and minor additions for the UI library.

Additions

• Added system for handling billboard pooling using recent mod API additions
• Added BillboardUtils class to provide utilites for efficiently rendering billboards in bulk
• Added RadialSelectionBox, a generic radial selection menu extending HudCollection
• Added GlyphFormat constructor that takes font style enum instead of requiring full Vector2I index
• Added tools for rendering polygonal circles & annuli
• Added name indexer to BindGroup
• Added utility methods to selection boxes to simplify adding entries from internal pools
• Added low latency IsChatOpen property to BindManager for input polling
• Added IsNewPressed and IsReleased properties to IControl

Fixes

• Cursor position now continues to update even when not visible
• Fixed bugs in textbox causing caret to appear out of position
• Fixed out of range exceptions in TextBox
• Fixed bug in Dropdown text formatting
• Fixed several instances where library UI elements would fail to initialize previous BG and text colors before taking input focus
• Fixed bug in ListInputElement affecting selection box types that would prevent it from handling disabled entries correctly
• Fixed bug in BindManager where binds would sometimes fail to finish releasing, blocking other inputs

Other Changes

• Refactored text renderer to render billboards in batches, combined with new pooling system,
reducing text draw time by 60-80%
• Binds now use EventHandler delegate type for events
• Removed candidate bind input filter
• Overlapping binds can now be pressed without previously pressed binds being fully released

Fix ScrollBox Min Visible Range Calculation

28 Nov 15:27
Compare
Choose a tag to compare

• Fixed bug preventing ScrollBoxes from correctly calculating logical end of visible range when MinVisibleCount property causes it to run over
• Moved some library UI elements erroneously placed in server ns

UI Clipping, Better Cursor and Input Management

14 Sep 00:14
Compare
Choose a tag to compare

This is a smaller feature update. Unlike previous versions, this update is focused on adding new core functionality to the UI framework without any significant optimizations or changes to the UI library.

Additions:

  • Support for UI clipping. Partially visible elements in scrolling lists, windows, and the like are now clipped instead of simply being set to invisible if they can't fit.
    • Clipping controlled via IsMasking, IsSelectivelyMasked and CanIgnoreMasking properties in HudElementBase
  • ScrollBox and dependent elements now support smooth scrolling
  • Added ToolTips
    • Tooltips are registered with the cursor once every frame on HandleInput
  • Added shared control blacklist to BindManager for disabling the game's built-in binds
    • Controlled via SeBlacklistModes flags. The current version doesn't allow per-control blacklisting. Instead, there are three groups of controls: mouse, camera look, and all binds.

Fixes:

  • Slider bars sliders no longer jump to the cursor when clicked
  • Fixed index out of range bug in TextBox when copying/pasting text
  • UI elements will no longer attempt to capture the cursor when they're not visible

Other Changes:

  • Scaling properties removed from UI elements in favor of the new ScaledSpaceNode, a type of HUD Space Node. The scaling properties were made redundant in the 1.0 release when I introduced support for custom draw matrices and they were just adding a bunch of complexity and jitteriness for no reason. So, I've removed them.
  • Cursor can now be enabled without requiring chat to be open
    • Text entry still requires chat
    • Added a new InputMode property to HudMain to differentiate between cursor input modes.
  • Removed obsolete fast unregister/reregister for UI elements
  • Now using length 1 array wrappers to minimize copies of draw matrix copies when drawing billboards. Hud Space Nodes and HudMain also now expose these wrapper properties. The things I do in lieu of return by ref...

Text Update Fixes and Minor Formatting Optimization

06 May 03:03
Compare
Choose a tag to compare

• Library UI elements that change text formatting now only change text color. This should make it easier to use custom text formats with these types, especially SelectionBox types.
• Fixed bug underline bounding calculation preventing it from correctly clipping underlines on text with a horizontal offset.
• SetText() and SetFormatting() methods in TextBuilders affecting the entire text now change default formatting.
• Changes to text formatting that only affect color will not trigger a full update; it'll just update the billboard color.
• GlyphFormat is now a value type.

Cursor Hotfix

02 Apr 23:33
Compare
Choose a tag to compare
1.1.0.1

Increment version

UI Tree Optimization and Library Overhaul

27 Mar 14:24
Compare
Choose a tag to compare

This update doesn't feature any major feature additions and is mostly focused on improving performance, scalability, and the code quality of elements supplied in the included UI library.

Tree Optimization

In previous versions, update delegates for every node, visible or not, were loaded into the update list on Master. This had the advantage of only requiring the client to update its delegate list when new elements were registered, but with the downside of introducing a constant load, even if nothing was on screen, significantly limiting scalability. Fortunately, there's a simple solution to this problem: just stop trying to load everything at once!

Master now rebuilds its update list constantly, and clients (1.1.0.0+) will only register visible elements; any invisible element in the tree will be omitted along with its children, simultaneously eliminating the overhead of invoking update methods for invisible elements and making tree rebuilds/sorting faster by just reducing the size of the collection. This has the consequence of both significantly raising the ceiling for UI complexity while lowering the cost of invisible UI elements to almost nothing.

But there is one small snag: the update list on Master doesn't update on every draw tick, it's spread out over 5 ticks, meaning there's a little under 100ms of latency, causing perceptible lag time between making an element visible, and having it actually appear. For most use cases, this isn't an issue, but if you're implementing a scrolling list, you'll need to preload a range of elements before and after the visible range, unless you're okay waiting a few frames for your members to appear in the list. The generic ScrollBox in the UI library does this automatically.

Library Overhaul

Every non-generic UI element in the library has been reworked to more closely align with the changes to the appearance and function of Space Engineer's UI elements since the Xbox release, and have gained limited support for keyboard input when focused. Selection Box types, like ListBox, TreeBox and Dropdown, for example, by default, allow scrolling and selection using the arrow keys and space bar, in addition to normal mouse input. It's a small detail, but I think it's small details like that that really bring a UI together.

And that's another thing: Input Focus. While window focusing functions to bring a window to the foreground, the new input focus functionality determines which element should be accepting keyboard input, usually, the last one clicked/selected. This functionality has been integrated into the MouseInputElement, and by extension, every other element that accepts mouse input.

Other Changes:

Selection Boxes: The ListBox, TreeBox, and Dropdown UI elements have been completely reimplemented to improve reliability, appearance and flexibility, and are now all built on a new generic SelectionBox type. In previous iterations, they only supported a single type of entry element; now, they can support custom entry types with arbitrary dimensions, in addition to the more restrictive variants.

• Added support for page subcategories to the terminal.

Minor Terminal Fixes and List Box Refactoring

12 Mar 23:11
Compare
Choose a tag to compare

• Added new API accessors for terminal ListBox types to allow insertion, removal, and retrieval of the selection's current index.
• Terminal ListBox entries now allow the user to retrieve/modify the name of the entry
• Refactored ListBox, Dropdown and TreeBox to allow the use of custom entry elements
• Fixed bug preventing clients from reading/writing to terminal ListBox entry properties
• The terminal will now automatically close when the SE terminal or other windows open

Tab Stops, Statistics, Text Management and Bug Fixes

29 Jan 00:55
Compare
Choose a tag to compare

Additions:
• Added support for tab stops to the text renderer.
• Added stats page to debug utils; enabled/disabled with the "/rhd toggledebug" chat command.
• Added support for extended client registration message to improve extensibility and facilitate access to the client's exception handler. Backward compatible.
• Added ObjectPool documentation and added support for resetting/returning collections to minimize profiler overhead.
• Added support for RichText Clearing/Trimming and added a method for appending StringBuilders to improve reusability.
• Added more overloaded methods for adding StringBuilders/Strings/Chars to RichText and TextBuilders.

Fixes:
• Exceptions thrown in methods registered to client bind press events are now caught by the client instead of master.
• Client Root PixelToWorld transform and cursor now updating at the correct time.
• Fixed a few instances where API accessors were creating unnecessary copies of RichText objects.
• Fixed bug in TextBuilder that would cause SetFormatting() format comparison to always return false and force a glyph data to be regenerated.
• FIxed bug in NodeUtils that could cause HudCollection to over-allocate when adding fast unregistered UI elements.
• Fixed bug in NodeUtils that would cause it to throw an exception when trying to remove an empty collection.
• Fixed bug in NodeUtils that caused unregister range to always mark elements as fast unregistered.
• Fixed a number of API accessors that were inappropriately casting RichText data as IList instead of List, forcing a copy to be made.

Other Changes:
• TextBuilder will now attempt to reuse the last RichText object used to set text when retrieving its contents.
• Replaced Utils.Stopwatch with System.Debugging.Stopwatch. I don't know when this was whitelisted, but I'm really happy that it was.
• RichText will now compare the formatting of the last appended string to the current string to see if it can reuse the previous StringBuilder.
• HudMain clipboard now returns/creates copies instead of the original, mutable instance.
• ObjectPool now backed by List instead of ConcurrentBag.
• Renamed IBind and IChatCommand events to match the convention used by other events.
• Removed RichString class.