From 0c16f3241ebe0100e7a6314909b2992304c539f6 Mon Sep 17 00:00:00 2001 From: Salikh Gurgenidze Date: Sat, 22 Nov 2025 11:57:23 +0400 Subject: [PATCH] clean: unused code --- UI/ItemButton.lua | 116 ---------------------------------------------- 1 file changed, 116 deletions(-) diff --git a/UI/ItemButton.lua b/UI/ItemButton.lua index 51da5e5..e3cd83f 100644 --- a/UI/ItemButton.lua +++ b/UI/ItemButton.lua @@ -661,120 +661,4 @@ function Guda_ItemButton_OnLeave(self) Guda_BagFrame_ClearBagButtonHighlight() end end -end - --- OnDragStart handler -function Guda_ItemButton_OnDragStart(self, button) - -- Don't allow dragging other characters' items or in read-only mode - if self.otherChar or self.isReadOnly then - return - end - - -- Only allow left button drag - if button == "LeftButton" and self.hasItem then - -- Ensure the global click catcher doesn't intercept the drag/drop - local cc = getglobal and getglobal("Guda_ClickCatcher") - if cc and cc.Hide and cc:IsShown() then - cc:Hide() - end - PickupContainerItem(self.bagID, self.slotID) - end -end - --- OnReceiveDrag handler -function Guda_ItemButton_OnReceiveDrag(self) - -- Don't allow dragging to other characters' items or in read-only mode - if self.otherChar or self.isReadOnly then - return - end - - -- Place the item being dragged - PickupContainerItem(self.bagID, self.slotID) - - -- Trigger UI update after drop completes (was skipped during drag) - if addon and addon.Modules and addon.Modules.BagFrame then - addon.Modules.BagFrame:Update() - end -end - --- Handle mouse-up to emulate Blizzard drop behavior on 1.12 where OnReceiveDrag may not always fire --- (rollback) no custom OnMouseUp; rely on Blizzard default - --- OnMouseDown handler - pick up item when pressing mouse button (classic pattern) --- (rollback) no custom OnMouseDown; rely on Blizzard default - --- OnDragStop handler (optional cleanup) -function Guda_ItemButton_OnDragStop(self) - -- Reset cursor to default to avoid lingering special cursors - if ResetCursor then - ResetCursor() - end - - -- Trigger UI update after drag completes (was skipped during drag) - if addon and addon.Modules and addon.Modules.BagFrame then - addon.Modules.BagFrame:Update() - end -end - --- Stack split callback (called by StackSplitFrame) -local function ItemButton_SplitStack(self, split) - if self.bagID and self.slotID then - SplitContainerItem(self.bagID, self.slotID, split) - end -end - --- OnClick handler -function Guda_ItemButton_OnClick(self, button) - -- Don't allow interaction with other characters' items or in read-only mode - if self.otherChar or self.isReadOnly then return end - - -- Set the split callback - self.SplitStack = ItemButton_SplitStack - - -- Modified clicks - if IsShiftKeyDown() then - if button == "LeftButton" and self.hasItem then - -- Get live count and link - local _, count = GetContainerItemInfo(self.bagID, self.slotID) - local itemLink = GetContainerItemLink(self.bagID, self.slotID) - - -- Shift+Left Click on stackable item: Show split stack dialog - if count and count > 1 then - OpenStackSplitFrame(count, self, "BOTTOMRIGHT", "TOPRIGHT") - return - end - -- If not stackable or only 1 item, link to chat - if itemLink and ChatFrameEditBox:IsVisible() then - ChatFrameEditBox:Insert(itemLink) - end - end - return - elseif IsControlKeyDown() then - -- Ctrl+Click: Dress up (if applicable) - if self.hasItem then - local itemLink = GetContainerItemLink(self.bagID, self.slotID) - if itemLink then - DressUpItemLink(itemLink) - end - end - return - end - - if button == "LeftButton" then - -- Left clicks are handled by MouseDown/MouseUp to prevent instant self-drop. - return - elseif button == "RightButton" then - -- Right click: Use item (only if slot has an item) - if self.hasItem then - UseContainerItem(self.bagID, self.slotID) - end - end -end - --- Release all buttons -function Guda_ReleaseAllButtons() - for _, button in pairs(buttonPool) do - button:Hide() - button:ClearAllPoints() - end end \ No newline at end of file