forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'space-wizards:master' into master
- Loading branch information
Showing
88 changed files
with
6,917 additions
and
4,501 deletions.
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
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
67 changes: 56 additions & 11 deletions
67
Content.Client/Silicons/StationAi/StationAiSystem.Airlock.cs
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 |
---|---|---|
@@ -1,30 +1,75 @@ | ||
using Content.Shared.Doors.Components; | ||
using Content.Shared.Electrocution; | ||
using Content.Shared.Silicons.StationAi; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Client.Silicons.StationAi; | ||
|
||
public sealed partial class StationAiSystem | ||
{ | ||
private readonly ResPath _aiActionsRsi = new ResPath("/Textures/Interface/Actions/actions_ai.rsi"); | ||
|
||
private void InitializeAirlock() | ||
{ | ||
SubscribeLocalEvent<DoorBoltComponent, GetStationAiRadialEvent>(OnDoorBoltGetRadial); | ||
SubscribeLocalEvent<AirlockComponent, GetStationAiRadialEvent>(OnEmergencyAccessGetRadial); | ||
SubscribeLocalEvent<ElectrifiedComponent, GetStationAiRadialEvent>(OnDoorElectrifiedGetRadial); | ||
} | ||
|
||
private void OnDoorBoltGetRadial(Entity<DoorBoltComponent> ent, ref GetStationAiRadialEvent args) | ||
{ | ||
args.Actions.Add(new StationAiRadial() | ||
{ | ||
Sprite = ent.Comp.BoltsDown ? | ||
new SpriteSpecifier.Rsi( | ||
new ResPath("/Textures/Structures/Doors/Airlocks/Standard/basic.rsi"), "open") : | ||
new SpriteSpecifier.Rsi( | ||
new ResPath("/Textures/Structures/Doors/Airlocks/Standard/basic.rsi"), "closed"), | ||
Tooltip = ent.Comp.BoltsDown ? Loc.GetString("bolt-open") : Loc.GetString("bolt-close"), | ||
Event = new StationAiBoltEvent() | ||
args.Actions.Add( | ||
new StationAiRadial | ||
{ | ||
Sprite = ent.Comp.BoltsDown | ||
? new SpriteSpecifier.Rsi(_aiActionsRsi, "unbolt_door") | ||
: new SpriteSpecifier.Rsi(_aiActionsRsi, "bolt_door"), | ||
Tooltip = ent.Comp.BoltsDown | ||
? Loc.GetString("bolt-open") | ||
: Loc.GetString("bolt-close"), | ||
Event = new StationAiBoltEvent | ||
{ | ||
Bolted = !ent.Comp.BoltsDown, | ||
} | ||
} | ||
); | ||
} | ||
|
||
private void OnEmergencyAccessGetRadial(Entity<AirlockComponent> ent, ref GetStationAiRadialEvent args) | ||
{ | ||
args.Actions.Add( | ||
new StationAiRadial | ||
{ | ||
Sprite = ent.Comp.EmergencyAccess | ||
? new SpriteSpecifier.Rsi(_aiActionsRsi, "emergency_off") | ||
: new SpriteSpecifier.Rsi(_aiActionsRsi, "emergency_on"), | ||
Tooltip = ent.Comp.EmergencyAccess | ||
? Loc.GetString("emergency-access-off") | ||
: Loc.GetString("emergency-access-on"), | ||
Event = new StationAiEmergencyAccessEvent | ||
{ | ||
EmergencyAccess = !ent.Comp.EmergencyAccess, | ||
} | ||
} | ||
); | ||
} | ||
|
||
private void OnDoorElectrifiedGetRadial(Entity<ElectrifiedComponent> ent, ref GetStationAiRadialEvent args) | ||
{ | ||
args.Actions.Add( | ||
new StationAiRadial | ||
{ | ||
Bolted = !ent.Comp.BoltsDown, | ||
Sprite = ent.Comp.Enabled | ||
? new SpriteSpecifier.Rsi(_aiActionsRsi, "door_overcharge_off") | ||
: new SpriteSpecifier.Rsi(_aiActionsRsi, "door_overcharge_on"), | ||
Tooltip = ent.Comp.Enabled | ||
? Loc.GetString("electrify-door-off") | ||
: Loc.GetString("electrify-door-on"), | ||
Event = new StationAiElectrifiedEvent | ||
{ | ||
Electrified = !ent.Comp.Enabled, | ||
} | ||
} | ||
}); | ||
); | ||
} | ||
} |
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
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.