Thread Tools Display Modes
08-14-15, 07:43 AM   #1
Deadlyz
A Wyrmkin Dreamwalker
 
Deadlyz's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 55
Type DELETE!

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

I'm really lazy.
__________________

My last movie: Rogue Sweethearts
  Reply With Quote
08-14-15, 09:19 AM   #2
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
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.
  Reply With Quote
08-14-15, 01:24 PM   #3
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Lua Code:
  1. StaticPopupDialogs.DELETE_GOOD_ITEM.hasEditBox = false
  2. StaticPopupDialogs.DELETE_GOOD_ITEM.OnShow = function(self)
  3.     self.button1:Enable()
  4. end
  Reply With Quote
08-15-15, 12:00 AM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
08-15-15, 12:57 AM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
I'd honestly just sync it with StaticPopupDialogs["DELETE_ITEM"].
Code:
StaticPopupDialogs.DELETE_GOOD_ITEM=StaticPopupDialogs.DELETE_ITEM
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
08-15-15, 03:29 AM   #6
Deadlyz
A Wyrmkin Dreamwalker
 
Deadlyz's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 55
Nice, thanks!

Now how do I make it into an addon?
__________________

My last movie: Rogue Sweethearts
  Reply With Quote
08-15-15, 07:05 AM   #7
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 363
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)

Originally Posted by Deadlyz View Post
Nice, thanks!

Now how do I make it into an addon?
http://addon.bool.no/
  Reply With Quote
08-16-15, 05:18 AM   #8
karmamuscle
A Cobalt Mageweaver
 
karmamuscle's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 205
[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.
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
__________________
55 89 144 233 377 610 987 1597 2584 4181 6765

Last edited by karmamuscle : 08-16-15 at 04:23 PM. Reason: Updated with Tanaan info
  Reply With Quote
08-16-15, 02:55 PM   #9
Deadlyz
A Wyrmkin Dreamwalker
 
Deadlyz's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 55
Talyrius
Thank you! I'm going to test it tomorrow.

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

My last movie: Rogue Sweethearts
  Reply With Quote
08-18-15, 04:13 AM   #10
Deadlyz
A Wyrmkin Dreamwalker
 
Deadlyz's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 55
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!
__________________

My last movie: Rogue Sweethearts
  Reply With Quote
08-18-15, 01:01 PM   #11
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 363
Originally Posted by Deadlyz View Post
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. }
  Reply With Quote
08-18-15, 03:37 PM   #12
Deadlyz
A Wyrmkin Dreamwalker
 
Deadlyz's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 55
Originally Posted by Talyrius View Post
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!
__________________

My last movie: Rogue Sweethearts
  Reply With Quote
08-19-15, 03:41 AM   #13
Deadlyz
A Wyrmkin Dreamwalker
 
Deadlyz's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 55
Originally Posted by karmamuscle View Post
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.
__________________

My last movie: Rogue Sweethearts

Last edited by Deadlyz : 08-19-15 at 03:57 AM.
  Reply With Quote
08-19-15, 03:01 PM   #14
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 363
Originally Posted by Deadlyz View Post
Well, now I'm confused. I'm not sure I want to remove those dialogs.
You're free to modify the code.

Originally Posted by Deadlyz View Post
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.
  Reply With Quote
08-24-15, 06:54 AM   #15
Deadlyz
A Wyrmkin Dreamwalker
 
Deadlyz's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 55
Talyrius
For some reason Delete key isn't working for me. *the key itself is working*

P3lim
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?
__________________

My last movie: Rogue Sweethearts
  Reply With Quote
08-24-15, 08:16 AM   #16
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Code:
StaticPopupDialogs.DELETE_GOOD_ITEM.text = DELETE_ITEM
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
08-24-15, 08:30 AM   #17
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
At this point I'd just have to agree with SDPhantom, replacing the popup with the normal one entirely.
  Reply With Quote
08-24-15, 09:40 AM   #18
Deadlyz
A Wyrmkin Dreamwalker
 
Deadlyz's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 55
Originally Posted by p3lim View Post
At this point I'd just have to agree with SDPhantom, replacing the popup with the normal one entirely.
So.. just this one line?
StaticPopupDialogs.DELETE_GOOD_ITEM=StaticPopupDialogs.DELETE_ITEM
__________________

My last movie: Rogue Sweethearts
  Reply With Quote
08-24-15, 01:12 PM   #19
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
Yep.

It runs the exact same API function when you confirm, so there's really no difference in how they operate.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 08-24-15 at 01:16 PM.
  Reply With Quote
08-24-15, 01:46 PM   #20
Deadlyz
A Wyrmkin Dreamwalker
 
Deadlyz's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 55
EpicDelete works like a charm. Thanks everyone!
__________________

My last movie: Rogue Sweethearts
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Type DELETE!

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off