Skip to content

Commit

Permalink
Merge branch 'fully-translate' of https://github.com/Rinary1/space-su…
Browse files Browse the repository at this point in the history
…nrise; branch 'master' of https://github.com/space-sunrise/space-station-14 into fully-translate

# Conflicts:
#	Content.Server/CharacterInfo/CharacterInfoSystem.cs
  • Loading branch information
Rinary1 committed Jul 27, 2024
2 parents a7a6821 + 5f38b52 commit a841c2a
Show file tree
Hide file tree
Showing 270 changed files with 8,443 additions and 84,171 deletions.
1 change: 1 addition & 0 deletions Content.Client/Actions/ActionsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ private void OnEntityTargetHandleState(EntityUid uid, EntityTargetActionComponen

component.Whitelist = state.Whitelist;
component.CanTargetSelf = state.CanTargetSelf;
component.IgnoreContainer = state.IgnoreContainer; // Sunrise-Edit
BaseHandleState<EntityTargetActionComponent>(uid, component, state);
}

Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Arcade/BlockGameMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ private Control SetupGameGrid(Texture panelTex)
{
PanelOverride = back,
HorizontalExpand = true,
SizeFlagsStretchRatio = 60
SizeFlagsStretchRatio = 34.25f
};
var backgroundPanel = new PanelContainer
{
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Arcade/UI/BlockGameBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ protected override void Open()
base.Open();

_menu = this.CreateWindow<BlockGameMenu>();
_menu.OnAction += SendAction;
}

protected override void ReceiveMessage(BoundUserInterfaceMessage message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ protected override void Open()
base.Open();

_menu = this.CreateWindow<SpaceVillainArcadeMenu>();
_menu.OnPlayerAction += SendAction;
}

protected override void ReceiveMessage(BoundUserInterfaceMessage message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,12 @@ private bool TryFindFallbackSpawn(out EntityCoordinates coords)
{
var size = grid.LocalAABB.Size.LengthSquared();

if (maxSize is not null && size < maxSize)
continue;

var station = HasComp<StationMemberComponent>(uid);

//We want the first station grid to overwrite any previous non-station grids no matter the size, in case the vgroid was found first
if (maxSize is not null && size < maxSize && !(!stationFound && station))
continue;

if (!station && stationFound)
continue;

Expand All @@ -183,7 +184,6 @@ private bool TryFindFallbackSpawn(out EntityCoordinates coords)

if (station)
stationFound = true;

}

coords = new EntityCoordinates(maxUid ?? default, default);
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/RoundEnd/RoundEndSummaryWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public sealed class RoundEndSummaryWindow : DefaultWindow
public int RoundId;

public RoundEndSummaryWindow(string gm, string roundEnd, TimeSpan roundTimeSpan, int roundId,
RoundEndMessageEvent.RoundEndPlayerInfo[] info, string roundEndStats, StatisticEntry[] statisticEntries, IEntityManager entityManager, ISharedPlayerManager playerManager) // Sunrise-Edit
RoundEndMessageEvent.RoundEndPlayerInfo[] info, string roundEndStats, SharedStatisticEntry[] statisticEntries, IEntityManager entityManager, ISharedPlayerManager playerManager) // Sunrise-Edit
{
_entityManager = entityManager;
_playerManager = playerManager; // Sunrise-Edit
Expand Down Expand Up @@ -207,7 +207,7 @@ private BoxContainer MakeRoundEndStatsTab(string stats)
return roundEndSummaryTab;
}

private BoxContainer MakeRoundEndMyStatsTab(StatisticEntry[] statisticEntries)
private BoxContainer MakeRoundEndMyStatsTab(SharedStatisticEntry[] statisticEntries)
{
var roundEndSummaryTab = new BoxContainer
{
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Silicons/Laws/Ui/SiliconLawMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
Title="{Loc 'laws-ui-menu-title'}"
MinSize="200 100"
SetSize="450 515">
MinSize="700 500"
SetSize="700 500"> <!-- Sunrise-Edit -->
<BoxContainer Orientation="Vertical"
HorizontalExpand="True"
VerticalExpand="True">
Expand Down
5 changes: 5 additions & 0 deletions Content.IntegrationTests/Tests/Damageable/DamageableTest.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System.Linq;
using Content.Shared._Sunrise.SunriseCCVars;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
using Content.Shared.FixedPoint;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;

namespace Content.IntegrationTests.Tests.Damageable
Expand Down Expand Up @@ -89,6 +91,7 @@ public async Task TestDamageableComponents()
var sMapManager = server.ResolveDependency<IMapManager>();
var sPrototypeManager = server.ResolveDependency<IPrototypeManager>();
var sEntitySystemManager = server.ResolveDependency<IEntitySystemManager>();
var sConfigManager = server.ResolveDependency<IConfigurationManager>();

EntityUid sDamageableEntity = default;
DamageableComponent sDamageableComponent = null;
Expand Down Expand Up @@ -127,6 +130,8 @@ await server.WaitPost(() =>
type3a = sPrototypeManager.Index<DamageTypePrototype>("TestDamage3a");
type3b = sPrototypeManager.Index<DamageTypePrototype>("TestDamage3b");
type3c = sPrototypeManager.Index<DamageTypePrototype>("TestDamage3c");

sConfigManager.SetCVar(SunriseCCVars.DamageVariance, 0f); // Sunrise-Edit
});

await server.WaitRunTicks(5);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using Content.Server.Destructible.Thresholds.Triggers;
using Content.Shared._Sunrise.SunriseCCVars;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
using Content.Shared.FixedPoint;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Configuration;
using static Content.IntegrationTests.Tests.Destructible.DestructibleTestPrototypes;

namespace Content.IntegrationTests.Tests.Destructible
Expand All @@ -26,6 +28,7 @@ public async Task AndTest()
var sEntityManager = server.ResolveDependency<IEntityManager>();
var sPrototypeManager = server.ResolveDependency<IPrototypeManager>();
var sEntitySystemManager = server.ResolveDependency<IEntitySystemManager>();
var sConfigManager = server.ResolveDependency<IConfigurationManager>(); // Sunrise-Edit

EntityUid sDestructibleEntity = default;
DamageableComponent sDamageableComponent = null;
Expand All @@ -43,6 +46,7 @@ await server.WaitPost(() =>
sTestThresholdListenerSystem.ThresholdsReached.Clear();

sDamageableSystem = sEntitySystemManager.GetEntitySystem<DamageableSystem>();
sConfigManager.SetCVar(SunriseCCVars.DamageVariance, 0f); // Sunrise-Edit
});

await server.WaitRunTicks(5);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using Content.Server.Destructible.Thresholds.Triggers;
using Content.Shared._Sunrise.SunriseCCVars;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Configuration;
using static Content.IntegrationTests.Tests.Destructible.DestructibleTestPrototypes;

namespace Content.IntegrationTests.Tests.Destructible
Expand All @@ -23,6 +25,7 @@ public async Task Test()
var sEntityManager = server.ResolveDependency<IEntityManager>();
var sEntitySystemManager = server.ResolveDependency<IEntitySystemManager>();
var protoManager = server.ResolveDependency<IPrototypeManager>();
var sConfigManager = server.ResolveDependency<IConfigurationManager>(); // Sunrise-Edit

EntityUid sDestructibleEntity = default;
DamageableComponent sDamageableComponent = null;
Expand All @@ -38,6 +41,7 @@ await server.WaitPost(() =>
sTestThresholdListenerSystem = sEntitySystemManager.GetEntitySystem<TestDestructibleListenerSystem>();
sTestThresholdListenerSystem.ThresholdsReached.Clear();
sDamageableSystem = sEntitySystemManager.GetEntitySystem<DamageableSystem>();
sConfigManager.SetCVar(SunriseCCVars.DamageVariance, 0f); // Sunrise-Edit
});

await server.WaitRunTicks(5);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override async void Execute(IConsoleShell shell, string argStr, string[]
var isWhitelisted = await _db.IsJobWhitelisted(guid, job);
if (isWhitelisted)
{
shell.WriteLine(Loc.GetString("cmd-jobwhitelist-already-whitelisted",
shell.WriteLine(Loc.GetString("cmd-jobwhitelistadd-already-whitelisted",
("player", player),
("jobId", job.Id),
("jobName", jobPrototype.LocalizedName)));
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Arcade/BlockGame/BlockGame.Ui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private void InputTick(float frameTime)
/// <param name="message">The message to broadcase to all players/spectators.</param>
private void SendMessage(BoundUserInterfaceMessage message)
{
_uiSystem.ServerSendUiMessage(_entityManager.GetEntity(message.Entity), BlockGameUiKey.Key, message);
_uiSystem.ServerSendUiMessage(_owner, BlockGameUiKey.Key, message);
}

/// <summary>
Expand All @@ -167,7 +167,7 @@ private void SendMessage(BoundUserInterfaceMessage message)
/// <param name="actor">The target recipient.</param>
private void SendMessage(BoundUserInterfaceMessage message, EntityUid actor)
{
_uiSystem.ServerSendUiMessage(_entityManager.GetEntity(message.Entity), BlockGameUiKey.Key, message, actor);
_uiSystem.ServerSendUiMessage(_owner, BlockGameUiKey.Key, message, actor);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/CharacterInfo/CharacterInfoSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private void OnRequestCharacterInfoEvent(RequestCharacterInfoEvent msg, EntitySe
var entity = args.SenderSession.AttachedEntity.Value;

var objectives = new Dictionary<string, List<ObjectiveInfo>>();
var jobTitle = Loc.GetString("characterinfo-job-title");
var jobTitle = Loc.GetString("character-info-no-profession");
string? briefing = null;
if (_minds.TryGetMind(entity, out var mindId, out var mind))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Content.Server.Chemistry.EntitySystems;
using Content.Server.Sunrise.SolutionRegenerationSwitcher;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;

namespace Content.Server.Chemistry.Components;
Expand All @@ -8,7 +10,7 @@ namespace Content.Server.Chemistry.Components;
/// Passively increases a solution's quantity of a reagent.
/// </summary>
[RegisterComponent, AutoGenerateComponentPause]
[Access(typeof(SolutionRegenerationSystem))]
[Access(typeof(SolutionRegenerationSystem), typeof(SolutionRegenerationSwitcherSystem))] // Sunrise-Edit
public sealed partial class SolutionRegenerationComponent : Component
{
/// <summary>
Expand Down Expand Up @@ -41,4 +43,12 @@ public sealed partial class SolutionRegenerationComponent : Component
[DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan NextRegenTime = TimeSpan.FromSeconds(0);

// Sunrise-start
public void ChangeGenerated(ReagentQuantity reagent)
{
Generated.RemoveAllSolution();
Generated.AddReagent(reagent);
}
// Sunrise-end
}
41 changes: 41 additions & 0 deletions Content.Server/CrewManifest/CrewManifestSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
using Content.Server.Station.Systems;
using Content.Server.StationRecords;
using Content.Server.StationRecords.Systems;
using Content.Shared.Actions;
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Content.Shared.CrewManifest;
using Content.Shared.GameTicking;
using Content.Shared.Roles;
using Content.Shared.Silicons.Borgs.Components;
using Content.Shared.StationRecords;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
Expand All @@ -26,6 +28,7 @@ public sealed class CrewManifestSystem : EntitySystem
[Dependency] private readonly EuiManager _euiManager = default!;
[Dependency] private readonly IConfigurationManager _configManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;

/// <summary>
/// Cached crew manifest entries. The alternative is to outright
Expand All @@ -46,8 +49,46 @@ public override void Initialize()

SubscribeLocalEvent<CrewManifestViewerComponent, BoundUIClosedEvent>(OnBoundUiClose);
SubscribeLocalEvent<CrewManifestViewerComponent, CrewManifestOpenUiMessage>(OpenEuiFromBui);
SubscribeLocalEvent<BorgCrewManifestViewerComponent, MapInitEvent>(BorgCrewManifestViewerMapInit);
SubscribeLocalEvent<BorgCrewManifestViewerComponent, CrewManifestOpenActionEvent>(OpenCrewManifest);
}

// Sunrise-Start
private void BorgCrewManifestViewerMapInit(EntityUid uid, BorgCrewManifestViewerComponent component, MapInitEvent args)
{
_actions.AddAction(uid, component.ActionViewCrewManifest);
}

private void OpenCrewManifest(EntityUid uid, BorgCrewManifestViewerComponent component, CrewManifestOpenActionEvent args)
{
if (args.Handled)
return;

var owningStation = _stationSystem.GetOwningStation(uid);
if (owningStation == null || !TryComp<ActorComponent>(args.Performer, out var actor))
{
return;
}

if (!_openEuis.TryGetValue(owningStation.Value, out var euis))
{
euis = new();
_openEuis.Add(owningStation.Value, euis);
}

if (euis.ContainsKey(actor.PlayerSession))
{
CloseEui(owningStation.Value, actor.PlayerSession, uid);
}
else
{
OpenEui(owningStation.Value, actor.PlayerSession, uid);
}

args.Handled = true;
}
// Sunrise-End

private void OnRoundRestart(RoundRestartCleanupEvent ev)
{
foreach (var (_, euis) in _openEuis)
Expand Down
4 changes: 3 additions & 1 deletion Content.Server/GameTicking/GameTicker.RoundFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Robust.Shared.Random;
using Robust.Shared.Utility;
using Content.Server.StatsBoard;
using Content.Shared._Sunrise.StatsBoard;

namespace Content.Server.GameTicking
{
Expand Down Expand Up @@ -433,6 +434,7 @@ public void ShowRoundEndScoreboard(string text = "")
// Sunrise-Start
var roundStats = _statsBoardSystem.GetRoundStats();
var statisticEntries = _statsBoardSystem.GetStatisticEntries();
var sharedEntries = statisticEntries.Select(entry => _statsBoardSystem.ConvertToSharedStatisticEntry(entry)).ToArray();
// Sunrise-End

var roundEndMessageEvent = new RoundEndMessageEvent(
Expand All @@ -443,7 +445,7 @@ public void ShowRoundEndScoreboard(string text = "")
listOfPlayerInfoFinal.Length,
listOfPlayerInfoFinal,
roundStats, // Sunrise-Edit
statisticEntries, // Sunrise-Edit
sharedEntries, // Sunrise-Edit
sound
);
RaiseNetworkEvent(roundEndMessageEvent);
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Medical/HealthAnalyzerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ damageableComponent.DamageContainerID is not null &&

_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, uid.Comp.ScanDelay, new HealthAnalyzerDoAfterEvent(), uid, target: args.Target, used: uid)
{
NeedHand = true,
NeedHand = args.NeedHand, // Sunrise-Edit
BreakOnMove = true
});

Expand Down
21 changes: 21 additions & 0 deletions Content.Server/Shuttles/Systems/ShuttleSystem.IFF.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Server.Shuttles.Components;
using Content.Shared.CCVar;
using Content.Shared.Shuttles.BUIStates;
using Content.Shared.Shuttles.Components;
using Content.Shared.Shuttles.Events;
Expand All @@ -12,6 +13,26 @@ private void InitializeIFF()
SubscribeLocalEvent<IFFConsoleComponent, AnchorStateChangedEvent>(OnIFFConsoleAnchor);
SubscribeLocalEvent<IFFConsoleComponent, IFFShowIFFMessage>(OnIFFShow);
SubscribeLocalEvent<IFFConsoleComponent, IFFShowVesselMessage>(OnIFFShowVessel);
SubscribeLocalEvent<GridSplitEvent>(OnGridSplit);
}

private void OnGridSplit(ref GridSplitEvent ev)
{
var splitMass = _cfg.GetCVar(CCVars.HideSplitGridsUnder);

if (splitMass < 0)
return;

foreach (var grid in ev.NewGrids)
{
if (!_physicsQuery.TryGetComponent(grid, out var physics) ||
physics.Mass > splitMass)
{
continue;
}

AddIFFFlag(grid, IFFFlags.HideLabel);
}
}

private void OnIFFShow(EntityUid uid, IFFConsoleComponent component, IFFShowIFFMessage args)
Expand Down
10 changes: 8 additions & 2 deletions Content.Server/StationRecords/Systems/StationRecordsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,19 @@ private void CreateGeneralRecord(EntityUid station, EntityUid player, HumanoidCh
|| !_prototypeManager.HasIndex<JobPrototype>(jobId))
return;

// Sunrise-Start
var name = profile.Name;
if (!_inventory.TryGetSlotEntity(player, "id", out var idUid))
return;
{
idUid = null;
name = MetaData(player).EntityName;
}
// Sunrise-End

TryComp<FingerprintComponent>(player, out var fingerprintComponent);
TryComp<DnaComponent>(player, out var dnaComponent);

CreateGeneralRecord(station, idUid.Value, profile.Name, profile.Age, profile.Species, profile.Gender, jobId, fingerprintComponent?.Fingerprint, dnaComponent?.DNA, profile, records);
CreateGeneralRecord(station, idUid, name, profile.Age, profile.Species, profile.Gender, jobId, fingerprintComponent?.Fingerprint, dnaComponent?.DNA, profile, records);
}


Expand Down
Loading

0 comments on commit a841c2a

Please sign in to comment.