Skip to content

Commit e91f220

Browse files
committed
Clear cursor pickup when opening item menu
Handles a niche case where the item menu does nothing because the item in question is locked due to being picked up on the cursor.
1 parent f0472b0 commit e91f220

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

ConsolePort/Utils/Wrapper.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ CPAPI.RunMacroText = C_Macro and C_Macro.RunMacroText
256256
CPAPI.SplitContainerItem = C_Container and C_Container.SplitContainerItem or SplitContainerItem;
257257
CPAPI.UseContainerItem = C_Container and C_Container.UseContainerItem or UseContainerItem;
258258
-- Fallthroughs
259+
CPAPI.ClearCursor = ClearCursor or nop;
259260
CPAPI.GetOverrideBarSkin = GetOverrideBarSkin or nop;
260261
CPAPI.GetSpecializationInfoByID = GetSpecializationInfoByID or nop;
261262
CPAPI.IsInLFDBattlefield = IsInLFDBattlefield or nop;

ConsolePort/View/Popup/ItemMenu.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ local ItemMenu = db:Register('ItemMenu', CPAPI.EventHandler(ConsolePortItemMenu,
99
'PLAYER_REGEN_DISABLED';
1010
}))
1111
---------------------------------------------------------------
12-
local INDEX_INFO_ILINK = 2
13-
local INDEX_INFO_ITEMQ = 3
14-
local INDEX_INFO_STACK = 8
15-
local INDEX_INFO_EQLOC = 9
16-
---------------------------------------------------------------
1712
local INV_EQ_LOCATIONS = {
1813
INVTYPE_RANGED = CPAPI.IsClassicVersion and {'RANGEDSLOT'};
1914
INVTYPE_CLOAK = {'BACKSLOT'};
@@ -60,6 +55,7 @@ function ItemMenu:SetItem(bagID, slotID)
6055
self.Name:SetTextColor(self:GetItemQualityColor().color:GetRGB())
6156
self.Border:SetAtlas(BORDER_ATLAS[self:GetQuality()])
6257

58+
self:ClearPickup()
6359
self:SetTooltip()
6460
self:SetCommands()
6561
self:FixHeight()
@@ -82,7 +78,7 @@ function ItemMenu:SetCommands()
8278
end
8379

8480
if self:IsSellableItem() then
85-
self:AddCommand('Sell', 'Sell')
81+
self:AddCommand(L'Sell', 'Sell')
8682
end
8783

8884
if self:IsSplittableItem() then
@@ -334,6 +330,10 @@ function ItemMenu:Refresh()
334330
end
335331
end
336332

333+
function ItemMenu:ClearPickup()
334+
CPAPI.ClearCursor()
335+
end
336+
337337
function ItemMenu:MERCHANT_SHOW()
338338
self.merchantAvailable = true;
339339
self:Refresh()

0 commit comments

Comments
 (0)