diff --git a/Content.Benchmarks/EntityManagerGetAllComponents.cs b/Content.Benchmarks/EntityManagerGetAllComponents.cs index 0b9683a4abb..8e02b8d71de 100644 --- a/Content.Benchmarks/EntityManagerGetAllComponents.cs +++ b/Content.Benchmarks/EntityManagerGetAllComponents.cs @@ -47,6 +47,7 @@ public void Setup() var componentFactory = new Mock(); componentFactory.Setup(p => p.GetComponent()).Returns(new DummyComponent()); + componentFactory.Setup(m => m.GetIndex(typeof(DummyComponent))).Returns(CompIdx.Index()); componentFactory.Setup(p => p.GetRegistration(It.IsAny())).Returns(dummyReg); componentFactory.Setup(p => p.GetAllRegistrations()).Returns(new[] { dummyReg }); componentFactory.Setup(p => p.GetAllRefTypes()).Returns(new[] { CompIdx.Index() }); diff --git a/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs index af977f763c6..ddd66623bd4 100644 --- a/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs +++ b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs @@ -75,7 +75,7 @@ public BwoinkControl() if (info.Antag && info.ActiveThisRound) sb.Append(new Rune(0x1F5E1)); // 🗡 - if (info.OverallPlaytime <= TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.NewPlayerThreshold))) + if (info.OverallPlaytime <= TimeSpan.FromMinutes(_cfg.GetCVar(CCVars.NewPlayerThreshold))) sb.Append(new Rune(0x23F2)); // ⏲ sb.AppendFormat("\"{0}\"", text); @@ -226,7 +226,7 @@ private string FormatTabTitle(ItemList.Item li, PlayerInfo? pl = default) if (pl.Antag) sb.Append(new Rune(0x1F5E1)); // 🗡 - if (pl.OverallPlaytime <= TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.NewPlayerThreshold))) + if (pl.OverallPlaytime <= TimeSpan.FromMinutes(_cfg.GetCVar(CCVars.NewPlayerThreshold))) sb.Append(new Rune(0x23F2)); // ⏲ sb.AppendFormat("\"{0}\"", pl.CharacterName); @@ -243,9 +243,9 @@ private void SwitchToChannel(NetUserId? ch) { UpdateButtons(); + AHelpHelper.HideAllPanels(); if (ch != null) { - AHelpHelper.HideAllPanels(); var panel = AHelpHelper.EnsurePanel(ch.Value); panel.Visible = true; } diff --git a/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml.cs b/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml.cs index 999eba4d29d..30f9d24df1d 100644 --- a/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml.cs +++ b/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml.cs @@ -18,7 +18,7 @@ public BwoinkWindow() { if (sel is null) { - Title = Loc.GetString("bwoink-none-selected"); + Title = Loc.GetString("bwoink-title-none-selected"); return; } diff --git a/Content.Client/Doors/FirelockSystem.cs b/Content.Client/Doors/FirelockSystem.cs index f64b4c8e522..ad869391f4b 100644 --- a/Content.Client/Doors/FirelockSystem.cs +++ b/Content.Client/Doors/FirelockSystem.cs @@ -25,15 +25,12 @@ private void OnAppearanceChange(EntityUid uid, FirelockComponent comp, ref Appea if (!_appearanceSystem.TryGetData(uid, DoorVisuals.State, out var state, args.Component)) state = DoorState.Closed; - if (_appearanceSystem.TryGetData(uid, DoorVisuals.Powered, out var powered, args.Component) && powered) - { - boltedVisible = _appearanceSystem.TryGetData(uid, DoorVisuals.BoltLights, out var lights, args.Component) && lights; - unlitVisible = - state == DoorState.Closing - || state == DoorState.Opening - || state == DoorState.Denying - || (_appearanceSystem.TryGetData(uid, DoorVisuals.ClosedLights, out var closedLights, args.Component) && closedLights); - } + boltedVisible = _appearanceSystem.TryGetData(uid, DoorVisuals.BoltLights, out var lights, args.Component) && lights; + unlitVisible = + state == DoorState.Closing + || state == DoorState.Opening + || state == DoorState.Denying + || (_appearanceSystem.TryGetData(uid, DoorVisuals.ClosedLights, out var closedLights, args.Component) && closedLights); args.Sprite.LayerSetVisible(DoorVisualLayers.BaseUnlit, unlitVisible && !boltedVisible); args.Sprite.LayerSetVisible(DoorVisualLayers.BaseBolted, boltedVisible); diff --git a/Content.Client/Lobby/LobbyUIController.cs b/Content.Client/Lobby/LobbyUIController.cs index 464e16597f3..4958304960f 100644 --- a/Content.Client/Lobby/LobbyUIController.cs +++ b/Content.Client/Lobby/LobbyUIController.cs @@ -15,6 +15,7 @@ using Content.Shared.Preferences.Loadouts; using Content.Shared.Roles; using Content.Shared.Traits; +using Content.Sunrise.Interfaces.Client; using Robust.Client.Player; using Robust.Client.ResourceManagement; using Robust.Client.State; @@ -46,6 +47,7 @@ public sealed partial class LobbyUIController : UIController, IOnStateEntered /// This is the characher preview panel in the chat. This should only update if their character updates. @@ -62,6 +64,7 @@ public sealed partial class LobbyUIController : UIController, IOnStateEntered(LoadoutSystem.GetJobPrototype(job.ID))) { - var loadout = profile.GetLoadoutOrDefault(LoadoutSystem.GetJobPrototype(job.ID), profile.Species, EntityManager, _prototypeManager); - GiveDummyLoadout(dummy, loadout); + var loadout = profile.GetLoadoutOrDefault(LoadoutSystem.GetJobPrototype(job.ID), _playerManager.LocalSession, profile.Species, EntityManager, _prototypeManager, sponsorPrototypes); + GiveDummyLoadout(dummy, loadout, true); } } @@ -309,19 +316,31 @@ public JobPrototype GetPreferredJob(HumanoidCharacterProfile profile) return _prototypeManager.Index(highPriorityJob.Id ?? SharedGameTicker.FallbackOverflowJob); } - public void GiveDummyLoadout(EntityUid uid, RoleLoadout? roleLoadout) + public void GiveDummyLoadout(EntityUid uid, RoleLoadout? roleLoadout, bool outerwear) { if (roleLoadout == null) return; + var undervearSlots = new List { "bra", "pants", "socks" }; + foreach (var group in roleLoadout.SelectedLoadouts.Values) { foreach (var loadout in group) { + var wear = true; if (!_prototypeManager.TryIndex(loadout.Prototype, out var loadoutProto)) continue; - _spawn.EquipStartingGear(uid, _prototypeManager.Index(loadoutProto.Equipment)); + var startingGear = _prototypeManager.Index(loadoutProto.Equipment); + + foreach (var keyValuePair in startingGear.Equipment) + { + if (!undervearSlots.Contains(keyValuePair.Key) && !outerwear) + wear = false; + } + + if (wear) + _spawn.EquipStartingGear(uid, startingGear); } } } @@ -395,6 +414,10 @@ public EntityUid LoadProfileEntity(HumanoidCharacterProfile? humanoid, JobProtot { EntityUid dummyEnt; + // Sunrise-Start + var sponsorPrototypes = _sponsorsManager?.GetClientPrototypes().ToArray() ?? []; + // Sunrise-End + if (humanoid is not null) { var dummy = _prototypeManager.Index(humanoid.Species).DollPrototype; @@ -407,15 +430,15 @@ public EntityUid LoadProfileEntity(HumanoidCharacterProfile? humanoid, JobProtot _humanoid.LoadProfile(dummyEnt, humanoid); - if (humanoid != null && jobClothes) + if (humanoid != null) { job ??= GetPreferredJob(humanoid); GiveDummyJobClothes(dummyEnt, humanoid, job); if (_prototypeManager.HasIndex(LoadoutSystem.GetJobPrototype(job.ID))) { - var loadout = humanoid.GetLoadoutOrDefault(LoadoutSystem.GetJobPrototype(job.ID), humanoid.Species, EntityManager, _prototypeManager); - GiveDummyLoadout(dummyEnt, loadout); + var loadout = humanoid.GetLoadoutOrDefault(LoadoutSystem.GetJobPrototype(job.ID), _playerManager.LocalSession, humanoid.Species, EntityManager, _prototypeManager, sponsorPrototypes); + GiveDummyLoadout(dummyEnt, loadout, jobClothes); } } diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs index 6884707e101..11960f65f0b 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs @@ -814,6 +814,10 @@ public void RefreshJobs() departments.Add(department); } + // Sunrise-Start + var sponsorPrototypes = _sponsorsMgr?.GetClientPrototypes().ToArray() ?? []; + // Sunrise-End + departments.Sort(DepartmentUIComparer.Instance); var items = new[] @@ -964,7 +968,7 @@ public void RefreshJobs() if (loadout == null) { loadout = new RoleLoadout(roleLoadoutProto.ID); - loadout.SetDefault(_prototypeManager); + loadout.SetDefault(Profile, _playerManager.LocalSession, _prototypeManager, sponsorPrototypes); } OpenLoadout(job, loadout, roleLoadoutProto); @@ -1170,6 +1174,7 @@ private void SetSex(Sex newSex) UpdateGenderControls(); UpdateTTSVoicesControls(); // Sunrise-TTS + RefreshLoadouts(); // Sunrise-Sex restrictions Markings.SetSex(newSex); ReloadPreview(); SetDirty(); diff --git a/Content.Client/Lobby/UI/LobbyGui.xaml b/Content.Client/Lobby/UI/LobbyGui.xaml index 1e4cd7dff14..a42448fd4d9 100644 --- a/Content.Client/Lobby/UI/LobbyGui.xaml +++ b/Content.Client/Lobby/UI/LobbyGui.xaml @@ -108,7 +108,7 @@