Commit Graph
77 Commits
Author SHA1 Message Date
49515b03f7 Fix all warnings from Dispose on Controls (#5986)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2026-08-08 15:51:34 +10:00
pathetic meowmeowandGitHub bbfd27d78f XamlX upgrade (#6288) 2026-07-24 19:00:35 +10:00
Leon FriedrichandGitHub 80cad0cd8f Add public control sawmill to UI Manager (#6231)
* Add public control sawmill

* Remove static IoCManager in MarkupTagManager

* very important comment

* release notes

* fix merge

* fix
2025-11-13 21:33:50 +11:00
PJB3005 34a371ef1f Make OrderedChildCollection implement IReadOnlyList<T>
Implements indexing operation.
2025-08-27 19:39:54 +02:00
b61075c660 Stopped recursive updates for controls that are not visible, as it vi… (#5960)
* Stopped recursive updates for controls that are not visible, as it violates framerate in large menus.

* Update Robust.Client/UserInterface/Control.cs

---------

Co-authored-by: Cam <Nop>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2025-05-23 17:42:47 +02:00
acc7bf7595 Add support for overlays to draw controls (#5223)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2025-01-29 22:48:11 +11:00
6f1427ef3c Interface to remove a controls child by index (#5485)
Co-authored-by: Eoin Mcloughlin <helloworld@eoinrul.es>
2024-10-06 22:51:53 +02:00
Pieter-Jan Briers 16a93e86f6 Add obsoletion warning on control dispose
this shouldn't be used anymore
2024-07-21 01:45:24 +02:00
69c1161562 FormattedMessage/DebugConsole performance improvements (#5244)
* Add VisibilityChanged virtual to Control

* Defer updating invisible OutputPanels on UIScale change

DebugConsole falls under this when not hidden, and it significantly improves perf of e.g. resizing the window when there's a lot of stuff in there.

* Avoid redundant UI Scale updates on window resize.

Window resizing can change the UI scale, due to the auto-scaling system. This system had multiple perf issues:

UI scale was set and propagated even if it didn't change (system disabled, not effective, etc). This was just wasted processing.

UI scale was updated for every window resize event. When the game is lagging (due to the aforementioned UI scale updates being expensive...) this means multiple window resize events in a single frame ALL cause a UI scale update, which is useless.

UI scale updates from resizing now avoid doing *nothing* and are deferred until later in the frame for natural batching.

* Reduce allocations/memory usage of various rich-text related things

Just allocate a buncha dictionaries what could possibly go wrong.

I kept to non-breaking-changes which means this couldn't as effective as it should be.

There's some truly repulsive stuff here. Ugh.

* Cap debug console content size.

It's a CVar.

OutputPanel has been switched to use a new RingBufferList datastructure to make removal of the oldest entry efficient.

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2024-06-20 17:22:12 +10:00
eoineoineoinandGitHub 56c30edf04 Replace Matrix3 with System.Numerics.Matrix3x2 (#5078)
* Delete Matrix3. Replace with System.Numerics.Matrix3x2

* Feedback

* release notes
2024-06-02 14:08:47 +10:00
Pieter-Jan Briers f6a5120e56 Fix exception when inspecting element in some cases.
Happened when I was trying to develop item status stuff.
2024-04-14 02:05:40 +02:00
a9d17337a3 RT Patches for UI improvements (#4841)
* fix up buttons

* wah

* ough

* huhwuhuahsdhsfdj

* loud incorrect buzzer

* wawa

* Allow XmlnsDefinition

* wawa

* Release notes.

* Expose keybind loading.

* address reviews and other things

---------

Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2024-02-11 17:18:39 +01:00
metalgearslothandGitHub ef325b4780 Fix SetPositionInParent throwing for end position (#4740)
If a child is at the end spot this will ensure it doesn't throw.
2023-12-20 11:15:20 +11:00
metalgearslothandGitHub 7d1ad527d9 Replace Robust Vector2 with System.Numerics (#4092) 2023-07-08 14:08:26 +10:00
Leon FriedrichandGitHub 7cb01b8a85 Update theme on child add (#4059) 2023-05-17 10:19:08 +10:00
Leon FriedrichandGitHub 022a668266 Revert "Fix hidden action numbers by updating UI theme" (#4057) 2023-05-17 05:51:38 +10:00
SkyeandGitHub 109e685d55 Fix hidden action numbers by updating UI theme (#3973) 2023-05-15 12:50:01 +10:00
0eba350eb1 Fix bug where ScrollContainer could cause layout engine to loop forever. (#3723)
Co-authored-by: Eoin Mcloughlin <helloworld@eoinrul.es>
2023-02-06 23:37:26 +01:00
metalgearslothandGitHub 8e6bc1651e Add tooltip tracking (#3665) 2023-01-13 11:40:35 +11:00
metalgearslothandGitHub 0c9fe010b1 Fix tooltips being incorrect for a frame (#3664) 2023-01-08 16:22:16 +11:00
Pieter-Jan Briers 708b3b2acf Remove unnecessary IoC resolve from new theming system. 2022-11-11 01:25:17 +01:00
710371d7d1 UI refactor and UITheme implementations (#2712)
* UIControllerManager


Implemented UI Controller Manager

* added fetch function

* added note

* Hiding some internal stuff

* Implemented event on gamestate switch for ui

* Fix serialization field assigner emit

* fixing issues with ILEmitter stuff

* AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

Blame Smug

* fixing nullref

* Add checking for no backing field / property for ui system dependencies

* fixes Gamestate detection

* Implemented event on UIControllers on system load

* Updated systemload/unload listeners

* Had this backwards lol

* Fix nulling systems before calling OnSystemUnloaded, broke InventoryUIController.Hands.cs

* Created UI Window management system

- A manager that allows for easy creation and access of popup or gamestate windows

* Changing to use basewindow instead of default window

* Implemented UI Theming that isn't ass

* Updated default theme loading and validation

* Added path validation for themes

* Implemented UI Themes

* Implemented UI Theme prototypes

* Implementing theming for texture buttons and Texturerects

* fixing server error

* Remove IUILink

* Implemented default theme overriding and theme colors

* Fixing sandbox lul

* Added error for not finding UITheme

* fixing setting default theme in content

* Move entity and tile spawn window logic to controllers

* Add 2 TODOs

* Merge fixes

* Add IOnStateChanged for UI controllers

* Fix inventory window being slow to open
Caches resources when the UI theme is changed

* Remove caching on theme change
The real fix was fixing the path for resources

* Remove test method

* Fix crash when controllers implement non generic interfaces

* Add controllers frame update

* Split UserInterfaceManager into partials

- Created UI screen

* Converted more UI managers into partials

* Setup UIScreen manager system

* Added some widget utility funcs


updated adding widgets

* Started removing HUDManager

* Moved UiController Manager to Partials


Finished moving all UIController code to UIManager

* Fixed screen loading

* Fixed Screen scaling

* Fixed Screen scaling


cleanup

* wat

* IwantToDie

* Fixed resolving ResourceCache instead of IResourceCache

* Split IOnStateChanged into IOnStateEntered and IOnStateExited

* Implemented helpers for adjusting UIAutoscale for screens

* Fixed autoscale, removed archiving from autoscale

* Implemented popups and adjusted some stuff

* Fixing some popup related shinanegans

* Fixing some draw order issues

* fixing dumb shit

* Fix indentation in UserInterfaceManager.Input.cs

* Moved screen setup to post init (run after content)

* Fix updating theme

* Merge fixes

* Fix resolving sprite system on control creation

* Fix min size of tile spawn window

* Add UIController.Initialize method

* https://tenor.com/view/minor-spelling-mistake-gif-21179057

* Add doc comment to UIController

* Split UIController.cs and UISystemDependency.cs into their own files

* Add more documentation to ui controllers

* Add AttributeUsage to UISystemDependencyAttribute

* Fix method naming

* Add documentation for assigners

* Return casted widgets where relevant

* Fix entity spawner scroll (#1)

* Add CloseOnClick and CloseOnEscape for popups

* Remove named windows and popups

* Cleanup controller code

* Add IOnStateChanged, IOnSystemChanged, IOnSystemLoaded, IOnSystemUnloaded

* Add more docs to state and system change interfaces

* Fixing Window issues

* Fixing some window fuckery

* Added OnOpen event to windows, updated sandbox window

Sandbox windows now persist values and positions

* Recurse through controls to register widgets (#2)

* Allow path to be folder

* Fix local player shutdown

* Fixing escape menu

* Fix backing field in DataDefinition.Emitters

* Ent+Tile spawn no crash

* Skip no-spawn in entity spawn menu

Co-authored-by: Jezithyr <jmaster9999@gmail.com>
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
Co-authored-by: Jezithyr <Jezithyr@gmail.com>
Co-authored-by: wrexbe <81056464+wrexbe@users.noreply.github.com>
Co-authored-by: Flipp Syder <76629141+vulppine@users.noreply.github.com>
Co-authored-by: wrexbe <wrexbe@protonmail.com>
2022-09-04 16:10:54 -07:00
Pieter-Jan Briers e86bd33a29 Fix XAML support in Rider EAP 2022-06-02 21:50:39 +02:00
41e9d9b08b Client profiling system (#2783)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-05-14 15:08:46 +10:00
de4d255841 Analyzer to enforce classes to be either [Virtual], abstract, or sealed. (#2469)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-02-05 19:31:58 +01:00
Pieter-Jan Briers 21f5fed32f Fix IsVisibleInTree calculation with secondary window roots 2021-11-14 19:08:14 +01:00
VisneandGitHub 068c05c355 Use enum for access level in XamlUiPartialClassGenerator (#2161) 2021-10-27 08:52:09 +02:00
VisneandGitHub d9af00c931 Make autogenerated XAML UI fields access level settable (#2148)
* Make autogenerated XAML fields public instead of protected

* Make field always public, remove stray commented out code

* Remove encapsulation for previously protected XAML UI fields

* Make access level settable

* Set access to public for DebugConsole LineEdit

* Address reviews and add documentation

* Remove documentation

* Address reviews
2021-10-24 23:20:27 +02:00
SweptandGitHub 028dea2819 Updates documentation link in comment 2021-09-20 01:25:57 +00:00
Pieter-Jan Briers 3fd55733bb Add child added/removed/moved events to Control.
Intended for UI dev window
2021-08-22 02:07:42 +02:00
Pieter-Jan Briers 7d2bbc2ca7 Add an OnResized event to controls 2021-08-22 01:29:24 +02:00
Pieter-Jan BriersandGitHub 8efffc471d Multi-window support (#1713) 2021-05-02 14:05:50 +02:00
c4946b8466 Viewport Improvements (#1528)
Co-authored-by: 20kdc <asdd2808@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2021-04-19 09:47:20 +02:00
Vera Aguilera Puerto 3ec9e7a734 Remove a few (now irrelevant) comments mentioning Godot. 2021-04-12 20:10:05 +02:00
Acruid 3203ca2ff4 Removed Control.Update from the UI system. UI Controls have no business running code in simulation updates.
Refactored the client update loop so that the GameStateManager is in full control of the simulation update.
2021-03-26 17:46:34 -07:00
Pieter-Jan BriersandGitHub 583b7ebf38 WPF layout (#1581) 2021-02-21 12:28:13 +01:00
AcruidandGitHub 2183cd7ca1 Massive Namespace Cleanup (#1544)
* Removed the Interfaces folder.
* All objects inside the GameObjects subfolders are now in the GameObjects namespace.
* Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces.
* Simplified Robust.client.Graphics namespace.
* Automated remove redundant using statements.
2021-02-10 23:27:19 -08:00
chairbenderandGitHub c4062bcae9 #1449 new ControlFocusExited override for allowing controls to know (#1467)
when they lost control focus, separate from keyboard focus
2021-01-13 23:18:45 +01:00
Pieter-Jan Briers 28caf0d74c Reduce allocations 2020-12-29 03:58:16 +01:00
d94f702601 Xaml UI (#1446)
Co-authored-by: Paul <ritter.paul1+git@googlemail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-12-20 23:52:36 +01:00
chairbenderandGitHub 1bf9e2e87a Multiselect option button, tooltip delay (Action Hotbar Support) (#1435) 2020-12-13 01:01:00 +01:00
ad8b0b3c83 Add bytes or sbytes to enum where available (#1430)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-12-08 12:46:30 +01:00
b8e5b47e7a Use 'new' expression in places where the type is evident for the engine (#1415)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-11-26 00:16:55 +01:00
chairbenderandGitHub ee381804ec New GridContainer capabilities and customizable tooltips (#1395)
* #272 avoid mouse overlapping tooltip when near edges,
change tooltip colors to match mockups

* #272 WIP customizable tooltips, old approach currently working still

* #272 WIP customizable tooltips, old approach currently working still

* #272 ensure tooltips go away when disposing control

* #272 implement row-oriented GridContainer

* #272 generalize GridContainer to support
rows or cols

* #272 improve readability in new GridContainer
logic

* #272 GridContainer can expand in opposite
direction

* #272 GridContainer can expand in opposite
direction

* #272 GridContainer can expand in opposite
direction, fix test

* #272 add GridContainer capability to
limit by size rather than count

* #272 add some clarifications about ui scale and vp / rp

* #272 don't spam showtooltip
event, calculate tooltip
positioning using combined
minimum size
2020-11-10 15:21:32 +11:00
214ba440dc Float spinbox (#1354)
corner styles

Co-authored-by: a.rudenko <creadth@gmail.com>
2020-10-27 20:01:04 +01:00
SweptandGitHub cd1d6035e5 Control.cs (#1262) 2020-08-27 00:31:12 +02:00
Pieter-Jan Briers f77fdbced6 Remove finalizer from Control.
We aren't used Godot anymore so no need for this.
2020-06-25 16:29:03 +02:00
Pieter-Jan BriersandGitHub 6674be3adc Client NRTs (#1121) 2020-06-12 12:57:39 +02:00
Pieter-Jan Briers 782ac26a94 Mark some control properties as animatable. 2020-05-27 14:09:58 +02:00
Pieter-Jan Briers 832a4e01f1 High level cursor API. 2020-04-17 16:57:51 +02:00