From 41d94db3a71ed1a5692e4db36c0408fefb96d56b Mon Sep 17 00:00:00 2001 From: Arufonsu <17498701+Arufonsu@users.noreply.github.com> Date: Wed, 31 Dec 2025 11:38:36 -0300 Subject: [PATCH 1/6] chore: spell items --- .../Interface/Game/Spells/SpellItem.cs | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Intersect.Client.Core/Interface/Game/Spells/SpellItem.cs b/Intersect.Client.Core/Interface/Game/Spells/SpellItem.cs index a10b3a6ebe..53b58db10d 100644 --- a/Intersect.Client.Core/Interface/Game/Spells/SpellItem.cs +++ b/Intersect.Client.Core/Interface/Game/Spells/SpellItem.cs @@ -219,22 +219,24 @@ public override void Update() Icon.RenderColor.A = 255; } - if (Path.GetFileName(Icon.Texture?.Name) != spell.Icon) + if (Icon.TextureFilename == spell.Icon) { - var spellIconTexture = GameContentManager.Current.GetTexture(TextureType.Spell, spell.Icon); - if (spellIconTexture != null) - { - Icon.Texture = spellIconTexture; - Icon.RenderColor.A = (byte)(_cooldownLabel.IsVisibleInParent ? 100 : 255); - Icon.IsVisibleInParent = true; - } - else + return; + } + + var spellTexture = GameContentManager.Current.GetTexture(TextureType.Spell, spell.Icon); + if (spellTexture != default) + { + Icon.Texture = spellTexture; + Icon.RenderColor.A = (byte)(_cooldownLabel.IsVisibleInParent ? 100 : 255); + Icon.IsVisibleInParent = true; + } + else + { + if (Icon.Texture != null) { - if (Icon.Texture != null) - { - Icon.Texture = null; - Icon.IsVisibleInParent = false; - } + Icon.Texture = null; + Icon.IsVisibleInParent = false; } } } From db2a50c61f6d75fb0ee5714315fde3721724ec3e Mon Sep 17 00:00:00 2001 From: Arufonsu <17498701+Arufonsu@users.noreply.github.com> Date: Wed, 31 Dec 2025 11:42:02 -0300 Subject: [PATCH 2/6] fix: stop drag-drop from reparenting item icons Fixes #2793 Prevent Gwen's default drop handler from reparenting the dragged icon into the hovered control, which could place the icon into the wrong slot/container. Draggable now forwards DragAndDrop_HandleDrop to its SlotItem parent, and the drag package stores the source SlotItem in Package.UserData to make slot handlers deterministic. --- .../Interface/Game/Draggable.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Intersect.Client.Core/Interface/Game/Draggable.cs b/Intersect.Client.Core/Interface/Game/Draggable.cs index 1205e3a1c5..ded6fb37ff 100644 --- a/Intersect.Client.Core/Interface/Game/Draggable.cs +++ b/Intersect.Client.Core/Interface/Game/Draggable.cs @@ -16,6 +16,7 @@ public override bool DragAndDrop_Draggable() public override bool DragAndDrop_CanAcceptPackage(Package package) { + // Important: Icon is the topmost hovered control, so it must be allowed to "receive" the drop, BUT: we forward handling to SlotItem. return true; } @@ -27,6 +28,7 @@ public override bool DragAndDrop_CanAcceptPackage(Package package) DrawControl = this, Name = Name, HoldOffset = ToLocal(InputHandler.MousePosition.X, InputHandler.MousePosition.Y), + UserData = Parent, // Expected to be SlotItem (InventoryItem/BankItem/etc) }; } @@ -39,4 +41,22 @@ public override void DragAndDrop_EndDragging(bool success, int x, int y) { IsVisibleInParent = true; } + + public override bool DragAndDrop_HandleDrop(Package package, int x, int y) + { + // Never allow Base.DragAndDrop_HandleDrop() to run on the icon because it reparents SourceControl (Base.cs) + // Forward drop handling to the slot (or nearest SlotItem ancestor). + var node = Parent; + while (node != null) + { + if (node is SlotItem) + { + return node.DragAndDrop_HandleDrop(package, x, y); + } + + node = node.Parent; + } + + return false; + } } \ No newline at end of file From 7419e0c8a77e792f50adc301edb90451beed15d7 Mon Sep 17 00:00:00 2001 From: Arufonsu <17498701+Arufonsu@users.noreply.github.com> Date: Thu, 1 Jan 2026 16:43:07 -0300 Subject: [PATCH 3/6] fix: spell/item icon flicker after successful drag-drop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stop restoring dragged icon visibility at the end of a successful drag-drop operation, since the item may have moved (e.g., inventory ↔ bank // inventory ↔ drop item) and the server-driven slot update will refresh the correct icon state. This fixes a 1-frame flash where the source slot icon briefly reappears before disappearing again. --- Intersect.Client.Core/Interface/Game/Draggable.cs | 5 ++++- .../Interface/Game/Inventory/InventoryItem.cs | 1 + Intersect.Client.Framework/Gwen/DragDrop/DragAndDrop.cs | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Intersect.Client.Core/Interface/Game/Draggable.cs b/Intersect.Client.Core/Interface/Game/Draggable.cs index ded6fb37ff..c7897ed101 100644 --- a/Intersect.Client.Core/Interface/Game/Draggable.cs +++ b/Intersect.Client.Core/Interface/Game/Draggable.cs @@ -39,7 +39,10 @@ public override void DragAndDrop_StartDragging(Package package, int x, int y) public override void DragAndDrop_EndDragging(bool success, int x, int y) { - IsVisibleInParent = true; + if (!success) + { + IsVisibleInParent = true; + } } public override bool DragAndDrop_HandleDrop(Package package, int x, int y) diff --git a/Intersect.Client.Core/Interface/Game/Inventory/InventoryItem.cs b/Intersect.Client.Core/Interface/Game/Inventory/InventoryItem.cs index bfa5324fec..5f18b7f77a 100644 --- a/Intersect.Client.Core/Interface/Game/Inventory/InventoryItem.cs +++ b/Intersect.Client.Core/Interface/Game/Inventory/InventoryItem.cs @@ -477,6 +477,7 @@ private void PlayerOnInventoryUpdated(Player player, int slotIndex) // empty texture to reload on update Icon.Texture = default; + Icon.IsVisibleInParent = false; } public override void Update() diff --git a/Intersect.Client.Framework/Gwen/DragDrop/DragAndDrop.cs b/Intersect.Client.Framework/Gwen/DragDrop/DragAndDrop.cs index 97f634e58b..325a8a89d1 100644 --- a/Intersect.Client.Framework/Gwen/DragDrop/DragAndDrop.cs +++ b/Intersect.Client.Framework/Gwen/DragDrop/DragAndDrop.cs @@ -58,7 +58,7 @@ private static bool ShouldStartDraggingControl(int x, int y) // Not been dragged far enough var length = Math.Abs(x - sLastPressedPos.X) + Math.Abs(y - sLastPressedPos.Y); - if (length < 5) + if (length <= 1) { return false; } From a54a2b1dca655c618fb78c77f7f65c925409bd68 Mon Sep 17 00:00:00 2001 From: Arufonsu <17498701+Arufonsu@users.noreply.github.com> Date: Thu, 1 Jan 2026 21:21:38 -0300 Subject: [PATCH 4/6] fix: restores proper prompt for item drag-and-drop - Ensures all item drops go through TryDropItem, restoring the safety prompt that asks which item and how many to drop. - Fixes a bug introduced with DragAndDrop_HandleDrop returning an incorrect boolean when bypassing the drop prompt, which caused undroppable items to have their icons hidden. --- Intersect.Client.Core/Entities/Player.cs | 2 +- Intersect.Client.Core/Interface/Game/Draggable.cs | 5 +---- .../Interface/Game/Inventory/InventoryItem.cs | 15 ++++++--------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Intersect.Client.Core/Entities/Player.cs b/Intersect.Client.Core/Entities/Player.cs index d318429af1..ad7b31e1f8 100644 --- a/Intersect.Client.Core/Entities/Player.cs +++ b/Intersect.Client.Core/Entities/Player.cs @@ -415,7 +415,7 @@ public void TryDropItem(int inventorySlotIndex) } var quantity = inventorySlot.Quantity; - var canDropMultiple = quantity > 1; + var canDropMultiple = GetQuantityOfItemInInventory(itemDescriptor.Id) > 1; var inputType = canDropMultiple ? InputType.NumericSliderInput : InputType.YesNo; var prompt = canDropMultiple ? Strings.Inventory.DropItemPrompt : Strings.Inventory.DropPrompt; _ = new InputBox( diff --git a/Intersect.Client.Core/Interface/Game/Draggable.cs b/Intersect.Client.Core/Interface/Game/Draggable.cs index c7897ed101..94d0fe744f 100644 --- a/Intersect.Client.Core/Interface/Game/Draggable.cs +++ b/Intersect.Client.Core/Interface/Game/Draggable.cs @@ -39,10 +39,7 @@ public override void DragAndDrop_StartDragging(Package package, int x, int y) public override void DragAndDrop_EndDragging(bool success, int x, int y) { - if (!success) - { - IsVisibleInParent = true; - } + IsVisibleInParent = !success; } public override bool DragAndDrop_HandleDrop(Package package, int x, int y) diff --git a/Intersect.Client.Core/Interface/Game/Inventory/InventoryItem.cs b/Intersect.Client.Core/Interface/Game/Inventory/InventoryItem.cs index 5f18b7f77a..a95b5d3a59 100644 --- a/Intersect.Client.Core/Interface/Game/Inventory/InventoryItem.cs +++ b/Intersect.Client.Core/Interface/Game/Inventory/InventoryItem.cs @@ -403,12 +403,6 @@ public override bool DragAndDrop_HandleDrop(Package package, int x, int y) return false; } - if (!Interface.DoesMouseHitInterface() && !player.IsBusy) - { - PacketSender.SendDropItem(SlotIndex, inventorySlot.Quantity); - return true; - } - var targetNode = Interface.FindComponentUnderCursor(); // Find the first parent acceptable in that tree that can accept the package @@ -430,13 +424,12 @@ public override bool DragAndDrop_HandleDrop(Package package, int x, int y) return true; case BankItem bankItem: - player.TryStoreItemInBank( + return player.TryStoreItemInBank( SlotIndex, bankSlotIndex: bankItem.SlotIndex, quantityHint: inventorySlot.Quantity, skipPrompt: true ); - return true; case HotbarItem hotbarItem: player.AddToHotbar(hotbarItem.SlotIndex, 0, SlotIndex); @@ -452,7 +445,11 @@ public override bool DragAndDrop_HandleDrop(Package package, int x, int y) } } - // If we've reached the top of the tree, we can't drop here, so cancel drop + if (!Interface.DoesMouseHitInterface() && !player.IsBusy) + { + player.TryDropItem(SlotIndex); + } + return false; } From 44c1a0a3ba2af169a6b63e51b250ea41c0a18604 Mon Sep 17 00:00:00 2001 From: Arufonsu <17498701+Arufonsu@users.noreply.github.com> Date: Sat, 3 Jan 2026 01:33:05 -0300 Subject: [PATCH 5/6] Weylon's Review Signed-off-by: Arufonsu <17498701+Arufonsu@users.noreply.github.com> --- Intersect.Client.Core/Entities/Player.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Intersect.Client.Core/Entities/Player.cs b/Intersect.Client.Core/Entities/Player.cs index ad7b31e1f8..e80518753a 100644 --- a/Intersect.Client.Core/Entities/Player.cs +++ b/Intersect.Client.Core/Entities/Player.cs @@ -415,7 +415,8 @@ public void TryDropItem(int inventorySlotIndex) } var quantity = inventorySlot.Quantity; - var canDropMultiple = GetQuantityOfItemInInventory(itemDescriptor.Id) > 1; + var maxQuantity = GetQuantityOfItemInInventory(itemDescriptor.Id); + var canDropMultiple = maxQuantity > 1; var inputType = canDropMultiple ? InputType.NumericSliderInput : InputType.YesNo; var prompt = canDropMultiple ? Strings.Inventory.DropItemPrompt : Strings.Inventory.DropPrompt; _ = new InputBox( @@ -423,7 +424,7 @@ public void TryDropItem(int inventorySlotIndex) prompt: prompt.ToString(itemDescriptor.Name), inputType: inputType, quantity: quantity, - maximumQuantity: GetQuantityOfItemInInventory(itemDescriptor.Id), + maximumQuantity: maxQuantity, userData: inventorySlotIndex, onSubmit: (sender, args) => { From 3d1581315aa5dc2f9db22d5ee8ae77fce6a3393d Mon Sep 17 00:00:00 2001 From: Arufonsu <17498701+Arufonsu@users.noreply.github.com> Date: Sat, 3 Jan 2026 02:58:04 -0300 Subject: [PATCH 6/6] updates and code cleanup: DragAndDrop_HandleDrop overrides - Required logic update after fixes for item's icon handling. - hotkeys and bags handling for DragAndDrop_HandleDrop - (bags seriously need a big refactor): replaced direct packet store (buggy) and slider (never been coded properly) for at least, a simple and functional YesNo Prompt that stores whole item stacks from inventory. - HotbarItem case returns false (required so items don't go invisible when placing them to hotbars). - SpellItem to Hotbar case returns false (required so spells don't go invisible when placing them to hotbars). - fixes quantityLabels logic - visually functional bags and bank items when moving them around --- Intersect.Client.Core/Entities/Player.cs | 29 ++++++++--------- .../Interface/Game/Bag/BagItem.cs | 22 +++++++++---- .../Interface/Game/Bag/BagWindow.cs | 2 +- .../Interface/Game/Bank/BankItem.cs | 32 +++++++++---------- .../Interface/Game/Bank/BankWindow.cs | 2 +- .../Interface/Game/Crafting/RecipeItem.cs | 3 -- .../Interface/Game/Hotbar/HotbarItem.cs | 7 ++-- .../Interface/Game/Inventory/InventoryItem.cs | 18 ++++------- .../Interface/Game/Shop/ShopItem.cs | 6 ++-- .../Interface/Game/Shop/ShopWindow.cs | 2 +- .../Interface/Game/Spells/SpellItem.cs | 4 +-- .../Interface/Game/Trades/TradeItem.cs | 1 - Intersect.Client.Core/Localization/Strings.cs | 5 ++- .../Entities/IPlayer.cs | 2 +- 14 files changed, 64 insertions(+), 71 deletions(-) diff --git a/Intersect.Client.Core/Entities/Player.cs b/Intersect.Client.Core/Entities/Player.cs index e80518753a..5729eeb870 100644 --- a/Intersect.Client.Core/Entities/Player.cs +++ b/Intersect.Client.Core/Entities/Player.cs @@ -1121,41 +1121,32 @@ public void TryStoreItemInBag(int inventorySlotIndex, int bagSlotIndex) } var quantity = inventorySlot.Quantity; - var maxQuantity = quantity; - - if (maxQuantity < 2) - { - PacketSender.SendStoreBagItem(inventorySlotIndex, 1, bagSlotIndex); - return; - } _ = new InputBox( title: Strings.Bags.StoreItem, prompt: Strings.Bags.StoreItemPrompt.ToString(itemDescriptor.Name), - inputType: InputType.NumericSliderInput, + inputType: InputType.YesNo, quantity: quantity, - maximumQuantity: maxQuantity, - userData: new Tuple(inventorySlotIndex, bagSlotIndex), + userData: new Tuple(inventorySlotIndex, bagSlotIndex, quantity), onSubmit: TryStoreItemInBagOnSubmit ); } private static void TryStoreItemInBagOnSubmit(Base sender, InputSubmissionEventArgs args) { - if (sender is not InputBox { UserData: (int inventorySlotIndex, int bagSlotIndex) }) + if (sender is not InputBox { UserData: (int inventorySlotIndex, int bagSlotIndex, int quantity) }) { return; } - if (args.Value is not NumericalSubmissionValue submissionValue) + if (args.Value is not BooleanSubmissionValue submissionValue) { return; } - var value = (int)Math.Round(submissionValue.Value); - if (value > 0) + if (submissionValue.Value) { - PacketSender.SendStoreBagItem(inventorySlotIndex, value, bagSlotIndex); + PacketSender.SendStoreBagItem(inventorySlotIndex, quantity, bagSlotIndex); } } @@ -1445,12 +1436,17 @@ public void AddToHotbar(int hotbarSlot, sbyte itemType, int itemSlot) PacketSender.SendHotbarUpdate(hotbarSlot, itemType, itemSlot); } - public void HotbarSwap(int index, int swapIndex) + public bool HotbarSwap(int index, int swapIndex) { var itemId = Hotbar[index].ItemOrSpellId; var bagId = Hotbar[index].BagId; var stats = Hotbar[index].PreferredStatBuffs; + if (Hotbar[swapIndex].ItemOrSpellId == itemId) + { + return false; + } + Hotbar[index].ItemOrSpellId = Hotbar[swapIndex].ItemOrSpellId; Hotbar[index].BagId = Hotbar[swapIndex].BagId; Hotbar[index].PreferredStatBuffs = Hotbar[swapIndex].PreferredStatBuffs; @@ -1460,6 +1456,7 @@ public void HotbarSwap(int index, int swapIndex) Hotbar[swapIndex].PreferredStatBuffs = stats; PacketSender.SendHotbarSwap(index, swapIndex); + return true; } // Change the dimension if the player is on a gateway diff --git a/Intersect.Client.Core/Interface/Game/Bag/BagItem.cs b/Intersect.Client.Core/Interface/Game/Bag/BagItem.cs index c2c83e97a1..ab0d7ec68e 100644 --- a/Intersect.Client.Core/Interface/Game/Bag/BagItem.cs +++ b/Intersect.Client.Core/Interface/Game/Bag/BagItem.cs @@ -19,15 +19,13 @@ public partial class BagItem : SlotItem { // Controls private readonly Label _quantityLabel; - private readonly BagWindow _bagWindow; // Context Menu Handling private readonly MenuItem _withdrawContextItem; - public BagItem(BagWindow bagWindow, Base parent, int index, ContextMenu contextMenu) + public BagItem(Base parent, int index, ContextMenu contextMenu) : base(parent, nameof(BagItem), index, contextMenu) { - _bagWindow = bagWindow; TextureFilename = "bagitem.png"; Icon.HoverEnter += Icon_HoverEnter; @@ -145,6 +143,16 @@ private void Icon_DoubleClicked(Base sender, MouseButtonState arguments) public override bool DragAndDrop_HandleDrop(Package package, int x, int y) { + if (Globals.Me is not { } player) + { + return false; + } + + if (Globals.BagSlots is not { Length: > 0 } bagSlots) + { + return false; + } + var targetNode = Interface.FindComponentUnderCursor(); // Find the first parent acceptable in that tree that can accept the package @@ -154,11 +162,11 @@ public override bool DragAndDrop_HandleDrop(Package package, int x, int y) { case BagItem bagItem: PacketSender.SendMoveBagItems(SlotIndex, bagItem.SlotIndex); - return true; + return bagSlots[bagItem.SlotIndex] is not { Quantity: > 0 }; case InventoryItem inventoryItem: - Globals.Me?.TryRetrieveItemFromBag(SlotIndex, inventoryItem.SlotIndex); - return true; + player.TryRetrieveItemFromBag(SlotIndex, inventoryItem.SlotIndex); + return bagSlots[inventoryItem.SlotIndex] is not { Quantity: > 0 }; default: targetNode = targetNode.Parent; @@ -194,7 +202,7 @@ public override void Update() var bagSlot = bagSlots[SlotIndex]; var descriptor = bagSlot.Descriptor; - _quantityLabel.IsVisibleInParent = !Icon.IsDragging && descriptor.IsStackable && bagSlot.Quantity > 1; + _quantityLabel.IsVisibleInParent = !Icon.IsHidden && descriptor.IsStackable && bagSlot.Quantity > 1; if (_quantityLabel.IsVisibleInParent) { _quantityLabel.Text = Strings.FormatQuantityAbbreviated(bagSlot.Quantity); diff --git a/Intersect.Client.Core/Interface/Game/Bag/BagWindow.cs b/Intersect.Client.Core/Interface/Game/Bag/BagWindow.cs index 7c88c48f93..6deb89dd9b 100644 --- a/Intersect.Client.Core/Interface/Game/Bag/BagWindow.cs +++ b/Intersect.Client.Core/Interface/Game/Bag/BagWindow.cs @@ -58,7 +58,7 @@ private void InitItemContainer() for (var slotIndex = 0; slotIndex < bagSlots.Length; slotIndex++) { - Items.Add(new BagItem(this, _slotContainer, slotIndex, _contextMenu)); + Items.Add(new BagItem(_slotContainer, slotIndex, _contextMenu)); } PopulateSlotContainer.Populate(_slotContainer, Items); diff --git a/Intersect.Client.Core/Interface/Game/Bank/BankItem.cs b/Intersect.Client.Core/Interface/Game/Bank/BankItem.cs index a9c7194737..7a832a64a9 100644 --- a/Intersect.Client.Core/Interface/Game/Bank/BankItem.cs +++ b/Intersect.Client.Core/Interface/Game/Bank/BankItem.cs @@ -22,15 +22,12 @@ public partial class BankItem : SlotItem { // Controls private readonly Label _quantityLabel; - private BankWindow _bankWindow; // Context Menu Handling private MenuItem _withdrawContextItem; - public BankItem(BankWindow bankWindow, Base parent, int index, ContextMenu contextMenu) : - base(parent, nameof(BankItem), index, contextMenu) + public BankItem(Base parent, int index, ContextMenu contextMenu) : base(parent, nameof(BankItem), index, contextMenu) { - _bankWindow = bankWindow; TextureFilename = "bankitem.png"; Icon.HoverEnter += Icon_HoverEnter; @@ -105,6 +102,7 @@ private void Icon_HoverEnter(Base? sender, EventArgs? arguments) if (bankSlots[SlotIndex] is not { Descriptor: not null } or { Quantity: <= 0 }) { + _quantityLabel.IsVisibleInParent = false; return; } @@ -194,29 +192,28 @@ public override bool DragAndDrop_HandleDrop(Package package, int x, int y) } } + if (Globals.BankSlots is not { Length: > 0 } bankSlots) + { + return false; + } + var targetNode = Interface.FindComponentUnderCursor(); // Find the first parent acceptable in that tree that can accept the package while (targetNode != default) { + if (bankSlots[SlotIndex] is not { Quantity: > 0 } slot) + { + return false; + } + switch (targetNode) { case BankItem bankItem: PacketSender.SendMoveBankItems(SlotIndex, bankItem.SlotIndex); - return true; + return bankSlots[bankItem.SlotIndex] is not { Quantity: > 0 }; case InventoryItem inventoryItem: - - if (Globals.BankSlots is not { Length: > 0 } bankSlots) - { - return false; - } - - if (bankSlots[SlotIndex] is not { Quantity: > 0 } slot) - { - return false; - } - player.TryRetrieveItemFromBank( SlotIndex, inventorySlotIndex: inventoryItem.SlotIndex, @@ -259,7 +256,7 @@ public override void Update() var bankSlot = bankSlots[SlotIndex]; var descriptor = bankSlot.Descriptor; - _quantityLabel.IsVisibleInParent = !Icon.IsDragging && descriptor.IsStackable && bankSlot.Quantity > 1; + _quantityLabel.IsVisibleInParent = descriptor.IsStackable && bankSlot.Quantity > 1 && !Icon.IsHidden; if (_quantityLabel.IsVisibleInParent) { _quantityLabel.Text = Strings.FormatQuantityAbbreviated(bankSlot.Quantity); @@ -283,6 +280,7 @@ public override void Update() { Icon.Texture = default; Icon.IsVisibleInParent = false; + _quantityLabel.IsVisibleInParent = false; } } } diff --git a/Intersect.Client.Core/Interface/Game/Bank/BankWindow.cs b/Intersect.Client.Core/Interface/Game/Bank/BankWindow.cs index a618f1e7a7..13d8a765c2 100644 --- a/Intersect.Client.Core/Interface/Game/Bank/BankWindow.cs +++ b/Intersect.Client.Core/Interface/Game/Bank/BankWindow.cs @@ -67,7 +67,7 @@ private void InitItemContainer() { for (var slotIndex = 0; slotIndex < Globals.BankSlotCount; slotIndex++) { - Items.Add(new BankItem(this, _slotContainer, slotIndex, _contextMenu)); + Items.Add(new BankItem(_slotContainer, slotIndex, _contextMenu)); } PopulateSlotContainer.Populate(_slotContainer, Items); diff --git a/Intersect.Client.Core/Interface/Game/Crafting/RecipeItem.cs b/Intersect.Client.Core/Interface/Game/Crafting/RecipeItem.cs index 9467c216a6..ce9623d55c 100644 --- a/Intersect.Client.Core/Interface/Game/Crafting/RecipeItem.cs +++ b/Intersect.Client.Core/Interface/Game/Crafting/RecipeItem.cs @@ -4,7 +4,6 @@ using Intersect.Client.General; using Intersect.Framework.Core.GameObjects.Crafting; using Intersect.Framework.Core.GameObjects.Items; -using Intersect.GameObjects; namespace Intersect.Client.Interface.Game.Crafting; @@ -14,8 +13,6 @@ public partial class RecipeItem public ImagePanel? Container; - public bool IsDragging; - //Dragging private bool mCanDrag; diff --git a/Intersect.Client.Core/Interface/Game/Hotbar/HotbarItem.cs b/Intersect.Client.Core/Interface/Game/Hotbar/HotbarItem.cs index 1783f5fa6f..353fd06b38 100644 --- a/Intersect.Client.Core/Interface/Game/Hotbar/HotbarItem.cs +++ b/Intersect.Client.Core/Interface/Game/Hotbar/HotbarItem.cs @@ -217,12 +217,9 @@ public override bool DragAndDrop_HandleDrop(Package package, int x, int y) if (targetNode is HotbarItem hotbarItem) { player.HotbarSwap(SlotIndex, hotbarItem.SlotIndex); - return true; - } - else - { - targetNode = targetNode.Parent; } + + targetNode = targetNode.Parent; } // If we've reached the top of the tree, we can't drop here, so cancel drop diff --git a/Intersect.Client.Core/Interface/Game/Inventory/InventoryItem.cs b/Intersect.Client.Core/Interface/Game/Inventory/InventoryItem.cs index a95b5d3a59..d3310d8321 100644 --- a/Intersect.Client.Core/Interface/Game/Inventory/InventoryItem.cs +++ b/Intersect.Client.Core/Interface/Game/Inventory/InventoryItem.cs @@ -13,7 +13,6 @@ using Intersect.Client.Interface.Game.Hotbar; using Intersect.Client.Interface.Game.Shop; using Intersect.Client.Localization; -using Intersect.Client.Networking; using Intersect.Configuration; using Intersect.Framework.Core.GameObjects.Items; using Intersect.GameObjects; @@ -421,7 +420,7 @@ public override bool DragAndDrop_HandleDrop(Package package, int x, int y) case BagItem bagItem: player.TryStoreItemInBag(SlotIndex, bagItem.SlotIndex); - return true; + return false; case BankItem bankItem: return player.TryStoreItemInBank( @@ -433,11 +432,11 @@ public override bool DragAndDrop_HandleDrop(Package package, int x, int y) case HotbarItem hotbarItem: player.AddToHotbar(hotbarItem.SlotIndex, 0, SlotIndex); - return true; + return false; case ShopWindow: player.TrySellItem(SlotIndex); - return true; + return false; default: targetNode = targetNode.Parent; @@ -496,17 +495,14 @@ public override void Update() } var equipped = Globals.Me.MyEquipment.Any(s => s == SlotIndex); - var isDragging = Icon.IsDragging; - _equipImageBackground.IsVisibleInParent = !isDragging && equipped; - _equipLabel.IsVisibleInParent = !isDragging && equipped; - - _quantityLabel.IsVisibleInParent = !isDragging && descriptor.IsStackable && inventorySlot.Quantity > 1; + _equipImageBackground.IsVisibleInParent = !Icon.IsDragging && equipped; + _equipLabel.IsVisibleInParent = !Icon.IsHidden && equipped; + _quantityLabel.IsVisibleInParent = !Icon.IsHidden && descriptor.IsStackable && inventorySlot.Quantity > 1; if (_quantityLabel.IsVisibleInParent) { _quantityLabel.Text = Strings.FormatQuantityAbbreviated(inventorySlot.Quantity); } - - _cooldownLabel.IsVisibleInParent = !isDragging && Globals.Me.IsItemOnCooldown(SlotIndex); + _cooldownLabel.IsVisibleInParent = !Icon.IsHidden && Globals.Me.IsItemOnCooldown(SlotIndex); if (_cooldownLabel.IsVisibleInParent) { var itemCooldownRemaining = Globals.Me.GetItemRemainingCooldown(SlotIndex); diff --git a/Intersect.Client.Core/Interface/Game/Shop/ShopItem.cs b/Intersect.Client.Core/Interface/Game/Shop/ShopItem.cs index f56ef18ef6..6becd3c390 100644 --- a/Intersect.Client.Core/Interface/Game/Shop/ShopItem.cs +++ b/Intersect.Client.Core/Interface/Game/Shop/ShopItem.cs @@ -16,13 +16,11 @@ namespace Intersect.Client.Interface.Game.Shop; public partial class ShopItem : SlotItem { private readonly int _mySlot; - private readonly ShopWindow _shopWindow; private readonly MenuItem _buyMenuItem; - public ShopItem(ShopWindow shopWindow, Base parent, int index, ContextMenu contextMenu) + public ShopItem(Base parent, int index, ContextMenu contextMenu) : base(parent, nameof(ShopItem), index, contextMenu) { - _shopWindow = shopWindow; _mySlot = index; TextureFilename = "shopitem.png"; @@ -106,7 +104,7 @@ private void Icon_DoubleClicked(Base sender, MouseButtonState arguments) Globals.Me?.TryBuyItem(_mySlot); } - private void _buyMenuItem_Clicked(Base sender, Framework.Gwen.Control.EventArguments.MouseButtonState arguments) + private void _buyMenuItem_Clicked(Base sender, MouseButtonState arguments) { Globals.Me?.TryBuyItem(_mySlot); } diff --git a/Intersect.Client.Core/Interface/Game/Shop/ShopWindow.cs b/Intersect.Client.Core/Interface/Game/Shop/ShopWindow.cs index a5a0f538a3..a28587aea5 100644 --- a/Intersect.Client.Core/Interface/Game/Shop/ShopWindow.cs +++ b/Intersect.Client.Core/Interface/Game/Shop/ShopWindow.cs @@ -58,7 +58,7 @@ private void InitItemContainer() for (var slotIndex = 0; slotIndex < gameShop.SellingItems.Count; slotIndex++) { - _items.Add(new ShopItem(this, _slotContainer, slotIndex, _contextMenu)); + _items.Add(new ShopItem(_slotContainer, slotIndex, _contextMenu)); } PopulateSlotContainer.Populate(_slotContainer, _items); diff --git a/Intersect.Client.Core/Interface/Game/Spells/SpellItem.cs b/Intersect.Client.Core/Interface/Game/Spells/SpellItem.cs index 53b58db10d..d875f1ad7f 100644 --- a/Intersect.Client.Core/Interface/Game/Spells/SpellItem.cs +++ b/Intersect.Client.Core/Interface/Game/Spells/SpellItem.cs @@ -173,7 +173,7 @@ public override bool DragAndDrop_HandleDrop(Package package, int x, int y) case HotbarItem hotbarItem: player.AddToHotbar(hotbarItem.SlotIndex, 1, SlotIndex); - return true; + return false; default: targetNode = targetNode.Parent; @@ -207,7 +207,7 @@ public override void Update() return; } - _cooldownLabel.IsVisibleInParent = !Icon.IsDragging && Globals.Me.IsSpellOnCooldown(SlotIndex); + _cooldownLabel.IsVisibleInParent = !Icon.IsHidden && Globals.Me.IsSpellOnCooldown(SlotIndex); if (_cooldownLabel.IsVisibleInParent) { var itemCooldownRemaining = Globals.Me.GetSpellRemainingCooldown(SlotIndex); diff --git a/Intersect.Client.Core/Interface/Game/Trades/TradeItem.cs b/Intersect.Client.Core/Interface/Game/Trades/TradeItem.cs index 0384b263d9..dfd246e0fa 100644 --- a/Intersect.Client.Core/Interface/Game/Trades/TradeItem.cs +++ b/Intersect.Client.Core/Interface/Game/Trades/TradeItem.cs @@ -6,7 +6,6 @@ using Intersect.Client.General; using Intersect.Configuration; using Intersect.Framework.Core.GameObjects.Items; -using Intersect.GameObjects; namespace Intersect.Client.Interface.Game.Trades; diff --git a/Intersect.Client.Core/Localization/Strings.cs b/Intersect.Client.Core/Localization/Strings.cs index ea8fb4106c..722a8f3c8c 100644 --- a/Intersect.Client.Core/Localization/Strings.cs +++ b/Intersect.Client.Core/Localization/Strings.cs @@ -541,7 +541,10 @@ public partial struct Bags public static LocalizedString StoreItem = @"Store Item"; [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public static LocalizedString StoreItemPrompt = @"How many/much {00} would you like to store?"; + public static LocalizedString StoreMultipleItemPrompt = @"How many/much {00} would you like to store?"; + + [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] + public static LocalizedString StoreItemPrompt = @"Do you wish to store the item: {00} ?"; [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public static LocalizedString Title = @"Bag"; diff --git a/Intersect.Client.Framework/Entities/IPlayer.cs b/Intersect.Client.Framework/Entities/IPlayer.cs index 7142371d2e..e0ff8aec6c 100644 --- a/Intersect.Client.Framework/Entities/IPlayer.cs +++ b/Intersect.Client.Framework/Entities/IPlayer.cs @@ -34,7 +34,7 @@ public interface IPlayer : IEntity void AddToHotbar(int hotbarSlot, sbyte itemType, int itemSlot); int FindHotbarItem(IHotbarInstance hotbarInstance); int FindHotbarSpell(IHotbarInstance hotbarInstance); - void HotbarSwap(int index, int swapIndex); + bool HotbarSwap(int index, int swapIndex); int FindItem(Guid itemId, int itemVal = 1); void SwapItems(int item1, int item2); long GetItemCooldown(Guid id);