Delta-v/Content.Client/UserInterface/Controls
Pieter-Jan Briers ffe130b38d
Battery (SMES/substation) interface (#36386)
* Add ENERGYWATTHOURS() loc function

Takes in joules (energy), displays as watt-hours.

* Add simple OnOffButton control

* Re-add Inset style class

This was sloppily removed at some point?? Whatever, I need it.

* Add helper functions for setting title/guidebook IDs on FancyWindow

Reagent dispenser uses these, more in the next commits.

* Add BuiPredictionState helper

This enables me to implement coarse prediction manually in the battery UI.

Basically it's a local buffer of predicted inputs that can easily be replayed against future BUI states from the server.

* Add input coalescing infrastructure

I ran into the following problem: Robust's Slider control absolutely *spams* input events, to such a degree that it actually causes issues for the networking layer if directly passed through. For something like a slider, we just need to send the most recent value.

There is no good way for us to handle this in the control itself, as it *really* needs to happen in PreEngine. For simplicity reasons (for BUIs) I came to the conclusion it's best if it's there, as it's *before* any new states from the server can be applied. We can't just do this in Update() or something on the control as the timing just doesn't line up.

I made a content system, BuiPreTickUpdateSystem, that runs in the ModRunLevel.PreEngine phase to achieve this. It runs a method on a new IBuiPreTickUpdate interface on all open BUIs. They can then implement their own coalescing logic.

In the simplest case, this coalescing logic can just be "save the last value, and if we have any new value since the last update, send an input event." This is what the new InputCoalescer<T> type is for.

Adding new coalescing logic should be possible in the future, of course. It's all just small helpers.

* Battery interface

This adds a proper interface to batteries (SMES/substation). Players can turn IO on and off, and they can change charge and discharge rate. There's also a ton of numbers and stuff. It looks great.

This actually enables charge and discharge rates to be changed for these devices. The settings for both have been set between 5kW and 150kW.

* Oops, forgot to remove these style class defs.
2025-04-27 21:08:34 +10:00
..
FancyTree Fix 38 non-obsolete warnings (#33794) 2025-02-11 20:59:50 +11:00
ClipControl.cs Various item status fixes/tweaks (#27267) 2024-04-25 00:01:31 +10:00
ConfirmButton.cs News UI overhaul and PDA notifications (#19610) 2024-02-26 21:38:00 -04:00
DialogWindow.xaml make dialog window not evil (#24677) 2024-02-01 23:56:40 +11:00
DialogWindow.xaml.cs HOTFIX: Fix lineedit focus (#34621) 2025-02-06 16:14:55 +01:00
DirectionIcon.cs Replace Matrix3 with System.Numerics.Matrix3x2 (#27443) 2024-06-02 14:07:41 +10:00
FancyWindow.xaml Adds Support for Guidebook Buttons in UIs (#27891) 2024-05-10 22:21:18 -04:00
FancyWindow.xaml.cs Battery (SMES/substation) interface (#36386) 2025-04-27 21:08:34 +10:00
HLine.cs Lobby Refactor (#7077) 2022-03-13 19:33:19 -07:00
HSpacer.cs Remove accidental using directives on transient dependencies. (#18999) 2023-08-11 16:56:40 -05:00
HighDivider.cs Move/Rename stuff (#11209) 2022-09-11 18:56:21 -07:00
ListContainer.cs Predict vending machine UI (#33412) 2025-03-02 13:47:52 +11:00
MainViewport.cs Adds the option to fit the viewport to vertical screenspace (#27061) 2024-04-20 16:46:02 +10:00
MapGridControl.xaml Shuttle console + FTL rework (#24430) 2024-03-03 18:39:19 +11:00
MapGridControl.xaml.cs Replace Matrix3 with System.Numerics.Matrix3x2 (#27443) 2024-06-02 14:07:41 +10:00
MenuButton.cs Remove lights compref (#19531) 2023-09-11 19:18:06 +10:00
NanoHeading.cs Minor UI refactor (#11212) 2022-09-11 20:42:12 -07:00
OnOffButton.xaml Battery (SMES/substation) interface (#36386) 2025-04-27 21:08:34 +10:00
OnOffButton.xaml.cs Battery (SMES/substation) interface (#36386) 2025-04-27 21:08:34 +10:00
Placeholder.cs More minor UI refactor stuff (#11287) 2022-09-14 20:42:35 -07:00
ProgressTextureRect.cs Add BUI ctor tests (#31463) 2024-08-26 17:39:48 +10:00
RadialContainer.cs Revert "Feature/shader radial menu" due to shader issue (#36470) 2025-04-11 23:30:52 +02:00
RadialMenu.cs Revert "Feature/shader radial menu" due to shader issue (#36470) 2025-04-11 23:30:52 +02:00
SearchListContainer.cs Add search filter to the admin menu player tab (#28030) 2024-05-31 02:28:08 -04:00
SimpleRadialMenu.xaml refactor: simple radial menu for easier creation (#34639) 2025-03-31 12:57:47 +03:00
SimpleRadialMenu.xaml.cs Cleanup warnings in SimpleRadialMenu (#36690) 2025-04-18 18:28:24 +02:00
SlotButton.cs make filled inventory slots blank (#27150) 2024-04-20 13:17:29 +10:00
SlotControl.cs make filled inventory slots blank (#27150) 2024-04-20 13:17:29 +10:00
SplitBar.xaml Puddles & spreader refactor (#15191) 2023-04-10 15:37:03 +10:00
SplitBar.xaml.cs Random spontaneous cleanup PR (#25131) 2024-02-13 16:48:39 -05:00
StripeBack.cs Minor visual fixups from StyleboxTexture scaling (#17763) 2023-07-09 04:57:47 +10:00
TableContainer.cs Guidebook Tables (#28484) 2024-06-01 20:58:33 -07:00
VSpacer.cs Lobby Refactor (#7077) 2022-03-13 19:33:19 -07:00