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

Early merge #878

Merged
merged 41 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
66897dc
Add bio reactions (#25366)
genderGeometries Feb 19, 2024
6d4d986
Automatic changelog update
PJBot Feb 19, 2024
06e8a64
Increase printing price for neck clothes (#25375)
hiucko Feb 19, 2024
aea748d
add icons for drinks in Solar's (#25301)
azurerosegarden Feb 19, 2024
d64d41a
Automatic changelog update
PJBot Feb 19, 2024
903eb06
Small Nymph Changes (#25363)
LankLTE Feb 19, 2024
4698a45
Automatic changelog update
PJBot Feb 19, 2024
4e7dc01
Bump nixpkgs rev (#25361)
yathxyz Feb 19, 2024
7e066f0
Adds guidebooks to the 4 learner roles (#25388)
PotentiallyTom Feb 19, 2024
7149a63
Automatic changelog update
PJBot Feb 19, 2024
292b92c
Add support for metamorphic fill levels (#25022)
Tayrtahn Feb 19, 2024
d5c65dd
Vending UI facelift (#25377)
jamessimo Feb 19, 2024
66c3a65
Automatic changelog update
PJBot Feb 19, 2024
4bb5cbe
Make metamorphic glasses use last solution's empty sprite (#25322)
Tayrtahn Feb 19, 2024
cd5ae0a
Moths can eat plushies (#25382)
marboww Feb 19, 2024
a59323a
Automatic changelog update
PJBot Feb 19, 2024
581cb93
Make pills colorful and labeled (#25284)
veprolet Feb 19, 2024
da32d06
Add Flammable Touch Reaction for liquid tritium (#25281)
ArchPigeon Feb 19, 2024
30fbda4
randomized sexless species now have epicene gender by default (#25282)
Dutch-VanDerLinde Feb 19, 2024
cfb035f
Automatic changelog update
PJBot Feb 19, 2024
9df7cb3
Mechanized treatment improvements (#25356)
Mangohydra Feb 19, 2024
f1bacc3
Hotfix: Set round end information for replays back to null on round s…
VasilisThePikachu Feb 20, 2024
585c34e
Fix action state handling bug (#25395)
ElectroJr Feb 20, 2024
21a1a2b
Automatic changelog update
PJBot Feb 20, 2024
837272c
Fix admin notes and database time nonsense. (#25280)
PJB3005 Feb 20, 2024
28d18c0
PlayerListControl fixes. (#25248)
PJB3005 Feb 20, 2024
73415d5
Automatic changelog update
PJBot Feb 20, 2024
cf303a9
Ore crab structural weakness (#25390)
Tonydatguy Feb 20, 2024
7832d67
Automatic changelog update
PJBot Feb 20, 2024
1275031
Set nav map icon textures to use bilinear filtering (#25411)
PJB3005 Feb 20, 2024
2333da8
Fix PlayerListControl re-raising selection changed when repopulated. …
PJB3005 Feb 20, 2024
c2995bb
Train station (#24927)
TheShuEd Feb 20, 2024
cd1b5f0
Mindshield outline flashes, (#25409)
Golinth Feb 20, 2024
4a9f619
Automatic changelog update
PJBot Feb 20, 2024
ce116fc
Small Artifact Fixes (#25416)
Deeeeja Feb 20, 2024
0c95a1d
Add roundid to replay_final.yml (#25398)
VasilisThePikachu Feb 20, 2024
39a7741
Resprite & hand position correction of Nettle & Death Nettle (#25421)
MjrLandWhale Feb 20, 2024
57de0fb
Automatic changelog update
PJBot Feb 20, 2024
c05ea5a
balance Explosive Technology (#25397)
takemysoult Feb 21, 2024
a11ac77
Automatic changelog update
PJBot Feb 21, 2024
fc6e184
Duplicate
DebugOk Feb 21, 2024
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
4 changes: 2 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8="
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
fi
use flake
7 changes: 4 additions & 3 deletions Content.Client/Actions/ActionsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ private void OnWorldTargetHandleState(EntityUid uid, WorldTargetActionComponent

private void BaseHandleState<T>(EntityUid uid, BaseActionComponent component, BaseActionComponentState state) where T : BaseActionComponent
{
// TODO ACTIONS use auto comp states
component.Icon = state.Icon;
component.IconOn = state.IconOn;
component.IconColor = state.IconColor;
component.Keywords = new HashSet<string>(state.Keywords);
component.Keywords.Clear();
component.Keywords.UnionWith(state.Keywords);
component.Enabled = state.Enabled;
component.Toggled = state.Toggled;
component.Cooldown = state.Cooldown;
Expand All @@ -102,8 +104,7 @@ private void BaseHandleState<T>(EntityUid uid, BaseActionComponent component, Ba
component.ItemIconStyle = state.ItemIconStyle;
component.Sound = state.Sound;

if (_playerManager.LocalEntity == component.AttachedEntity)
ActionsUpdated?.Invoke();
UpdateAction(uid, component);
}

protected override void UpdateAction(EntityUid? actionId, BaseActionComponent? action = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public sealed partial class PlayerListControl : BoxContainer
private IEntityManager _entManager;
private IUserInterfaceManager _uiManager;

private PlayerInfo? _selectedPlayer;

public PlayerListControl()
{
_entManager = IoCManager.Resolve<IEntityManager>();
Expand All @@ -50,10 +52,14 @@ private void PlayerListItemPressed(BaseButton.ButtonEventArgs? args, ListData? d
if (args == null || data is not PlayerListData {Info: var selectedPlayer})
return;

if (selectedPlayer == _selectedPlayer)
return;

if (args.Event.Function != EngineKeyFunctions.UIClick)
return;

OnSelectionChanged?.Invoke(selectedPlayer);
_selectedPlayer = selectedPlayer;

// update label text. Only required if there is some override (e.g. unread bwoink count).
if (OverrideText != null && args.Button.Children.FirstOrDefault()?.Children?.FirstOrDefault() is Label label)
Expand Down Expand Up @@ -95,13 +101,18 @@ private void FilterList()
_sortedPlayerList.Sort((a, b) => Comparison(a, b));

PlayerListContainer.PopulateList(_sortedPlayerList.Select(info => new PlayerListData(info)).ToList());
if (_selectedPlayer != null)
PlayerListContainer.Select(new PlayerListData(_selectedPlayer));
}

public void PopulateList(IReadOnlyList<PlayerInfo>? players = null)
{
players ??= _adminSystem.PlayerList;

_playerList = players.ToList();
if (_selectedPlayer != null && !_playerList.Contains(_selectedPlayer))
_selectedPlayer = null;

FilterList();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private void Refresh()
SeverityRect.Texture = _sprites.Frame0(new SpriteSpecifier.Texture(new ResPath(iconPath)));
}

TimeLabel.Text = Note.CreatedAt.ToString("yyyy-MM-dd HH:mm:ss");
TimeLabel.Text = Note.CreatedAt.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
ServerLabel.Text = Note.ServerName ?? "Unknown";
RoundLabel.Text = Note.Round == null ? "Unknown round" : "Round " + Note.Round;
AdminLabel.Text = Note.CreatedByName;
Expand All @@ -91,7 +91,7 @@ private void Refresh()
if (Note.ExpiryTime.Value > DateTime.UtcNow)
{
ExpiresLabel.Text = Loc.GetString("admin-note-editor-expiry-label-params",
("date", Note.ExpiryTime.Value.ToString("yyyy-MM-dd HH:mm:ss")),
("date", Note.ExpiryTime.Value.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")),
("expiresIn", (Note.ExpiryTime.Value - DateTime.UtcNow).ToString("d'd 'hh':'mm")));
ExpiresLabel.Modulate = Color.FromHex("#86DC3D");
}
Expand All @@ -104,7 +104,7 @@ private void Refresh()

if (Note.LastEditedAt > Note.CreatedAt)
{
EditedLabel.Text = Loc.GetString("admin-notes-edited", ("author", Note.EditedByName), ("date", Note.LastEditedAt));
EditedLabel.Text = Loc.GetString("admin-notes-edited", ("author", Note.EditedByName), ("date", Note.LastEditedAt.Value.ToLocalTime()));
EditedLabel.Visible = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ public AdminNotesLinePopup(SharedAdminNote note, string playerName, bool showDel
? Loc.GetString("admin-notes-round-id-unknown")
: Loc.GetString("admin-notes-round-id", ("id", note.Round));
CreatedByLabel.Text = Loc.GetString("admin-notes-created-by", ("author", note.CreatedByName));
CreatedAtLabel.Text = Loc.GetString("admin-notes-created-at", ("date", note.CreatedAt.ToString("yyyy-MM-dd HH:mm:ss")));
CreatedAtLabel.Text = Loc.GetString("admin-notes-created-at", ("date", note.CreatedAt.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")));
EditedByLabel.Text = Loc.GetString("admin-notes-last-edited-by", ("author", note.EditedByName));
EditedAtLabel.Text = Loc.GetString("admin-notes-last-edited-at", ("date", note.LastEditedAt?.ToString("yyyy-MM-dd HH:mm:ss") ?? Loc.GetString("admin-notes-edited-never")));
EditedAtLabel.Text = Loc.GetString("admin-notes-last-edited-at", ("date", note.LastEditedAt?.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss") ?? Loc.GetString("admin-notes-edited-never")));
ExpiryTimeLabel.Text = note.ExpiryTime == null
? Loc.GetString("admin-notes-expires-never")
: Loc.GetString("admin-notes-expires", ("expires", note.ExpiryTime.Value.ToString("yyyy-MM-dd HH:mm:ss")));
: Loc.GetString("admin-notes-expires", ("expires", note.ExpiryTime.Value.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")));
NoteTextEdit.InsertAtCursor(note.Message);

if (note.NoteType is NoteType.ServerBan or NoteType.RoleBan)
Expand Down
6 changes: 3 additions & 3 deletions Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public NoteEdit(SharedAdminNote? note, string playerName, bool canCreate, bool c
{
PermanentCheckBox.Pressed = false;
UpdatePermanentCheckboxFields();
ExpiryLineEdit.Text = ExpiryTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
ExpiryLineEdit.Text = ExpiryTime.Value.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
}
}

Expand Down Expand Up @@ -173,7 +173,7 @@ private void UpdatePermanentCheckboxFields()
ExpiryLabel.Visible = !PermanentCheckBox.Pressed;
ExpiryLineEdit.Visible = !PermanentCheckBox.Pressed;

ExpiryLineEdit.Text = !PermanentCheckBox.Pressed ? DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty;
ExpiryLineEdit.Text = !PermanentCheckBox.Pressed ? DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty;
}

private void OnSecretPressed(BaseButton.ButtonEventArgs _)
Expand Down Expand Up @@ -269,7 +269,7 @@ private bool ParseExpiryTime()
return false;
}

ExpiryTime = result;
ExpiryTime = result.ToUniversalTime();
ExpiryLineEdit.ModulateSelfOverride = null;
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,17 @@ protected override void OnAppearanceChange(EntityUid uid, SolutionContainerVisua
if (!args.Sprite.LayerMapTryGet(component.Layer, out var fillLayer))
return;

var maxFillLevels = component.MaxFillLevels;
var fillBaseName = component.FillBaseName;
var changeColor = component.ChangeColor;
var fillSprite = component.MetamorphicDefaultSprite;

// Currently some solution methods such as overflowing will try to update appearance with a
// volume greater than the max volume. We'll clamp it so players don't see
// a giant error sign and error for debug.
if (fraction > 1f)
{
Logger.Error("Attempted to set solution container visuals volume ratio on " + ToPrettyString(uid) + " to a value greater than 1. Volume should never be greater than max volume!");
Log.Error("Attempted to set solution container visuals volume ratio on " + ToPrettyString(uid) + " to a value greater than 1. Volume should never be greater than max volume!");
fraction = 1f;
}
if (component.Metamorphic)
Expand All @@ -72,13 +77,23 @@ protected override void OnAppearanceChange(EntityUid uid, SolutionContainerVisua
if (reagentProto?.MetamorphicSprite is { } sprite)
{
args.Sprite.LayerSetSprite(baseLayer, sprite);
args.Sprite.LayerSetVisible(fillLayer, false);
if (reagentProto.MetamorphicMaxFillLevels > 0)
{
args.Sprite.LayerSetVisible(fillLayer, true);
maxFillLevels = reagentProto.MetamorphicMaxFillLevels;
fillBaseName = reagentProto.MetamorphicFillBaseName;
changeColor = reagentProto.MetamorphicChangeColor;
fillSprite = sprite;
}
else
args.Sprite.LayerSetVisible(fillLayer, false);

if (hasOverlay)
args.Sprite.LayerSetVisible(overlayLayer, false);
return;
}
else
{
args.Sprite.LayerSetVisible(fillLayer, true);
if (hasOverlay)
args.Sprite.LayerSetVisible(overlayLayer, true);
if (component.MetamorphicDefaultSprite != null)
Expand All @@ -87,21 +102,27 @@ protected override void OnAppearanceChange(EntityUid uid, SolutionContainerVisua
}
}
}
else
{
args.Sprite.LayerSetVisible(fillLayer, true);
}

int closestFillSprite = ContentHelpers.RoundToLevels(fraction, 1, component.MaxFillLevels + 1);
var closestFillSprite = ContentHelpers.RoundToLevels(fraction, 1, maxFillLevels + 1);

if (closestFillSprite > 0)
{
if (component.FillBaseName == null)
if (fillBaseName == null)
return;

args.Sprite.LayerSetVisible(fillLayer, true);

var stateName = component.FillBaseName + closestFillSprite;
var stateName = fillBaseName + closestFillSprite;
if (fillSprite != null)
args.Sprite.LayerSetSprite(fillLayer, fillSprite);
args.Sprite.LayerSetState(fillLayer, stateName);

if (component.ChangeColor && AppearanceSystem.TryGetData<Color>(uid, SolutionContainerVisuals.Color, out var color, args.Component))
if (changeColor && AppearanceSystem.TryGetData<Color>(uid, SolutionContainerVisuals.Color, out var color, args.Component))
args.Sprite.LayerSetColor(fillLayer, color);
else
args.Sprite.LayerSetColor(fillLayer, Color.White);
}
else
{
Expand All @@ -110,8 +131,10 @@ protected override void OnAppearanceChange(EntityUid uid, SolutionContainerVisua
else
{
args.Sprite.LayerSetState(fillLayer, component.EmptySpriteName);
if (component.ChangeColor)
if (changeColor)
args.Sprite.LayerSetColor(fillLayer, component.EmptySpriteColor);
else
args.Sprite.LayerSetColor(fillLayer, Color.White);
}
}

Expand All @@ -130,7 +153,7 @@ private void OnGetHeldVisuals(EntityUid uid, SolutionContainerVisualsComponent c
if (!AppearanceSystem.TryGetData<float>(uid, SolutionContainerVisuals.FillFraction, out var fraction, appearance))
return;

int closestFillSprite = ContentHelpers.RoundToLevels(fraction, 1, component.InHandsMaxFillLevels + 1);
var closestFillSprite = ContentHelpers.RoundToLevels(fraction, 1, component.InHandsMaxFillLevels + 1);

if (closestFillSprite > 0)
{
Expand Down
6 changes: 5 additions & 1 deletion Content.Client/StatusIcon/StatusIconOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
using Robust.Shared.Enums;
using System.Numerics;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;

namespace Content.Client.StatusIcon;

public sealed class StatusIconOverlay : Overlay
{
[Dependency] private readonly IEntityManager _entity = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IGameTiming _timing = default!;

private readonly SpriteSystem _sprite;
private readonly TransformSystem _transform;
Expand Down Expand Up @@ -72,7 +74,9 @@ protected override void Draw(in OverlayDrawArgs args)

foreach (var proto in icons)
{
var texture = _sprite.Frame0(proto.Icon);

var curTime = _timing.RealTime;
var texture = _sprite.GetFrame(proto.Icon, curTime);

float yOffset;
float xOffset;
Expand Down
26 changes: 22 additions & 4 deletions Content.Client/VendingMachines/UI/VendingMachineMenu.xaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
<DefaultWindow xmlns="https://spacestation14.io">
<controls:FancyWindow
xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:style="clr-namespace:Content.Client.Stylesheets">
<BoxContainer Orientation="Vertical">
<LineEdit Name="SearchBar" PlaceHolder="{Loc 'vending-machine-component-search-filter'}" HorizontalExpand="True" Margin ="0 4" Access="Public"/>
<LineEdit Name="SearchBar" PlaceHolder="{Loc 'vending-machine-component-search-filter'}" HorizontalExpand="True" Margin ="4 4" Access="Public"/>
<ItemList Name="VendingContents"
SizeFlagsStretchRatio="8"
VerticalExpand="True"
SelectMode="Button">
ItemSeparation="2"
Margin="4 0"
SelectMode="Button"
StyleClasses="transparentBackgroundItemList">
</ItemList>
<!-- Footer -->
<BoxContainer Orientation="Vertical">
<PanelContainer StyleClasses="LowDivider" />
<BoxContainer Orientation="Horizontal" Margin="10 2 5 0" VerticalAlignment="Bottom">
<Label Text="{Loc 'vending-machine-flavor-left'}" StyleClasses="WindowFooterText" />
<Label Text="{Loc 'vending-machine-flavor-right'}" StyleClasses="WindowFooterText"
HorizontalAlignment="Right" HorizontalExpand="True" Margin="0 0 5 0" />
<TextureRect StyleClasses="NTLogoDark" Stretch="KeepAspectCentered"
VerticalAlignment="Center" HorizontalAlignment="Right" SetSize="19 19"/>
</BoxContainer>
</BoxContainer>
</BoxContainer>
</DefaultWindow>
</controls:FancyWindow>
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Content.Client.Stylesheets;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
using FancyWindow = Content.Client.UserInterface.Controls.FancyWindow;

namespace Content.Client.VendingMachines.UI
{
[GenerateTypedNameReferences]
public sealed partial class VendingMachineMenu : DefaultWindow
public sealed partial class VendingMachineMenu : FancyWindow
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;

Expand Down
59 changes: 59 additions & 0 deletions Content.IntegrationTests/Tests/Actions/ActionPvsDetachTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using System.Linq;
using Content.Shared.Actions;
using Content.Shared.Eye;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;

namespace Content.IntegrationTests.Tests.Actions;

[TestFixture]
public sealed class ActionPvsDetachTest
{
[Test]
public async Task TestActionDetach()
{
await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true });
var (server, client) = pair;
var sys = server.System<SharedActionsSystem>();
var cSys = client.System<SharedActionsSystem>();

// Spawn mob that has some actions
EntityUid ent = default;
var map = await pair.CreateTestMap();
await server.WaitPost(() => ent = server.EntMan.SpawnAtPosition("MobHuman", map.GridCoords));
await pair.RunTicksSync(5);
var cEnt = pair.ToClientUid(ent);

// Verify that both the client & server agree on the number of actions
var initActions = sys.GetActions(ent).Count();
Assert.That(initActions, Is.GreaterThan(0));
Assert.That(initActions, Is.EqualTo(cSys.GetActions(cEnt).Count()));

// PVS-detach action entities
// We do this by just giving them the ghost layer
var visSys = server.System<VisibilitySystem>();
var enumerator = server.Transform(ent).ChildEnumerator;
while (enumerator.MoveNext(out var child))
{
visSys.AddLayer(child, (int) VisibilityFlags.Ghost);
}
await pair.RunTicksSync(5);

// Client's actions have left been detached / are out of view, but action comp state has not changed
Assert.That(sys.GetActions(ent).Count(), Is.EqualTo(initActions));
Assert.That(cSys.GetActions(cEnt).Count(), Is.EqualTo(initActions));

// Re-enter PVS view
enumerator = server.Transform(ent).ChildEnumerator;
while (enumerator.MoveNext(out var child))
{
visSys.RemoveLayer(child, (int) VisibilityFlags.Ghost);
}
await pair.RunTicksSync(5);
Assert.That(sys.GetActions(ent).Count(), Is.EqualTo(initActions));
Assert.That(cSys.GetActions(cEnt).Count(), Is.EqualTo(initActions));

await server.WaitPost(() => server.EntMan.DeleteEntity(map.MapUid));
await pair.CleanReturnAsync();
}
}
Loading
Loading