-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* thermalvisionclothingcomponent * toggling * sprites, uplink listings, shadowling interaction * action icon * its silent anyways * unnecessary dependency * less hardcode * change meta * change licensing * unhardcode
- Loading branch information
Showing
23 changed files
with
224 additions
and
3 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
Content.Server/Stories/ThermalVision/ThermalVisionSystem.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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using Content.Shared.Actions; | ||
using Content.Shared.GameTicking; | ||
using Content.Shared.Inventory.Events; | ||
using Content.Shared.Stories.ThermalVision; | ||
using Robust.Shared.Player; | ||
using Robust.Shared.Timing; | ||
|
||
namespace Content.Server.Stories.ThermalVision; | ||
|
||
public sealed class ThermalVisionSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IGameTiming _gameTiming = default!; | ||
[Dependency] private readonly SharedActionsSystem _actions = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<ThermalVisionClothingComponent, GotEquippedEvent>(OnEquipped); | ||
SubscribeLocalEvent<ThermalVisionClothingComponent, GotUnequippedEvent>(OnUnequipped); | ||
SubscribeLocalEvent<ThermalVisionComponent, ComponentStartup>(OnStartUp); | ||
SubscribeLocalEvent<ThermalVisionComponent, ComponentShutdown>(OnShutdown); | ||
} | ||
private void OnUnequipped(EntityUid uid, ThermalVisionClothingComponent component, GotUnequippedEvent args) | ||
{ | ||
if (args.Slot == "eyes" && !(TryComp<ThermalVisionComponent>(args.Equipee, out var comp) && comp.Innate)) | ||
RemCompDeferred<ThermalVisionComponent>(args.Equipee); | ||
} | ||
private void OnEquipped(EntityUid uid, ThermalVisionClothingComponent component, GotEquippedEvent args) | ||
{ | ||
if (_gameTiming.ApplyingState) | ||
return; | ||
|
||
if (args.Slot == "eyes" && component.Enabled && !HasComp<ThermalVisionComponent>(args.Equipee)) | ||
AddComp<ThermalVisionComponent>(args.Equipee); | ||
} | ||
private void OnStartUp(EntityUid uid, ThermalVisionComponent component, ComponentStartup args) | ||
{ | ||
_actions.AddAction(uid, ref component.ToggleActionEntity, component.ToggleAction); | ||
} | ||
private void OnShutdown(EntityUid uid, ThermalVisionComponent component, ComponentShutdown args) | ||
{ | ||
Del(component.ToggleActionEntity); | ||
} | ||
} |
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
10 changes: 10 additions & 0 deletions
10
Content.Shared/Stories/ThermalVision/ThermalVisionClothingComponent.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.Stories.ThermalVision; | ||
|
||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)] | ||
public sealed partial class ThermalVisionClothingComponent : Component | ||
{ | ||
[DataField, AutoNetworkedField] | ||
public bool Enabled = true; | ||
} |
12 changes: 10 additions & 2 deletions
12
Content.Shared/Stories/ThermalVision/ThermalVisionComponent.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,10 +1,18 @@ | ||
using Robust.Shared.GameStates; | ||
using Content.Shared.Actions; | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.Stories.ThermalVision; | ||
|
||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)] | ||
public sealed partial class ThermalVisionComponent : Component | ||
{ | ||
[ViewVariables(VVAccess.ReadWrite), DataField("enabled"), AutoNetworkedField] | ||
public bool Enabled { get; set; } = false; | ||
[ViewVariables(VVAccess.ReadWrite), DataField("innate"), AutoNetworkedField] | ||
public bool Innate { get; set; } = false; | ||
[DataField] | ||
public string ToggleAction = "ToggleThermalVisionAction"; | ||
[DataField, AutoNetworkedField] | ||
public bool Enabled = true; | ||
public EntityUid? ToggleActionEntity; | ||
} | ||
public sealed partial class ToggleThermalVisionEvent : InstantActionEvent { } |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- type: entity | ||
id: ToggleThermalVisionAction | ||
name: Термальное зрение | ||
description: Переключить своё термальное зрение. | ||
components: | ||
- type: InstantAction | ||
useDelay: 5 | ||
icon: { sprite: Stories/Actions/thermalVision.rsi, state: toggle } | ||
event: !type:ToggleThermalVisionEvent |
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
29 changes: 29 additions & 0 deletions
29
Resources/Prototypes/Stories/Entities/Clothing/Eyes/glasses.yml
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
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
14 changes: 14 additions & 0 deletions
14
Resources/Textures/Stories/Actions/thermalVision.rsi/meta.json
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"version": 1, | ||
"license": "CC-BY-NC-SA-3.0", | ||
"copyright": "Created By RustedTim(discord:helloo4771) for SpaceStories(Server SS14).", | ||
"size": { | ||
"x": 32, | ||
"y": 32 | ||
}, | ||
"states": [ | ||
{ | ||
"name": "toggle" | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+294 Bytes
Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/equipped-EYES.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+667 Bytes
Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+248 Bytes
Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/inhand-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+251 Bytes
Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/inhand-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions
26
Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/meta.json
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"version": 1, | ||
"license": "CC-BY-NC-SA-3.0", | ||
"copyright": "Created By RustedTim(discord:helloo4771) for SpaceStories(Server SS14).", | ||
"size": { | ||
"x": 32, | ||
"y": 32 | ||
}, | ||
"states": [ | ||
{ | ||
"name": "equipped-EYES", | ||
"directions": 4 | ||
}, | ||
{ | ||
"name": "icon" | ||
}, | ||
{ | ||
"name": "inhand-left", | ||
"directions": 4 | ||
}, | ||
{ | ||
"name": "inhand-right", | ||
"directions": 4 | ||
} | ||
] | ||
} |
Binary file added
BIN
+230 Bytes
...Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/equipped-EYES.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+631 Bytes
Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+233 Bytes
...s/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/inhand-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+243 Bytes
.../Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/inhand-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions
26
Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/meta.json
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"version": 1, | ||
"license": "CC-BY-NC-SA-3.0", | ||
"copyright": "Created By RustedTim(discord:helloo4771) for SpaceStories(Server SS14).", | ||
"size": { | ||
"x": 32, | ||
"y": 32 | ||
}, | ||
"states": [ | ||
{ | ||
"name": "equipped-EYES", | ||
"directions": 4 | ||
}, | ||
{ | ||
"name": "icon" | ||
}, | ||
{ | ||
"name": "inhand-left", | ||
"directions": 4 | ||
}, | ||
{ | ||
"name": "inhand-right", | ||
"directions": 4 | ||
} | ||
] | ||
} |