forked from RMC-14/RMC-14
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,075 changed files
with
119,932 additions
and
51,541 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
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,49 @@ | ||
using Content.Shared._RMC14.Aura; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.Graphics; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Client._RMC14.Aura; | ||
|
||
public sealed class AuraSystem : SharedAuraSystem | ||
{ | ||
[Dependency] private readonly IPrototypeManager _prototypes = default!; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<AuraComponent, ComponentStartup>(OnStartup); | ||
SubscribeLocalEvent<AuraComponent, ComponentShutdown>(OnShutdown); | ||
} | ||
|
||
private void OnStartup(Entity<AuraComponent> ent, ref ComponentStartup args) | ||
{ | ||
if (!TryComp(ent, out SpriteComponent? sprite)) | ||
return; | ||
|
||
sprite.PostShader = _prototypes.Index<ShaderPrototype>("RMCAuraOutline").InstanceUnique(); | ||
} | ||
|
||
private void OnShutdown(Entity<AuraComponent> ent, ref ComponentShutdown args) | ||
{ | ||
if (TerminatingOrDeleted(ent)) | ||
return; | ||
|
||
if (!TryComp(ent, out SpriteComponent? sprite)) | ||
return; | ||
|
||
sprite.PostShader = null; | ||
} | ||
|
||
public override void Update(float frameTime) | ||
{ | ||
base.Update(frameTime); | ||
|
||
var auraQuery = EntityQueryEnumerator<AuraComponent, SpriteComponent>(); | ||
|
||
while (auraQuery.MoveNext(out var uid, out var aura, out var sprite)) | ||
{ | ||
sprite.PostShader?.SetParameter("outline_color", aura.Color); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System.Numerics; | ||
using Content.Client._RMC14.MotionDetector; | ||
using Content.Shared._RMC14.Intel.Detector; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.Graphics; | ||
using Robust.Shared.Enums; | ||
using Robust.Shared.Timing; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Client._RMC14.Intel; | ||
|
||
public sealed class IntelDetectorOverlay : Overlay | ||
{ | ||
[Dependency] private readonly IEntityManager _entity = default!; | ||
[Dependency] private readonly IGameTiming _timing = default!; | ||
|
||
public override OverlaySpace Space => OverlaySpace.WorldSpace; | ||
|
||
private TimeSpan _last; | ||
private readonly List<Vector2> _blips = new(); | ||
|
||
private MotionDetectorOverlaySystem _motionDetector; | ||
private SpriteSystem _sprite; | ||
|
||
public IntelDetectorOverlay() | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
_motionDetector = _entity.System<MotionDetectorOverlaySystem>(); | ||
_sprite = _entity.System<SpriteSystem>(); | ||
} | ||
|
||
protected override void Draw(in OverlayDrawArgs args) | ||
{ | ||
var frame = _sprite.GetFrame(new SpriteSpecifier.Rsi(new ResPath("/Textures/_RMC14/Objects/Tools/intel_detector.rsi"), "data_blip"), _timing.CurTime); | ||
_motionDetector.DrawBlips<IntelDetectorComponent>(args.WorldHandle, ref _last, _blips, frame); | ||
} | ||
} |
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,19 @@ | ||
using Robust.Client.Graphics; | ||
|
||
namespace Content.Client._RMC14.Intel; | ||
|
||
public sealed class IntelDetectorOverlaySystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IOverlayManager _overlay = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
if (!_overlay.HasOverlay<IntelDetectorOverlay>()) | ||
_overlay.AddOverlay(new IntelDetectorOverlay()); | ||
} | ||
|
||
public override void Shutdown() | ||
{ | ||
_overlay.RemoveOverlay<IntelDetectorOverlay>(); | ||
} | ||
} |
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,30 @@ | ||
using Content.Shared._RMC14.Intel; | ||
|
||
namespace Content.Client._RMC14.Intel; | ||
|
||
public sealed class IntelUISystem : EntitySystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<ViewIntelObjectivesComponent, AfterAutoHandleStateEvent>(OnViewIntelObjectivesAfterState); | ||
} | ||
|
||
private void OnViewIntelObjectivesAfterState(Entity<ViewIntelObjectivesComponent> ent, ref AfterAutoHandleStateEvent args) | ||
{ | ||
try | ||
{ | ||
if (!TryComp(ent, out UserInterfaceComponent? ui)) | ||
return; | ||
|
||
foreach (var bui in ui.ClientOpenInterfaces.Values) | ||
{ | ||
if (bui is ViewIntelObjectivesBui intelUi) | ||
intelUi.Refresh(); | ||
} | ||
} | ||
catch (Exception e) | ||
{ | ||
Log.Error($"Error refreshing {nameof(ViewIntelObjectivesBui)}\n{e}"); | ||
} | ||
} | ||
} |
Oops, something went wrong.