forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/arumoon-server' into Maps
- Loading branch information
Showing
265 changed files
with
66,376 additions
and
72,602 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@echo off | ||
chcp 65001 > nul | ||
setlocal | ||
echo Версии сборки: | ||
echo 1 - Debug | ||
echo 2 - Release | ||
:SetBuild | ||
set /p choice="Введите номер требуемой сборки: " | ||
if "%choice%"=="1" ( | ||
echo Сборка Debug версии... | ||
dotnet build -c Debug | ||
)else if "%choice%"=="2" ( | ||
echo Сборка Release версии... | ||
dotnet build -c Release | ||
)else ( | ||
echo Некорректный номер сборки. Пожалуйста, выберите 1 или 2. | ||
goto SetBuild) | ||
endlocal | ||
pause |
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
48 changes: 48 additions & 0 deletions
48
Content.Client/Clothing/FlippableClothingVisualizerSystem.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,48 @@ | ||
using Content.Shared.Clothing; | ||
using Content.Shared.Clothing.Components; | ||
using Content.Shared.Clothing.EntitySystems; | ||
using Content.Shared.Foldable; | ||
using Content.Shared.Item; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client.Clothing; | ||
|
||
public sealed class FlippableClothingVisualizerSystem : VisualizerSystem<FlippableClothingVisualsComponent> | ||
{ | ||
[Dependency] private readonly SharedItemSystem _itemSys = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<FlippableClothingVisualsComponent, GetEquipmentVisualsEvent>(OnGetVisuals, after: [typeof(ClothingSystem)]); | ||
SubscribeLocalEvent<FlippableClothingVisualsComponent, FoldedEvent>(OnFolded); | ||
} | ||
|
||
private void OnFolded(Entity<FlippableClothingVisualsComponent> ent, ref FoldedEvent args) | ||
{ | ||
_itemSys.VisualsChanged(ent); | ||
} | ||
|
||
private void OnGetVisuals(Entity<FlippableClothingVisualsComponent> ent, ref GetEquipmentVisualsEvent args) | ||
{ | ||
if (!TryComp(ent, out SpriteComponent? sprite) || | ||
!TryComp(ent, out ClothingComponent? clothing)) | ||
return; | ||
|
||
if (clothing.MappedLayer == null || | ||
!AppearanceSystem.TryGetData<bool>(ent, FoldableSystem.FoldedVisuals.State, out var folding) || | ||
!sprite.LayerMapTryGet(folding ? ent.Comp.FoldingLayer : ent.Comp.UnfoldingLayer, out var idx)) | ||
return; | ||
|
||
// add each layer to the visuals | ||
var spriteLayer = sprite[idx]; | ||
foreach (var layer in args.Layers) | ||
{ | ||
if (layer.Item1 != clothing.MappedLayer) | ||
continue; | ||
|
||
layer.Item2.Scale = spriteLayer.Scale; | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
Content.Client/Clothing/FlippableClothingVisualsComponent.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,16 @@ | ||
namespace Content.Client.Clothing; | ||
|
||
/// <summary> | ||
/// Communicates folded layers data (currently only Scale to handle flipping) | ||
/// to the wearer clothing sprite layer | ||
/// </summary> | ||
[RegisterComponent] | ||
[Access(typeof(FlippableClothingVisualizerSystem))] | ||
public sealed partial class FlippableClothingVisualsComponent : Component | ||
{ | ||
[DataField] | ||
public string FoldingLayer = "foldedLayer"; | ||
|
||
[DataField] | ||
public string UnfoldingLayer = "unfoldedLayer"; | ||
} |
19 changes: 19 additions & 0 deletions
19
Content.Client/Clothing/Systems/PilotedByClothingSystem.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,19 @@ | ||
using Content.Shared.Clothing.Components; | ||
using Robust.Client.Physics; | ||
|
||
namespace Content.Client.Clothing.Systems; | ||
|
||
public sealed partial class PilotedByClothingSystem : EntitySystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<PilotedByClothingComponent, UpdateIsPredictedEvent>(OnUpdatePredicted); | ||
} | ||
|
||
private void OnUpdatePredicted(Entity<PilotedByClothingComponent> entity, ref UpdateIsPredictedEvent args) | ||
{ | ||
args.BlockPrediction = true; | ||
} | ||
} |
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
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
86 changes: 86 additions & 0 deletions
86
Content.Client/Starshine/Eye/NightVision/NightVisionOverlay.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,86 @@ | ||
using Content.Shared.Starshine.Eye.NightVision.Components; //creater - vladospupuos | ||
using Robust.Client.Graphics; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Enums; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Client.GG.Eye.NightVision | ||
{ | ||
public sealed class NightVisionOverlay : Overlay | ||
{ | ||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; | ||
[Dependency] private readonly IPlayerManager _playerManager = default!; | ||
[Dependency] private readonly IEntityManager _entityManager = default!; | ||
[Dependency] private readonly ILightManager _lightManager = default!; | ||
|
||
|
||
public override bool RequestScreenTexture => true; | ||
public override OverlaySpace Space => OverlaySpace.WorldSpace; | ||
private readonly ShaderInstance _greyscaleShader; | ||
public Color NightvisionColor = Color.Green; | ||
|
||
private NightVisionComponent _nightvisionComponent = default!; | ||
|
||
public NightVisionOverlay(Color color) | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
_greyscaleShader = _prototypeManager.Index<ShaderPrototype>("GreyscaleFullscreen").InstanceUnique(); | ||
|
||
NightvisionColor = color; | ||
} | ||
protected override bool BeforeDraw(in OverlayDrawArgs args) | ||
{ | ||
if (!_entityManager.TryGetComponent(_playerManager.LocalSession?.AttachedEntity, out EyeComponent? eyeComp)) | ||
return false; | ||
|
||
if (args.Viewport.Eye != eyeComp.Eye) | ||
return false; | ||
|
||
var playerEntity = _playerManager.LocalSession?.AttachedEntity; | ||
|
||
if (playerEntity == null) | ||
return false; | ||
|
||
if (!_entityManager.TryGetComponent<NightVisionComponent>(playerEntity, out var nightvisionComp)) | ||
return false; | ||
|
||
_nightvisionComponent = nightvisionComp; | ||
|
||
var nightvision = _nightvisionComponent.IsNightVision; | ||
|
||
if (!nightvision && _nightvisionComponent.DrawShadows) // Disable our Night Vision | ||
{ | ||
_lightManager.DrawLighting = true; | ||
_nightvisionComponent.DrawShadows = false; | ||
_nightvisionComponent.GraceFrame = true; | ||
return true; | ||
} | ||
|
||
return nightvision; | ||
} | ||
|
||
protected override void Draw(in OverlayDrawArgs args) | ||
{ | ||
if (ScreenTexture == null) | ||
return; | ||
|
||
if (!_nightvisionComponent.GraceFrame) | ||
{ | ||
_nightvisionComponent.DrawShadows = true; // Enable our Night Vision | ||
_lightManager.DrawLighting = false; | ||
} | ||
else | ||
{ | ||
_nightvisionComponent.GraceFrame = false; | ||
} | ||
|
||
_greyscaleShader?.SetParameter("SCREEN_TEXTURE", ScreenTexture); | ||
|
||
var worldHandle = args.WorldHandle; | ||
var viewport = args.WorldBounds; | ||
worldHandle.UseShader(_greyscaleShader); | ||
worldHandle.DrawRect(viewport, NightvisionColor); | ||
worldHandle.UseShader(null); | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
Content.Client/Starshine/Eye/NightVision/NightVisionSystem.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,47 @@ | ||
using Content.Client.Overlays; | ||
using Content.Shared.GameTicking; | ||
using Content.Shared.Starshine.Eye.NightVision.Components; | ||
using Content.Shared.Inventory.Events; | ||
using Robust.Client.Graphics; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Player; | ||
|
||
namespace Content.Client.GG.Eye.NightVision; | ||
|
||
public sealed class NightVisionSystem : EquipmentHudSystem<NightVisionComponent> | ||
{ | ||
[Dependency] private readonly IOverlayManager _overlayMan = default!; | ||
[Dependency] private readonly ILightManager _lightManager = default!; | ||
|
||
|
||
private NightVisionOverlay _overlay = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
_overlay = new(Color.Green); | ||
} | ||
|
||
protected override void UpdateInternal(RefreshEquipmentHudEvent<NightVisionComponent> component) | ||
{ | ||
base.UpdateInternal(component); | ||
|
||
foreach (var comp in component.Components) | ||
{ | ||
_overlay.NightvisionColor = comp.NightVisionColor; | ||
} | ||
if (!_overlayMan.HasOverlay<NightVisionOverlay>()) | ||
{ | ||
_overlayMan.AddOverlay(_overlay); | ||
} | ||
_lightManager.DrawLighting = false; | ||
} | ||
|
||
protected override void DeactivateInternal() | ||
{ | ||
base.DeactivateInternal(); | ||
_overlayMan.RemoveOverlay(_overlay); | ||
_lightManager.DrawLighting = true; | ||
} | ||
} |
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.