Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream merge 59.5 #1524

Merged
merged 46 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
21d0326
Meta Robotics Console (#30652)
JustCone14 Aug 4, 2024
f1b8dcb
Cluster Christmas Removal (#30635)
JustCone14 Aug 4, 2024
17cecec
Update Core (#30633)
UbaserB Aug 4, 2024
548f9e3
Box Atmos Miners Grille Removal (#30610)
JustCone14 Aug 4, 2024
c237ef2
Fland Atmos Gas Miners Grille Removal (#30615)
JustCone14 Aug 4, 2024
8e43bb1
fml to chatsan (#30651)
OrangeMoronage9622 Aug 4, 2024
b306130
tweak(grammar): Correct multiple instances of incorrect "it's" usage…
Brandon-Huu Aug 4, 2024
c04f717
tweak(grammar): Correct multiple instances of incorrect "its" usage (…
Brandon-Huu Aug 4, 2024
d87d9c4
Fix GhostRoleRadio icons (#30650)
Plykiya Aug 5, 2024
84a9253
Fix falsely showing damage color effect to entities that aren't allow…
DrSmugleaf Aug 5, 2024
490de1d
Explosion resistance is now predicted! (#30654)
beck-thompson Aug 5, 2024
118ea97
Automatic changelog update
PJBot Aug 5, 2024
82d7636
Fix some descriptions (#30644)
lzk228 Aug 5, 2024
d0884a3
Improve communications console countdown formatting (#30495)
slarticodefast Aug 5, 2024
c5b887f
Gets rid of all leftover usages of IEyeManager.CurrentMap (#30022)
Plykiya Aug 5, 2024
6503cb7
Sleeper agents event no longer occurs when evacuation is called (#30646)
Killerqu00 Aug 5, 2024
7e285ee
Automatic changelog update
PJBot Aug 5, 2024
a79cbf3
Give Mice Combat Mode and a 0 Damage Attack (#30487)
Cojoke-dot Aug 5, 2024
68dbf64
Automatic changelog update
PJBot Aug 5, 2024
0ef5f66
Fix warnings in ShuttleSystem.GridFill.cs (#30253)
Simyon264 Aug 5, 2024
01e1624
Move PaperSystem to Shared (#30592)
Plykiya Aug 5, 2024
a95d225
JobRequirement refactor (#30347)
TheShuEd Aug 5, 2024
71a8fd5
Automatic changelog update
PJBot Aug 5, 2024
6264a55
Restore the longer traitor briefing message (#30404)
Errant-4 Aug 5, 2024
9a8620d
De-duplicate loadout gear (#30341)
metalgearsloth Aug 5, 2024
a3cbbe7
Change the mimebot and killer tomato's descriptions (#30639)
voidnull000 Aug 5, 2024
c9b69ef
Update submodule to 229.1.0 (#30664)
metalgearsloth Aug 5, 2024
e2ca1a1
add(Spawners): Add a honk bot spawner (#30616)
Brandon-Huu Aug 5, 2024
1629e20
Missing mime mask sprites for Vox (#30607)
foboscheshir Aug 5, 2024
bc3d53e
Automatic changelog update
PJBot Aug 5, 2024
8771cc0
Debug command to set either your hunger or thirst to one of their res…
Mervill Aug 5, 2024
52e03d2
Automatic changelog update
PJBot Aug 5, 2024
8197382
Fix random unused field warnings (#29948)
metalgearsloth Aug 5, 2024
bf06d0e
Change Thief Syndie & Chameleon kit contents, add Syndie codeword pap…
SlamBamActionman Aug 5, 2024
50408da
Automatic changelog update
PJBot Aug 5, 2024
b3a64d4
Add slowdown to low temperatures (#29692)
EmoGarbage404 Aug 5, 2024
d45810b
Automatic changelog update
PJBot Aug 5, 2024
c1eb319
Refactor the `hungry` debug command to be in line with `thirsty` (#30…
Mervill Aug 5, 2024
f7d8b4e
Fix verb sub (#30667)
metalgearsloth Aug 5, 2024
87276d5
Merge remote-tracking branch 'off/master' into upstream-merge-59-2
DexlerXD Aug 5, 2024
fa6915f
post-merge fixes
DexlerXD Aug 5, 2024
1d55c5f
ahhhhh, I need a loadout baaag
DexlerXD Aug 5, 2024
8a00872
fix criminal records console ui
DexlerXD Aug 5, 2024
59406a7
give hidden departments names
DexlerXD Aug 5, 2024
6ca638a
fix locale
DexlerXD Aug 5, 2024
882bae9
we do a little amount of trolling
DexlerXD Aug 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Content.Client/Administration/AdminNameOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected override void Draw(in OverlayDrawArgs args)
}

// if not on the same map, continue
if (_entityManager.GetComponent<TransformComponent>(entity.Value).MapID != _eyeManager.CurrentMap)
if (_entityManager.GetComponent<TransformComponent>(entity.Value).MapID != args.MapId)
{
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void UpdateCountdown()

EmergencyShuttleButton.Text = Loc.GetString("comms-console-menu-recall-shuttle");
var infoText = Loc.GetString($"comms-console-menu-time-remaining",
("time", diff.TotalSeconds.ToString(CultureInfo.CurrentCulture)));
("time", diff.ToString(@"hh\:mm\:ss", CultureInfo.CurrentCulture)));
CountdownLabel.SetMessage(infoText);
}
}
Expand Down
8 changes: 8 additions & 0 deletions Content.Client/Explosion/ExplosionSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Content.Shared.Explosion.EntitySystems;

namespace Content.Client.Explosion.EntitySystems;

public sealed class ExplosionSystem : SharedExplosionSystem
{

}
2 changes: 1 addition & 1 deletion Content.Client/Ghost/GhostRoleRadioBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected override void Open()
_ghostRoleRadioMenu.SendGhostRoleRadioMessageAction += SendGhostRoleRadioMessage;
}

public void SendGhostRoleRadioMessage(ProtoId<GhostRolePrototype> protoId)
private void SendGhostRoleRadioMessage(ProtoId<GhostRolePrototype> protoId)
{
SendMessage(new GhostRoleRadioMessage(protoId));
}
Expand Down
5 changes: 2 additions & 3 deletions Content.Client/Ghost/GhostRoleRadioMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Content.Client.UserInterface.Controls;
using Content.Shared.Ghost.Roles;
using Content.Shared.Ghost.Roles.Components;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
Expand Down Expand Up @@ -33,7 +32,7 @@ public void SetEntity(EntityUid uid)

private void RefreshUI()
{
// The main control that will contain all of the clickable options
// The main control that will contain all the clickable options
var main = FindControl<RadialContainer>("Main");

// The purpose of this radial UI is for ghost role radios that allow you to select
Expand Down Expand Up @@ -70,7 +69,7 @@ private void RefreshUI()
if (_prototypeManager.TryIndex(ghostRoleProto.IconPrototype, out var iconProto))
entProtoView.SetPrototype(iconProto);
else
entProtoView.SetPrototype(comp.Prototype);
entProtoView.SetPrototype(ghostRoleProto.EntityPrototype);

button.AddChild(entProtoView);
main.AddChild(button);
Expand Down
8 changes: 4 additions & 4 deletions Content.Client/LateJoin/LateJoinGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
using System.Numerics;
using Content.Client.CrewManifest;
using Content.Client.GameTicking.Managers;
using Content.Client.Lobby;
using Content.Client.UserInterface.Controls;
using Content.Client.Players.PlayTimeTracking;
using Content.Shared.CCVar;
using Content.Shared.Preferences;
using Content.Shared.Roles;
using Content.Shared.StatusIcon;
using Robust.Client.Console;
Expand All @@ -16,19 +18,17 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using static Robust.Client.UserInterface.Controls.BoxContainer;
using Content.Shared.Preferences;
using Content.Client.Lobby;

namespace Content.Client.LateJoin
{
public sealed class LateJoinGui : DefaultWindow
{
[Dependency] private readonly IClientPreferencesManager _preferencesManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
[Dependency] private readonly IConfigurationManager _configManager = default!;
[Dependency] private readonly IEntitySystemManager _entitySystem = default!;
[Dependency] private readonly JobRequirementsManager _jobRequirements = default!;
[Dependency] private readonly IClientPreferencesManager _preferencesManager = default!;

public event Action<(NetEntity, string)> SelectedId;

Expand Down Expand Up @@ -257,7 +257,7 @@ private void RebuildUI()

jobButton.OnPressed += _ => SelectedId.Invoke((id, jobButton.JobId));

if (!_jobRequirements.IsAllowed(prototype, (_preferencesManager?.Preferences!.SelectedCharacter as HumanoidCharacterProfile)!, out var reason))
if (!_jobRequirements.IsAllowed(prototype, (HumanoidCharacterProfile?)_preferencesManager.Preferences?.SelectedCharacter, out var reason))
{
jobButton.Disabled = true;

Expand Down
48 changes: 32 additions & 16 deletions Content.Client/Lobby/LobbyUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public sealed class LobbyUIController : UIController, IOnStateEntered<LobbyState
[UISystemDependency] private readonly ClientInventorySystem _inventory = default!;
[UISystemDependency] private readonly StationSpawningSystem _spawn = default!;
[UISystemDependency] private readonly GuidebookSystem _guide = default!;
[UISystemDependency] private readonly LoadoutSystem _loadouts = default!;

private CharacterSetupGui? _characterSetup;
private HumanoidProfileEditor? _profileEditor;
Expand Down Expand Up @@ -365,7 +366,7 @@ public void GiveDummyLoadout(EntityUid uid, RoleLoadout? roleLoadout)
if (!_prototypeManager.TryIndex(loadout.Prototype, out var loadoutProto))
continue;

_spawn.EquipStartingGear(uid, _prototypeManager.Index(loadoutProto.Equipment));
_spawn.EquipStartingGear(uid, loadoutProto);
}
}
}
Expand All @@ -388,36 +389,51 @@ public void GiveDummyJobClothes(EntityUid dummy, HumanoidCharacterProfile profil
if (!_prototypeManager.TryIndex(loadout.Prototype, out var loadoutProto))
continue;

// TODO: Need some way to apply starting gear to an entity coz holy fucking shit dude.
var loadoutGear = _prototypeManager.Index(loadoutProto.Equipment);

// TODO: Need some way to apply starting gear to an entity and replace existing stuff coz holy fucking shit dude.
foreach (var slot in slots)
{
var itemType = loadoutGear.GetGear(slot.Name);

if (_inventory.TryUnequip(dummy, slot.Name, out var unequippedItem, silent: true, force: true, reparent: false))
// Try startinggear first
if (_prototypeManager.TryIndex(loadoutProto.StartingGear, out var loadoutGear))
{
EntityManager.DeleteEntity(unequippedItem.Value);
var itemType = ((IEquipmentLoadout) loadoutGear).GetGear(slot.Name);

if (_inventory.TryUnequip(dummy, slot.Name, out var unequippedItem, silent: true, force: true, reparent: false))
{
EntityManager.DeleteEntity(unequippedItem.Value);
}

if (itemType != string.Empty)
{
var item = EntityManager.SpawnEntity(itemType, MapCoordinates.Nullspace);
_inventory.TryEquip(dummy, item, slot.Name, true, true);
}
}

if (itemType != string.Empty)
else
{
var item = EntityManager.SpawnEntity(itemType, MapCoordinates.Nullspace);
_inventory.TryEquip(dummy, item, slot.Name, true, true);
var itemType = ((IEquipmentLoadout) loadoutProto).GetGear(slot.Name);

if (_inventory.TryUnequip(dummy, slot.Name, out var unequippedItem, silent: true, force: true, reparent: false))
{
EntityManager.DeleteEntity(unequippedItem.Value);
}

if (itemType != string.Empty)
{
var item = EntityManager.SpawnEntity(itemType, MapCoordinates.Nullspace);
_inventory.TryEquip(dummy, item, slot.Name, true, true);
}
}
}
}
}
}

if (job.StartingGear == null)
if (!_prototypeManager.TryIndex(job.StartingGear, out var gear))
return;

var gear = _prototypeManager.Index<StartingGearPrototype>(job.StartingGear);

foreach (var slot in slots)
{
var itemType = gear.GetGear(slot.Name);
var itemType = ((IEquipmentLoadout) gear).GetGear(slot.Name);

if (_inventory.TryUnequip(dummy, slot.Name, out var unequippedItem, silent: true, force: true, reparent: false))
{
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ public void RefreshAntags()
selector.Select(Profile?.AntagPreferences.Contains(antag.ID) == true ? 0 : 1);

var requirements = _entManager.System<SharedRoleSystem>().GetAntagRequirement(antag);
if (!_requirements.CheckRoleTime(requirements, out var reason))
if (!_requirements.CheckRoleRequirements(requirements, (HumanoidCharacterProfile?)_preferencesManager.Preferences?.SelectedCharacter, out var reason))
{
selector.LockRequirements(reason);
Profile = Profile?.WithAntagPreference(antag.ID, false);
Expand Down
6 changes: 0 additions & 6 deletions Content.Client/Paper/PaperComponent.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Content.Client/Paper/UI/PaperBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Utility;
using static Content.Shared.Paper.SharedPaperComponent;
using static Content.Shared.Paper.PaperComponent;

namespace Content.Client.Paper.UI;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Robust.Client.GameObjects;

using static Content.Shared.Paper.SharedPaperComponent;
using static Content.Shared.Paper.PaperComponent;

namespace Content.Client.Paper;
namespace Content.Client.Paper.UI;

public sealed class PaperSystem : VisualizerSystem<PaperVisualsComponent>
public sealed class PaperVisualizerSystem : VisualizerSystem<PaperVisualsComponent>
{
protected override void OnAppearanceChange(EntityUid uid, PaperVisualsComponent component, ref AppearanceChangeEvent args)
{
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Paper/UI/PaperVisualsComponent.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Numerics;

namespace Content.Client.Paper;
namespace Content.Client.Paper.UI;

[RegisterComponent]
public sealed partial class PaperVisualsComponent : Component
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Paper/UI/PaperWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ protected override void Draw(DrawingHandleScreen handle)
/// Initialize the paper contents, i.e. the text typed by the
/// user and any stamps that have peen put on the page.
/// </summary>
public void Populate(SharedPaperComponent.PaperBoundUserInterfaceState state)
public void Populate(PaperComponent.PaperBoundUserInterfaceState state)
{
bool isEditing = state.Mode == SharedPaperComponent.PaperAction.Write;
bool isEditing = state.Mode == PaperComponent.PaperAction.Write;
bool wasEditing = InputContainer.Visible;
InputContainer.Visible = isEditing;
EditButtons.Visible = isEditing;
Expand Down
87 changes: 16 additions & 71 deletions Content.Client/Players/PlayTimeTracking/JobRequirementsManager.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Diagnostics.CodeAnalysis;
using Content.Client.Administration.Managers;
using System.Diagnostics.CodeAnalysis;
using Content.Client.Administration.Managers; //SS220-Client-admin-check-for-jobs
using Content.Client.Lobby;
using Content.Shared.CCVar;
using Content.Shared.Players;
using Content.Shared.Players.JobWhitelist;
using Content.Shared.Players.PlayTimeTracking;
using Content.Shared.Preferences;
using Content.Shared.Roles;
using Robust.Client;
using Robust.Client.Player;
Expand All @@ -12,9 +14,6 @@
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using Content.Shared.Preferences;
using Content.Shared.Humanoid.Prototypes;
using ReasonList = System.Collections.Generic.List<string>;

namespace Content.Client.Players.PlayTimeTracking;

Expand All @@ -26,8 +25,7 @@ public sealed class JobRequirementsManager : ISharedPlaytimeManager
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IPrototypeManager _prototypes = default!;
[Dependency] private readonly IClientAdminManager _adminManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IClientAdminManager _adminManager = default!; //SS220-Client-admin-check-for-jobs

private readonly Dictionary<string, TimeSpan> _roles = new();
private readonly List<string> _roleBans = new();
Expand Down Expand Up @@ -101,7 +99,7 @@ private bool IsBypassedChecks()
return _adminManager.IsActive();
}

public bool IsAllowed(JobPrototype job, HumanoidCharacterProfile profile, [NotNullWhen(false)] out FormattedMessage? reason)
public bool IsAllowed(JobPrototype job, HumanoidCharacterProfile? profile, [NotNullWhen(false)] out FormattedMessage? reason)
{
reason = null;

Expand All @@ -118,89 +116,36 @@ public bool IsAllowed(JobPrototype job, HumanoidCharacterProfile profile, [NotNu
if (player == null)
return true;

return CheckAllowed(job, profile, out reason);
}

//SS220 Species-Job-Requirement begin
public void BuildReason(ReasonList reasons, out FormattedMessage reason)
{
reason = FormattedMessage.FromMarkup(string.Join('\n', reasons));
return CheckRoleRequirements(job, profile, out reason);
}

public bool CheckAllowed(JobPrototype job, HumanoidCharacterProfile profile, [NotNullWhen(false)] out FormattedMessage? reason)
public bool CheckRoleRequirements(JobPrototype job, HumanoidCharacterProfile? profile, [NotNullWhen(false)] out FormattedMessage? reason)
{
reason = null;
ReasonList reasons = new();

var bCheckSpecies = CheckSpeciesRestrict(job, profile, reasons);
var bCheckRoleTime = CheckRoleTime(job, out var roleTimeReason);
if (roleTimeReason is not null)
reasons.Add(roleTimeReason.ToMarkup());

if (bCheckSpecies && bCheckRoleTime)
{
return true;
}

BuildReason(reasons, out reason);
return false;
}

public bool CheckSpeciesRestrict(JobPrototype job, HumanoidCharacterProfile profile, ReasonList reasons)
{
var species = _prototypeManager.Index<SpeciesPrototype>(profile.Species);

if (species is not null)
{
if (JobRequirements.TryRequirementsSpeciesMet(job, species, profile.Sex, out var reason, _prototypeManager)) //ss220-arahFix
return true;

reasons.Add(reason.ToMarkup());
return false;
}

return true;
var reqs = _entManager.System<SharedRoleSystem>().GetJobRequirement(job);
return CheckRoleRequirements(reqs, profile, out reason);
}

// for compatible things like xaml for ghost roles
public bool CheckRoleTime(HashSet<JobRequirement>? requirements, [NotNullWhen(false)] out FormattedMessage? reason)
public bool CheckRoleRequirements(HashSet<JobRequirement>? requirements, HumanoidCharacterProfile? profile, [NotNullWhen(false)] out FormattedMessage? reason)
{
reason = null;
ReasonList reasons = new();

if (!CheckRoleTime(requirements, reasons))
{
BuildReason(reasons, out reason);
return false;
}
return true;
}
//SS220 Species-Job-Requirement end

public bool CheckRoleTime(JobPrototype job, [NotNullWhen(false)] out FormattedMessage? reason)
{
var reqs = _entManager.System<SharedRoleSystem>().GetJobRequirement(job);
return CheckRoleTime(reqs, out reason);
}

public bool CheckRoleTime(HashSet<JobRequirement>? requirements, ReasonList reasons)
{
if (requirements == null || !_cfg.GetCVar(CCVars.GameRoleTimers))
return true;

var reasons = new List<string>();
foreach (var requirement in requirements)
{
if (JobRequirements.TryRequirementMet(requirement, _roles, out var jobReason, _entManager, _prototypes))
if (requirement.Check(_entManager, _prototypes, profile, _roles, out var jobReason))
continue;

//SS220-Client-admin-check-for-jobs
if (IsBypassedChecks())
if (IsBypassedChecks()) //SS220-Client-admin-check-for-jobs
continue;

reasons.Add(jobReason.ToMarkup());
}

return reasons.Count == 0; //SS220 Species-Job-Requirement
reason = reasons.Count == 0 ? null : FormattedMessage.FromMarkup(string.Join('\n', reasons));
return reason == null;
}

public bool CheckWhitelist(JobPrototype job, [NotNullWhen(false)] out FormattedMessage? reason)
Expand Down
Loading
Loading