Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/wizards/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	Content.Server/Preferences/Managers/ServerPreferencesManager.cs
#	Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs
#	Content.Shared/Alert/AlertType.cs
#	Content.Shared/Preferences/Loadouts/RoleLoadout.cs
#	Resources/ServerInfo/Guidebook/Antagonist/MinorAntagonists.xml
#	Resources/ServerInfo/Guidebook/Antagonist/Nuclear Operatives.xml
#	Resources/ServerInfo/Guidebook/Antagonist/Revolutionaries.xml
#	Resources/ServerInfo/Guidebook/Antagonist/SpaceNinja.xml
#	Resources/ServerInfo/Guidebook/Antagonist/Traitors.xml
#	Resources/Textures/Objects/Weapons/Grenades/modular.rsi/meta.json
  • Loading branch information
VigersRay committed May 29, 2024
2 parents 08c4f1d + a90cb25 commit e4d1971
Show file tree
Hide file tree
Showing 308 changed files with 4,837 additions and 9,266 deletions.
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
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
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
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;
}
}
41 changes: 23 additions & 18 deletions Content.Client/Movement/Systems/FloorOcclusionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,56 @@ public sealed class FloorOcclusionSystem : SharedFloorOcclusionSystem
{
[Dependency] private readonly IPrototypeManager _proto = default!;

private EntityQuery<SpriteComponent> _spriteQuery;

public override void Initialize()
{
base.Initialize();

_spriteQuery = GetEntityQuery<SpriteComponent>();

SubscribeLocalEvent<FloorOcclusionComponent, ComponentStartup>(OnOcclusionStartup);
SubscribeLocalEvent<FloorOcclusionComponent, ComponentShutdown>(OnOcclusionShutdown);
SubscribeLocalEvent<FloorOcclusionComponent, AfterAutoHandleStateEvent>(OnOcclusionAuto);
}

private void OnOcclusionAuto(EntityUid uid, FloorOcclusionComponent component, ref AfterAutoHandleStateEvent args)
private void OnOcclusionAuto(Entity<FloorOcclusionComponent> ent, ref AfterAutoHandleStateEvent args)
{
SetEnabled(uid, component, component.Enabled);
SetShader(ent.Owner, ent.Comp.Enabled);
}

private void OnOcclusionStartup(EntityUid uid, FloorOcclusionComponent component, ComponentStartup args)
private void OnOcclusionStartup(Entity<FloorOcclusionComponent> ent, ref ComponentStartup args)
{
if (component.Enabled && TryComp<SpriteComponent>(uid, out var sprite))
SetShader(sprite, true);
SetShader(ent.Owner, ent.Comp.Enabled);
}

protected override void SetEnabled(EntityUid uid, FloorOcclusionComponent component, bool enabled)
private void OnOcclusionShutdown(Entity<FloorOcclusionComponent> ent, ref ComponentShutdown args)
{
if (component.Enabled == enabled)
return;

base.SetEnabled(uid, component, enabled);

if (!TryComp<SpriteComponent>(uid, out var sprite))
return;
SetShader(ent.Owner, false);
}

SetShader(sprite, enabled);
protected override void SetEnabled(Entity<FloorOcclusionComponent> entity)
{
SetShader(entity.Owner, entity.Comp.Enabled);
}

private void SetShader(SpriteComponent sprite, bool enabled)
private void SetShader(Entity<SpriteComponent?> sprite, bool enabled)
{
if (!_spriteQuery.Resolve(sprite.Owner, ref sprite.Comp, false))
return;

var shader = _proto.Index<ShaderPrototype>("HorizontalCut").Instance();

if (sprite.PostShader is not null && sprite.PostShader != shader)
if (sprite.Comp.PostShader is not null && sprite.Comp.PostShader != shader)
return;

if (enabled)
{
sprite.PostShader = shader;
sprite.Comp.PostShader = shader;
}
else
{
sprite.PostShader = null;
sprite.Comp.PostShader = null;
}
}
}
1 change: 0 additions & 1 deletion Content.Client/Options/UI/OptionsMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
<tabs:GraphicsTab Name="GraphicsTab" />
<tabs:KeyRebindTab Name="KeyRebindTab" />
<tabs:AudioTab Name="AudioTab" />
<tabs:NetworkTab Name="NetworkTab" />
</TabContainer>
</DefaultWindow>
1 change: 0 additions & 1 deletion Content.Client/Options/UI/OptionsMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public OptionsMenu()
Tabs.SetTabTitle(1, Loc.GetString("ui-options-tab-graphics"));
Tabs.SetTabTitle(2, Loc.GetString("ui-options-tab-controls"));
Tabs.SetTabTitle(3, Loc.GetString("ui-options-tab-audio"));
Tabs.SetTabTitle(4, Loc.GetString("ui-options-tab-network"));

UpdateTabs();
}
Expand Down
Loading

0 comments on commit e4d1971

Please sign in to comment.