[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);
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;
}
}
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";
// 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)