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 #1507

Merged
merged 40 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
dd6b7b3
Fix sprite alignment (#20975)
daerSeebaer Oct 13, 2023
4c630d0
Radiation collector sprite update (#20956)
chromiumboy Oct 13, 2023
4c4f244
Automatic changelog update
PJBot Oct 13, 2023
d5e5b80
Increase containment field connection duration (#20965)
liltenhead Oct 13, 2023
60f88b1
Decrease AME stability damage (#20963)
liltenhead Oct 13, 2023
0603671
Automatic changelog update
PJBot Oct 13, 2023
516aa1d
Automatic changelog update
PJBot Oct 13, 2023
69995ef
Added missing name (#20979)
chromiumboy Oct 14, 2023
4c92465
add flash and dash sounds to paracusia (#20983)
deltanedas Oct 14, 2023
acb390e
Small Liquid Anomaly Patch (#20967)
TheShuEd Oct 14, 2023
4fb8fa3
update landmine sprites from tg (#20977)
deltanedas Oct 14, 2023
33e5dfb
add igniter (#20962)
deltanedas Oct 14, 2023
65f5703
Automatic changelog update
PJBot Oct 14, 2023
5ecd5f7
Fix hostile simplemob rotation (#20900)
EmoGarbage404 Oct 14, 2023
3a24824
Show total playtime in player list and AHelp window (#20980)
DrSmugleaf Oct 14, 2023
5be0df3
Add admin Erase verb, add checkbox to erase from the ban panel (#20985)
DrSmugleaf Oct 14, 2023
f02a544
Make the panic bunker UI send cvar updates on focus exit, add erase v…
DrSmugleaf Oct 14, 2023
d59dd0d
saltern update (#20986)
deltanedas Oct 14, 2023
8639df7
Add pop sound effect when using the erase admin verb (#20988)
DrSmugleaf Oct 14, 2023
546fa44
Kill `SharedUnoccludedExtensions` (#20914)
mirrorcult Oct 14, 2023
0775ab6
Moves SolutionContainerManagerComponent to Shared. (#20944)
TemporalOroboros Oct 14, 2023
ce76a03
Small ExplosionSystem Cleanup (#20817)
ElectroJr Oct 14, 2023
49a584f
Update comms console description (#20974)
Interrobang01 Oct 14, 2023
9e1ecde
Remove obsolete usages of AnimationPlayerComponent (#20806)
DrSmugleaf Oct 14, 2023
ed15b93
Make starting gear automatically find hands for inhand items (#20861)
DrSmugleaf Oct 14, 2023
5767a59
Automatic changelog update
PJBot Oct 14, 2023
eba6e74
helm explosion resist nerf (#20943)
liltenhead Oct 14, 2023
8555a8e
Automatic changelog update
PJBot Oct 14, 2023
aac17c3
Cleanup more follower leaks (#20902)
metalgearsloth Oct 14, 2023
38387ef
atmos buttons and new jani sign (#20969)
JustCone14 Oct 14, 2023
d2ad017
meta update (#20916)
JoeHammad1844 Oct 14, 2023
abf80c5
Barratry update (#20810)
JoeHammad1844 Oct 14, 2023
873e287
Automatic changelog update
PJBot Oct 14, 2023
8801885
Fix not being able to sort by playtime in the F7 players tab (#21004)
DrSmugleaf Oct 14, 2023
55a9110
Merge remote-tracking branch 'upstream/master' into upstream-sync
Morb0 Oct 15, 2023
3b66b6f
Update radiation collector sprites
Morb0 Oct 15, 2023
183ef00
Update locale
Morb0 Oct 15, 2023
2569e71
Fix locale
Morb0 Oct 15, 2023
65d3934
Fix locale
Morb0 Oct 15, 2023
4fd87f4
Fix yaml
Morb0 Oct 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Content.Client/Administration/UI/BanPanel/BanPanel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<LineEdit Name="HwidLine" MinWidth="100" HorizontalExpand="True" PlaceHolder="{Loc ban-panel-hwid}" ToolTip="{Loc ban-panel-ip-hwid-tooltip}" />
</BoxContainer>
<CheckBox Name="LastConnCheckbox" Margin="2" Text="{Loc ban-panel-last-conn}" Pressed="True" />
<CheckBox Name="EraseCheckbox" Margin="2" Text="{Loc ban-panel-erase}" Pressed="False" />
<BoxContainer Orientation="Horizontal" Margin="2">
<LineEdit Name="TimeLine" MaxWidth="150" MinWidth="70" PlaceHolder="0" />
<OptionButton Name="MultiplierOption" />
Expand All @@ -30,7 +31,7 @@
</BoxContainer>
<BoxContainer Orientation="Horizontal" Margin="4">
<OptionButton Name="TypeOption" />
<Control MinWidth="30"></Control>
<Control MinWidth="30" />
<Label Text="{Loc ban-panel-severity}" />
<OptionButton Name="SeverityOption" />
</BoxContainer>
Expand Down
8 changes: 3 additions & 5 deletions Content.Client/Administration/UI/BanPanel/BanPanel.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System.Globalization;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text.RegularExpressions;
using Content.Client.Administration.UI.CustomControls;
using Content.Client.Stylesheets;
using Content.Shared.Administration;
using Content.Shared.Database;
using Content.Shared.Roles;
Expand All @@ -23,7 +20,7 @@ namespace Content.Client.Administration.UI.BanPanel;
[GenerateTypedNameReferences]
public sealed partial class BanPanel : DefaultWindow
{
public event Action<string?, (IPAddress, int)?, bool, byte[]?, bool, uint, string, NoteSeverity, string[]?>? BanSubmitted;
public event Action<string?, (IPAddress, int)?, bool, byte[]?, bool, uint, string, NoteSeverity, string[]?, bool>? BanSubmitted;
public event Action<string>? PlayerChanged;
private string? PlayerUsername { get; set; }
private (IPAddress, int)? IpAddress { get; set; }
Expand Down Expand Up @@ -441,7 +438,8 @@ private void SubmitButtonOnOnPressed(BaseButton.ButtonEventArgs obj)
var useLastIp = IpCheckbox.Pressed && LastConnCheckbox.Pressed && IpAddress is null;
var useLastHwid = HwidCheckbox.Pressed && LastConnCheckbox.Pressed && Hwid is null;
var severity = (NoteSeverity) SeverityOption.SelectedId;
BanSubmitted?.Invoke(player, IpAddress, useLastIp, Hwid, useLastHwid, (uint) (TimeEntered * Multiplier), reason, severity, roles);
var erase = EraseCheckbox.Pressed;
BanSubmitted?.Invoke(player, IpAddress, useLastIp, Hwid, useLastHwid, (uint) (TimeEntered * Multiplier), reason, severity, roles, erase);
}

protected override void FrameUpdate(FrameEventArgs args)
Expand Down
9 changes: 2 additions & 7 deletions Content.Client/Administration/UI/BanPanel/BanPanelEui.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Content.Client.Eui;
using Content.Shared.Administration;
using Content.Shared.Eui;
Expand All @@ -19,8 +14,8 @@ public BanPanelEui()
{
BanPanel = new BanPanel();
BanPanel.OnClose += () => SendMessage(new CloseEuiMessage());
BanPanel.BanSubmitted += (player, ip, useLastIp, hwid, useLastHwid, minutes, reason, severity, roles)
=> SendMessage(new BanPanelEuiStateMsg.CreateBanRequest(player, ip, useLastIp, hwid, useLastHwid, minutes, reason, severity, roles));
BanPanel.BanSubmitted += (player, ip, useLastIp, hwid, useLastHwid, minutes, reason, severity, roles, erase)
=> SendMessage(new BanPanelEuiStateMsg.CreateBanRequest(player, ip, useLastIp, hwid, useLastHwid, minutes, reason, severity, roles, erase));
BanPanel.PlayerChanged += player => SendMessage(new BanPanelEuiStateMsg.GetPlayerInfoRequest(player));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public BwoinkWindow()
if (sel is not null)
{
Title = $"{sel.CharacterName} / {sel.Username}";

if (sel.OverallPlaytime != null)
{
Title += $" | {Loc.GetString("generic-playtime-title")}: {sel.PlaytimeString}";
}
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,47 @@ public sealed partial class PanicBunkerTab : Control
{
[Dependency] private readonly IConsoleHost _console = default!;

private string _minAccountAge;
private string _minOverallHours;

public PanicBunkerTab()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);

DisableAutomaticallyButton.ToolTip = Loc.GetString("admin-ui-panic-bunker-disable-automatically-tooltip");

MinAccountAge.OnTextEntered += args =>
MinAccountAge.OnTextEntered += args => SendMinAccountAge(args.Text);
MinAccountAge.OnFocusExit += args => SendMinAccountAge(args.Text);
_minAccountAge = MinAccountAge.Text;

MinOverallHours.OnTextEntered += args => SendMinOverallHours(args.Text);
MinOverallHours.OnFocusExit += args => SendMinOverallHours(args.Text);
_minOverallHours = MinOverallHours.Text;
}

private void SendMinAccountAge(string text)
{
if (string.IsNullOrWhiteSpace(text) ||
text == _minAccountAge ||
!int.TryParse(text, out var minutes))
{
if (string.IsNullOrWhiteSpace(args.Text) || !int.TryParse(args.Text, out var minutes))
return;
return;
}

_console.ExecuteCommand($"panicbunker_min_account_age {minutes}");
};
_console.ExecuteCommand($"panicbunker_min_account_age {minutes}");
}

MinOverallHours.OnTextEntered += args =>
private void SendMinOverallHours(string text)
{
if (string.IsNullOrWhiteSpace(text) ||
text == _minOverallHours ||
!int.TryParse(text, out var hours))
{
if (string.IsNullOrWhiteSpace(args.Text) || !int.TryParse(args.Text, out var hours))
return;
return;
}

_console.ExecuteCommand($"panicbunker_min_overall_hours {hours}");
};
_console.ExecuteCommand($"panicbunker_min_overall_hours {hours}");
}

public void UpdateStatus(PanicBunkerStatus status)
Expand All @@ -48,7 +67,11 @@ public void UpdateStatus(PanicBunkerStatus status)
EnableAutomaticallyButton.Pressed = status.EnableWithoutAdmins;
CountDeadminnedButton.Pressed = status.CountDeadminnedAdmins;
ShowReasonButton.Pressed = status.ShowReason;

MinAccountAge.Text = status.MinAccountAgeHours.ToString();
_minAccountAge = MinAccountAge.Text;

MinOverallHours.Text = status.MinOverallHours.ToString();
_minOverallHours = MinOverallHours.Text;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ private void RefreshPlayerList(IReadOnlyList<PlayerInfo> players)
player.StartingJob,
player.Antag ? "YES" : "NO",
new StyleBoxFlat(useAltColor ? _altColor : _defaultColor),
player.Connected);
player.Connected,
player.PlaytimeString);
entry.PlayerEntity = player.NetEntity;
entry.OnPressed += args => OnEntryPressed?.Invoke(args);
entry.ToolTip = Loc.GetString("player-tab-entry-tooltip");
PlayerList.AddChild(entry);

useAltColor ^= true;
Expand All @@ -148,6 +150,7 @@ private int Compare(PlayerInfo x, PlayerInfo y)
Header.Character => Compare(x.CharacterName, y.CharacterName),
Header.Job => Compare(x.StartingJob, y.StartingJob),
Header.Antagonist => x.Antag.CompareTo(y.Antag),
Header.Playtime => Compare(x.PlaytimeString, y.PlaytimeString),
_ => 1
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,9 @@
SizeFlagsStretchRatio="2"
HorizontalExpand="True"
ClipText="True"/>
<Label Name="OverallPlaytimeLabel"
SizeFlagsStretchRatio="2"
HorizontalExpand="True"
ClipText="True"/>
</BoxContainer>
</ContainerButton>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public sealed partial class PlayerTabEntry : ContainerButton
{
public NetEntity? PlayerEntity;

public PlayerTabEntry(string username, string character, string identity, string job, string antagonist, StyleBox styleBox, bool connected)
public PlayerTabEntry(string username, string character, string identity, string job, string antagonist, StyleBox styleBox, bool connected, string overallPlaytime)
{
RobustXamlLoader.Load(this);

Expand All @@ -23,5 +23,6 @@ public PlayerTabEntry(string username, string character, string identity, string
CharacterLabel.Text += $" [{identity}]";
AntagonistLabel.Text = antagonist;
BackgroundColorPanel.PanelOverride = styleBox;
OverallPlaytimeLabel.Text = overallPlaytime;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,11 @@
ClipText="True"
Text="{Loc player-tab-antagonist}"
MouseFilter="Pass"/>
<Label Name="PlaytimeLabel"
SizeFlagsStretchRatio="2"
HorizontalExpand="True"
ClipText="True"
Text="{Loc player-tab-playtime}"
MouseFilter="Pass"/>
</BoxContainer>
</ContainerButton>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public PlayerTabHeader()
CharacterLabel.OnKeyBindDown += CharacterClicked;
JobLabel.OnKeyBindDown += JobClicked;
AntagonistLabel.OnKeyBindDown += AntagonistClicked;
PlaytimeLabel.OnKeyBindDown += PlaytimeClicked;
}

public Label GetHeader(Header header)
Expand All @@ -29,6 +30,7 @@ public Label GetHeader(Header header)
Header.Character => CharacterLabel,
Header.Job => JobLabel,
Header.Antagonist => AntagonistLabel,
Header.Playtime => PlaytimeLabel,
_ => throw new ArgumentOutOfRangeException(nameof(header), header, null)
};
}
Expand All @@ -39,6 +41,7 @@ public void ResetHeaderText()
CharacterLabel.Text = Loc.GetString("player-tab-character");
JobLabel.Text = Loc.GetString("player-tab-job");
AntagonistLabel.Text = Loc.GetString("player-tab-antagonist");
PlaytimeLabel.Text = Loc.GetString("player-tab-playtime");
}

private void HeaderClicked(GUIBoundKeyEventArgs args, Header header)
Expand Down Expand Up @@ -72,16 +75,22 @@ private void AntagonistClicked(GUIBoundKeyEventArgs args)
HeaderClicked(args, Header.Antagonist);
}

private void PlaytimeClicked(GUIBoundKeyEventArgs args)
{
HeaderClicked(args, Header.Playtime);
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);

if (disposing)
{
UsernameLabel.OnKeyBindDown += UsernameClicked;
CharacterLabel.OnKeyBindDown += CharacterClicked;
JobLabel.OnKeyBindDown += JobClicked;
AntagonistLabel.OnKeyBindDown += AntagonistClicked;
UsernameLabel.OnKeyBindDown -= UsernameClicked;
CharacterLabel.OnKeyBindDown -= CharacterClicked;
JobLabel.OnKeyBindDown -= JobClicked;
AntagonistLabel.OnKeyBindDown -= AntagonistClicked;
PlaytimeLabel.OnKeyBindDown -= PlaytimeClicked;
}
}

Expand All @@ -90,6 +99,7 @@ public enum Header
Username,
Character,
Job,
Antagonist
Antagonist,
Playtime
}
}
11 changes: 11 additions & 0 deletions Content.Client/Animations/EntityPickupAnimationComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Content.Client.Animations;

/// <summary>
/// Applied to client-side clone entities to animate them approaching the player that
/// picked up the original entity.
/// </summary>
[RegisterComponent]
[Access(typeof(EntityPickupAnimationSystem))]
public sealed partial class EntityPickupAnimationComponent : Component
{
}
87 changes: 87 additions & 0 deletions Content.Client/Animations/EntityPickupAnimationSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
using System.Numerics;
using Robust.Client.Animations;
using Robust.Client.GameObjects;
using Robust.Shared.Animations;
using Robust.Shared.Map;
using Robust.Shared.Spawners;
using static Robust.Client.Animations.AnimationTrackProperty;

namespace Content.Client.Animations;

/// <summary>
/// System that handles animating an entity that a player has picked up.
/// </summary>
public sealed class EntityPickupAnimationSystem : EntitySystem
{
[Dependency] private readonly AnimationPlayerSystem _animations = default!;
[Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly TransformSystem _transform = default!;

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

SubscribeLocalEvent<EntityPickupAnimationComponent, AnimationCompletedEvent>(OnEntityPickupAnimationCompleted);
}

private void OnEntityPickupAnimationCompleted(EntityUid uid, EntityPickupAnimationComponent component, AnimationCompletedEvent args)
{
Del(uid);
}

/// <summary>
/// Animates a clone of an entity moving from one point to another before
/// being deleted.
/// Used when the player picks up an entity.
/// </summary>
public void AnimateEntityPickup(EntityUid uid, EntityCoordinates initial, Vector2 final, Angle initialAngle)
{
if (Deleted(uid) || !initial.IsValid(EntityManager))
return;

var metadata = MetaData(uid);

if (IsPaused(uid, metadata))
return;

var animatableClone = Spawn("clientsideclone", initial);
EnsureComp<EntityPickupAnimationComponent>(animatableClone);
var val = metadata.EntityName;
_metaData.SetEntityName(animatableClone, val);

if (!TryComp(uid, out SpriteComponent? sprite0))
{
Log.Error("Entity ({0}) couldn't be animated for pickup since it doesn't have a {1}!", metadata.EntityName, nameof(SpriteComponent));
return;
}

var sprite = Comp<SpriteComponent>(animatableClone);
sprite.CopyFrom(sprite0);
sprite.Visible = true;

var animations = Comp<AnimationPlayerComponent>(animatableClone);

var despawn = EnsureComp<TimedDespawnComponent>(animatableClone);
despawn.Lifetime = 0.25f;
_transform.SetLocalRotationNoLerp(animatableClone, initialAngle);

_animations.Play(animatableClone, animations, new Animation
{
Length = TimeSpan.FromMilliseconds(125),
AnimationTracks =
{
new AnimationTrackComponentProperty
{
ComponentType = typeof(TransformComponent),
Property = nameof(TransformComponent.LocalPosition),
InterpolationMode = AnimationInterpolationMode.Linear,
KeyFrames =
{
new KeyFrame(initial.Position, 0),
new KeyFrame(final, 0.125f)
}
},
}
}, "fancy_pickup_anim");
}
}
Loading
Loading