Skip to content

Project Menlo Port#1017

Merged
fenndragon merged 4 commits intoHardLightSector:masterfrom
TrylobyteWasTaken:edisonchopjob
Mar 17, 2026
Merged

Project Menlo Port#1017
fenndragon merged 4 commits intoHardLightSector:masterfrom
TrylobyteWasTaken:edisonchopjob

Conversation

@TrylobyteWasTaken
Copy link
Contributor

This is a port of the Edison Power Plant devices and systems from Frontier. It's. A bit of a hack-job because of how much I had to remove that we didn't want and I haven't had time to test it. You might not want to add this stuff to the live server until you run it in a devenv. Also ports the updated SMES display interface from WizDen #38386.

🆑

  • add: Edison Power Plant devices.
  • add: AME Fuel Jar generator
  • add: Bluespace SMES
  • add: Power Transmission Sales Port
  • add: Fancy new SMES interface.
  • add: Other stuff I forget about, it's 4 AM, sue me.

TrylobyteWasTaken and others added 4 commits March 17, 2026 03:27
Ports the stuff we want from Frontier's Project Menlo, without the stuff we don't!
* 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.
# Conflicts:
#	Content.Client/Entry/EntryPoint.cs
#	Content.Client/Stylesheets/StyleNano.cs
#	Content.Client/UserInterface/BuiPreTickUpdateSystem.cs
#	Content.Client/UserInterface/BuiPredictionState.cs
#	Content.Client/UserInterface/Controls/FancyWindow.xaml.cs
#	Content.Client/UserInterface/InputCoalescer.cs
#	Content.Shared/Localizations/ContentLocalizationManager.cs
@fenndragon fenndragon merged commit 02ccee4 into HardLightSector:master Mar 17, 2026
15 of 17 checks passed
xemeraldwingx-dot added a commit that referenced this pull request Mar 17, 2026
Triad-Sector pushed a commit to Triad-Sector/Triad that referenced this pull request Mar 17, 2026
* Project Menlo Port

Ports the stuff we want from Frontier's Project Menlo, without the stuff we don't!

* 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.
# Conflicts:
#	Content.Client/Entry/EntryPoint.cs
#	Content.Client/Stylesheets/StyleNano.cs
#	Content.Client/UserInterface/BuiPreTickUpdateSystem.cs
#	Content.Client/UserInterface/BuiPredictionState.cs
#	Content.Client/UserInterface/Controls/FancyWindow.xaml.cs
#	Content.Client/UserInterface/InputCoalescer.cs
#	Content.Shared/Localizations/ContentLocalizationManager.cs

* Update StyleNano.cs

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants