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 sync #524

Merged
merged 36 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1d72d07
Add explosion-proof backpack to uplink (#26187)
21Melkuu Mar 17, 2024
209846b
Gives glue tag to crazy glue (#26154)
Adrian16199 Mar 17, 2024
c35ff87
SlowContactsSystem to SpeedModifierContactsSystem mini rework (#26110)
TheShuEd Mar 17, 2024
90be67e
Add decoy syndicate bomb to uplink (#26034)
Ilya246 Mar 17, 2024
7d275a4
Obsolete `Logger` cleanup for `EntitySystem`s part 2 (#26159)
LordCarve Mar 17, 2024
fd2d5c2
Recolor R&D airlocks (#1950)
SonicHDC Mar 17, 2024
14b7d30
Update maps in corvax default mappool (#1966)
lzk228 Mar 17, 2024
2b92df7
One-time signal ERT spawners (#1968)
TheShuEd Mar 17, 2024
a751abc
Merge remote-tracking branch 'upstream/master' into upstream-sync
Morb0 Mar 17, 2024
f259f2f
Update blood related tips! (#25809)
QuietlyWhisper Mar 17, 2024
b12b5af
Update locale
Morb0 Mar 17, 2024
6f8e0e1
Merge pull request #1969 from space-syndicate/upstream-sync
Morb0 Mar 17, 2024
29a1716
[Maps] CentComm station update (#1972)
poeMota Mar 17, 2024
4357b9e
Added 18 new bounties to cargo (#26160)
wafehling Mar 17, 2024
eeaea6c
Unify `Content`'s `EntitySystem` logging (#26216)
LordCarve Mar 17, 2024
909b2aa
New wooden furniture (#26182)
Ko4ergaPunk Mar 17, 2024
b5138b2
Fix barotrauma calculations
PJB3005 Mar 17, 2024
865f530
Increase air alarm low pressure thresholds.
PJB3005 Mar 17, 2024
2eec906
Make puddle smoothing better (#26171)
potato1234x Mar 17, 2024
6095383
Change Syndie Monkey Price 8-6 TC (#26214)
FungiFellow Mar 18, 2024
21de5e9
Criminal Record Icons below Job Icons (#26203)
Golinth Mar 18, 2024
153d281
Fix pressure damage calculations (#26217)
Partmedia Mar 18, 2024
597107c
Fixed safe filling with WT550 (#26208)
HappyRoach Mar 18, 2024
6c23989
Suit slot weapon consistency + visuals (#26152)
Vaaankas Mar 18, 2024
87386ca
make romerol work on the dead (#26222)
Dutch-VanDerLinde Mar 18, 2024
0493130
reach update (#26224)
Emisse Mar 18, 2024
7561bef
Move faction exception and everything it needs to shared (#25154)
deltanedas Mar 18, 2024
646f7e0
Add reckless replay load button (#26212)
ElectroJr Mar 18, 2024
2988763
Fix borg charger error (#26230)
Tayrtahn Mar 18, 2024
8d40bc3
Improves Medical Hud interface and functionality (#26027)
DoutorWhite Mar 18, 2024
21c527d
fix decoy bomb uplink category (#26205)
Ilya246 Mar 18, 2024
75287db
Increase lone ops TC from 40 to 60 (#26130)
Plykiya Mar 18, 2024
2ee78ee
Merge remote-tracking branch 'upstream/master' into upstream-sync
Rxup Mar 18, 2024
4aa1485
Merge remote-tracking branch 'wizard/master' into upstream-sync
Rxup Mar 18, 2024
a4c4034
upd
Rxup Mar 18, 2024
78a06c8
fix
Rxup Mar 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions Content.Client/CardboardBox/CardboardBoxSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Numerics;
using System.Numerics;
using Content.Shared.CardboardBox;
using Content.Shared.CardboardBox.Components;
using Content.Shared.Examine;
Expand All @@ -11,6 +11,7 @@ public sealed class CardboardBoxSystem : SharedCardboardBoxSystem
{
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
[Dependency] private readonly TransformSystem _transform = default!;
[Dependency] private readonly ExamineSystemShared _examine = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -55,7 +56,7 @@ private void OnBoxEffect(PlayBoxEffectMessage msg)
foreach (var mob in mobMoverEntities)
{
var mapPos = _transform.GetMapCoordinates(mob);
if (!ExamineSystemShared.InRangeUnOccluded(sourcePos, mapPos, box.Distance, null))
if (!_examine.InRangeUnOccluded(sourcePos, mapPos, box.Distance, null))
continue;

var ent = Spawn(box.Effect, mapPos);
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public sealed class EntryPoint : GameClient
[Dependency] private readonly IResourceManager _resourceManager = default!;
[Dependency] private readonly IReplayLoadManager _replayLoad = default!;
[Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly ContentReplayPlaybackManager _replayMan = default!;


// start-backmen: ioc
Expand Down Expand Up @@ -109,12 +110,10 @@ public override void Init()
_prototypeManager.RegisterIgnore("seed"); // Seeds prototypes are server-only.
_prototypeManager.RegisterIgnore("objective");
_prototypeManager.RegisterIgnore("holiday");
_prototypeManager.RegisterIgnore("aiFaction");
_prototypeManager.RegisterIgnore("htnCompound");
_prototypeManager.RegisterIgnore("htnPrimitive");
_prototypeManager.RegisterIgnore("gameMap");
_prototypeManager.RegisterIgnore("gameMapPool");
_prototypeManager.RegisterIgnore("npcFaction");
_prototypeManager.RegisterIgnore("lobbyBackground");
_prototypeManager.RegisterIgnore("advertisementsPack");
_prototypeManager.RegisterIgnore("gamePreset");
Expand Down Expand Up @@ -216,6 +215,7 @@ private void SwitchToDefaultState(bool disconnected = false)
_resourceManager,
ReplayConstants.ReplayZipFolder.ToRootedPath());

_replayMan.LastLoad = (null, ReplayConstants.ReplayZipFolder.ToRootedPath());
_replayLoad.LoadAndStartReplay(reader);
}
else if (_gameController.LaunchState.FromLauncher)
Expand Down
25 changes: 16 additions & 9 deletions Content.Client/Overlays/ShowHealthIconsSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Content.Shared.Atmos.Rotting;
using Content.Shared.Damage;
using Content.Shared.Inventory.Events;
using Content.Shared.Mobs.Components;
using Content.Shared.Overlays;
using Content.Shared.StatusIcon;
using Content.Shared.StatusIcon.Components;
Expand All @@ -17,9 +19,6 @@ public sealed class ShowHealthIconsSystem : EquipmentHudSystem<ShowHealthIconsCo

public HashSet<string> DamageContainers = new();

[ValidatePrototypeId<StatusIconPrototype>]
private const string HealthIconFine = "HealthIconFine";

public override void Initialize()
{
base.Initialize();
Expand All @@ -45,18 +44,20 @@ protected override void DeactivateInternal()
DamageContainers.Clear();
}

private void OnGetStatusIconsEvent(EntityUid uid, DamageableComponent damageableComponent, ref GetStatusIconsEvent args)
private void OnGetStatusIconsEvent(Entity<DamageableComponent> entity, ref GetStatusIconsEvent args)
{
if (!IsActive || args.InContainer)
return;

var healthIcons = DecideHealthIcons(damageableComponent);
var healthIcons = DecideHealthIcons(entity);

args.StatusIcons.AddRange(healthIcons);
}

private IReadOnlyList<StatusIconPrototype> DecideHealthIcons(DamageableComponent damageableComponent)
private IReadOnlyList<StatusIconPrototype> DecideHealthIcons(Entity<DamageableComponent> entity)
{
var damageableComponent = entity.Comp;

if (damageableComponent.DamageContainerID == null ||
!DamageContainers.Contains(damageableComponent.DamageContainerID))
{
Expand All @@ -66,10 +67,16 @@ private IReadOnlyList<StatusIconPrototype> DecideHealthIcons(DamageableComponent
var result = new List<StatusIconPrototype>();

// Here you could check health status, diseases, mind status, etc. and pick a good icon, or multiple depending on whatever.
if (damageableComponent?.DamageContainerID == "Biological" &&
_prototypeMan.TryIndex<StatusIconPrototype>(HealthIconFine, out var healthyIcon))
if (damageableComponent?.DamageContainerID == "Biological")
{
result.Add(healthyIcon);
if (TryComp<MobStateComponent>(entity, out var state))
{
// Since there is no MobState for a rotting mob, we have to deal with this case first.
if (HasComp<RottingComponent>(entity) && _prototypeMan.TryIndex(damageableComponent.RottingIcon, out var rottingIcon))
result.Add(rottingIcon);
else if (damageableComponent.HealthIcons.TryGetValue(state.CurrentState, out var value) && _prototypeMan.TryIndex(value, out var icon))
result.Add(icon);
}
}

return result;
Expand Down
5 changes: 4 additions & 1 deletion Content.Client/Popups/PopupOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public sealed class PopupOverlay : Overlay
private readonly IUserInterfaceManager _uiManager;
private readonly PopupSystem _popup;
private readonly PopupUIController _controller;
private readonly ExamineSystemShared _examine;

private readonly ShaderInstance _shader;

Expand All @@ -33,12 +34,14 @@ public PopupOverlay(
IPrototypeManager protoManager,
IUserInterfaceManager uiManager,
PopupUIController controller,
ExamineSystemShared examine,
PopupSystem popup)
{
_configManager = configManager;
_entManager = entManager;
_playerMgr = playerMgr;
_uiManager = uiManager;
_examine = examine;
_popup = popup;
_controller = controller;

Expand Down Expand Up @@ -81,7 +84,7 @@ private void DrawWorld(DrawingHandleScreen worldHandle, OverlayDrawArgs args, fl
var distance = (mapPos.Position - args.WorldBounds.Center).Length();

// Should handle fade here too wyci.
if (!args.WorldBounds.Contains(mapPos.Position) || !ExamineSystemShared.InRangeUnOccluded(viewPos, mapPos, distance,
if (!args.WorldBounds.Contains(mapPos.Position) || !_examine.InRangeUnOccluded(viewPos, mapPos, distance,
e => e == popup.InitialPos.EntityId || e == ourEntity, entMan: _entManager))
continue;

Expand Down
3 changes: 3 additions & 0 deletions Content.Client/Popups/PopupSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Linq;
using Content.Shared.Examine;
using Content.Shared.GameTicking;
using Content.Shared.Popups;
using Robust.Client.Graphics;
Expand Down Expand Up @@ -26,6 +27,7 @@ public sealed class PopupSystem : SharedPopupSystem
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IUserInterfaceManager _uiManager = default!;
[Dependency] private readonly IReplayRecordingManager _replayRecording = default!;
[Dependency] private readonly ExamineSystemShared _examine = default!;

public IReadOnlyList<WorldPopupLabel> WorldLabels => _aliveWorldLabels;
public IReadOnlyList<CursorPopupLabel> CursorLabels => _aliveCursorLabels;
Expand All @@ -51,6 +53,7 @@ public override void Initialize()
_prototype,
_uiManager,
_uiManager.GetUIController<PopupUIController>(),
_examine,
this));
}

Expand Down
62 changes: 59 additions & 3 deletions Content.Client/Replay/ContentReplayPlaybackManager.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System.IO.Compression;
using Content.Client.Administration.Managers;
using Content.Client.Launcher;
using Content.Client.MainMenu;
using Content.Client.Replay.Spectator;
using Content.Client.Replay.UI.Loading;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Systems.Chat;
using Content.Shared.Chat;
using Content.Shared.Effects;
Expand All @@ -24,7 +26,13 @@
using Robust.Client.State;
using Robust.Client.Timing;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared;
using Robust.Shared.Configuration;
using Robust.Shared.ContentPack;
using Robust.Shared.Serialization.Markdown.Mapping;
using Robust.Shared.Utility;

namespace Content.Client.Replay;

Expand All @@ -41,6 +49,8 @@ public sealed class ContentReplayPlaybackManager
[Dependency] private readonly IClientAdminManager _adminMan = default!;
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly IBaseClient _client = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IResourceManager _resMan = default!;

/// <summary>
/// UI state to return to when stopping a replay or loading fails.
Expand All @@ -50,6 +60,13 @@ public sealed class ContentReplayPlaybackManager
public bool IsScreenshotMode = false;

private bool _initialized;

/// <summary>
/// Most recently loaded file, for re-attempting the load with error tolerance.
/// Required because the zip reader auto-disposes and I'm too lazy to change it so that
/// <see cref="ReplayFileReaderZip"/> can re-open it.
/// </summary>
public (ResPath? Zip, ResPath Folder)? LastLoad;

public void Initialize()
{
Expand All @@ -73,11 +90,50 @@ private void LoadOverride(IReplayFileReader fileReader)

private void OnFinishedLoading(Exception? exception)
{
if (exception != null)
if (exception == null)
{
LastLoad = null;
return;
}

ReturnToDefaultState();

// Show a popup window with the error message
var text = Loc.GetString("replay-loading-failed", ("reason", exception));
var box = new BoxContainer
{
Orientation = BoxContainer.LayoutOrientation.Vertical,
Children = {new Label {Text = text}}
};

var popup = new DefaultWindow { Title = "Error!" };
popup.Contents.AddChild(box);

// Add button for attempting to re-load the replay while ignoring some errors.
if (!_cfg.GetCVar(CVars.ReplayIgnoreErrors) && LastLoad is {} last)
{
ReturnToDefaultState();
_uiMan.Popup(Loc.GetString("replay-loading-failed", ("reason", exception)));
var button = new Button
{
Text = Loc.GetString("replay-loading-retry"),
StyleClasses = { StyleBase.ButtonCaution }
};

button.OnPressed += _ =>
{
_cfg.SetCVar(CVars.ReplayIgnoreErrors, true);
popup.Dispose();

IReplayFileReader reader = last.Zip == null
? new ReplayFileReaderResources(_resMan, last.Folder)
: new ReplayFileReaderZip(new(_resMan.UserData.OpenRead(last.Zip.Value)), last.Folder);

_loadMan.LoadAndStartReplay(reader);
};

box.AddChild(button);
}

popup.OpenCentered();
}

public void ReturnToDefaultState()
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/StatusIcon/StatusIconOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected override void Draw(in OverlayDrawArgs args)
accOffsetL += texture.Height;
countL++;
}
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) accOffsetL / EyeManager.PixelsPerMeter;
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) (accOffsetL - proto.Offset) / EyeManager.PixelsPerMeter;
xOffset = -(bounds.Width + sprite.Offset.X) / 2f;

}
Expand All @@ -106,7 +106,7 @@ protected override void Draw(in OverlayDrawArgs args)
accOffsetR += texture.Height;
countR++;
}
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) accOffsetR / EyeManager.PixelsPerMeter;
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) (accOffsetR - proto.Offset) / EyeManager.PixelsPerMeter;
xOffset = (bounds.Width + sprite.Offset.X) / 2f - (float) texture.Width / EyeManager.PixelsPerMeter;

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ private void UpdateQueuedSpeechBubbles(FrameEventArgs delta)

var otherPos = EntityManager.GetComponent<TransformComponent>(ent).MapPosition;

if (occluded && !ExamineSystemShared.InRangeUnOccluded(
if (occluded && !_examine.InRangeUnOccluded(
playerPos,
otherPos, 0f,
(ent, player), predicate))
Expand Down
8 changes: 4 additions & 4 deletions Content.Client/Verbs/VerbSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Content.Client.Verbs
public sealed class VerbSystem : SharedVerbSystem
{
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly ExamineSystem _examineSystem = default!;
[Dependency] private readonly ExamineSystem _examine = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
[Dependency] private readonly IStateManager _stateManager = default!;
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
Expand Down Expand Up @@ -77,7 +77,7 @@ public bool TryGetEntityMenuEntities(MapCoordinates targetPos, [NotNullWhen(true
bool Predicate(EntityUid e) => e == player || entitiesUnderMouse.Contains(e);

// first check the general location.
if (!_examineSystem.CanExamine(player.Value, targetPos, Predicate))
if (!_examine.CanExamine(player.Value, targetPos, Predicate))
return false;

TryComp(player.Value, out ExaminerComponent? examiner);
Expand All @@ -86,7 +86,7 @@ public bool TryGetEntityMenuEntities(MapCoordinates targetPos, [NotNullWhen(true
entities = new();
foreach (var ent in _entityLookup.GetEntitiesInRange(targetPos, EntityMenuLookupSize))
{
if (_examineSystem.CanExamine(player.Value, targetPos, Predicate, ent, examiner))
if (_examine.CanExamine(player.Value, targetPos, Predicate, ent, examiner))
entities.Add(ent);
}
}
Expand Down Expand Up @@ -147,7 +147,7 @@ public bool TryGetEntityMenuEntities(MapCoordinates targetPos, [NotNullWhen(true
{
var entity = entities[i];

if (!ExamineSystemShared.InRangeUnOccluded(
if (!_examine.InRangeUnOccluded(
playerPos,
xformQuery.GetComponent(entity).MapPosition,
ExamineSystemShared.ExamineRange,
Expand Down
15 changes: 9 additions & 6 deletions Content.Replay/Menu/ReplayMainMenu.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.IO.Compression;
using System.Linq;
using Content.Client.Message;
using Content.Client.Replay;
using Content.Client.UserInterface.Systems.EscapeMenu;
using Robust.Client;
using Robust.Client.Replays.Loading;
Expand Down Expand Up @@ -31,6 +32,7 @@ public sealed class ReplayMainScreen : State
[Dependency] private readonly IGameController _controllerProxy = default!;
[Dependency] private readonly IClientRobustSerializer _serializer = default!;
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
[Dependency] private readonly ContentReplayPlaybackManager _replayMan = default!;

private ReplayMainMenuControl _mainMenuControl = default!;
private SelectReplayWindow? _selectWindow;
Expand Down Expand Up @@ -207,12 +209,13 @@ private void OnFolderPressed(BaseButton.ButtonEventArgs obj)

private void OnLoadPressed(BaseButton.ButtonEventArgs obj)
{
if (_selected.HasValue)
{
var fileReader = new ReplayFileReaderZip(
new ZipArchive(_resMan.UserData.OpenRead(_selected.Value)), ReplayZipFolder);
_loadMan.LoadAndStartReplay(fileReader);
}
if (!_selected.HasValue)
return;

_replayMan.LastLoad = (_selected.Value, ReplayZipFolder);
var fileReader = new ReplayFileReaderZip(
new ZipArchive(_resMan.UserData.OpenRead(_selected.Value)), ReplayZipFolder);
_loadMan.LoadAndStartReplay(fileReader);
}

private void RefreshReplays()
Expand Down
3 changes: 2 additions & 1 deletion Content.Server/Administration/Systems/AdminVerbSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public sealed partial class AdminVerbSystem : EntitySystem
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly StationSystem _stations = default!;
[Dependency] private readonly StationSpawningSystem _spawning = default!;
[Dependency] private readonly ExamineSystemShared _examine = default!;

private readonly Dictionary<ICommonSession, List<EditSolutionsEui>> _openSolutionUis = new();

Expand Down Expand Up @@ -416,7 +417,7 @@ private void AddDebugVerbs(GetVerbsEvent<Verb> args)
Act = () =>
{

var message = ExamineSystemShared.InRangeUnOccluded(args.User, args.Target)
var message = _examine.InRangeUnOccluded(args.User, args.Target)
? Loc.GetString("in-range-unoccluded-verb-on-activate-not-occluded")
: Loc.GetString("in-range-unoccluded-verb-on-activate-occluded");

Expand Down
Loading
Loading