karmamuscle |
08-16-15 05:18 AM |
[quote=Talyrius;310354]Here is another alternative:
Lua Code:
-- confirm item destruction with delete key local addText = "\n\n|cff808080Note:|r You may also press the |cffffd200Delete|r key as confirmation." local itemDialogs = { "DELETE_ITEM", "DELETE_GOOD_ITEM", "DELETE_QUEST_ITEM", "DELETE_GOOD_QUEST_ITEM", } for k, v in pairs(itemDialogs) do StaticPopupDialogs[v].text = _G[v] .. addText end local f = CreateFrame("Frame", nil, UIParent) f:RegisterEvent("DELETE_ITEM_CONFIRM") f:SetScript("OnEvent", function(self, event) for i = 1, STATICPOPUP_NUMDIALOGS do local dialog = _G["StaticPopup" .. i] local editBox = _G["StaticPopup" .. i .. "EditBox"] local isItemDialog = false for k, v in pairs(itemDialogs) do if dialog.which == v then isItemDialog = true end end if isItemDialog then if editBox then editBox:ClearFocus() end dialog:SetScript("OnKeyDown", function(self, key) if key == "DELETE" then DeleteCursorItem() end end) dialog:HookScript("OnHide", function(self) self:SetScript("OnKeyDown", nil) end) end end end)
This is very neat! Love it. :D
Found some items it can't use the delete key for.
All the old rare tokens from Ahn'Qiraj can't be deleted with the Del key.
There was an item from Tanaan Jungle as well, but I forgot to write down the name ofc...
Update: It is Baleful tokens
|