]> git.smokeofanarchy.ru Git - space-station-14.git/commit
Move ApcPowerReceiverComponent Powered state to shared (#28206)
authorShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
Thu, 30 May 2024 06:46:22 +0000 (23:46 -0700)
committerGitHub <noreply@github.com>
Thu, 30 May 2024 06:46:22 +0000 (16:46 +1000)
commite2bf127323ebf48c99c1ecf473de878a1ce5d88d
treecba85c0c1271b52782aeb5f723621022f21efff7
parentce2446a6125c2666954eda4a1c559c437c7097b1
Move ApcPowerReceiverComponent Powered state to shared (#28206)

* Try syncing powered state to client

For some reason the client is not receiving the ApcPowerReceiverComponentState, so it's not working.

* Fix powered state not syncing to client

The client PowerReceiverSystem was abstract, which prevented it from
running initialize.

* Flip check so that it runs bigger checks first

PowerDisabled skips the others.
NeedsPower skips the receiving check.

* Disallow changing Powered manually

* Move Powered update to PowerReceiverSystem

* Move appearance to event subscription

* Move metadata component to AllEntityQuery

* Cleanup

* Move Powered update back to PowerNetSystem

It's easier to use the EntityQueries and it dosen't need to be updated
anywhere else.

* Put appearance updating back

* Move IsPowered to shared

* Simplify IsPowered

* Cleanup

* Remove duplicate PowerChangedEvent

PowerChangedEvent on ProviderChanged doesn't seem to be needed
PowerChangedEvent gets raised by in update if the power state changes
after a new provider is connected
Content.Client/Power/Components/ApcPowerReceiverComponent.cs [new file with mode: 0644]
Content.Client/Power/EntitySystems/PowerReceiverSystem.cs [new file with mode: 0644]
Content.Server/Power/Components/ApcPowerReceiverComponent.cs
Content.Server/Power/EntitySystems/PowerNetSystem.cs
Content.Server/Power/EntitySystems/PowerReceiverSystem.cs
Content.Shared/Power/Components/ApcPowerReceiverComponentState.cs [new file with mode: 0644]
Content.Shared/Power/Components/SharedApcPowerReceiverComponent.cs [new file with mode: 0644]
Content.Shared/Power/EntitySystems/SharedPowerReceiverSystem.cs [new file with mode: 0644]