Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/arumoon-server' into Maps
Browse files Browse the repository at this point in the history
  • Loading branch information
Elst28 committed Jun 23, 2024
2 parents f3d425f + 1206949 commit 22682df
Show file tree
Hide file tree
Showing 265 changed files with 66,376 additions and 72,602 deletions.
19 changes: 19 additions & 0 deletions BUILD.bat
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
8 changes: 4 additions & 4 deletions Content.Client/Clothing/ClientClothingSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Numerics;
using Content.Client.Inventory;
using Content.Shared.Clothing;
using Content.Shared.Clothing.Components;
Expand Down Expand Up @@ -113,6 +114,7 @@ private void OnGetVisuals(EntityUid uid, ClothingComponent item, GetEquipmentVis
i++;
}

item.MappedLayer = key;
args.Layers.Add((key, layer));
}
}
Expand Down Expand Up @@ -153,13 +155,9 @@ private bool TryGetDefaultVisuals(EntityUid uid, ClothingComponent clothing, str

// species specific
if (speciesId != null && rsi.TryGetState($"{state}-{speciesId}", out _))
{
state = $"{state}-{speciesId}";
}
else if (!rsi.TryGetState(state, out _))
{
return false;
}

var layer = new PrototypeLayerData();
layer.RsiPath = rsi.Path.ToString();
Expand Down Expand Up @@ -287,6 +285,8 @@ private void RenderEquipment(EntityUid equipee, EntityUid equipment, string slot

if (layerData.Color != null)
sprite.LayerSetColor(key, layerData.Color.Value);
if (layerData.Scale != null)
sprite.LayerSetScale(key, layerData.Scale.Value);
}
else
index = sprite.LayerMapReserveBlank(key);
Expand Down
48 changes: 48 additions & 0 deletions Content.Client/Clothing/FlippableClothingVisualizerSystem.cs
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 Content.Client/Clothing/FlippableClothingVisualsComponent.cs
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 Content.Client/Clothing/Systems/PilotedByClothingSystem.cs
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;
}
}
2 changes: 1 addition & 1 deletion Content.Client/Interaction/DragDropSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ private void RemoveHighlights()
// CanInteract() doesn't support checking a second "target" entity.
// Doing so manually:
var ev = new GettingInteractedWithAttemptEvent(user, dragged);
RaiseLocalEvent(dragged, ev, true);
RaiseLocalEvent(dragged, ref ev);

if (ev.Cancelled)
return false;
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Overlays/StencilOverlay.Weather.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private void DrawWeather(in OverlayDrawArgs args, WeatherPrototype weatherProto,
foreach (var tile in grid.Comp.GetTilesIntersecting(worldAABB))
{
// Ignored tiles for stencil
if (_weather.CanWeatherAffect(grid, tile))
if (_weather.CanWeatherAffect(grid.Owner, grid, tile))
{
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Power/PowerMonitoringWindow.xaml.Widgets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ public PowerMonitoringButton()
{
HorizontalAlignment = HAlignment.Right,
Align = Label.AlignMode.Right,
SetWidth = 72f,
SetWidth = 80f,
Margin = new Thickness(10, 0, 0, 0),
ClipText = true,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private void InitializeBlockers()
SubscribeLocalEvent<ReplaySpectatorComponent, UseAttemptEvent>(OnAttempt);
SubscribeLocalEvent<ReplaySpectatorComponent, PickupAttemptEvent>(OnAttempt);
SubscribeLocalEvent<ReplaySpectatorComponent, ThrowAttemptEvent>(OnAttempt);
SubscribeLocalEvent<ReplaySpectatorComponent, InteractionAttemptEvent>(OnAttempt);
SubscribeLocalEvent<ReplaySpectatorComponent, InteractionAttemptEvent>(OnInteractAttempt);
SubscribeLocalEvent<ReplaySpectatorComponent, AttackAttemptEvent>(OnAttempt);
SubscribeLocalEvent<ReplaySpectatorComponent, DropAttemptEvent>(OnAttempt);
SubscribeLocalEvent<ReplaySpectatorComponent, IsEquippingAttemptEvent>(OnAttempt);
Expand All @@ -27,6 +27,11 @@ private void InitializeBlockers()
SubscribeLocalEvent<ReplaySpectatorComponent, PullAttemptEvent>(OnPullAttempt);
}

private void OnInteractAttempt(Entity<ReplaySpectatorComponent> ent, ref InteractionAttemptEvent args)
{
args.Cancelled = true;
}

private void OnAttempt(EntityUid uid, ReplaySpectatorComponent component, CancellableEntityEventArgs args)
{
args.Cancel();
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Robotics/UI/RoboticsConsoleWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private void PopulateData()
BorgInfo.SetMessage(text);

// how the turntables
DisableButton.Disabled = !data.HasBrain;
DisableButton.Disabled = !(data.HasBrain && data.CanDisable);
DestroyButton.Disabled = _timing.CurTime < _console.Comp1.NextDestroy;
}

Expand Down
3 changes: 0 additions & 3 deletions Content.Client/Sprite/RandomSpriteSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ private void UpdateClothingComponentAppearance(EntityUid uid, RandomSpriteCompon
if (!Resolve(uid, ref clothing, false))
return;

if (clothing.ClothingVisuals == null)
return;

foreach (var slotPair in clothing.ClothingVisuals)
{
foreach (var keyColorPair in component.Selected)
Expand Down
86 changes: 86 additions & 0 deletions Content.Client/Starshine/Eye/NightVision/NightVisionOverlay.cs
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 Content.Client/Starshine/Eye/NightVision/NightVisionSystem.cs
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;
}
}
5 changes: 2 additions & 3 deletions Content.Client/UserInterface/Systems/Chat/ChatUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Content.Shared.Chat;
using Content.Shared.Decals;
using Content.Shared.Damage.ForceSay;
using Content.Shared.Examine;
using Content.Shared.Decals;
using Content.Shared.Input;
using Content.Shared.Radio;
using Robust.Client.GameObjects;
Expand Down Expand Up @@ -626,7 +625,7 @@ private void UpdateQueuedSpeechBubbles(FrameEventArgs delta)
var predicate = static (EntityUid uid, (EntityUid compOwner, EntityUid? attachedEntity) data)
=> uid == data.compOwner || uid == data.attachedEntity;
var playerPos = player != null
? _transform?.GetMapCoordinates(player.Value) ?? MapCoordinates.Nullspace
? _eye.CurrentEye.Position
: MapCoordinates.Nullspace;

var occluded = player != null && _examine.IsOccluded(player.Value);
Expand Down
Loading

0 comments on commit 22682df

Please sign in to comment.