Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fract-war-ebent-u…
Browse files Browse the repository at this point in the history
…pdate-v0.7
  • Loading branch information
Kirus59 committed Jan 10, 2025
2 parents 00c7eda + 3ea57e2 commit dfa8f5d
Show file tree
Hide file tree
Showing 429 changed files with 48,470 additions and 45,464 deletions.
1 change: 1 addition & 0 deletions Content.Client/RCD/RCDConstructionGhostSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@ public override void Update(float frameTime)

_placementManager.Clear();
_placementManager.BeginPlacing(newObjInfo);
_placementManager.Direction = rcd.ConstructionDirection; // SS220 fix rcd rotation
}
}
22 changes: 19 additions & 3 deletions Content.Client/RCD/RCDMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
VerticalExpand="True"
HorizontalExpand="True"
MinSize="450 450">

<!-- Note: The min size of the window just determine how close to the edge of the screen the center of the radial menu can be placed -->
<!-- The radial menu will try to open so that its center is located where the player's cursor is currently -->

Expand All @@ -16,7 +16,7 @@
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/Interface/Radial/RCD/walls_and_flooring.png"/>
</ui:RadialMenuTextureButton>
<ui:RadialMenuTextureButton StyleClasses="RadialMenuButton" SetSize="64 64" ToolTip="{Loc 'rcd-component-windows-and-grilles'}" TargetLayer="WindowsAndGrilles" Visible="False">
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/Interface/Radial/RCD/windows_and_grilles.png"/>
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/SS220/Interface/Radial/RCD/window_reinforced.png"/>
</ui:RadialMenuTextureButton>
<ui:RadialMenuTextureButton StyleClasses="RadialMenuButton" SetSize="64 64" ToolTip="{Loc 'rcd-component-airlocks'}" TargetLayer="Airlocks" Visible="False">
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/Interface/Radial/RCD/airlocks.png"/>
Expand All @@ -27,6 +27,14 @@
<ui:RadialMenuTextureButton StyleClasses="RadialMenuButton" SetSize="64 64" ToolTip="{Loc 'rcd-component-lighting'}" TargetLayer="Lighting" Visible="False">
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/Interface/Radial/RCD/lighting.png"/>
</ui:RadialMenuTextureButton>
<!-- SS220 rcd upd bgn -->
<ui:RadialMenuTextureButton StyleClasses="RadialMenuButton" SetSize="64 64" ToolTip="{Loc 'rcd-component-pipes'}" TargetLayer="Pipes" Visible="False">
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/SS220/Interface/Radial/RCD/pipes.png"/>
</ui:RadialMenuTextureButton>
<ui:RadialMenuTextureButton StyleClasses="RadialMenuButton" SetSize="64 64" ToolTip="{Loc 'rcd-component-disposals'}" TargetLayer="Disposals" Visible="False">
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/SS220/Interface/Radial/RCD/conpipe-tagger.png"/>
</ui:RadialMenuTextureButton>
<!-- SS220 rcd upd end -->
</ui:RadialContainer>

<!-- Walls and flooring -->
Expand All @@ -40,8 +48,16 @@

<!-- Computer and machine frames -->
<ui:RadialContainer Name="Electrical" VerticalExpand="True" HorizontalExpand="True" Radius="64"/>

<!-- Lighting -->
<ui:RadialContainer Name="Lighting" VerticalExpand="True" HorizontalExpand="True" Radius="64"/>

<!-- SS220 (rcd upd) bgn -->
<!-- Pipes -->
<ui:RadialContainer Name="Pipes" VerticalExpand="True" HorizontalExpand="True" Radius="64"/>

<!-- Disposals -->
<ui:RadialContainer Name="Disposals" VerticalExpand="True" HorizontalExpand="True" Radius="64"/>
<!-- SS220 (rcd upd) end -->

</ui:RadialMenu>
71 changes: 71 additions & 0 deletions Content.Client/SS220/Afk/AfkSystem220.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
using Content.Shared.SS220.Afk;
using Content.Shared.SS220.CCVars;
using Robust.Client.Input;
using Robust.Client.UserInterface;
using Robust.Shared.Configuration;
using Robust.Shared.Input;
using Robust.Shared.Timing;

namespace Content.Client.SS220.Afk;

public sealed class AfkSystem220 : EntitySystem
{
[Dependency] private readonly IInputManager _inputManager = default!;
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IConfigurationManager _configurationManager = default!;

private bool _isAnyInput = false;
private TimeSpan? _lastActivityMessageTimestamp;
private TimeSpan _activityMessageInterval;

public override void Initialize()
{
base.Initialize();
_inputManager.UIKeyBindStateChanged += OnUIKeyBindStateChanged;
_activityMessageInterval = TimeSpan.FromSeconds(_configurationManager.GetCVar(CCVars220.AfkActivityMessageInterval));
}

public override void Shutdown()
{
base.Shutdown();
// The problem here is that shutdown can be very likely caused by disconnecting from server,
// that is caused by clicking the UI button, that is caused by user input and this UIKeyBindStateChanged event,
// so this is basically a modifying-collection-inside-iteration case. That is why I use DeferAction, so
// unsubscription will happen this or next frame but certainly not inside collection iteration.
// Yes, this is not the best solution, but probably the simplest for now.
_userInterfaceManager.DeferAction(() =>
{
_inputManager.UIKeyBindStateChanged -= OnUIKeyBindStateChanged;
});
}

public override void Update(float frameTime)
{
base.Update(frameTime);

// We need to initialize time and turns out that it does not work inside Initialize() call.
_lastActivityMessageTimestamp ??= _gameTiming.CurTime;

if (_gameTiming.CurTime - _lastActivityMessageTimestamp > _activityMessageInterval)
{
SendActivityMessage();
}
}

private bool OnUIKeyBindStateChanged(BoundKeyEventArgs args)
{
_isAnyInput = true;
return false;
}

private void SendActivityMessage()
{
_lastActivityMessageTimestamp = _gameTiming.CurTime;
if (!_isAnyInput)
return;
RaiseNetworkEvent(new PlayerActivityMessage());
_isAnyInput = false;
}
}
2 changes: 1 addition & 1 deletion Content.Client/SprayPainter/UI/SprayPainterWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public sealed partial class SprayPainterWindow : DefaultWindow
private List<SprayPainterEntry> CurrentEntries = new List<SprayPainterEntry>();

private readonly SpriteSpecifier _colorEntryIconTexture = new SpriteSpecifier.Rsi(
new ResPath("Structures/Piping/Atmospherics/pipe.rsi"),
new ResPath("SS220/Structures/Piping/Atmospherics/pipe.rsi"), //ss220 engineering-update-atmos
"pipeStraight");

public SprayPainterWindow()
Expand Down
21 changes: 21 additions & 0 deletions Content.Server/SS220/Afk/AfkSystem220.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
using Content.Server.Afk;
using Content.Shared.SS220.Afk;

namespace Content.Server.SS220.Afk;

public sealed class AfkSystem220 : EntitySystem
{
[Dependency] private readonly IAfkManager _afkManager = default!;

public override void Initialize()
{
base.Initialize();
SubscribeNetworkEvent<PlayerActivityMessage>(OnActivityMessage);
}

private void OnActivityMessage(PlayerActivityMessage message, EntitySessionEventArgs args)
{
_afkManager.PlayerDidAction(args.SenderSession);
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
using Content.Shared.SS220.CultYogg.Cultists;
using Content.Shared.Popups;
using Robust.Shared.Timing;

namespace Content.Server.SS220.CultYogg.Cultists;

public sealed class CultYoggPurifiedSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<CultYoggPurifiedComponent, ComponentInit>(OnInit);
}

private void OnInit(Entity<CultYoggPurifiedComponent> ent, ref ComponentInit args)
{
_popup.PopupEntity(Loc.GetString("cult-yogg-cleansing-start"), ent, ent);
}

public override void Update(float frameTime)
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Atmos/Components/PipeAppearanceComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ namespace Content.Shared.Atmos.Components;
public sealed partial class PipeAppearanceComponent : Component
{
[DataField("sprite")]
public SpriteSpecifier.Rsi Sprite = new(new("Structures/Piping/Atmospherics/pipe.rsi"), "pipeConnector");
public SpriteSpecifier.Rsi Sprite = new(new("SS220/Structures/Piping/Atmospherics/pipe.rsi"), "pipeConnector"); //ss220 engineering-update-atmos
}
5 changes: 3 additions & 2 deletions Content.Shared/Humanoid/Markings/MarkingCategories.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public enum MarkingCategories : byte
Chest,
Arms,
Legs,
Foots, // SS220 Add foots marking
Tail,
Overlay
}
Expand All @@ -39,8 +40,8 @@ public static MarkingCategories FromHumanoidVisualLayers(HumanoidVisualLayers la
HumanoidVisualLayers.LHand => MarkingCategories.Arms,
HumanoidVisualLayers.LLeg => MarkingCategories.Legs,
HumanoidVisualLayers.RLeg => MarkingCategories.Legs,
HumanoidVisualLayers.LFoot => MarkingCategories.Legs,
HumanoidVisualLayers.RFoot => MarkingCategories.Legs,
HumanoidVisualLayers.LFoot => MarkingCategories.Foots, // SS220 Add foots marking
HumanoidVisualLayers.RFoot => MarkingCategories.Foots, // SS220 Add foots marking
HumanoidVisualLayers.Tail => MarkingCategories.Tail,
_ => MarkingCategories.Overlay
};
Expand Down
24 changes: 20 additions & 4 deletions Content.Shared/RCD/Systems/RCDSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class RCDSystem : EntitySystem
[Dependency] private readonly IPrototypeManager _protoManager = default!;
[Dependency] private readonly SharedMapSystem _mapSystem = default!;
[Dependency] private readonly TagSystem _tags = default!;
[Dependency] private readonly SharedTransformSystem _xform = default!; // SS220 fix rcd rotation

private readonly int _instantConstructionDelay = 0;
private readonly EntProtoId _instantConstructionFx = "EffectRCDConstruct0";
Expand Down Expand Up @@ -515,21 +516,36 @@ private void FinalizeRCDOperation(EntityUid uid, RCDComponent component, MapGrid
break;

case RcdMode.ConstructObject:
var ent = Spawn(component.CachedPrototype.Prototype, _mapSystem.GridTileToLocal(mapGridData.GridUid, mapGridData.Component, mapGridData.Position));
//var ent = Spawn(component.CachedPrototype.Prototype, _mapSystem.GridTileToLocal(mapGridData.GridUid, mapGridData.Component, mapGridData.Position)); // SS220 fix rcd rotation

Angle rotation = 0; // SS220 fix rcd rotation
switch (component.CachedPrototype.Rotation)
{
case RcdRotation.Fixed:
Transform(ent).LocalRotation = Angle.Zero;
// SS220 fix rcd rotation begin
//Transform(ent).LocalRotation = Angle.Zero;
rotation = Angle.Zero;
// SS220 fix rcd rotation end
break;
case RcdRotation.Camera:
Transform(ent).LocalRotation = Transform(uid).LocalRotation;
// SS220 fix rcd rotation begin
//Transform(ent).LocalRotation = Transform(uid).LocalRotation;
rotation = Transform(uid).LocalRotation;
// SS220 fix rcd rotation end
break;
case RcdRotation.User:
Transform(ent).LocalRotation = direction.ToAngle();
// SS220 fix rcd rotation begin
//Transform(ent).LocalRotation = direction.ToAngle();
rotation = direction.ToAngle();
// SS220 fix rcd rotation end
break;
}

// SS220 fix rcd rotation begin
var mapcords = _xform.ToMapCoordinates(_mapSystem.GridTileToLocal(mapGridData.GridUid, mapGridData.Component, mapGridData.Position));
var ent = Spawn(component.CachedPrototype.Prototype, mapcords, rotation: rotation);
// SS220 fix rcd rotation end

_adminLogger.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(user):user} used RCD to spawn {ToPrettyString(ent)} at {mapGridData.Position} on grid {mapGridData.GridUid}");
break;

Expand Down
10 changes: 10 additions & 0 deletions Content.Shared/SS220/Afk/PlayerActivityMessage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
using Robust.Shared.Serialization;

namespace Content.Shared.SS220.Afk;

/// <summary>
/// "Hey, I am not AFK!" type of message.
/// </summary>
[Serializable, NetSerializable]
public sealed class PlayerActivityMessage : EntityEventArgs;
9 changes: 9 additions & 0 deletions Content.Shared/SS220/CCVars/CCVars220.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public sealed class CCVars220
public static readonly CVarDef<float> AfkTeleportToCryo =
CVarDef.Create("afk.teleport_to_cryo", 1800f, CVar.SERVERONLY);

public static readonly CVarDef<float> AfkActivityMessageInterval =
CVarDef.Create("afk.activity_message_interval", 20f, CVar.CLIENTONLY | CVar.CHEAT);

/// <summary>
/// Controls whether the server will deny any players that are not whitelisted in the Prime DB.
/// </summary>
Expand Down Expand Up @@ -109,4 +112,10 @@ public sealed class CCVars220
/// </summary>
public static readonly CVarDef<string> DiscordLinkApiKey =
CVarDef.Create("discord_auth.link_key", "", CVar.SERVERONLY | CVar.CONFIDENTIAL);

/// <summary>
/// How different is the game year from the real one
/// </summary>
public static readonly CVarDef<int> GameYearDelta =
CVarDef.Create("date.game_year_delta", 544, CVar.SERVER | CVar.REPLICATED);
}
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,39 @@ private bool TryGetCorruptionRecipe(EntityUid uid, [NotNullWhen(true)] out CultY
var parents = MetaData(uid).EntityPrototype?.Parents;
if (parents == null)
return null;

foreach (var parentId in parents)
{
if (_recipiesByParentPrototypeId.TryGetValue(parentId, out var recipe))
return recipe;

var parentRecipe = GetRecipeByParentPrototypeId(parentId);
if (parentRecipe != null)
return parentRecipe;
}
return null;
}

/// <summary>
/// Overload to see parents
/// </summary>
private CultYoggCorruptedPrototype? GetRecipeByParentPrototypeId(string id)
{
if (!_prototypeManager.TryIndex<EntityPrototype>(id, out var entProto))
return null;

var parents = entProto.Parents;
if (parents == null)
return null;

foreach (var parentId in parents)
{
if (_recipiesByParentPrototypeId.TryGetValue(parentId, out var recipe))
return recipe;

var parentRecipe = GetRecipeByParentPrototypeId(parentId);
if (parentRecipe != null)
return parentRecipe;
}
return null;
}
Expand Down
3 changes: 3 additions & 0 deletions Content.Shared/SS220/CultYogg/MiGo/SharedMiGoSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,10 @@ public virtual void ChangeForm(EntityUid uid, MiGoComponent comp, bool isMateria

//full vision during astral
if (TryComp<EyeComponent>(uid, out var eye))
{
_eye.SetDrawFov(uid, isMaterial, eye);
_eye.SetDrawLight((uid, eye), isMaterial);
}
}


Expand Down
1 change: 1 addition & 0 deletions Content.Shared/SS220/CultYogg/Pod/CultYoggPodComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Content.Shared.Damage;
using Content.Shared.Whitelist;
using Robust.Shared.GameStates;
using Content.Shared.SS220.CultYogg.MiGo;

namespace Content.Shared.SS220.CultYogg.Pod;

Expand Down
15 changes: 15 additions & 0 deletions Content.Shared/SS220/Paper/PaperAutoFormDatasetPrototype.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
using Robust.Shared.Prototypes;

namespace Content.Shared.SS220.Paper;

[Prototype("paperAutoFormDataset")]
public sealed partial class PaperAutoFormDatasetPrototype : IPrototype
{
[ViewVariables]
[IdDataField]
public string ID { get; private set; } = default!;

[DataField]
public Dictionary<string, ReplacedData> KeyWordsReplace = [];
}
Loading

0 comments on commit dfa8f5d

Please sign in to comment.