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

Merged
merged 94 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
e0f3bf0
User accessible playtime (#21242)
Titian3 Oct 28, 2023
3319774
Automatic changelog update
PJBot Oct 28, 2023
17f3fc1
Moves cloning comp & cloning event to shared (#21253)
keronshb Oct 28, 2023
b223e7d
Generalizes solution overflow & slightly increases space lube yield (…
TemporalOroboros Oct 28, 2023
1b86ecf
Automatic changelog update
PJBot Oct 28, 2023
f308adf
Move ActorComponent to shared (#21293)
ElectroJr Oct 28, 2023
f3c84b9
Update engine to v174.0.0 (#21311)
ElectroJr Oct 28, 2023
e792475
Fix planet command help message (#21312)
ElectroJr Oct 29, 2023
d08a9e2
Wearable bee plush (#20623)
UbaserB Oct 29, 2023
44558f0
Automatic changelog update
PJBot Oct 29, 2023
cd280ee
remove pulse rifle from ert medic (#21310)
QuietlyWhisper Oct 29, 2023
9b1b3e0
Content audio (#20862)
metalgearsloth Oct 29, 2023
073c8c1
Automatic changelog update
PJBot Oct 29, 2023
4f6ea2a
Update submodule to 175.0.0 (#21318)
metalgearsloth Oct 29, 2023
5b8f3c4
Revert "Update submodule to 175.0.0 (#21318)" (#21319)
metalgearsloth Oct 29, 2023
f2bc0ff
Atomic bomb add uranium (#21143)
kerisargit Oct 29, 2023
6e49331
Action bugfixes (#21321)
ElectroJr Oct 29, 2023
5466a9b
Disable OOC during round (#21323)
Titian3 Oct 29, 2023
d696793
Fix PDA notifications when creating a news entry using the Mass-Media…
Simyon264 Oct 29, 2023
24dc5b6
Automatic changelog update
PJBot Oct 29, 2023
b5c21bc
Update belt.yml (#21317)
Sifb26 Oct 29, 2023
00523b5
New foam sprites (edge sprites) (#21308)
brainfood1183 Oct 29, 2023
a6448cb
Fix bola stam damage, bring back old construction requirements (#21340)
misandrie Oct 29, 2023
9734ead
Automatic changelog update
PJBot Oct 29, 2023
014d3a3
Added thermal insulation to flannel jackets (#21273)
nmajask Oct 30, 2023
5349f32
Automatic changelog update
PJBot Oct 30, 2023
e22d3a4
Space Asshole Gear (#21243)
Psychpsyo Oct 30, 2023
6eebda7
Fix broken slot highlight in midnight theme. (#21331)
EmoGarbage404 Oct 30, 2023
d0e2672
Update Patrons.yml (#21344)
DrSmugleaf Oct 30, 2023
b3b0d0c
Thicken thindow bounds (#21280)
metalgearsloth Oct 30, 2023
d6d0312
Automatic changelog update
PJBot Oct 30, 2023
1a45c32
1984 mouse AI (#21353)
VasilisThePikachu Oct 31, 2023
98420b5
Automatic changelog update
PJBot Oct 31, 2023
e1440cb
Pumpkins, jack o' lanterns and pumpkin hat resprite (#21176)
Doru991 Oct 31, 2023
1659a14
Update ground_lighting.yml (#21350)
TheShuEd Oct 31, 2023
01d57a0
fix fireaxe swing (#21346)
notquitehadouken Oct 31, 2023
b6bd029
Automatic changelog update
PJBot Oct 31, 2023
4f81a56
Enable skeletons temporarily for Halloween (#21356)
EmoGarbage404 Oct 31, 2023
2c5ea97
Automatic changelog update
PJBot Oct 31, 2023
0c329ed
Storage Standardization [Take 2] (#21270)
EmoGarbage404 Oct 31, 2023
4ebc688
Automatic changelog update
PJBot Oct 31, 2023
a302775
Pea Plants (#20504)
ZeroDayDaemon Oct 31, 2023
89df430
Automatic changelog update
PJBot Oct 31, 2023
a05ef80
fix smoke not transferring (#21332)
EmoGarbage404 Oct 31, 2023
bb4bb50
Automatic changelog update
PJBot Oct 31, 2023
1a9f3bc
Fix the organtype (#21347)
LankLTE Oct 31, 2023
4ca06ee
Automatic changelog update
PJBot Oct 31, 2023
77db8b1
mindshield implants (#21269)
brainfood1183 Oct 31, 2023
74f1098
Candy Bucket for Halloween (#21257)
Bixkitts Oct 31, 2023
49f0b20
make bloodred large size (#21362)
deltanedas Oct 31, 2023
1c604a4
Cockroach + Glockroach Admeme + Mothroach (#19752)
potato1234x Oct 31, 2023
672969b
Automatic changelog update
PJBot Oct 31, 2023
6a18bdc
Soapy Water & Edible Soap (#20364)
Psychpsyo Oct 31, 2023
31d9956
Automatic changelog update
PJBot Oct 31, 2023
15fc7b1
blue blood now requires copper instead of iron to cure bloodloss (#20…
brainfood1183 Oct 31, 2023
3b10c88
Command Styled QM Card (#21368)
Nairodian Oct 31, 2023
b806722
Automatic changelog update
PJBot Oct 31, 2023
3a4c40c
Validate PresetIdCardComponent.JobName prototype ids (#21361)
DrSmugleaf Oct 31, 2023
96ff529
Anomaly Cores (#21306)
TheShuEd Oct 31, 2023
f85ca70
Automatic changelog update
PJBot Oct 31, 2023
e1e3eba
Getting turned to a rev makes the rev antag sound (#21316)
VasilisThePikachu Nov 1, 2023
e134a53
Automatic changelog update
PJBot Nov 1, 2023
222c025
Revert "Enable skeletons temporarily for Halloween (#21356)" (#21385)
Titian3 Nov 1, 2023
2b903ed
Automatic changelog update
PJBot Nov 1, 2023
9e7cac2
Fix tests fail (#21384)
MilenVolf Nov 1, 2023
85f09ca
More Storage Rebalancing (#21373)
EmoGarbage404 Nov 1, 2023
9374e2b
Automatic changelog update
PJBot Nov 1, 2023
aa0c3b6
Mark all tests that restart rounds as dirty (#21376)
DrSmugleaf Nov 2, 2023
2d58d19
Make all prototype types partial (#21374)
DrSmugleaf Nov 2, 2023
751ffdc
Return the nukie hypo (#21391)
liltenhead Nov 2, 2023
0392217
Automatic changelog update
PJBot Nov 2, 2023
1961445
Makes thieving gloves sneakier (#21398)
TemporalOroboros Nov 3, 2023
8ee0a96
Automatic changelog update
PJBot Nov 3, 2023
675bcd5
Fix negative tank pressure (#21401)
themias Nov 3, 2023
973380b
Automatic changelog update
PJBot Nov 3, 2023
268bd10
buff bag of holding (#21411)
deltanedas Nov 3, 2023
7e8d042
Automatic changelog update
PJBot Nov 3, 2023
a68b1d2
fixed rat kebab parents (#21409)
Tunguso4ka Nov 3, 2023
598b3c9
Automatic changelog update
PJBot Nov 3, 2023
f1c9935
Makes a syndicate chemvend so they dont have to hack it on nukie plan…
IProduceWidgets Nov 3, 2023
c7f74f7
fish petting (#21412)
deltanedas Nov 3, 2023
188cbba
Fix roaches weight to match new system (#21414)
Fromoriss Nov 3, 2023
6e90eef
Security Chunk Salvage (#21403)
Blackern5000 Nov 3, 2023
a90d624
Fix rotation on Moth Head (Moonfly) marking (#21417)
photonicDog Nov 3, 2023
d218fa3
Automatic changelog update
PJBot Nov 3, 2023
3a788dd
Mind Action Container (#21336)
keronshb Nov 3, 2023
a96563c
fix anomaly core size (#21418)
EmoGarbage404 Nov 4, 2023
5a5e39f
Added a penguin plushie! (#21097)
Piras314 Nov 4, 2023
6be2ef0
Fixes A Anomaly Core Description Typo (#21424)
PursuitInAshes Nov 4, 2023
aa713ea
Candles (#21087)
TheShuEd Nov 4, 2023
5a3476f
Automatic changelog update
PJBot Nov 4, 2023
259233a
Merge remote-tracking branch 'upstream/master' into upstream-sync
Morb0 Nov 4, 2023
bc40fdd
Fix IAA item sizes
Morb0 Nov 4, 2023
a64291b
Update locale
Morb0 Nov 4, 2023
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
  •  
  •  
  •  
1 change: 1 addition & 0 deletions Content.Client/Actions/ActionsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ private void BaseHandleState<T>(EntityUid uid, BaseActionComponent component, Ba
component.ClientExclusive = state.ClientExclusive;
component.Priority = state.Priority;
component.AttachedEntity = EnsureEntity<T>(state.AttachedEntity, uid);
component.RaiseOnUser = state.RaiseOnUser;
component.AutoPopulate = state.AutoPopulate;
component.Temporary = state.Temporary;
component.ItemIconStyle = state.ItemIconStyle;
Expand Down
31 changes: 23 additions & 8 deletions Content.Client/DoAfter/DoAfterOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Robust.Client.Graphics;
using Robust.Shared.Enums;
using Robust.Shared.Graphics;
using Robust.Client.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
Expand All @@ -14,6 +15,7 @@ public sealed class DoAfterOverlay : Overlay
{
private readonly IEntityManager _entManager;
private readonly IGameTiming _timing;
private readonly IPlayerManager _player;
private readonly SharedTransformSystem _transform;
private readonly MetaDataSystem _meta;

Expand All @@ -31,13 +33,14 @@ public sealed class DoAfterOverlay : Overlay

public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV;

public DoAfterOverlay(IEntityManager entManager, IPrototypeManager protoManager, IGameTiming timing)
public DoAfterOverlay(IEntityManager entManager, IPrototypeManager protoManager, IGameTiming timing, IPlayerManager player)
{
_entManager = entManager;
_timing = timing;
_player = player;
_transform = _entManager.EntitySysManager.GetEntitySystem<SharedTransformSystem>();
_meta = _entManager.EntitySysManager.GetEntitySystem<MetaDataSystem>();
var sprite = new SpriteSpecifier.Rsi(new ("/Textures/Interface/Misc/progress_bar.rsi"), "icon");
var sprite = new SpriteSpecifier.Rsi(new("/Textures/Interface/Misc/progress_bar.rsi"), "icon");
_barTexture = _entManager.EntitySysManager.GetEntitySystem<SpriteSystem>().Frame0(sprite);

_shader = protoManager.Index<ShaderPrototype>("unshaded").Instance();
Expand All @@ -58,6 +61,7 @@ protected override void Draw(in OverlayDrawArgs args)
var curTime = _timing.CurTime;

var bounds = args.WorldAABB.Enlarged(5f);
var localEnt = _player.LocalSession?.AttachedEntity;

var metaQuery = _entManager.GetEntityQuery<MetaDataComponent>();
var enumerator = _entManager.AllEntityQueryEnumerator<ActiveDoAfterComponent, DoAfterComponent, SpriteComponent, TransformComponent>();
Expand Down Expand Up @@ -88,6 +92,17 @@ protected override void Draw(in OverlayDrawArgs args)

foreach (var doAfter in comp.DoAfters.Values)
{
// Hide some DoAfters from other players for stealthy actions (ie: thieving gloves)
var alpha = 1f;
if (doAfter.Args.Hidden)
{
if (uid != localEnt)
continue;

// Hints to the local player that this do-after is not visible to other players.
alpha = 0.5f;
}

// Use the sprite itself if we know its bounds. This means short or tall sprites don't get overlapped
// by the bar.
float yOffset = sprite.Bounds.Height / 2f + 0.05f;
Expand All @@ -108,15 +123,15 @@ protected override void Draw(in OverlayDrawArgs args)
{
var elapsed = doAfter.CancelledTime.Value - doAfter.StartTime;
elapsedRatio = (float) Math.Min(1, elapsed.TotalSeconds / doAfter.Args.Delay.TotalSeconds);
var cancelElapsed = (time - doAfter.CancelledTime.Value).TotalSeconds;
var cancelElapsed = (time - doAfter.CancelledTime.Value).TotalSeconds;
var flash = Math.Floor(cancelElapsed / FlashTime) % 2 == 0;
color = new Color(1f, 0f, 0f, flash ? 1f : 0f);
color = new Color(1f, 0f, 0f, flash ? alpha : 0f);
}
else
{
var elapsed = time - doAfter.StartTime;
elapsedRatio = (float) Math.Min(1, elapsed.TotalSeconds / doAfter.Args.Delay.TotalSeconds);
color = GetProgressColor(elapsedRatio);
color = GetProgressColor(elapsedRatio, alpha);
}

var xProgress = (EndX - StartX) * elapsedRatio + StartX;
Expand All @@ -131,14 +146,14 @@ protected override void Draw(in OverlayDrawArgs args)
handle.SetTransform(Matrix3.Identity);
}

public static Color GetProgressColor(float progress)
public static Color GetProgressColor(float progress, float alpha = 1f)
{
if (progress >= 1.0f)
{
return new Color(0f, 1f, 0f);
return new Color(0f, 1f, 0f, alpha);
}
// lerp
var hue = (5f / 18f) * progress;
return Color.FromHsv((hue, 1f, 0.75f, 1f));
return Color.FromHsv((hue, 1f, 0.75f, alpha));
}
}
2 changes: 1 addition & 1 deletion Content.Client/DoAfter/DoAfterSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public sealed class DoAfterSystem : SharedDoAfterSystem
public override void Initialize()
{
base.Initialize();
_overlay.AddOverlay(new DoAfterOverlay(EntityManager, _prototype, GameTiming));
_overlay.AddOverlay(new DoAfterOverlay(EntityManager, _prototype, GameTiming, _player));
}

public override void Shutdown()
Expand Down
39 changes: 39 additions & 0 deletions Content.Client/Info/PlaytimeStats/PlaytimeStatsEntry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.Info.PlaytimeStats;

[GenerateTypedNameReferences]
public sealed partial class PlaytimeStatsEntry : ContainerButton
{
public TimeSpan Playtime { get; private set; } // new TimeSpan property

public PlaytimeStatsEntry(string role, TimeSpan playtime, StyleBox styleBox)
{
RobustXamlLoader.Load(this);

RoleLabel.Text = role;
Playtime = playtime; // store the TimeSpan value directly
PlaytimeLabel.Text = ConvertTimeSpanToHoursMinutes(playtime); // convert to string for display
BackgroundColorPanel.PanelOverride = styleBox;
}

private static string ConvertTimeSpanToHoursMinutes(TimeSpan timeSpan)
{
var hours = (int)timeSpan.TotalHours;
var minutes = timeSpan.Minutes;

var formattedTimeLoc = Loc.GetString("ui-playtime-time-format", ("hours", hours), ("minutes", minutes));
return formattedTimeLoc;
}

public void UpdateShading(StyleBoxFlat styleBox)
{
BackgroundColorPanel.PanelOverride = styleBox;
}
public string? PlaytimeText => PlaytimeLabel.Text;

public string? RoleText => RoleLabel.Text;
}
20 changes: 20 additions & 0 deletions Content.Client/Info/PlaytimeStats/PlaytimeStatsEntry.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<ContainerButton xmlns="https://spacestation14.io"
xmlns:customControls1="clr-namespace:Content.Client.Administration.UI.CustomControls"
EnableAllKeybinds="True">
<PanelContainer Name="BackgroundColorPanel"/>
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
SeparationOverride="4">
<Label Name="RoleLabel"
SizeFlagsStretchRatio="3"
HorizontalExpand="True"
ClipText="True"
Margin="5,5,5,5"/>
<customControls1:VSeparator/>
<Label Name="PlaytimeLabel"
SizeFlagsStretchRatio="3"
HorizontalExpand="True"
ClipText="True"
Margin="5,5,5,5"/>
</BoxContainer>
</ContainerButton>
86 changes: 86 additions & 0 deletions Content.Client/Info/PlaytimeStats/PlaytimeStatsHeader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Input;

namespace Content.Client.Info.PlaytimeStats;

[GenerateTypedNameReferences]
public sealed partial class PlaytimeStatsHeader : ContainerButton
{
public event Action<Header, SortDirection>? OnHeaderClicked;
private SortDirection _roleDirection = SortDirection.Ascending;
private SortDirection _playtimeDirection = SortDirection.Descending;

public PlaytimeStatsHeader()
{
RobustXamlLoader.Load(this);

RoleLabel.OnKeyBindDown += RoleClicked;
PlaytimeLabel.OnKeyBindDown += PlaytimeClicked;

UpdateLabels();
}

public enum Header : byte
{
Role,
Playtime
}
public enum SortDirection : byte
{
Ascending,
Descending
}

private void HeaderClicked(GUIBoundKeyEventArgs args, Header header)
{
if (args.Function != EngineKeyFunctions.UIClick)
{
return;
}

switch (header)
{
case Header.Role:
_roleDirection = _roleDirection == SortDirection.Ascending ? SortDirection.Descending : SortDirection.Ascending;
break;
case Header.Playtime:
_playtimeDirection = _playtimeDirection == SortDirection.Ascending ? SortDirection.Descending : SortDirection.Ascending;
break;
}

UpdateLabels();
OnHeaderClicked?.Invoke(header, header == Header.Role ? _roleDirection : _playtimeDirection);
args.Handle();
}
private void UpdateLabels()
{
RoleLabel.Text = Loc.GetString("ui-playtime-header-role-type") +
(_roleDirection == SortDirection.Ascending ? " ↓" : " ↑");
PlaytimeLabel.Text = Loc.GetString("ui-playtime-header-role-time") +
(_playtimeDirection == SortDirection.Ascending ? " ↓" : " ↑");
}

private void RoleClicked(GUIBoundKeyEventArgs args)
{
HeaderClicked(args, Header.Role);
}

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

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

if (disposing)
{
RoleLabel.OnKeyBindDown -= RoleClicked;
PlaytimeLabel.OnKeyBindDown -= PlaytimeClicked;
}
}
}
29 changes: 29 additions & 0 deletions Content.Client/Info/PlaytimeStats/PlaytimeStatsHeader.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<ContainerButton xmlns="https://spacestation14.io"
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
EnableAllKeybinds="True">
<PanelContainer Name="BackgroundColorPlaytimePanel" Access="Public"/>
<BoxContainer Orientation="Vertical"
HorizontalExpand="True">
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
SeparationOverride="4">
<Label Name="RoleLabel"
SizeFlagsStretchRatio="3"
HorizontalExpand="True"
ClipText="True"
Text="{Loc ui-playtime-header-role-type}"
MouseFilter="Pass"
Margin="5,5,5,5"/>
<customControls:VSeparator/>
<Label Name="PlaytimeLabel"
SizeFlagsStretchRatio="3"
HorizontalExpand="True"
ClipText="True"
Text="{Loc ui-playtime-header-role-time}"
MouseFilter="Pass"
Margin="5,5,5,5"/>
</BoxContainer>
<!-- Horizontal Separator -->
<customControls:HSeparator/>
</BoxContainer>
</ContainerButton>
Loading
Loading