|
1 | 1 | using Content.Shared.Doors.Components;
|
| 2 | +using Content.Shared.Electrocution; |
2 | 3 | using Content.Shared.Silicons.StationAi;
|
3 | 4 | using Robust.Shared.Utility;
|
4 | 5 |
|
5 | 6 | namespace Content.Client.Silicons.StationAi;
|
6 | 7 |
|
7 | 8 | public sealed partial class StationAiSystem
|
8 | 9 | {
|
| 10 | + private readonly ResPath _aiActionsRsi = new ResPath("/Textures/Interface/Actions/actions_ai.rsi"); |
| 11 | + |
9 | 12 | private void InitializeAirlock()
|
10 | 13 | {
|
11 | 14 | SubscribeLocalEvent<DoorBoltComponent, GetStationAiRadialEvent>(OnDoorBoltGetRadial);
|
| 15 | + SubscribeLocalEvent<AirlockComponent, GetStationAiRadialEvent>(OnEmergencyAccessGetRadial); |
| 16 | + SubscribeLocalEvent<ElectrifiedComponent, GetStationAiRadialEvent>(OnDoorElectrifiedGetRadial); |
12 | 17 | }
|
13 | 18 |
|
14 | 19 | private void OnDoorBoltGetRadial(Entity<DoorBoltComponent> ent, ref GetStationAiRadialEvent args)
|
15 | 20 | {
|
16 |
| - args.Actions.Add(new StationAiRadial() |
17 |
| - { |
18 |
| - Sprite = ent.Comp.BoltsDown ? |
19 |
| - new SpriteSpecifier.Rsi( |
20 |
| - new ResPath("/Textures/Structures/Doors/Airlocks/Standard/basic.rsi"), "open") : |
21 |
| - new SpriteSpecifier.Rsi( |
22 |
| - new ResPath("/Textures/Structures/Doors/Airlocks/Standard/basic.rsi"), "closed"), |
23 |
| - Tooltip = ent.Comp.BoltsDown ? Loc.GetString("bolt-open") : Loc.GetString("bolt-close"), |
24 |
| - Event = new StationAiBoltEvent() |
| 21 | + args.Actions.Add( |
| 22 | + new StationAiRadial |
| 23 | + { |
| 24 | + Sprite = ent.Comp.BoltsDown |
| 25 | + ? new SpriteSpecifier.Rsi(_aiActionsRsi, "unbolt_door") |
| 26 | + : new SpriteSpecifier.Rsi(_aiActionsRsi, "bolt_door"), |
| 27 | + Tooltip = ent.Comp.BoltsDown |
| 28 | + ? Loc.GetString("bolt-open") |
| 29 | + : Loc.GetString("bolt-close"), |
| 30 | + Event = new StationAiBoltEvent |
| 31 | + { |
| 32 | + Bolted = !ent.Comp.BoltsDown, |
| 33 | + } |
| 34 | + } |
| 35 | + ); |
| 36 | + } |
| 37 | + |
| 38 | + private void OnEmergencyAccessGetRadial(Entity<AirlockComponent> ent, ref GetStationAiRadialEvent args) |
| 39 | + { |
| 40 | + args.Actions.Add( |
| 41 | + new StationAiRadial |
| 42 | + { |
| 43 | + Sprite = ent.Comp.EmergencyAccess |
| 44 | + ? new SpriteSpecifier.Rsi(_aiActionsRsi, "emergency_off") |
| 45 | + : new SpriteSpecifier.Rsi(_aiActionsRsi, "emergency_on"), |
| 46 | + Tooltip = ent.Comp.EmergencyAccess |
| 47 | + ? Loc.GetString("emergency-access-off") |
| 48 | + : Loc.GetString("emergency-access-on"), |
| 49 | + Event = new StationAiEmergencyAccessEvent |
| 50 | + { |
| 51 | + EmergencyAccess = !ent.Comp.EmergencyAccess, |
| 52 | + } |
| 53 | + } |
| 54 | + ); |
| 55 | + } |
| 56 | + |
| 57 | + private void OnDoorElectrifiedGetRadial(Entity<ElectrifiedComponent> ent, ref GetStationAiRadialEvent args) |
| 58 | + { |
| 59 | + args.Actions.Add( |
| 60 | + new StationAiRadial |
25 | 61 | {
|
26 |
| - Bolted = !ent.Comp.BoltsDown, |
| 62 | + Sprite = ent.Comp.Enabled |
| 63 | + ? new SpriteSpecifier.Rsi(_aiActionsRsi, "door_overcharge_off") |
| 64 | + : new SpriteSpecifier.Rsi(_aiActionsRsi, "door_overcharge_on"), |
| 65 | + Tooltip = ent.Comp.Enabled |
| 66 | + ? Loc.GetString("electrify-door-off") |
| 67 | + : Loc.GetString("electrify-door-on"), |
| 68 | + Event = new StationAiElectrifiedEvent |
| 69 | + { |
| 70 | + Electrified = !ent.Comp.Enabled, |
| 71 | + } |
27 | 72 | }
|
28 |
| - }); |
| 73 | + ); |
29 | 74 | }
|
30 | 75 | }
|
0 commit comments