Skip to content
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

Substation Maintenance (take 3) #32550

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
19e9654
substation wear added
joshepvodka Oct 31, 2023
670358d
removed emag
joshepvodka Nov 1, 2023
d985825
fixed timer and added VVrw
joshepvodka Nov 4, 2023
89196cf
added component to all substations
joshepvodka Nov 4, 2023
ff93fc9
blinking lights and screen change
joshepvodka Nov 8, 2023
65b977d
added substation fuse
joshepvodka Nov 19, 2023
b8eaa36
fuse lifetime upgrades
joshepvodka Nov 19, 2023
11d9691
fixed formatting
joshepvodka Nov 19, 2023
2263549
added sprites fixed some code
joshepvodka Dec 31, 2023
6cfde65
Merge branch 'master' into substation
joshepvodka Dec 31, 2023
92b3a57
fixed lights and yml
joshepvodka Dec 31, 2023
739f629
Merge branch 'substation' of https://github.com/joshepvodka/space-sta…
joshepvodka Dec 31, 2023
9d47c0e
changed conduit material composition
joshepvodka Dec 31, 2023
b2dc9a6
fix some checks
joshepvodka Dec 31, 2023
f193cba
change item name
joshepvodka Dec 31, 2023
543c273
Merge remote-tracking branch 'sub_maint_pr/substation' into substatio…
Peptide90 Feb 12, 2024
c2e71c0
changes all naming from conduit to nitrogen booster. Removes machine …
Peptide90 Feb 13, 2024
1911b09
remove plasma needs
Peptide90 Feb 13, 2024
09e61b4
math changes
Peptide90 Feb 15, 2024
dc9886e
Merge remote-tracking branch 'upstream/master' into substation_mainte…
AwareFoxy Sep 30, 2024
b3bb50e
Resprite screens to make it more accessible to colorblind
AwareFoxy Sep 30, 2024
063cd1d
some code cleanup + cvars
AwareFoxy Sep 30, 2024
d12de7d
gazanalyzer error fix
AwareFoxy Oct 1, 2024
0b04231
weh
AwareFoxy Oct 1, 2024
c118947
uh
AwareFoxy Oct 2, 2024
6ff3278
some code cleanup
AwareFoxy Oct 14, 2024
620c79c
goddamn
AwareFoxy Oct 14, 2024
c5fe7d4
meow :33
AwareFoxy Oct 14, 2024
18e52e6
Merge branch 'master' into substation_maintenance
AwareFoxy Oct 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Content.Client/Power/Substation/SubstationVisualsComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Content.Shared.Power;

namespace Content.Client.Power.Substation;

[RegisterComponent]
public sealed partial class SubstationVisualsComponent : Component
{
[DataField("screenLayer")]
public string LayerMap { get; private set; } = string.Empty;

[DataField]
public Dictionary<SubstationIntegrityState, string> IntegrityStates = new();
}
22 changes: 22 additions & 0 deletions Content.Client/Power/Substation/SubstationVisualsSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Robust.Shared.GameObjects;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Content.Shared.Power;

namespace Content.Client.Power.Substation;

public sealed class SubstationVisualsSystem : VisualizerSystem<SubstationVisualsComponent>
{
protected override void OnAppearanceChange(EntityUid uid, SubstationVisualsComponent component, ref AppearanceChangeEvent args)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All system methods that take EntityUid and one or more components should be changed to take Entity<TComp1, TComp2, ..> instead.

Suggested change
protected override void OnAppearanceChange(EntityUid uid, SubstationVisualsComponent component, ref AppearanceChangeEvent args)
protected override void OnAppearanceChange(Entity<SubstationVisualsComponent> ent, ref AppearanceChangeEvent args)

{
if(args.Sprite == null || !args.Sprite.LayerMapTryGet(component.LayerMap, out var layer))
return;

if(args.AppearanceData.TryGetValue(SubstationVisuals.Screen, out var stateObject)
Comment on lines +12 to +15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(args.Sprite == null || !args.Sprite.LayerMapTryGet(component.LayerMap, out var layer))
return;
if(args.AppearanceData.TryGetValue(SubstationVisuals.Screen, out var stateObject)
if (args.Sprite == null || !args.Sprite.LayerMapTryGet(component.LayerMap, out var layer))
return;
if (args.AppearanceData.TryGetValue(SubstationVisuals.Screen, out var stateObject)

&& stateObject is SubstationIntegrityState
&& component.IntegrityStates.TryGetValue((SubstationIntegrityState)stateObject, out var state))
{
args.Sprite.LayerSetState(layer, new RSI.StateId(state));
}
}
}
6 changes: 6 additions & 0 deletions Content.Server/Construction/ConstructionSystem.Machine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,10 @@ private void CreateBoardAndStockParts(EntityUid uid, MachineComponent component)
}
}
}
public void AddMaxUpgrade(string upgradedLocId)
{
var upgraded = Loc.GetString(upgradedLocId);
this.Message.AddMarkup(Loc.GetString("machine-upgrade-max-upgrade", ("upgraded", upgraded)) + '\n');
}

}
Loading
Loading