-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix air devices ignoring settings after power cycle #34887
Open
VerinSenpai
wants to merge
8
commits into
space-wizards:master
Choose a base branch
from
VerinSenpai:fix-air-devices-ignoring-settings-after-power-cycle
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a47e7d8
add powered variable to vent components
VerinSenpai 2e066e6
add checks for powered to vent systems
VerinSenpai d1ffc42
removed powered from components
VerinSenpai d258a5b
Use ApcPowerReceieverComponent for power state.
VerinSenpai b086908
removed unneeded code from OnPowerChanged
VerinSenpai cdcfa9a
Merge branch 'space-wizards:master' into fix-air-devices-ignoring-set…
VerinSenpai 1c5ff93
document what enabled is used for in components
VerinSenpai 254fbf1
Merge branch 'master' into fix-air-devices-ignoring-settings-after-po…
VerinSenpai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,10 @@ namespace Content.Server.Atmos.Piping.Unary.Components | |
public sealed partial class GasVentScrubberComponent : Component | ||
{ | ||
[DataField] | ||
public bool Enabled { get; set; } = false; | ||
public bool Powered { get; set; } = false; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above. |
||
[DataField] | ||
public bool Enabled { get; set; } = true; | ||
Partmedia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[DataField] | ||
public bool IsDirty { get; set; } = false; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the power components please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretend I'm stupid. don't suppose theres an example of this >.>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm running myself ragged trying to find an existing powered component. The only thing I'm seeing that has a powered variable is ApcPowerReceiverComponent. Is that what you're referring to? I also noticed that the particle accelerator is enabling/disabling power in a similar manner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe for the most part you can do a trycomp to check power like so.
You can see an example in GasPressurePumpSystem, where we check if the device is not powered, if so we stop making sound and return early.
Here's an example for checking if a scrubber is powered:
That might work. Feel free to shoot me if it doesn't sloth (godo)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it may be something along those lines but thought that may be a bit bloated. I'll write it up and give it a shot. Thanks Roomba.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've got it right? Do I have to use an if statement for the trycomp in OnPowerChanged? That bugs me a tad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore that last message, we're no longer setting anything but the visual state in OnPowerChange.