Commit Graph

15 Commits

Author SHA1 Message Date
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
Kyle Tyo
1d360956a7 made requested changes. 2025-02-17 01:58:40 -05:00
Kyle Tyo
0fbacd7dcb Update ContentLocalizationManager.cs 2025-02-16 23:06:28 -05:00
Kyle Tyo
f6fda97b72 I'm gonna do something drastic I swear. 2025-02-16 15:40:30 -05:00
Kyle Tyo
5ecb623e45 Update ContentLocalizationManager.cs 2025-02-16 15:35:44 -05:00
pathetic meowmeow
524a2182b0 Round up playtime minutes (#34961) 2025-02-08 07:12:58 +01:00
Stalen
24f79c3ecc Fix playtime formatting (#32974) 2024-10-28 19:00:00 +01:00
icekot8
a2affe3d00 add 👷 JobCondition system for reagents (#29023)
* hell 💀

* you're right

i'm dumb

* use the beautiful protoid and or in localization 🥩

* 🙏
2024-06-15 17:36:25 -04:00
KrasnoshchekovPavel
199e05fb34 fixed formatting of floating point numbers during localization (#27441) 2024-04-28 21:52:35 -07:00
Nemanja
766192f4b5 Use nav beacon locations for announcements (#26437)
* use nav beacon locations for announcements

* :thumbs_up:
2024-03-28 16:53:18 +11:00
Nemanja
cb98613450 fix chem guidebooks not displaying all damages (#19509) 2023-08-24 21:14:53 -05:00
Nemanja
b9fb66f005 Chem guidebook (#17123)
* im good at atomizing. welcome to half-finished chem guides.

* wagh

* e

* save work

* aa

* woweee UI

* finishing the last of it

* don't actually update the engine :(

---------

Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
2023-06-04 15:45:02 -05:00
Visne
c6d3e4f3bd Fix warnings and code cleanup/fixes (#13570) 2023-01-19 13:56:45 +11:00
metalgearsloth
007b079330 Fix some comp dirty / appearance warnings (#13193)
* Fix some comp dirty / appearance warnings

* also dis
2022-12-27 17:58:53 +01:00
Kara
7ad867fa0f Slight localization func cleanup (#11380) 2022-10-18 19:51:18 -07:00