]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix the pin texture not rendering (#41093)
authorbeck-thompson <107373427+beck-thompson@users.noreply.github.com>
Sat, 25 Oct 2025 17:32:07 +0000 (10:32 -0700)
committerGitHub <noreply@github.com>
Sat, 25 Oct 2025 17:32:07 +0000 (19:32 +0200)
Content.Client/Administration/UI/CustomControls/PlayerListEntry.xaml.cs
Content.Client/Stylesheets/StyleNano.cs

index cd6a56ea71e69c47beec50a8acd7cb8ef49ef2cc..cf2e776ea8a55a35608ecc2e0de64a4558e5af89 100644 (file)
@@ -11,6 +11,9 @@ namespace Content.Client.Administration.UI.CustomControls;
 [GenerateTypedNameReferences]
 public sealed partial class PlayerListEntry : BoxContainer
 {
+    private readonly ResPath _pinnedResPath = new("/Textures/Interface/Bwoink/pinned.png");
+    private readonly ResPath _unPinnedResPath = new("/Textures/Interface/Bwoink/un_pinned.png");
+
     public PlayerListEntry()
     {
         RobustXamlLoader.Load(this);
@@ -44,15 +47,6 @@ public sealed partial class PlayerListEntry : BoxContainer
 
     private void UpdatePinButtonTexture(bool isPinned)
     {
-        if (isPinned)
-        {
-            PlayerEntryPinButton?.RemoveStyleClass(StyleNano.StyleClassPinButtonUnpinned);
-            PlayerEntryPinButton?.AddStyleClass(StyleNano.StyleClassPinButtonPinned);
-        }
-        else
-        {
-            PlayerEntryPinButton?.RemoveStyleClass(StyleNano.StyleClassPinButtonPinned);
-            PlayerEntryPinButton?.AddStyleClass(StyleNano.StyleClassPinButtonUnpinned);
-        }
+        PlayerEntryPinButton.TexturePath = isPinned ? _pinnedResPath.CanonPath : _unPinnedResPath.CanonPath;
     }
 }
index b1c20d1814cb36c7ae998acdd33176f10bc2c46c..5c8e86319445787d0ed53dd0b25af3ac5f719e7f 100644 (file)
@@ -159,10 +159,6 @@ namespace Content.Client.Stylesheets
 
         public static readonly Color ChatBackgroundColor = Color.FromHex("#25252ADD");
 
-        //Bwoink
-        public const string StyleClassPinButtonPinned = "pinButtonPinned";
-        public const string StyleClassPinButtonUnpinned = "pinButtonUnpinned";
-
         // i'm not sure what the missing symbols were referencing, and this is getting obseleted anyway so:
         public const string ButtonOpenRight = "OpenRight";
         public const string ButtonOpenLeft = "OpenLeft";
@@ -1768,21 +1764,6 @@ namespace Content.Client.Stylesheets
                 // Silicon law edit ui
                 Element<Label>().Class(SiliconLawContainer.StyleClassSiliconLawPositionLabel)
                     .Prop(Label.StylePropertyFontColor, NanoGold),
-                // Pinned button style
-                new StyleRule(
-                    new SelectorElement(typeof(TextureButton), new[] { StyleClassPinButtonPinned }, null, null),
-                    new[]
-                    {
-                        new StyleProperty(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Bwoink/pinned.png"))
-                    }),
-
-                // Unpinned button style
-                new StyleRule(
-                    new SelectorElement(typeof(TextureButton), new[] { StyleClassPinButtonUnpinned }, null, null),
-                    new[]
-                    {
-                        new StyleProperty(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/Bwoink/un_pinned.png"))
-                    }),
 
                 Element<PanelContainer>()
                     .Class(StyleClassInset)