Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…on-14 into upstream

# Conflicts:
#	Content.Server/Preferences/Managers/ServerPreferencesManager.cs
#	Content.Shared/Alert/AlertType.cs
#	Resources/Prototypes/Catalog/Fills/Boxes/syndicate.yml
#	Resources/Prototypes/Catalog/Fills/Crates/engineering.yml
#	Resources/Prototypes/Catalog/Fills/Lockers/engineer.yml
#	Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml
#	Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/bread.yml
#	Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml
#	Resources/Prototypes/Maps/Pools/default.yml
#	Resources/Prototypes/Voice/speech_emote_sounds.yml
#	Resources/ServerInfo/Guidebook/Antagonist/MinorAntagonists.xml
#	Resources/ServerInfo/Guidebook/Antagonist/Nuclear Operatives.xml
#	Resources/ServerInfo/Guidebook/Antagonist/Traitors.xml
#	Resources/Textures/Objects/Weapons/Grenades/modular.rsi/meta.json
#	Resources/migration.yml
  • Loading branch information
Ratyyy committed May 30, 2024
2 parents b5e56c4 + c3b687f commit eeb6993
Show file tree
Hide file tree
Showing 388 changed files with 10,266 additions and 14,169 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
/Content.YAMLLinter @DrSmugleaf
/Content.Shared/Damage/ @DrSmugleaf

/Content.*/Anomaly/ @EmoGarbage404
/Content.*/Anomaly/ @EmoGarbage404 @TheShuEd
/Content.*/Lathe/ @EmoGarbage404
/Content.*/Materials/ @EmoGarbage404
/Content.*/Mech/ @EmoGarbage404
/Content.*/Research/ @EmoGarbage404
/Content.*/Stack/ @EmoGarbage404
/Content.*/Xenoarchaeology/ @EmoGarbage404
/Content.*/Zombies/ @EmoGarbage404
/Resources/Prototypes/Entities/Structures/Specific/anomalies.yml @EmoGarbage404
/Resources/Prototypes/Entities/Structures/Specific/anomalies.yml @EmoGarbage404 @TheShuEd
/Resources/Prototypes/Research/ @EmoGarbage404

/Content.*/Forensics/ @ficcialfaint
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Alerts/ClientAlertsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private void OnPlayerDetached(EntityUid uid, AlertsComponent component, LocalPla
ClearAlerts?.Invoke(this, EventArgs.Empty);
}

public void AlertClicked(AlertType alertType)
public void AlertClicked(ProtoId<AlertPrototype> alertType)
{
RaiseNetworkEvent(new ClickAlertEvent(alertType));
}
Expand Down
39 changes: 25 additions & 14 deletions Content.Client/Atmos/EntitySystems/GasTileOverlaySystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Client.Atmos.Overlays;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Components;
using Content.Shared.Atmos.EntitySystems;
using JetBrains.Annotations;
Expand Down Expand Up @@ -36,28 +37,38 @@ public override void Shutdown()

private void OnHandleState(EntityUid gridUid, GasTileOverlayComponent comp, ref ComponentHandleState args)
{
if (args.Current is not GasTileOverlayState state)
return;
Dictionary<Vector2i, GasOverlayChunk> modifiedChunks;

// is this a delta or full state?
if (!state.FullState)
switch (args.Current)
{
foreach (var index in comp.Chunks.Keys)
// is this a delta or full state?
case GasTileOverlayDeltaState delta:
{
if (!state.AllChunks!.Contains(index))
comp.Chunks.Remove(index);
modifiedChunks = delta.ModifiedChunks;
foreach (var index in comp.Chunks.Keys)
{
if (!delta.AllChunks.Contains(index))
comp.Chunks.Remove(index);
}

break;
}
}
else
{
foreach (var index in comp.Chunks.Keys)
case GasTileOverlayState state:
{
if (!state.Chunks.ContainsKey(index))
comp.Chunks.Remove(index);
modifiedChunks = state.Chunks;
foreach (var index in comp.Chunks.Keys)
{
if (!state.Chunks.ContainsKey(index))
comp.Chunks.Remove(index);
}

break;
}
default:
return;
}

foreach (var (index, data) in state.Chunks)
foreach (var (index, data) in modifiedChunks)
{
comp.Chunks[index] = data;
}
Expand Down
27 changes: 0 additions & 27 deletions Content.Client/Cabinet/ItemCabinetSystem.cs

This file was deleted.

39 changes: 24 additions & 15 deletions Content.Client/Decals/DecalSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,34 +56,43 @@ protected override void OnDecalRemoved(EntityUid gridId, uint decalId, DecalGrid

private void OnHandleState(EntityUid gridUid, DecalGridComponent gridComp, ref ComponentHandleState args)
{
if (args.Current is not DecalGridState state)
return;

// is this a delta or full state?
_removedChunks.Clear();
Dictionary<Vector2i, DecalChunk> modifiedChunks;

if (!state.FullState)
switch (args.Current)
{
foreach (var key in gridComp.ChunkCollection.ChunkCollection.Keys)
case DecalGridDeltaState delta:
{
if (!state.AllChunks!.Contains(key))
_removedChunks.Add(key);
modifiedChunks = delta.ModifiedChunks;
foreach (var key in gridComp.ChunkCollection.ChunkCollection.Keys)
{
if (!delta.AllChunks.Contains(key))
_removedChunks.Add(key);
}

break;
}
}
else
{
foreach (var key in gridComp.ChunkCollection.ChunkCollection.Keys)
case DecalGridState state:
{
if (!state.Chunks.ContainsKey(key))
_removedChunks.Add(key);
modifiedChunks = state.Chunks;
foreach (var key in gridComp.ChunkCollection.ChunkCollection.Keys)
{
if (!state.Chunks.ContainsKey(key))
_removedChunks.Add(key);
}

break;
}
default:
return;
}

if (_removedChunks.Count > 0)
RemoveChunks(gridUid, gridComp, _removedChunks);

if (state.Chunks.Count > 0)
UpdateChunks(gridUid, gridComp, state.Chunks);
if (modifiedChunks.Count > 0)
UpdateChunks(gridUid, gridComp, modifiedChunks);
}

private void OnChunkUpdate(DecalChunkUpdateEvent ev)
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Doors/FirelockSystem.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using Content.Shared.Doors.Components;
using Content.Shared.Doors.Systems;
using Robust.Client.GameObjects;

namespace Content.Client.Doors;

public sealed class FirelockSystem : EntitySystem
public sealed class FirelockSystem : SharedFirelockSystem
{
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;

Expand Down
6 changes: 4 additions & 2 deletions Content.Client/Examine/ExamineSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,10 @@ public void OpenTooltip(EntityUid player, EntityUid target, bool centeredOnCurso

if (knowTarget)
{
var itemName = FormattedMessage.RemoveMarkup(Identity.Name(target, EntityManager, player));
var labelMessage = FormattedMessage.FromMarkup($"[bold]{itemName}[/bold]");
// TODO: FormattedMessage.RemoveMarkupPermissive
// var itemName = FormattedMessage.RemoveMarkupPermissive(Identity.Name(target, EntityManager, player));
var itemName = FormattedMessage.FromMarkupPermissive(Identity.Name(target, EntityManager, player)).ToString();
var labelMessage = FormattedMessage.FromMarkupPermissive($"[bold]{itemName}[/bold]");
var label = new RichTextLabel();
label.SetMessage(labelMessage);
hBox.AddChild(label);
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Gravity/GravitySystem.Shake.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private void OnShakeInit(EntityUid uid, GravityShakeComponent component, Compone
{
var localPlayer = _playerManager.LocalEntity;

if (!TryComp<TransformComponent>(localPlayer, out var xform) ||
if (!TryComp(localPlayer, out TransformComponent? xform) ||
xform.GridUid != uid && xform.MapUid != uid)
{
return;
Expand All @@ -46,7 +46,7 @@ protected override void ShakeGrid(EntityUid uid, GravityComponent? gravity = nul

var localPlayer = _playerManager.LocalEntity;

if (!TryComp<TransformComponent>(localPlayer, out var xform))
if (!TryComp(localPlayer, out TransformComponent? xform))
return;

if (xform.GridUid != uid ||
Expand Down
10 changes: 2 additions & 8 deletions Content.Client/Instruments/UI/InstrumentBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,8 @@ public InstrumentBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, u

protected override void ReceiveMessage(BoundUserInterfaceMessage message)
{
switch (message)
{
case InstrumentBandResponseBuiMessage bandRx:
_bandMenu?.Populate(bandRx.Nearby, EntMan);
break;
default:
break;
}
if (message is InstrumentBandResponseBuiMessage bandRx)
_bandMenu?.Populate(bandRx.Nearby, EntMan);
}

protected override void Open()
Expand Down
22 changes: 2 additions & 20 deletions Content.Client/Interactable/InteractionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,6 @@

namespace Content.Client.Interactable
{
public sealed class InteractionSystem : SharedInteractionSystem
{
[Dependency] private readonly SharedContainerSystem _container = default!;

public override bool CanAccessViaStorage(EntityUid user, EntityUid target)
{
if (!EntityManager.EntityExists(target))
return false;

if (!_container.TryGetContainingContainer(target, out var container))
return false;

if (!HasComp<StorageComponent>(container.Owner))
return false;

// we don't check if the user can access the storage entity itself. This should be handed by the UI system.
// Need to return if UI is open or not
return true;
}
}
// TODO Remove Shared prefix
public sealed class InteractionSystem : SharedInteractionSystem;
}
5 changes: 0 additions & 5 deletions Content.Client/Interaction/DragDropHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ public DragDropHelper(OnBeginDrag onBeginDrag, OnContinueDrag onContinueDrag, On
_cfg.OnValueChanged(CCVars.DragDropDeadZone, SetDeadZone, true);
}

~DragDropHelper()
{
_cfg.UnsubValueChanged(CCVars.DragDropDeadZone, SetDeadZone);
}

/// <summary>
/// Tell the helper that the mouse button was pressed down on
/// a target, thus a drag has the possibility to begin for this target.
Expand Down
5 changes: 3 additions & 2 deletions Content.Client/Lobby/UI/ObserveWarningWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
<BoxContainer Orientation="Vertical">
<Label Text="{Loc 'observe-warning-1'}"/>
<Label Text="{Loc 'observe-warning-2'}"/>
<BoxContainer Orientation="Horizontal" >
<BoxContainer Orientation="Horizontal">
<Button Name="NevermindButton" Text="{Loc 'observe-nevermind'}" SizeFlagsStretchRatio="1"/>
<Control HorizontalExpand="True" SizeFlagsStretchRatio="2" />
<cc:CommandButton Command="observe" Name="ObserveButton" StyleClasses="Caution" Text="{Loc 'observe-confirm'}" SizeFlagsStretchRatio="1"/>
<cc:CommandButton Command="observe" Name="ObserveButton" StyleClasses="Caution" Text="{Loc 'observe-confirm'}" SizeFlagsStretchRatio="1"/>
<cc:CommandButton Command="observe admin" Name="ObserveAsAdminButton" Text="{Loc 'observe-as-admin'}" SizeFlagsStretchRatio="1" Visible="False"/>
</BoxContainer>
</BoxContainer>
</DefaultWindow>
13 changes: 13 additions & 0 deletions Content.Client/Lobby/UI/ObserveWarningWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Content.Shared.Administration.Managers;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.Player;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;

Expand All @@ -9,11 +11,22 @@ namespace Content.Client.Lobby.UI;
[UsedImplicitly]
public sealed partial class ObserveWarningWindow : DefaultWindow
{
[Dependency] private readonly ISharedAdminManager _adminManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;

public ObserveWarningWindow()
{
Title = Loc.GetString("observe-warning-window-title");
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
var player = _playerManager.LocalSession;

if (player != null && _adminManager.IsAdmin(player))
{
ObserveButton.Text = Loc.GetString("observe-as-player");
ObserveAsAdminButton.Visible = true;
ObserveAsAdminButton.OnPressed += _ => { this.Close(); };
}

ObserveButton.OnPressed += _ => { this.Close(); };
NevermindButton.OnPressed += _ => { this.Close(); };
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Maps/GridDraggingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void StopDragging()
{
if (_dragging == null) return;

if (_lastMousePosition != null && TryComp<TransformComponent>(_dragging.Value, out var xform) &&
if (_lastMousePosition != null && TryComp(_dragging.Value, out TransformComponent? xform) &&
TryComp<PhysicsComponent>(_dragging.Value, out var body) &&
xform.MapID == _lastMousePosition.Value.MapId)
{
Expand Down Expand Up @@ -104,7 +104,7 @@ public override void Update(float frameTime)
StartDragging(gridUid, Transform(gridUid).InvWorldMatrix.Transform(mousePos.Position));
}

if (!TryComp<TransformComponent>(_dragging, out var xform))
if (!TryComp(_dragging, out TransformComponent? xform))
{
StopDragging();
return;
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/MassMedia/Ui/ArticleEditorPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private void OnPreview(BaseButton.ButtonEventArgs eventArgs)

TextEditPanel.Visible = !_preview;
PreviewPanel.Visible = _preview;
PreviewLabel.SetMarkup(Rope.Collapse(ContentField.TextRope));
PreviewLabel.SetMarkupPermissive(Rope.Collapse(ContentField.TextRope));
}

private void OnCancel(BaseButton.ButtonEventArgs eventArgs)
Expand Down
18 changes: 18 additions & 0 deletions Content.Client/Message/RichTextLabelExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,27 @@ namespace Content.Client.Message;

public static class RichTextLabelExt
{


/// <summary>
/// Sets the labels markup.
/// </summary>
/// <remarks>
/// Invalid markup will cause exceptions to be thrown. Don't use this for user input!
/// </remarks>
public static RichTextLabel SetMarkup(this RichTextLabel label, string markup)
{
label.SetMessage(FormattedMessage.FromMarkup(markup));
return label;
}

/// <summary>
/// Sets the labels markup.<br/>
/// Uses <c>FormatedMessage.FromMarkupPermissive</c> which treats invalid markup as text.
/// </summary>
public static RichTextLabel SetMarkupPermissive(this RichTextLabel label, string markup)
{
label.SetMessage(FormattedMessage.FromMarkupPermissive(markup));
return label;
}
}
Loading

0 comments on commit eeb6993

Please sign in to comment.