Skip to content

Commit b6cb66c

Browse files
committed
fix: spell/item icon flicker after successful drag-drop
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.
1 parent 0783a72 commit b6cb66c

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

Intersect.Client.Core/Interface/Game/Draggable.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ public override void DragAndDrop_StartDragging(Package package, int x, int y)
3939

4040
public override void DragAndDrop_EndDragging(bool success, int x, int y)
4141
{
42-
IsVisibleInParent = true;
42+
if (!success)
43+
{
44+
IsVisibleInParent = true;
45+
}
4346
}
4447

4548
public override bool DragAndDrop_HandleDrop(Package package, int x, int y)

Intersect.Client.Core/Interface/Game/Inventory/InventoryItem.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ private void PlayerOnInventoryUpdated(Player player, int slotIndex)
477477

478478
// empty texture to reload on update
479479
Icon.Texture = default;
480+
Icon.IsVisibleInParent = false;
480481
}
481482

482483
public override void Update()

Intersect.Client.Framework/Gwen/DragDrop/DragAndDrop.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private static bool ShouldStartDraggingControl(int x, int y)
5858

5959
// Not been dragged far enough
6060
var length = Math.Abs(x - sLastPressedPos.X) + Math.Abs(y - sLastPressedPos.Y);
61-
if (length < 5)
61+
if (length <= 1)
6262
{
6363
return false;
6464
}

0 commit comments

Comments
 (0)