mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
* Power Supply and Load Stuff (#2505) # Description Changes how `ApcPowerReceiverComponent` works a bit. Separated the `Load` variable into main and side power loads. If main power demand is not met, the machine is considered unpowered. Side power demand is "optional", as can be met only partially (or not at all) and the device will continue to operate. Depending on the device, this may have different negative effects on its operaton. such as lights dimming and weapon rechargers not charging at full speed. This was first intended to fix an annoying bug with `ChargerComponent` and `ApcPowerReceiverBatteryComponent`, that made the powernet spaz out for a while if their power demand was too high. This is now fixed. --- <details><summary><h1>Media</h1></summary> <p> <details><summary>Before (heavy flashing lights)</summary> <p> https://github.com/user-attachments/assets/de7fb84f-54d0-4c8a-ba9e-7a97e8489980 </p> </details> <details><summary>After</summary> <p> https://github.com/user-attachments/assets/9cece608-24f7-4ec9-95cd-0c719c7beddb </p> </details> </p> </details> --- # Changelog 🆑 - fix: Chargers and energy turrets no longer make the lights flash rapidly if their power draw is too high - add: Lights dim if the powernet they're connected to is overloaded * больно много жрёт --------- Co-authored-by: VMSolidus <evilexecutive@gmail.com>
17 lines
473 B
C#
17 lines
473 B
C#
namespace Content.Shared.Power;
|
|
|
|
/// <summary>
|
|
/// Raised whenever an ApcPowerReceiver becomes powered / unpowered.
|
|
/// Does nothing on the client.
|
|
/// </summary>
|
|
[ByRefEvent]
|
|
public readonly record struct PowerChangedEvent(bool Powered, float ReceivingPower);
|
|
|
|
|
|
/// <summary>
|
|
/// Raised whenever power consumed as a side load changes.
|
|
/// Does nothing on the client.
|
|
/// </summary>
|
|
[ByRefEvent]
|
|
public readonly record struct SidePowerChangedEvent(float SideLoadFraction);
|