WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   Type DELETE! (https://www.wowinterface.com/forums/showthread.php?t=52612)

Deadlyz 08-14-15 07:43 AM

Type DELETE!
 
Is there any addon that allows deleting epic/blue items without typing anything?

I'm really lazy.

bsmorgan 08-14-15 09:19 AM

I too am annoyed by the type DELETE dialog but I'd be careful eliminating the dialog completely. I believe a simple confirmation dialog (i.e. OK or Cancel) would be adequate.

p3lim 08-14-15 01:24 PM

Lua Code:
  1. StaticPopupDialogs.DELETE_GOOD_ITEM.hasEditBox = false
  2. StaticPopupDialogs.DELETE_GOOD_ITEM.OnShow = function(self)
  3.     self.button1:Enable()
  4. end

Phanx 08-15-15 12:00 AM

And if you want to be even lazier and just press Enter instead of moving the mouse to click, you can add:

Code:

StaticPopupDialogs.DELETE_GOOD_ITEM.enterClicksFirstButton = 1

SDPhantom 08-15-15 12:57 AM

I'd honestly just sync it with StaticPopupDialogs["DELETE_ITEM"].
Code:

StaticPopupDialogs.DELETE_GOOD_ITEM=StaticPopupDialogs.DELETE_ITEM

Deadlyz 08-15-15 03:29 AM

Nice, thanks!

Now how do I make it into an addon?

Talyrius 08-15-15 07:05 AM

Here is another alternative:
Lua Code:
  1. -- confirm item destruction with delete key
  2. local addText = "\n\n|cff808080Note:|r You may also press the |cffffd200Delete|r key as confirmation."
  3. local itemDialogs = {
  4.   "DELETE_ITEM",
  5.   "DELETE_GOOD_ITEM",
  6.   "DELETE_QUEST_ITEM",
  7.   "DELETE_GOOD_QUEST_ITEM",
  8. }
  9.  
  10. for k, v in pairs(itemDialogs) do
  11.   StaticPopupDialogs[v].text = _G[v] .. addText
  12. end
  13.  
  14. local f = CreateFrame("Frame", nil, UIParent)
  15. f:RegisterEvent("DELETE_ITEM_CONFIRM")
  16. f:SetScript("OnEvent", function(self, event)
  17.   for i = 1, STATICPOPUP_NUMDIALOGS do
  18.     local dialog = _G["StaticPopup" .. i]
  19.     local editBox = _G["StaticPopup" .. i .. "EditBox"]
  20.     local isItemDialog = false
  21.     for k, v in pairs(itemDialogs) do
  22.       if dialog.which == v then
  23.         isItemDialog = true
  24.       end
  25.     end
  26.     if isItemDialog then
  27.       if editBox then
  28.         editBox:ClearFocus()
  29.       end
  30.       dialog:SetScript("OnKeyDown", function(self, key)
  31.         if key == "DELETE" then
  32.           DeleteCursorItem()
  33.         end
  34.       end)
  35.       dialog:HookScript("OnHide", function(self)
  36.         self:SetScript("OnKeyDown", nil)
  37.       end)
  38.     end
  39.   end
  40. end)

Quote:

Originally Posted by Deadlyz (Post 310351)
Nice, thanks!

Now how do I make it into an addon?

http://addon.bool.no/

karmamuscle 08-16-15 05:18 AM

[quote=Talyrius;310354]Here is another alternative:
Lua Code:
  1. -- confirm item destruction with delete key
  2. local addText = "\n\n|cff808080Note:|r You may also press the |cffffd200Delete|r key as confirmation."
  3. local itemDialogs = {
  4.   "DELETE_ITEM",
  5.   "DELETE_GOOD_ITEM",
  6.   "DELETE_QUEST_ITEM",
  7.   "DELETE_GOOD_QUEST_ITEM",
  8. }
  9.  
  10. for k, v in pairs(itemDialogs) do
  11.   StaticPopupDialogs[v].text = _G[v] .. addText
  12. end
  13.  
  14. local f = CreateFrame("Frame", nil, UIParent)
  15. f:RegisterEvent("DELETE_ITEM_CONFIRM")
  16. f:SetScript("OnEvent", function(self, event)
  17.   for i = 1, STATICPOPUP_NUMDIALOGS do
  18.     local dialog = _G["StaticPopup" .. i]
  19.     local editBox = _G["StaticPopup" .. i .. "EditBox"]
  20.     local isItemDialog = false
  21.     for k, v in pairs(itemDialogs) do
  22.       if dialog.which == v then
  23.         isItemDialog = true
  24.       end
  25.     end
  26.     if isItemDialog then
  27.       if editBox then
  28.         editBox:ClearFocus()
  29.       end
  30.       dialog:SetScript("OnKeyDown", function(self, key)
  31.         if key == "DELETE" then
  32.           DeleteCursorItem()
  33.         end
  34.       end)
  35.       dialog:HookScript("OnHide", function(self)
  36.         self:SetScript("OnKeyDown", nil)
  37.       end)
  38.     end
  39.   end
  40. 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

Deadlyz 08-16-15 02:55 PM

Talyrius
Thank you! I'm going to test it tomorrow.

Hope it won't auto-delete all my valuables!

Deadlyz 08-18-15 04:13 AM

Quote:

You may also press the |cffffd200Delete|r key as confirmation.
Is it possible to only show this text when deleting items that actually require typing anything?



Thanks!

Talyrius 08-18-15 01:01 PM

Quote:

Originally Posted by Deadlyz (Post 310416)
Is it possible to only show this text when deleting items that actually require typing anything?



Thanks!

Yes, remove the dialogs you don't want from the table.

Lua Code:
  1. local itemDialogs = {
  2.   "DELETE_ITEM", -- "Do you want to destroy %s?"
  3.   "DELETE_GOOD_ITEM", -- "Do you want to destroy %s?\n\nType \"DELETE\" into the field to confirm."
  4.   "DELETE_QUEST_ITEM", -- "Do you want to destroy %s?\n\n|cffff2020Destroying this item will also abandon any related quests.|r"
  5.   "DELETE_GOOD_QUEST_ITEM", -- "Do you want to destroy %s?\n|cffff2020Destroying this item will also abandon any related quests.|r\n\nType \"DELETE\" into the field to confirm."
  6. }

Deadlyz 08-18-15 03:37 PM

Quote:

Originally Posted by Talyrius (Post 310424)
Yes, remove the dialogs you don't want from the table.

Well, now I'm confused. I'm not sure I want to remove those dialogs.



I'm full of ideas today!

Deadlyz 08-19-15 03:41 AM

Quote:

Originally Posted by karmamuscle (Post 310380)
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

Delete key isn't working for toys and even Hyper Augment Runes.

updt: tried to delete some blue PvP item I got from Gladiator's sanctum but it won't let me.

Talyrius 08-19-15 03:01 PM

Quote:

Originally Posted by Deadlyz (Post 310425)
Well, now I'm confused. I'm not sure I want to remove those dialogs.

You're free to modify the code.

Quote:

Originally Posted by Deadlyz (Post 310435)
Delete key isn't working for toys and even Hyper Augment Runes.

updt: tried to delete some blue PvP item I got from Gladiator's sanctum but it won't let me.

I've used the code to delete everything I've encountered, including some of the things you've said haven't worked.

Deadlyz 08-24-15 06:54 AM

Talyrius
For some reason Delete key isn't working for me. *the key itself is working*

P3lim
Quote:

StaticPopupDialogs.DELETE_GOOD_ITEM.hasEditBox = false
StaticPopupDialogs.DELETE_GOOD_ITEM.OnShow = function(self)
self.button1:Enable()
end
This seems to be working nicely..



.. but how do I remove this text?

Phanx 08-24-15 08:16 AM

Code:

StaticPopupDialogs.DELETE_GOOD_ITEM.text = DELETE_ITEM

p3lim 08-24-15 08:30 AM

At this point I'd just have to agree with SDPhantom, replacing the popup with the normal one entirely.

Deadlyz 08-24-15 09:40 AM

Quote:

Originally Posted by p3lim (Post 310558)
At this point I'd just have to agree with SDPhantom, replacing the popup with the normal one entirely.

So.. just this one line?
Quote:

StaticPopupDialogs.DELETE_GOOD_ITEM=StaticPopupDialogs.DELETE_ITEM

SDPhantom 08-24-15 01:12 PM

Yep.

It runs the exact same API function when you confirm, so there's really no difference in how they operate.

Deadlyz 08-24-15 01:46 PM

EpicDelete works like a charm. Thanks everyone!


All times are GMT -6. The time now is 02:44 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI