-
Notifications
You must be signed in to change notification settings - Fork 47
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
866 changed files
with
53,347 additions
and
25,880 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,25 @@ jobs: | |
- uses: actions/[email protected] | ||
with: | ||
submodules: 'recursive' | ||
|
||
# Corvax-Secrets-Start | ||
- name: Setup secrets | ||
env: | ||
SSH_KEY: ${{ secrets.SECRETS_PRIVATE_KEY }} | ||
if: ${{ env.SSH_KEY != '' }} | ||
run: | | ||
mkdir ~/.ssh | ||
echo "${{ secrets.SECRETS_PRIVATE_KEY }}" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
echo "HOST *" > ~/.ssh/config | ||
echo "StrictHostKeyChecking no" >> ~/.ssh/config | ||
git clone [email protected]:corvax-nexus/secrets.git Secrets | ||
cp -R Secrets/Resources/Prototypes Resources/Prototypes/CorvaxSecrets | ||
cp -R Secrets/Resources/ServerPrototypes Resources/Prototypes/CorvaxSecretsServer | ||
cp -R Secrets/Resources/Locale Resources/Locale/ru-RU/corvax-secrets | ||
cp -R Secrets/Resources/Textures Resources/Textures/CorvaxSecrets | ||
# Corvax-Secrets-End | ||
|
||
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
with: | ||
|
46 changes: 46 additions & 0 deletions
46
Content.Client/ADT/Overlays/Shaders/MonochromacyOverlay.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,46 @@ | ||
// Simple Station | ||
|
||
using Robust.Client.Graphics; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Enums; | ||
using Robust.Shared.Prototypes; | ||
using Content.Shared.ADT.Traits; | ||
using Matrix3x2 = System.Numerics.Matrix3x2; | ||
|
||
namespace Content.Client.ADT.Overlays | ||
{ | ||
public sealed partial class MonochromacyOverlay : Overlay | ||
{ | ||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; | ||
[Dependency] private readonly IPlayerManager _playerManager = default!; | ||
[Dependency] IEntityManager _entityManager = default!; | ||
|
||
|
||
public override bool RequestScreenTexture => true; | ||
public override OverlaySpace Space => OverlaySpace.WorldSpace; | ||
private readonly ShaderInstance _greyscaleShader; | ||
|
||
public MonochromacyOverlay() | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
_greyscaleShader = _prototypeManager.Index<ShaderPrototype>("GreyscaleFullscreen").InstanceUnique(); | ||
} | ||
|
||
protected override void Draw(in OverlayDrawArgs args) | ||
{ | ||
if (ScreenTexture == null) return; | ||
if (_playerManager.LocalPlayer?.ControlledEntity is not { Valid: true } player) return; | ||
if (!_entityManager.HasComponent<MonochromacyComponent>(player)) return; | ||
|
||
_greyscaleShader?.SetParameter("SCREEN_TEXTURE", ScreenTexture); | ||
|
||
|
||
var worldHandle = args.WorldHandle; | ||
var viewport = args.WorldBounds; | ||
worldHandle.SetTransform(Matrix3x2.Identity); | ||
worldHandle.UseShader(_greyscaleShader); | ||
worldHandle.DrawRect(viewport, Color.White); | ||
worldHandle.UseShader(null); | ||
} | ||
} | ||
} |
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,93 @@ | ||
using Content.Shared.ADT.Silicon.Components; | ||
using Content.Shared.ADT.Silicon.Systems; | ||
using Content.Shared.StatusEffect; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.Graphics; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Enums; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Timing; | ||
|
||
|
||
namespace Content.Client.ADT.Overlays.Shaders; | ||
|
||
public sealed class StaticOverlay : Overlay | ||
{ | ||
[Dependency] private readonly IEntityManager _entityManager = default!; | ||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; | ||
[Dependency] private readonly IPlayerManager _playerManager = default!; | ||
|
||
public override OverlaySpace Space => OverlaySpace.WorldSpace; | ||
public override bool RequestScreenTexture => true; | ||
private readonly ShaderInstance _staticShader; | ||
|
||
private (TimeSpan, TimeSpan)? _time; | ||
private float? _fullTimeLeft; | ||
private float? _curTimeLeft; | ||
|
||
public float MixAmount = 0; | ||
|
||
public StaticOverlay() | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
_staticShader = _prototypeManager.Index<ShaderPrototype>("SeeingStatic").InstanceUnique(); | ||
} | ||
|
||
protected override void FrameUpdate(FrameEventArgs args) | ||
{ | ||
var playerEntity = _playerManager.LocalPlayer?.ControlledEntity; | ||
|
||
if (playerEntity == null) | ||
return; | ||
|
||
if (!_entityManager.TryGetComponent<SeeingStaticComponent>(playerEntity, out var staticComp) | ||
|| !_entityManager.TryGetComponent<StatusEffectsComponent>(playerEntity, out var statusComp)) | ||
return; | ||
|
||
var status = _entityManager.EntitySysManager.GetEntitySystem<StatusEffectsSystem>(); | ||
|
||
if (playerEntity == null || statusComp == null) | ||
return; | ||
|
||
if (!status.TryGetTime(playerEntity.Value, SharedSeeingStaticSystem.StaticKey, out var timeTemp, statusComp)) | ||
return; | ||
|
||
if (_time != timeTemp) // Resets the shader if the times change. This should factor in wheather it's a reset, or a increase, but I have a lot of cough syrup in me, so TODO. | ||
{ | ||
_time = timeTemp; | ||
_fullTimeLeft = null; | ||
_curTimeLeft = null; | ||
} | ||
|
||
_fullTimeLeft ??= (float) (timeTemp.Value.Item2 - timeTemp.Value.Item1).TotalSeconds; | ||
_curTimeLeft ??= _fullTimeLeft; | ||
|
||
_curTimeLeft -= args.DeltaSeconds; | ||
|
||
MixAmount = Math.Clamp(_curTimeLeft.Value / _fullTimeLeft.Value * staticComp.Multiplier, 0, 1); | ||
} | ||
|
||
protected override bool BeforeDraw(in OverlayDrawArgs args) | ||
{ | ||
if (!_entityManager.TryGetComponent(_playerManager.LocalPlayer?.ControlledEntity, out EyeComponent? eyeComp)) | ||
return false; | ||
|
||
if (args.Viewport.Eye != eyeComp.Eye) | ||
return false; | ||
|
||
return MixAmount > 0; | ||
} | ||
|
||
protected override void Draw(in OverlayDrawArgs args) | ||
{ | ||
if (ScreenTexture == null) | ||
return; | ||
|
||
var handle = args.WorldHandle; | ||
_staticShader.SetParameter("SCREEN_TEXTURE", ScreenTexture); | ||
_staticShader.SetParameter("mixAmount", MixAmount); | ||
handle.UseShader(_staticShader); | ||
handle.DrawRect(args.WorldBounds, Color.White); | ||
handle.UseShader(null); | ||
} | ||
} |
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,56 @@ | ||
// Simple Station | ||
|
||
using Robust.Client.GameObjects; | ||
using Robust.Client.Graphics; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Network; | ||
using Content.Shared.ADT.Traits; | ||
using Robust.Shared.Player; | ||
|
||
namespace Content.Client.ADT.Overlays; | ||
public sealed class MonochromacySystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IPlayerManager _player = default!; | ||
[Dependency] private readonly IOverlayManager _overlayMan = default!; | ||
[Dependency] private readonly INetManager _net = default!; | ||
[Dependency] private readonly IEntityManager _entityManager = default!; | ||
|
||
private MonochromacyOverlay _overlay = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<MonochromacyComponent, ComponentStartup>(OnMonochromacyStartup); | ||
SubscribeLocalEvent<MonochromacyComponent, ComponentShutdown>(OnMonochromacyShutdown); | ||
|
||
SubscribeLocalEvent<MonochromacyComponent, PlayerAttachedEvent>(OnPlayerAttached); | ||
SubscribeLocalEvent<MonochromacyComponent, PlayerDetachedEvent>(OnPlayerDetached); | ||
|
||
_overlay = new(); | ||
} | ||
|
||
private void OnMonochromacyStartup(EntityUid uid, MonochromacyComponent component, ComponentStartup args) | ||
{ | ||
if (_player.LocalPlayer?.ControlledEntity == uid) | ||
_overlayMan.AddOverlay(_overlay); | ||
} | ||
|
||
private void OnMonochromacyShutdown(EntityUid uid, MonochromacyComponent component, ComponentShutdown args) | ||
{ | ||
if (_player.LocalPlayer?.ControlledEntity == uid) | ||
{ | ||
_overlayMan.RemoveOverlay(_overlay); | ||
} | ||
} | ||
|
||
private void OnPlayerAttached(EntityUid uid, MonochromacyComponent component, PlayerAttachedEvent args) | ||
{ | ||
_overlayMan.AddOverlay(_overlay); | ||
} | ||
|
||
private void OnPlayerDetached(EntityUid uid, MonochromacyComponent component, PlayerDetachedEvent args) | ||
{ | ||
_overlayMan.RemoveOverlay(_overlay); | ||
} | ||
} |
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,57 @@ | ||
using Content.Client.ADT.Overlays.Shaders; | ||
using Content.Shared.ADT.Silicon.Components; | ||
using Robust.Client.Graphics; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Player; | ||
|
||
namespace Content.Client.ADT.Overlays; | ||
|
||
/// <summary> | ||
/// System to handle the SeeingStatic overlay. | ||
/// </summary> | ||
public sealed class SeeingStaticSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IPlayerManager _player = default!; | ||
[Dependency] private readonly IOverlayManager _overlayMan = default!; | ||
|
||
private StaticOverlay _overlay = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<SeeingStaticComponent, ComponentInit>(OnInit); | ||
SubscribeLocalEvent<SeeingStaticComponent, ComponentShutdown>(OnShutdown); | ||
|
||
SubscribeLocalEvent<SeeingStaticComponent, LocalPlayerAttachedEvent>(OnPlayerAttached); | ||
SubscribeLocalEvent<SeeingStaticComponent, LocalPlayerDetachedEvent>(OnPlayerDetached); | ||
|
||
_overlay = new(); | ||
} | ||
|
||
private void OnPlayerAttached(EntityUid uid, SeeingStaticComponent component, LocalPlayerAttachedEvent args) | ||
{ | ||
_overlayMan.AddOverlay(_overlay); | ||
} | ||
|
||
private void OnPlayerDetached(EntityUid uid, SeeingStaticComponent component, LocalPlayerDetachedEvent args) | ||
{ | ||
_overlay.MixAmount = 0; | ||
_overlayMan.RemoveOverlay(_overlay); | ||
} | ||
|
||
private void OnInit(EntityUid uid, SeeingStaticComponent component, ComponentInit args) | ||
{ | ||
if (_player.LocalPlayer?.ControlledEntity == uid) | ||
_overlayMan.AddOverlay(_overlay); | ||
} | ||
|
||
private void OnShutdown(EntityUid uid, SeeingStaticComponent component, ComponentShutdown args) | ||
{ | ||
if (_player.LocalPlayer?.ControlledEntity == uid) | ||
{ | ||
_overlay.MixAmount = 0; | ||
_overlayMan.RemoveOverlay(_overlay); | ||
} | ||
} | ||
} |
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,117 @@ | ||
using System.Numerics; | ||
using Content.Client.Gameplay; | ||
using Content.Shared.Hands.Components; | ||
using Content.Shared.Interaction; | ||
using Content.Shared.ADT.RPD.Components; | ||
using Content.Shared.ADT.RPD.Systems; | ||
using Robust.Client.Placement; | ||
using Robust.Client.Player; | ||
using Robust.Client.State; | ||
using Robust.Shared.Map; | ||
using Robust.Shared.Map.Components; | ||
|
||
namespace Content.Client.ADT.RPD; | ||
|
||
public sealed class AlignRPDConstruction : PlacementMode | ||
{ | ||
[Dependency] private readonly IEntityManager _entityManager = default!; | ||
[Dependency] private readonly IMapManager _mapManager = default!; | ||
private readonly SharedMapSystem _mapSystem; | ||
private readonly RPDSystem _rpdSystem; | ||
private readonly SharedTransformSystem _transformSystem; | ||
[Dependency] private readonly IPlayerManager _playerManager = default!; | ||
[Dependency] private readonly IStateManager _stateManager = default!; | ||
|
||
private const float SearchBoxSize = 2f; | ||
private const float PlaceColorBaseAlpha = 0.5f; | ||
|
||
private EntityCoordinates _unalignedMouseCoords = default; | ||
|
||
/// <summary> | ||
/// This placement mode is not on the engine because it is content specific (i.e., for the RPD) | ||
/// </summary> | ||
public AlignRPDConstruction(PlacementManager pMan) : base(pMan) | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
_mapSystem = _entityManager.System<SharedMapSystem>(); | ||
_rpdSystem = _entityManager.System<RPDSystem>(); | ||
_transformSystem = _entityManager.System<SharedTransformSystem>(); | ||
|
||
ValidPlaceColor = ValidPlaceColor.WithAlpha(PlaceColorBaseAlpha); | ||
} | ||
|
||
public override void AlignPlacementMode(ScreenCoordinates mouseScreen) | ||
{ | ||
_unalignedMouseCoords = ScreenToCursorGrid(mouseScreen); | ||
MouseCoords = _unalignedMouseCoords.AlignWithClosestGridTile(SearchBoxSize, _entityManager, _mapManager); | ||
|
||
var gridId = MouseCoords.GetGridUid(_entityManager); | ||
|
||
if (!_entityManager.TryGetComponent<MapGridComponent>(gridId, out var mapGrid)) | ||
return; | ||
|
||
CurrentTile = _mapSystem.GetTileRef(gridId.Value, mapGrid, MouseCoords); | ||
|
||
float tileSize = mapGrid.TileSize; | ||
GridDistancing = tileSize; | ||
|
||
if (pManager.CurrentPermission!.IsTile) | ||
{ | ||
MouseCoords = new EntityCoordinates(MouseCoords.EntityId, new Vector2(CurrentTile.X + tileSize / 2, | ||
CurrentTile.Y + tileSize / 2)); | ||
} | ||
else | ||
{ | ||
MouseCoords = new EntityCoordinates(MouseCoords.EntityId, new Vector2(CurrentTile.X + tileSize / 2 + pManager.PlacementOffset.X, | ||
CurrentTile.Y + tileSize / 2 + pManager.PlacementOffset.Y)); | ||
} | ||
} | ||
|
||
public override bool IsValidPosition(EntityCoordinates position) | ||
{ | ||
var player = _playerManager.LocalSession?.AttachedEntity; | ||
|
||
// If the destination is out of interaction range, set the placer alpha to zero | ||
if (!_entityManager.TryGetComponent<TransformComponent>(player, out var xform)) | ||
return false; | ||
|
||
if (!xform.Coordinates.InRange(_entityManager, _transformSystem, position, SharedInteractionSystem.InteractionRange)) | ||
{ | ||
InvalidPlaceColor = InvalidPlaceColor.WithAlpha(0); | ||
return false; | ||
} | ||
|
||
// Otherwise restore the alpha value | ||
else | ||
{ | ||
InvalidPlaceColor = InvalidPlaceColor.WithAlpha(PlaceColorBaseAlpha); | ||
} | ||
|
||
// Determine if player is carrying an RPD in their active hand | ||
if (!_entityManager.TryGetComponent<HandsComponent>(player, out var hands)) | ||
return false; | ||
|
||
var heldEntity = hands.ActiveHand?.HeldEntity; | ||
|
||
if (!_entityManager.TryGetComponent<RPDComponent>(heldEntity, out var rpd)) | ||
return false; | ||
|
||
// Retrieve the map grid data for the position | ||
if (!_rpdSystem.TryGetMapGridData(position, out var mapGridData)) | ||
return false; | ||
|
||
// Determine if the user is hovering over a target | ||
var currentState = _stateManager.CurrentState; | ||
|
||
if (currentState is not GameplayStateBase screen) | ||
return false; | ||
|
||
var target = screen.GetClickedEntity(_unalignedMouseCoords.ToMap(_entityManager, _transformSystem)); | ||
|
||
// Determine if the RPD operation is valid or not | ||
if (!_rpdSystem.IsRPDOperationStillValid(heldEntity.Value, rpd, mapGridData.Value, target, player.Value, false)) | ||
return false; | ||
|
||
return true; | ||
} | ||
} |
Oops, something went wrong.