Merge remote-tracking branch 'upstream/master' into ed-17-06-2024-upstream
# Conflicts: # Resources/Prototypes/Maps/oasis.yml
This commit is contained in:
@@ -75,7 +75,7 @@ namespace Content.Client.Administration.UI.Bwoink
|
||||
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 @@ namespace Content.Client.Administration.UI.Bwoink
|
||||
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 @@ namespace Content.Client.Administration.UI.Bwoink
|
||||
{
|
||||
UpdateButtons();
|
||||
|
||||
AHelpHelper.HideAllPanels();
|
||||
if (ch != null)
|
||||
{
|
||||
AHelpHelper.HideAllPanels();
|
||||
var panel = AHelpHelper.EnsurePanel(ch.Value);
|
||||
panel.Visible = true;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Content.Client.Administration.UI.Bwoink
|
||||
{
|
||||
if (sel is null)
|
||||
{
|
||||
Title = Loc.GetString("bwoink-none-selected");
|
||||
Title = Loc.GetString("bwoink-title-none-selected");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
using Content.Server.Bed.Sleep;
|
||||
|
||||
namespace Content.Client.Bed;
|
||||
|
||||
public sealed class SleepingSystem : SharedSleepingSystem
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Content.Client.Inventory;
|
||||
using Content.Shared.Clothing;
|
||||
using Content.Shared.Clothing.Components;
|
||||
@@ -120,6 +121,7 @@ public sealed class ClientClothingSystem : ClothingSystem
|
||||
i++;
|
||||
}
|
||||
|
||||
item.MappedLayer = key;
|
||||
args.Layers.Add((key, layer));
|
||||
}
|
||||
}
|
||||
@@ -160,13 +162,9 @@ public sealed class ClientClothingSystem : ClothingSystem
|
||||
|
||||
// species specific
|
||||
if (speciesId != null && rsi.TryGetState($"{state}-{speciesId}", out _))
|
||||
{
|
||||
state = $"{state}-{speciesId}";
|
||||
}
|
||||
else if (!rsi.TryGetState(state, out _))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var layer = new PrototypeLayerData();
|
||||
layer.RsiPath = rsi.Path.ToString();
|
||||
@@ -294,6 +292,8 @@ public sealed class ClientClothingSystem : ClothingSystem
|
||||
|
||||
if (layerData.Color != null)
|
||||
sprite.LayerSetColor(key, layerData.Color.Value);
|
||||
if (layerData.Scale != null)
|
||||
sprite.LayerSetScale(key, layerData.Scale.Value);
|
||||
}
|
||||
else
|
||||
index = sprite.LayerMapReserveBlank(key);
|
||||
|
||||
48
Content.Client/Clothing/FlippableClothingVisualizerSystem.cs
Normal file
48
Content.Client/Clothing/FlippableClothingVisualizerSystem.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using Content.Shared.Clothing;
|
||||
using Content.Shared.Clothing.Components;
|
||||
using Content.Shared.Clothing.EntitySystems;
|
||||
using Content.Shared.Foldable;
|
||||
using Content.Shared.Item;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.Clothing;
|
||||
|
||||
public sealed class FlippableClothingVisualizerSystem : VisualizerSystem<FlippableClothingVisualsComponent>
|
||||
{
|
||||
[Dependency] private readonly SharedItemSystem _itemSys = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<FlippableClothingVisualsComponent, GetEquipmentVisualsEvent>(OnGetVisuals, after: [typeof(ClothingSystem)]);
|
||||
SubscribeLocalEvent<FlippableClothingVisualsComponent, FoldedEvent>(OnFolded);
|
||||
}
|
||||
|
||||
private void OnFolded(Entity<FlippableClothingVisualsComponent> ent, ref FoldedEvent args)
|
||||
{
|
||||
_itemSys.VisualsChanged(ent);
|
||||
}
|
||||
|
||||
private void OnGetVisuals(Entity<FlippableClothingVisualsComponent> ent, ref GetEquipmentVisualsEvent args)
|
||||
{
|
||||
if (!TryComp(ent, out SpriteComponent? sprite) ||
|
||||
!TryComp(ent, out ClothingComponent? clothing))
|
||||
return;
|
||||
|
||||
if (clothing.MappedLayer == null ||
|
||||
!AppearanceSystem.TryGetData<bool>(ent, FoldableSystem.FoldedVisuals.State, out var folding) ||
|
||||
!sprite.LayerMapTryGet(folding ? ent.Comp.FoldingLayer : ent.Comp.UnfoldingLayer, out var idx))
|
||||
return;
|
||||
|
||||
// add each layer to the visuals
|
||||
var spriteLayer = sprite[idx];
|
||||
foreach (var layer in args.Layers)
|
||||
{
|
||||
if (layer.Item1 != clothing.MappedLayer)
|
||||
continue;
|
||||
|
||||
layer.Item2.Scale = spriteLayer.Scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Content.Client/Clothing/FlippableClothingVisualsComponent.cs
Normal file
16
Content.Client/Clothing/FlippableClothingVisualsComponent.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace Content.Client.Clothing;
|
||||
|
||||
/// <summary>
|
||||
/// Communicates folded layers data (currently only Scale to handle flipping)
|
||||
/// to the wearer clothing sprite layer
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(FlippableClothingVisualizerSystem))]
|
||||
public sealed partial class FlippableClothingVisualsComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public string FoldingLayer = "foldedLayer";
|
||||
|
||||
[DataField]
|
||||
public string UnfoldingLayer = "unfoldedLayer";
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using Content.Shared.Clothing;
|
||||
|
||||
namespace Content.Client.Clothing;
|
||||
|
||||
public sealed class MagbootsSystem : SharedMagbootsSystem
|
||||
{
|
||||
|
||||
}
|
||||
@@ -25,15 +25,12 @@ public sealed class FirelockSystem : SharedFirelockSystem
|
||||
if (!_appearanceSystem.TryGetData<DoorState>(uid, DoorVisuals.State, out var state, args.Component))
|
||||
state = DoorState.Closed;
|
||||
|
||||
if (_appearanceSystem.TryGetData<bool>(uid, DoorVisuals.Powered, out var powered, args.Component) && powered)
|
||||
{
|
||||
boltedVisible = _appearanceSystem.TryGetData<bool>(uid, DoorVisuals.BoltLights, out var lights, args.Component) && lights;
|
||||
unlitVisible =
|
||||
state == DoorState.Closing
|
||||
|| state == DoorState.Opening
|
||||
|| state == DoorState.Denying
|
||||
|| (_appearanceSystem.TryGetData<bool>(uid, DoorVisuals.ClosedLights, out var closedLights, args.Component) && closedLights);
|
||||
}
|
||||
boltedVisible = _appearanceSystem.TryGetData<bool>(uid, DoorVisuals.BoltLights, out var lights, args.Component) && lights;
|
||||
unlitVisible =
|
||||
state == DoorState.Closing
|
||||
|| state == DoorState.Opening
|
||||
|| state == DoorState.Denying
|
||||
|| (_appearanceSystem.TryGetData<bool>(uid, DoorVisuals.ClosedLights, out var closedLights, args.Component) && closedLights);
|
||||
|
||||
args.Sprite.LayerSetVisible(DoorVisualLayers.BaseUnlit, unlitVisible && !boltedVisible);
|
||||
args.Sprite.LayerSetVisible(DoorVisualLayers.BaseBolted, boltedVisible);
|
||||
|
||||
@@ -294,7 +294,7 @@ public sealed class LobbyUIController : UIController, IOnStateEntered<LobbyState
|
||||
|
||||
if (_prototypeManager.HasIndex<RoleLoadoutPrototype>(LoadoutSystem.GetJobPrototype(job.ID)))
|
||||
{
|
||||
var loadout = profile.GetLoadoutOrDefault(LoadoutSystem.GetJobPrototype(job.ID), profile.Species, EntityManager, _prototypeManager);
|
||||
var loadout = profile.GetLoadoutOrDefault(LoadoutSystem.GetJobPrototype(job.ID), _playerManager.LocalSession, profile.Species, EntityManager, _prototypeManager);
|
||||
GiveDummyLoadout(dummy, loadout);
|
||||
}
|
||||
}
|
||||
@@ -414,7 +414,7 @@ public sealed class LobbyUIController : UIController, IOnStateEntered<LobbyState
|
||||
|
||||
if (_prototypeManager.HasIndex<RoleLoadoutPrototype>(LoadoutSystem.GetJobPrototype(job.ID)))
|
||||
{
|
||||
var loadout = humanoid.GetLoadoutOrDefault(LoadoutSystem.GetJobPrototype(job.ID), humanoid.Species, EntityManager, _prototypeManager);
|
||||
var loadout = humanoid.GetLoadoutOrDefault(LoadoutSystem.GetJobPrototype(job.ID), _playerManager.LocalSession, humanoid.Species, EntityManager, _prototypeManager);
|
||||
GiveDummyLoadout(dummyEnt, loadout);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -947,7 +947,7 @@ namespace Content.Client.Lobby.UI
|
||||
if (loadout == null)
|
||||
{
|
||||
loadout = new RoleLoadout(roleLoadoutProto.ID);
|
||||
loadout.SetDefault(_prototypeManager);
|
||||
loadout.SetDefault(Profile, _playerManager.LocalSession, _prototypeManager);
|
||||
}
|
||||
|
||||
OpenLoadout(job, loadout, roleLoadoutProto);
|
||||
|
||||
@@ -87,7 +87,7 @@ public sealed partial class ApcVisualsComponent : Component
|
||||
/// </summary>
|
||||
[DataField("screenColors")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public Color[] ScreenColors = new Color[(byte)ApcChargeState.NumStates]{Color.FromHex("#d1332e"), Color.FromHex("#2e8ad1"), Color.FromHex("#3db83b"), Color.FromHex("#ffac1c")};
|
||||
public Color[] ScreenColors = new Color[(byte)ApcChargeState.NumStates]{Color.FromHex("#d1332e"), Color.FromHex("#dcdc28"), Color.FromHex("#82ff4c"), Color.FromHex("#ffac1c")};
|
||||
|
||||
/// <summary>
|
||||
/// The sprite state of the unlit overlay used for the APC screen when the APC has been emagged.
|
||||
|
||||
@@ -482,7 +482,7 @@ public sealed class PowerMonitoringButton : Button
|
||||
{
|
||||
HorizontalAlignment = HAlignment.Right,
|
||||
Align = Label.AlignMode.Right,
|
||||
SetWidth = 72f,
|
||||
SetWidth = 80f,
|
||||
Margin = new Thickness(10, 0, 0, 0),
|
||||
ClipText = true,
|
||||
};
|
||||
|
||||
@@ -134,7 +134,7 @@ public sealed partial class RoboticsConsoleWindow : FancyWindow
|
||||
BorgInfo.SetMessage(text);
|
||||
|
||||
// how the turntables
|
||||
DisableButton.Disabled = !data.HasBrain;
|
||||
DisableButton.Disabled = !(data.HasBrain && data.CanDisable);
|
||||
DestroyButton.Disabled = _timing.CurTime < _console.Comp1.NextDestroy;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,9 +43,6 @@ public sealed class RandomSpriteSystem : SharedRandomSpriteSystem
|
||||
if (!Resolve(uid, ref clothing, false))
|
||||
return;
|
||||
|
||||
if (clothing.ClothingVisuals == null)
|
||||
return;
|
||||
|
||||
foreach (var slotPair in clothing.ClothingVisuals)
|
||||
{
|
||||
foreach (var keyColorPair in component.Selected)
|
||||
|
||||
@@ -16,9 +16,8 @@ using Content.Client.UserInterface.Systems.Gameplay;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Chat;
|
||||
using Content.Shared.Decals;
|
||||
using Content.Shared.Damage.ForceSay;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Decals;
|
||||
using Content.Shared.Input;
|
||||
using Content.Shared.Radio;
|
||||
using Robust.Client.GameObjects;
|
||||
@@ -626,7 +625,7 @@ public sealed class ChatUIController : UIController
|
||||
var predicate = static (EntityUid uid, (EntityUid compOwner, EntityUid? attachedEntity) data)
|
||||
=> uid == data.compOwner || uid == data.attachedEntity;
|
||||
var playerPos = player != null
|
||||
? _transform?.GetMapCoordinates(player.Value) ?? MapCoordinates.Nullspace
|
||||
? _eye.CurrentEye.Position
|
||||
: MapCoordinates.Nullspace;
|
||||
|
||||
var occluded = player != null && _examine.IsOccluded(player.Value);
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
using Content.Client.Gameplay;
|
||||
using Content.Client.Info;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Guidebook;
|
||||
using Content.Shared.Info;
|
||||
using Robust.Client.Console;
|
||||
using Robust.Client.UserInterface.Controllers;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
@@ -14,21 +12,27 @@ namespace Content.Client.UserInterface.Systems.Info;
|
||||
|
||||
public sealed class InfoUIController : UIController, IOnStateExited<GameplayState>
|
||||
{
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
|
||||
[Dependency] private readonly INetManager _netManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
||||
[Dependency] private readonly ILogManager _logMan = default!;
|
||||
|
||||
private RulesPopup? _rulesPopup;
|
||||
private RulesAndInfoWindow? _infoWindow;
|
||||
private ISawmill _sawmill = default!;
|
||||
|
||||
[ValidatePrototypeId<GuideEntryPrototype>]
|
||||
private const string DefaultRuleset = "DefaultRuleset";
|
||||
|
||||
public ProtoId<GuideEntryPrototype> RulesEntryId = DefaultRuleset;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
|
||||
_sawmill = _logMan.GetSawmill("rules");
|
||||
_netManager.RegisterNetMessage<RulesAcceptedMessage>();
|
||||
_netManager.RegisterNetMessage<ShowRulesPopupMessage>(OnShowRulesPopupMessage);
|
||||
_netManager.RegisterNetMessage<SendRulesInformationMessage>(OnRulesInformationMessage);
|
||||
|
||||
_consoleHost.RegisterCommand("fuckrules",
|
||||
"",
|
||||
@@ -39,9 +43,12 @@ public sealed class InfoUIController : UIController, IOnStateExited<GameplayStat
|
||||
});
|
||||
}
|
||||
|
||||
private void OnShowRulesPopupMessage(ShowRulesPopupMessage message)
|
||||
private void OnRulesInformationMessage(SendRulesInformationMessage message)
|
||||
{
|
||||
ShowRules(message.PopupTime);
|
||||
RulesEntryId = message.CoreRules;
|
||||
|
||||
if (message.ShouldShowRules)
|
||||
ShowRules(message.PopupTime);
|
||||
}
|
||||
|
||||
public void OnStateExited(GameplayState state)
|
||||
@@ -84,8 +91,13 @@ public sealed class InfoUIController : UIController, IOnStateExited<GameplayStat
|
||||
|
||||
public GuideEntryPrototype GetCoreRuleEntry()
|
||||
{
|
||||
var guide = _cfg.GetCVar(CCVars.RulesFile);
|
||||
var guideEntryPrototype = _prototype.Index<GuideEntryPrototype>(guide);
|
||||
if (!_prototype.TryIndex(RulesEntryId, out var guideEntryPrototype))
|
||||
{
|
||||
guideEntryPrototype = _prototype.Index<GuideEntryPrototype>(DefaultRuleset);
|
||||
_sawmill.Error($"Couldn't find the following prototype: {RulesEntryId}. Falling back to {DefaultRuleset}, please check that the server has the rules set up correctly");
|
||||
return guideEntryPrototype;
|
||||
}
|
||||
|
||||
return guideEntryPrototype;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user