Skip to content

Commit

Permalink
Merge pull request space-wizards#1381 from space-syndicate/upstream-sync
Browse files Browse the repository at this point in the history
Upstream sync
  • Loading branch information
Morb0 authored Aug 31, 2023
2 parents 8585afd + 5b402fc commit 163e474
Show file tree
Hide file tree
Showing 243 changed files with 5,097 additions and 2,172 deletions.
1 change: 0 additions & 1 deletion Content.Client/Disposal/DisposalUnitComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Content.Client.Disposal;

[RegisterComponent]
[ComponentReference(typeof(SharedDisposalUnitComponent))]
public sealed partial class DisposalUnitComponent : SharedDisposalUnitComponent
{

Expand Down
5 changes: 5 additions & 0 deletions Content.Client/Disposal/Systems/DisposalUnitSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ private void OnHandleState(EntityUid uid, DisposalUnitComponent component, ref C
component.RecentlyEjected.AddRange(state.RecentlyEjected);
}

public override bool HasDisposals(EntityUid? uid)
{
return HasComp<DisposalUnitComponent>(uid);
}

public override void DoInsertDisposalUnit(EntityUid uid, EntityUid toInsert, EntityUid user, SharedDisposalUnitComponent? disposal = null)
{
return;
Expand Down
10 changes: 0 additions & 10 deletions Content.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,18 @@
using Content.Client.Stylesheets;
using Content.Client.Viewport;
using Content.Client.Voting;
using Content.Shared.Administration;
using Content.Shared.Ame;
using Content.Shared.Gravity;
using Content.Shared.Localizations;
using Robust.Client;
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.Replays.Loading;
using Robust.Client.Replays.Playback;
using Robust.Client.State;
using Robust.Client.UserInterface;
using Robust.Shared;
using Robust.Shared.Configuration;
using Robust.Shared.ContentPack;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Replays;

Expand Down Expand Up @@ -106,11 +103,8 @@ public override void Init()
_prototypeManager.RegisterIgnore("utilityQuery");
_prototypeManager.RegisterIgnore("utilityCurvePreset");
_prototypeManager.RegisterIgnore("accent");
_prototypeManager.RegisterIgnore("material");
_prototypeManager.RegisterIgnore("reaction"); //Chemical reactions only needed by server. Reactions checks are server-side.
_prototypeManager.RegisterIgnore("gasReaction");
_prototypeManager.RegisterIgnore("seed"); // Seeds prototypes are server-only.
_prototypeManager.RegisterIgnore("barSign");
_prototypeManager.RegisterIgnore("objective");
_prototypeManager.RegisterIgnore("holiday");
_prototypeManager.RegisterIgnore("aiFaction");
Expand All @@ -121,10 +115,7 @@ public override void Init()
_prototypeManager.RegisterIgnore("npcFaction");
_prototypeManager.RegisterIgnore("lobbyBackground");
_prototypeManager.RegisterIgnore("advertisementsPack");
_prototypeManager.RegisterIgnore("metabolizerType");
_prototypeManager.RegisterIgnore("metabolismGroup");
_prototypeManager.RegisterIgnore("salvageMap");
_prototypeManager.RegisterIgnore("salvageFaction");
_prototypeManager.RegisterIgnore("gamePreset");
_prototypeManager.RegisterIgnore("noiseChannel");
_prototypeManager.RegisterIgnore("spaceBiome");
Expand All @@ -139,7 +130,6 @@ public override void Init()
_prototypeManager.RegisterIgnore("nukeopsRole");
_prototypeManager.RegisterIgnore("stationGoal"); // Corvax-StationGoal
_prototypeManager.RegisterIgnore("loadout"); // Corvax-Loadout
_prototypeManager.RegisterIgnore("flavor");

_componentFactory.GenerateNetIds();
_adminManager.Initialize();
Expand Down
10 changes: 0 additions & 10 deletions Content.Client/Foldable/FoldableSystem.cs

This file was deleted.

7 changes: 7 additions & 0 deletions Content.Client/Mind/MindSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Content.Shared.Mind;

namespace Content.Client.Mind;

public sealed class MindSystem : SharedMindSystem
{
}
12 changes: 12 additions & 0 deletions Content.Client/Players/PlayerSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Content.Shared.Players;
using Robust.Shared.Players;

namespace Content.Client.Players;

public sealed class PlayerSystem : SharedPlayerSystem
{
public override PlayerData? ContentData(ICommonSession? session)
{
return null;
}
}
58 changes: 58 additions & 0 deletions Content.Client/Points/PointSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using Content.Client.CharacterInfo;
using Content.Client.Message;
using Content.Shared.Points;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameStates;

namespace Content.Client.Points;

/// <inheritdoc/>
public sealed class PointSystem : SharedPointSystem
{
[Dependency] private readonly CharacterInfoSystem _characterInfo = default!;

/// <inheritdoc/>
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<PointManagerComponent, ComponentHandleState>(OnHandleState);
SubscribeLocalEvent<CharacterInfoSystem.GetCharacterInfoControlsEvent>(OnGetCharacterInfoControls);
}

private void OnHandleState(EntityUid uid, PointManagerComponent component, ref ComponentHandleState args)
{
if (args.Current is not PointManagerComponentState state)
return;

component.Points = new(state.Points);
component.Scoreboard = state.Scoreboard;
_characterInfo.RequestCharacterInfo();
}

private void OnGetCharacterInfoControls(ref CharacterInfoSystem.GetCharacterInfoControlsEvent ev)
{
foreach (var point in EntityQuery<PointManagerComponent>())
{
var box = new BoxContainer
{
Margin = new Thickness(5),
Orientation = BoxContainer.LayoutOrientation.Vertical
};

var title = new RichTextLabel
{
HorizontalAlignment = Control.HAlignment.Center
};
title.SetMarkup(Loc.GetString("point-scoreboard-header"));

var text = new RichTextLabel();
text.SetMessage(point.Scoreboard);

box.AddChild(title);
box.AddChild(text);
ev.Controls.Add(box);
}
}
}
7 changes: 7 additions & 0 deletions Content.Client/Roles/Jobs/JobSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Content.Shared.Roles.Jobs;

namespace Content.Client.Roles.Jobs;

public sealed class JobSystem : SharedJobSystem
{
}
5 changes: 5 additions & 0 deletions Content.Client/Roles/RoleSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace Content.Client.Roles;

public sealed class RoleSystem : EntitySystem
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Content.Client.Storage.Components;

[RegisterComponent, ComponentReference(typeof(SharedEntityStorageComponent))]
[RegisterComponent]
public sealed partial class EntityStorageComponent : SharedEntityStorageComponent
{

Expand Down
34 changes: 33 additions & 1 deletion Content.Client/Storage/Systems/EntityStorageSystem.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,40 @@
using Content.Shared.Storage.EntitySystems;
using System.Diagnostics.CodeAnalysis;
using Content.Client.Storage.Components;
using Content.Shared.Destructible;
using Content.Shared.Interaction;
using Content.Shared.Lock;
using Content.Shared.Movement.Events;
using Content.Shared.Storage.Components;
using Content.Shared.Storage.EntitySystems;
using Content.Shared.Verbs;
using Robust.Shared.GameStates;

namespace Content.Client.Storage.Systems;

public sealed class EntityStorageSystem : SharedEntityStorageSystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<EntityStorageComponent, ComponentInit>(OnComponentInit);
SubscribeLocalEvent<EntityStorageComponent, ComponentStartup>(OnComponentStartup);
SubscribeLocalEvent<EntityStorageComponent, ActivateInWorldEvent>(OnInteract, after: new[] { typeof(LockSystem) });
SubscribeLocalEvent<EntityStorageComponent, LockToggleAttemptEvent>(OnLockToggleAttempt);
SubscribeLocalEvent<EntityStorageComponent, DestructionEventArgs>(OnDestruction);
SubscribeLocalEvent<EntityStorageComponent, GetVerbsEvent<InteractionVerb>>(AddToggleOpenVerb);
SubscribeLocalEvent<EntityStorageComponent, ContainerRelayMovementEntityEvent>(OnRelayMovement);

SubscribeLocalEvent<EntityStorageComponent, ComponentGetState>(OnGetState);
SubscribeLocalEvent<EntityStorageComponent, ComponentHandleState>(OnHandleState);
}

public override bool ResolveStorage(EntityUid uid, [NotNullWhen(true)] ref SharedEntityStorageComponent? component)
{
if (component != null)
return true;

TryComp<EntityStorageComponent>(uid, out var storage);
component = storage;
return component != null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ private void CharacterUpdated(CharacterData data)
_window.NameLabel.Text = entityName;
_window.SubText.Text = job;
_window.Objectives.RemoveAllChildren();
_window.ObjectivesLabel.Visible = objectives.Any();

foreach (var (groupId, conditions) in objectives)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Label Name="SubText" VerticalAlignment="Top" StyleClasses="LabelSubText" Access="Public"/>
</BoxContainer>
</BoxContainer>
<Label Text="{Loc 'character-info-objectives-label'}" HorizontalAlignment="Center"/>
<Label Name="ObjectivesLabel" Access="Public" Text="{Loc 'character-info-objectives-label'}" HorizontalAlignment="Center"/>
<BoxContainer Orientation="Vertical" Name="Objectives" Access="Public"/>
<cc:Placeholder Name="RolePlaceholder" Access="Public" PlaceholderText="{Loc 'character-info-roles-antagonist-text'}"/>
</BoxContainer>
Expand Down
4 changes: 2 additions & 2 deletions Content.IntegrationTests/Pair/TestPair.Recycle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using System.IO;
using System.Linq;
using Content.Server.GameTicking;
using Content.Server.Mind;
using Content.Server.Mind.Components;
using Content.Shared.CCVar;
using Content.Shared.GameTicking;
using Content.Shared.Mind;
using Content.Shared.Mind.Components;
using Robust.Client;
using Robust.Server.Player;
using Robust.Shared.Exceptions;
Expand Down
9 changes: 0 additions & 9 deletions Content.IntegrationTests/PoolManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,13 @@
using Content.IntegrationTests.Tests.Destructible;
using Content.IntegrationTests.Tests.DeviceNetwork;
using Content.IntegrationTests.Tests.Interaction.Click;
using Content.Server.GameTicking;
using Content.Server.Mind.Components;
using Content.Shared.CCVar;
using Content.Shared.GameTicking;
using Robust.Client;
using Robust.Client.State;
using Robust.Server;
using Robust.Server.Player;
using Robust.Shared;
using Robust.Shared.Configuration;
using Robust.Shared.ContentPack;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Network;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Robust.UnitTesting;
Expand Down
4 changes: 2 additions & 2 deletions Content.IntegrationTests/Tests/Interaction/InteractionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Content.Client.Examine;
using Content.IntegrationTests.Pair;
using Content.Server.Body.Systems;
using Content.Server.Mind;
using Content.Server.Players;
using Content.Server.Stack;
using Content.Server.Tools;
Expand All @@ -14,6 +13,7 @@
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.Mind;
using Robust.Client.Input;
using Robust.Client.UserInterface;
using Robust.Server.GameObjects;
Expand Down Expand Up @@ -192,7 +192,7 @@ await Server.WaitPost(() =>
{
// Fuck you mind system I want an hour of my life back
// Mind system is a time vampire
SEntMan.System<MindSystem>().WipeMind(ServerSession.ContentData()?.Mind);
SEntMan.System<SharedMindSystem>().WipeMind(ServerSession.ContentData()?.Mind);

old = cPlayerMan.LocalPlayer.ControlledEntity;
Player = SEntMan.SpawnEntity(PlayerPrototype, PlayerCoords);
Expand Down
4 changes: 2 additions & 2 deletions Content.IntegrationTests/Tests/Minds/GhostRoleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using System.Linq;
using Content.Server.Ghost.Roles;
using Content.Server.Ghost.Roles.Components;
using Content.Server.Mind;
using Content.Server.Players;
using Content.Shared.Ghost;
using Content.Shared.Mind;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
Expand Down Expand Up @@ -42,7 +42,7 @@ public async Task TakeRoleAndReturn()
var entMan = server.ResolveDependency<IEntityManager>();
var sPlayerMan = server.ResolveDependency<Robust.Server.Player.IPlayerManager>();
var conHost = client.ResolveDependency<IConsoleHost>();
var mindSystem = entMan.System<MindSystem>();
var mindSystem = entMan.System<SharedMindSystem>();
var session = sPlayerMan.ServerSessions.Single();
var originalMindId = session.ContentData()!.Mind!.Value;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Linq;
using Content.Server.Mind;
using Content.Server.Players;
using Content.Shared.Ghost;
using Content.Shared.Mind;
using Robust.Server.Console;
using Robust.Server.GameObjects;
using Robust.Server.Player;
Expand All @@ -27,7 +27,7 @@ public async Task TestDeleteVisiting()
var entMan = server.ResolveDependency<IServerEntityManager>();
var playerMan = server.ResolveDependency<IPlayerManager>();

var mindSystem = entMan.EntitySysManager.GetEntitySystem<MindSystem>();
var mindSystem = entMan.EntitySysManager.GetEntitySystem<SharedMindSystem>();

EntityUid playerEnt = default;
EntityUid visitEnt = default;
Expand Down Expand Up @@ -83,7 +83,7 @@ public async Task TestGhostOnDeleteMap()
var playerMan = server.ResolveDependency<IPlayerManager>();
var player = playerMan.ServerSessions.Single();

var mindSystem = entMan.EntitySysManager.GetEntitySystem<MindSystem>();
var mindSystem = entMan.EntitySysManager.GetEntitySystem<SharedMindSystem>();

EntityUid playerEnt = default;
EntityUid mindId = default!;
Expand Down Expand Up @@ -159,7 +159,7 @@ public async Task TestOriginalDeletedWhileGhostingKeepsGhost()

var entMan = server.ResolveDependency<IServerEntityManager>();
var playerMan = server.ResolveDependency<IPlayerManager>();
var mindSystem = entMan.EntitySysManager.GetEntitySystem<MindSystem>();
var mindSystem = entMan.EntitySysManager.GetEntitySystem<SharedMindSystem>();
var mind = GetMind(pair);

var player = playerMan.ServerSessions.Single();
Expand Down
6 changes: 3 additions & 3 deletions Content.IntegrationTests/Tests/Minds/MindTests.Helpers.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Linq;
using Content.IntegrationTests.Pair;
using Content.Server.Mind;
using Content.Server.Players;
using Content.Shared.Ghost;
using Content.Shared.Mind;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Enums;
Expand Down Expand Up @@ -34,7 +34,7 @@ public sealed partial class MindTests

var entMan = pair.Server.ResolveDependency<IServerEntityManager>();
var playerMan = pair.Server.ResolveDependency<IPlayerManager>();
var mindSys = entMan.System<MindSystem>();
var mindSys = entMan.System<SharedMindSystem>();

var player = playerMan.ServerSessions.Single();

Expand Down Expand Up @@ -66,7 +66,7 @@ private static async Task<EntityUid> BecomeGhost(TestPair pair, bool visit = fal
{
var entMan = pair.Server.ResolveDependency<IServerEntityManager>();
var playerMan = pair.Server.ResolveDependency<IPlayerManager>();
var mindSys = entMan.System<MindSystem>();
var mindSys = entMan.System<SharedMindSystem>();
EntityUid ghostUid = default;
EntityUid mindId = default!;
MindComponent mind = default!;
Expand Down
Loading

0 comments on commit 163e474

Please sign in to comment.