Commit graph

7 commits

Author SHA1 Message Date
Absotively
e0f899b9e0
Switch buttons for more power switches (#42631)
* Switch buttons for battery breakers

* Switch button for PowerCharge UI

* Switch button for particle accelerator power

* Remove strings used by removed control

* Remove now-unused button group
2026-09-29 05:08:09 +00:00
AndrewFenriz
70cd75a247
Standardize UI separators (#45820)
* remove unused using

* move VSeparator

* remove unused using

* move HSeparator

* remove BOM

* add Separator

* migrate

* fix separator migration

* remove old separators

* clean separator migration

* clean separator formatting

* cleanup

* update SeparatorSheetlet
2026-09-19 20:16:18 +00:00
AndrewFenriz
020112bf99
Migrate legacy UI colors and fix green button styling (#45889)
* migrate

* update ReplayLoadingFailedControl

* remove BOM
2026-09-19 18:11:23 +00:00
Whatstone
a023e5784c
Cleanup: Remove byte order markers from most files (#45796) 2026-09-17 23:23:54 +10:00
Pieter-Jan Briers
5168b5f3d4
IoC source gen compatibility (#43863)
* IoC source gen compatibility

Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter.

* Missed a spot
2026-05-09 03:29:58 +00:00
eoineoineoin
daccef7b43
Rename "Inset" style, implement in sheetlets (#41975)
* Rename "Inset" style, implement in sheetlets

* Remove from StyleNano
2026-01-19 23:27:42 +00:00
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