From e5a5196b1f5cba8e0f05c374b2b7c58eea6f7361 Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Fri, 19 Apr 2024 23:17:29 -0400 Subject: [PATCH] make filled inventory slots blank (#27150) * blank filled slots * Update InventoryTemplatePrototype.cs --- .../Inventory/ClientInventorySystem.cs | 1 + .../Inventory/StrippableBoundUserInterface.cs | 4 +-- .../UserInterface/Controls/SlotButton.cs | 1 + .../UserInterface/Controls/SlotControl.cs | 33 ++++++++++++++++-- .../Systems/Hands/HandsUIController.cs | 10 +++--- .../Inventory/InventoryUIController.cs | 6 ++-- .../Inventory/InventoryTemplatePrototype.cs | 4 +++ .../aghost_inventory_template.yml | 1 + .../arachnid_inventory_template.yml | 7 ++++ .../corpse_inventory_template.yml | 3 ++ .../diona_inventory_template.yml | 5 +++ .../holoclown_inventory_template.yml | 2 ++ .../human_inventory_template.yml | 5 +++ .../kangaroo_inventory_template.yml | 3 ++ .../monkey_inventory_template.yml | 1 + .../Interface/Ashen/template_small.png | Bin 0 -> 1282 bytes .../Interface/Minimalist/template_small.png | Bin 0 -> 240 bytes .../Interface/Retro/template_small.png | Bin 0 -> 96 bytes 18 files changed, 73 insertions(+), 13 deletions(-) create mode 100644 Resources/Textures/Interface/Ashen/template_small.png create mode 100644 Resources/Textures/Interface/Minimalist/template_small.png create mode 100644 Resources/Textures/Interface/Retro/template_small.png diff --git a/Content.Client/Inventory/ClientInventorySystem.cs b/Content.Client/Inventory/ClientInventorySystem.cs index 7b98513a92..1416545573 100644 --- a/Content.Client/Inventory/ClientInventorySystem.cs +++ b/Content.Client/Inventory/ClientInventorySystem.cs @@ -251,6 +251,7 @@ namespace Content.Client.Inventory public string SlotGroup => SlotDef.SlotGroup; public string SlotDisplayName => SlotDef.DisplayName; public string TextureName => "Slots/" + SlotDef.TextureName; + public string FullTextureName => SlotDef.FullTextureName; public SlotData(SlotDefinition slotDef, ContainerSlot? container = null, bool highlighted = false, bool blocked = false) diff --git a/Content.Client/Inventory/StrippableBoundUserInterface.cs b/Content.Client/Inventory/StrippableBoundUserInterface.cs index f8eb12df91..33f38688ed 100644 --- a/Content.Client/Inventory/StrippableBoundUserInterface.cs +++ b/Content.Client/Inventory/StrippableBoundUserInterface.cs @@ -219,7 +219,7 @@ namespace Content.Client.Inventory if (entity == null) { - button.SpriteView.SetEntity(null); + button.SetEntity(null); return; } @@ -231,7 +231,7 @@ namespace Content.Client.Inventory else return; - button.SpriteView.SetEntity(viewEnt); + button.SetEntity(viewEnt); } } } diff --git a/Content.Client/UserInterface/Controls/SlotButton.cs b/Content.Client/UserInterface/Controls/SlotButton.cs index 4ec6861606..c33782371f 100644 --- a/Content.Client/UserInterface/Controls/SlotButton.cs +++ b/Content.Client/UserInterface/Controls/SlotButton.cs @@ -9,6 +9,7 @@ namespace Content.Client.UserInterface.Controls public SlotButton(SlotData slotData) { ButtonTexturePath = slotData.TextureName; + FullButtonTexturePath = slotData.FullTextureName; Blocked = slotData.Blocked; Highlight = slotData.Highlighted; StorageTexturePath = "Slots/back"; diff --git a/Content.Client/UserInterface/Controls/SlotControl.cs b/Content.Client/UserInterface/Controls/SlotControl.cs index 9b94f8a0c8..a684bb05ef 100644 --- a/Content.Client/UserInterface/Controls/SlotControl.cs +++ b/Content.Client/UserInterface/Controls/SlotControl.cs @@ -15,11 +15,12 @@ namespace Content.Client.UserInterface.Controls public TextureRect ButtonRect { get; } public TextureRect BlockedRect { get; } public TextureRect HighlightRect { get; } - public SpriteView SpriteView { get; } public SpriteView HoverSpriteView { get; } public TextureButton StorageButton { get; } public CooldownGraphic CooldownDisplay { get; } + private SpriteView SpriteView { get; } + public EntityUid? Entity => SpriteView.Entity; private bool _slotNameSet; @@ -68,7 +69,18 @@ namespace Content.Client.UserInterface.Controls set { _buttonTexturePath = value; - ButtonRect.Texture = Theme.ResolveTextureOrNull(_buttonTexturePath)?.Texture; + UpdateButtonTexture(); + } + } + + private string? _fullButtonTexturePath; + public string? FullButtonTexturePath + { + get => _fullButtonTexturePath; + set + { + _fullButtonTexturePath = value; + UpdateButtonTexture(); } } @@ -197,6 +209,21 @@ namespace Content.Client.UserInterface.Controls HoverSpriteView.SetEntity(null); } + public void SetEntity(EntityUid? ent) + { + SpriteView.SetEntity(ent); + UpdateButtonTexture(); + } + + private void UpdateButtonTexture() + { + var fullTexture = Theme.ResolveTextureOrNull(_fullButtonTexturePath); + var texture = Entity.HasValue && fullTexture != null + ? fullTexture.Texture + : Theme.ResolveTextureOrNull(_buttonTexturePath)?.Texture; + ButtonRect.Texture = texture; + } + private void OnButtonPressed(GUIBoundKeyEventArgs args) { Pressed?.Invoke(args, this); @@ -229,8 +256,8 @@ namespace Content.Client.UserInterface.Controls base.OnThemeUpdated(); StorageButton.TextureNormal = Theme.ResolveTextureOrNull(_storageTexturePath)?.Texture; - ButtonRect.Texture = Theme.ResolveTextureOrNull(_buttonTexturePath)?.Texture; HighlightRect.Texture = Theme.ResolveTextureOrNull(_highlightTexturePath)?.Texture; + UpdateButtonTexture(); } EntityUid? IEntityControl.UiEntity => Entity; diff --git a/Content.Client/UserInterface/Systems/Hands/HandsUIController.cs b/Content.Client/UserInterface/Systems/Hands/HandsUIController.cs index 1bcdd89af6..bb550b0433 100644 --- a/Content.Client/UserInterface/Systems/Hands/HandsUIController.cs +++ b/Content.Client/UserInterface/Systems/Hands/HandsUIController.cs @@ -120,12 +120,12 @@ public sealed class HandsUIController : UIController, IOnStateEntered + /// The texture displayed in a slot when it has an item inside of it. + /// + [DataField] public string FullTextureName { get; private set; } = "SlotBackground"; [DataField("slotFlags")] public SlotFlags SlotFlags { get; private set; } = SlotFlags.PREVENTEQUIP; [DataField("showInWindow")] public bool ShowInWindow { get; private set; } = true; [DataField("slotGroup")] public string SlotGroup { get; private set; } = "Default"; diff --git a/Resources/Prototypes/InventoryTemplates/aghost_inventory_template.yml b/Resources/Prototypes/InventoryTemplates/aghost_inventory_template.yml index 6252ad8e99..84806a051a 100644 --- a/Resources/Prototypes/InventoryTemplates/aghost_inventory_template.yml +++ b/Resources/Prototypes/InventoryTemplates/aghost_inventory_template.yml @@ -11,6 +11,7 @@ displayName: ID - name: id slotTexture: id + fullTextureName: template_small slotFlags: IDCARD slotGroup: SecondHotbar stripTime: 6 diff --git a/Resources/Prototypes/InventoryTemplates/arachnid_inventory_template.yml b/Resources/Prototypes/InventoryTemplates/arachnid_inventory_template.yml index daf0161b7c..c0da3567c2 100644 --- a/Resources/Prototypes/InventoryTemplates/arachnid_inventory_template.yml +++ b/Resources/Prototypes/InventoryTemplates/arachnid_inventory_template.yml @@ -55,6 +55,7 @@ displayName: Head - name: id slotTexture: id + fullTextureName: template_small slotFlags: IDCARD slotGroup: SecondHotbar stripTime: 6 @@ -64,6 +65,7 @@ displayName: ID - name: belt slotTexture: belt + fullTextureName: template_small slotFlags: BELT slotGroup: SecondHotbar stripTime: 6 @@ -72,6 +74,7 @@ displayName: Belt - name: back slotTexture: back + fullTextureName: template_small slotFlags: BACK slotGroup: SecondHotbar stripTime: 6 @@ -81,6 +84,7 @@ - name: pocket4 slotTexture: web + fullTextureName: template_small slotFlags: POCKET slotGroup: MainHotbar stripTime: 3 @@ -89,6 +93,7 @@ displayName: Pocket 4 - name: pocket3 slotTexture: web + fullTextureName: template_small slotFlags: POCKET slotGroup: MainHotbar stripTime: 3 @@ -104,6 +109,7 @@ displayName: Suit - name: pocket1 slotTexture: pocket + fullTextureName: template_small slotFlags: POCKET slotGroup: MainHotbar stripTime: 3 @@ -114,6 +120,7 @@ stripHidden: true - name: pocket2 slotTexture: pocket + fullTextureName: template_small slotFlags: POCKET slotGroup: MainHotbar stripTime: 3 diff --git a/Resources/Prototypes/InventoryTemplates/corpse_inventory_template.yml b/Resources/Prototypes/InventoryTemplates/corpse_inventory_template.yml index 41fa7dc375..a672e403b3 100644 --- a/Resources/Prototypes/InventoryTemplates/corpse_inventory_template.yml +++ b/Resources/Prototypes/InventoryTemplates/corpse_inventory_template.yml @@ -55,6 +55,7 @@ displayName: Head - name: pocket1 slotTexture: pocket + fullTextureName: template_small slotFlags: POCKET slotGroup: MainHotbar stripTime: 3 @@ -65,6 +66,7 @@ stripHidden: true - name: pocket2 slotTexture: pocket + fullTextureName: template_small slotFlags: POCKET slotGroup: MainHotbar stripTime: 3 @@ -84,6 +86,7 @@ displayName: Suit Storage - name: belt slotTexture: belt + fullTextureName: template_small slotFlags: BELT slotGroup: SecondHotbar stripTime: 6 diff --git a/Resources/Prototypes/InventoryTemplates/diona_inventory_template.yml b/Resources/Prototypes/InventoryTemplates/diona_inventory_template.yml index 4bbd18b136..5d909264fe 100644 --- a/Resources/Prototypes/InventoryTemplates/diona_inventory_template.yml +++ b/Resources/Prototypes/InventoryTemplates/diona_inventory_template.yml @@ -56,6 +56,7 @@ displayName: Head - name: pocket1 slotTexture: pocket + fullTextureName: template_small slotFlags: POCKET slotGroup: MainHotbar stripTime: 3 @@ -66,6 +67,7 @@ stripHidden: true - name: pocket2 slotTexture: pocket + fullTextureName: template_small slotFlags: POCKET slotGroup: MainHotbar stripTime: 3 @@ -85,6 +87,7 @@ displayName: Suit Storage - name: id slotTexture: id + fullTextureName: template_small slotFlags: IDCARD slotGroup: SecondHotbar stripTime: 6 @@ -94,6 +97,7 @@ displayName: ID - name: belt slotTexture: belt + fullTextureName: template_small slotFlags: BELT slotGroup: SecondHotbar stripTime: 6 @@ -102,6 +106,7 @@ displayName: Belt - name: back slotTexture: back + fullTextureName: template_small slotFlags: BACK slotGroup: SecondHotbar stripTime: 6 diff --git a/Resources/Prototypes/InventoryTemplates/holoclown_inventory_template.yml b/Resources/Prototypes/InventoryTemplates/holoclown_inventory_template.yml index 57dce506ea..7be9c75015 100644 --- a/Resources/Prototypes/InventoryTemplates/holoclown_inventory_template.yml +++ b/Resources/Prototypes/InventoryTemplates/holoclown_inventory_template.yml @@ -3,6 +3,7 @@ slots: - name: pocket1 slotTexture: pocket + fullTextureName: template_small slotFlags: POCKET slotGroup: MainHotbar stripTime: 3 @@ -12,6 +13,7 @@ stripHidden: true - name: pocket2 slotTexture: pocket + fullTextureName: template_small slotFlags: POCKET slotGroup: MainHotbar stripTime: 3 diff --git a/Resources/Prototypes/InventoryTemplates/human_inventory_template.yml b/Resources/Prototypes/InventoryTemplates/human_inventory_template.yml index 574ecca35f..2070f646b7 100644 --- a/Resources/Prototypes/InventoryTemplates/human_inventory_template.yml +++ b/Resources/Prototypes/InventoryTemplates/human_inventory_template.yml @@ -62,6 +62,7 @@ displayName: Head - name: pocket1 slotTexture: pocket + fullTextureName: template_small slotFlags: POCKET slotGroup: MainHotbar stripTime: 3 @@ -72,6 +73,7 @@ stripHidden: true - name: pocket2 slotTexture: pocket + fullTextureName: template_small slotFlags: POCKET slotGroup: MainHotbar stripTime: 3 @@ -91,6 +93,7 @@ displayName: Suit Storage - name: id slotTexture: id + fullTextureName: template_small slotFlags: IDCARD slotGroup: SecondHotbar stripTime: 6 @@ -100,6 +103,7 @@ displayName: ID - name: belt slotTexture: belt + fullTextureName: template_small slotFlags: BELT slotGroup: SecondHotbar stripTime: 6 @@ -108,6 +112,7 @@ displayName: Belt - name: back slotTexture: back + fullTextureName: template_small slotFlags: BACK slotGroup: SecondHotbar stripTime: 6 diff --git a/Resources/Prototypes/InventoryTemplates/kangaroo_inventory_template.yml b/Resources/Prototypes/InventoryTemplates/kangaroo_inventory_template.yml index fb7dee1ec2..5f81cdebc6 100644 --- a/Resources/Prototypes/InventoryTemplates/kangaroo_inventory_template.yml +++ b/Resources/Prototypes/InventoryTemplates/kangaroo_inventory_template.yml @@ -35,6 +35,7 @@ - name: belt slotTexture: belt + fullTextureName: template_small slotFlags: BELT slotGroup: SecondHotbar stripTime: 6 @@ -47,6 +48,7 @@ - name: pocket1 slotTexture: pocket + fullTextureName: template_small slotFlags: POCKET slotGroup: MainHotbar stripTime: 3 @@ -60,6 +62,7 @@ slots: - name: pocket1 slotTexture: pocket + fullTextureName: template_small slotFlags: POCKET slotGroup: MainHotbar stripTime: 3 diff --git a/Resources/Prototypes/InventoryTemplates/monkey_inventory_template.yml b/Resources/Prototypes/InventoryTemplates/monkey_inventory_template.yml index 5af23dabac..bdd5100084 100644 --- a/Resources/Prototypes/InventoryTemplates/monkey_inventory_template.yml +++ b/Resources/Prototypes/InventoryTemplates/monkey_inventory_template.yml @@ -29,6 +29,7 @@ displayName: Jumpsuit - name: id slotTexture: id + fullTextureName: template_small slotFlags: IDCARD slotGroup: SecondHotbar stripTime: 6 diff --git a/Resources/Textures/Interface/Ashen/template_small.png b/Resources/Textures/Interface/Ashen/template_small.png new file mode 100644 index 0000000000000000000000000000000000000000..f3a4379f76cb1edf11b27d34ded3ddaa8388b816 GIT binary patch literal 1282 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}e5nzhX}-P; zT0k}j5QD&_;K@Lev%n*=n1R9c3J5dCr9K5pGiPLmM3hAM`dB6B=jtV<zCHb_`sNdc^+B->Ug!Z$#{Ilm}X!A#FU&p^qJ zOF==wrYI%ND#*nRsvXF)RmvzSDX`MlFE20GD>v55FG|-pw6wI;H!#vSGSUUA&@Haa zD@m--%_~-h7y>iLCAB!YD6^m>Ge1uOWNuD{X>Onz} zlL-o0tDMBVbX%ng-IUa{#L}D+CA;E`)YK9ieTWiNtq@UE6K(XdSZ)LIvQ=bIYH@x} zDJanGj7<$}zyX0GiU@v)jtHzekVVmT1Z3owO zx>*RzL-R6A>|h3<2_xx3iW)1&qLT9bqU;cGG(f`;r##dQNO&TpO-RBAhdnUm+i}_G z!*h`xm;Oh)H^A&F>FMGa62bX)`rfQ|1CgWo-h~3C1=k$sA9Or&T-@=4WJy8zp92Sv z7OlH;W&hhCk6Wsek9_ycxqot|(4u;|{PMbKsp%4J-*w-9wK;#qr1#M(rSqSSIhdlR zwf@?7ov$rH#I=Rl@3KqoZKK)C=RfFsoMBoh!~Xhc;Tg4Kg(<@FH)`j_n9J~F96Dma z6S0Z2=DuN~#~ZZ=;t!1)qkI;Gv28HmY_~f$`D4<9te>}UN^Ri0!IHyd#yGpd_kdc0 zaD}JCx^rs!ss3$76I3{h=kr>f?I@eI%xfC&1Jjo6jejP%U0u3Rz}KMW{_@=05uvtc zPi?Y^y}qUKT)V&gx}ZQt*G!J(nA9=Iv&7yQfexG1UV Tq*mutQ2FEO>gTe~DWM4fR5KfYkBkXLA0|yJ zt-IAE^<$s?`d4>vFSDMp<2JkDv8=Pj=O!rLUN*a}u4Pt%>Vi!wcQ{t)a56+Q7roRi zXZr2v*}&ofM-TEjRBi^9ny&Xf#3%J-!N)V&@*ZXp*DUXB37F)iweX$^~}ke*+YO{VDNPHb6Mw<&;$TR?O`+k literal 0 HcmV?d00001 diff --git a/Resources/Textures/Interface/Retro/template_small.png b/Resources/Textures/Interface/Retro/template_small.png new file mode 100644 index 0000000000000000000000000000000000000000..7244b37f5c785d78eee7767f9a4aa6bef3263b07 GIT binary patch literal 96 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ql2i3ArY-_ n4>B?Wc})uc*XMaSfSB*u1QZw;-5D2j067evu6{1-oD!M