Skip to content

Commit

Permalink
Merge branch 'master-ru' of https://gitlab.workbench.network/Workbenc…
Browse files Browse the repository at this point in the history
…h-Team/space-station-14 into arumoon-server

# Conflicts:
#	Content.Shared/Inventory/InventorySystem.Relay.cs
#	Resources/Locale/en-US/ss14-ru/prototypes/entities/objects/weapons/guns/rifles/rifles.ftl
#	Resources/Locale/ru-RU/reagents/meta/toxins.ftl
#	Resources/Locale/ru-RU/ss14-ru/prototypes/entities/objects/weapons/guns/rifles/rifles.ftl
#	Resources/Maps/box.yml
#	Resources/Maps/marathon.yml
#	Resources/Maps/origin.yml
#	Resources/Prototypes/Catalog/VendingMachines/Inventories/secdrobe.yml
#	Resources/Prototypes/Entities/Clothing/Eyes/base_clothingeyes.yml
#	Resources/Prototypes/Entities/Objects/Weapons/Guns/Rifles/rifles.yml
#	Resources/Prototypes/GameRules/events.yml
#	Resources/Prototypes/Reagents/toxins.yml
#	Resources/Prototypes/Voice/speech_emote_sounds.yml
  • Loading branch information
MilenVolf committed Jun 19, 2024
2 parents 87c0e12 + 3eb57f0 commit 9c30611
Show file tree
Hide file tree
Showing 276 changed files with 57,252 additions and 63,906 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/APC/ApcVisualizerComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public sealed partial class ApcVisualsComponent : Component
/// </summary>
[DataField("screenColors")]
[ViewVariables(VVAccess.ReadWrite)]
public Color[] ScreenColors = new Color[(byte)ApcChargeState.NumStates]{Color.FromHex("#d1332e"), Color.FromHex("#2e8ad1"), Color.FromHex("#3db83b"), Color.FromHex("#ffac1c")};
public Color[] ScreenColors = new Color[(byte)ApcChargeState.NumStates]{Color.FromHex("#d1332e"), Color.FromHex("#dcdc28"), Color.FromHex("#82ff4c"), Color.FromHex("#ffac1c")};

/// <summary>
/// The sprite state of the unlit overlay used for the APC screen when the APC has been emagged.
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
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
11 changes: 3 additions & 8 deletions Content.Client/Weather/WeatherSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@
using Content.Shared.Weather;
using Robust.Client.Audio;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Player;
using AudioComponent = Robust.Shared.Audio.Components.AudioComponent;

Expand Down Expand Up @@ -62,7 +57,7 @@ protected override void Run(EntityUid uid, WeatherData weather, WeatherPrototype
if (TryComp<MapGridComponent>(entXform.GridUid, out var grid))
{
var gridId = entXform.GridUid.Value;
// Floodfill to the nearest tile and use that for audio.
// FloodFill to the nearest tile and use that for audio.
var seed = _mapSystem.GetTileRef(gridId, grid, entXform.Coordinates);
var frontier = new Queue<TileRef>();
frontier.Enqueue(seed);
Expand All @@ -75,7 +70,7 @@ protected override void Run(EntityUid uid, WeatherData weather, WeatherPrototype
if (!visited.Add(node.GridIndices))
continue;

if (!CanWeatherAffect(grid, node))
if (!CanWeatherAffect(entXform.GridUid.Value, grid, node))
{
// Add neighbors
// TODO: Ideally we pick some deterministically random direction and use that
Expand Down Expand Up @@ -107,7 +102,7 @@ protected override void Run(EntityUid uid, WeatherData weather, WeatherPrototype
if (nearestNode != null)
{
var entPos = _transform.GetMapCoordinates(entXform);
var nodePosition = nearestNode.Value.ToMap(EntityManager, _transform).Position;
var nodePosition = _transform.ToMapCoordinates(nearestNode.Value).Position;
var delta = nodePosition - entPos.Position;
var distance = delta.Length();
occlusion = _audio.GetOcclusion(entPos, delta, distance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ private void OnRoundStartAttempt(RoundStartAttemptEvent args)
while (query.MoveNext(out _, out _, out var gameRule))
{
var minPlayers = gameRule.MinPlayers;
if (!gameRule.CancelPresetOnTooFewPlayers)
continue;
if (args.Players.Length >= minPlayers)
continue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ namespace Content.Server.Chemistry.Components;
[RegisterComponent, Access(typeof(TransformableContainerSystem))]
public sealed partial class TransformableContainerComponent : Component
{
/// <summary>
/// This is the initial metadata name for the container.
/// It will revert to this when emptied.
/// It defaults to the name of the parent entity unless overwritten.
/// </summary>
[DataField("initialName")]
public string? InitialName;

/// <summary>
/// This is the initial metadata description for the container.
/// It will revert to this when emptied.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.NameModifier.EntitySystems;
using Robust.Shared.Prototypes;

namespace Content.Server.Chemistry.EntitySystems;
Expand All @@ -11,22 +12,20 @@ public sealed class TransformableContainerSystem : EntitySystem
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SolutionContainerSystem _solutionsSystem = default!;
[Dependency] private readonly MetaDataSystem _metadataSystem = default!;
[Dependency] private readonly NameModifierSystem _nameMod = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<TransformableContainerComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<TransformableContainerComponent, SolutionContainerChangedEvent>(OnSolutionChange);
SubscribeLocalEvent<TransformableContainerComponent, RefreshNameModifiersEvent>(OnRefreshNameModifiers);
}

private void OnMapInit(Entity<TransformableContainerComponent> entity, ref MapInitEvent args)
private void OnMapInit(Entity<TransformableContainerComponent> entity, ref MapInitEvent args)
{
var meta = MetaData(entity.Owner);
if (string.IsNullOrEmpty(entity.Comp.InitialName))
{
entity.Comp.InitialName = meta.EntityName;
}
if (string.IsNullOrEmpty(entity.Comp.InitialDescription))
{
entity.Comp.InitialDescription = meta.EntityDescription;
Expand Down Expand Up @@ -58,12 +57,20 @@ private void OnSolutionChange(Entity<TransformableContainerComponent> entity, re
&& _prototypeManager.TryIndex(reagentId.Value.Prototype, out ReagentPrototype? proto))
{
var metadata = MetaData(entity.Owner);
var val = Loc.GetString("transformable-container-component-glass", ("name", proto.LocalizedName));
_metadataSystem.SetEntityName(entity.Owner, val, metadata);
_metadataSystem.SetEntityDescription(entity.Owner, proto.LocalizedDescription, metadata);
entity.Comp.CurrentReagent = proto;
entity.Comp.Transformed = true;
}

_nameMod.RefreshNameModifiers(entity.Owner);
}

private void OnRefreshNameModifiers(Entity<TransformableContainerComponent> entity, ref RefreshNameModifiersEvent args)
{
if (entity.Comp.CurrentReagent is { } currentReagent)
{
args.AddModifier("transformable-container-component-glass", priority: -1, ("reagent", currentReagent.LocalizedName));
}
}

private void CancelTransformation(Entity<TransformableContainerComponent> entity)
Expand All @@ -73,10 +80,8 @@ private void CancelTransformation(Entity<TransformableContainerComponent> entity

var metadata = MetaData(entity);

if (!string.IsNullOrEmpty(entity.Comp.InitialName))
{
_metadataSystem.SetEntityName(entity.Owner, entity.Comp.InitialName, metadata);
}
_nameMod.RefreshNameModifiers(entity.Owner);

if (!string.IsNullOrEmpty(entity.Comp.InitialDescription))
{
_metadataSystem.SetEntityDescription(entity.Owner, entity.Comp.InitialDescription, metadata);
Expand Down
Loading

0 comments on commit 9c30611

Please sign in to comment.