Quick Instructions:
This addon puts a red and white slash across items in your bags, bank, or on your character that you want to mark so you will not accidentally vendor or disenchant that item.
To use this addon, left click the minimap DoNotVendor button. Then alt left click any item in your bags, your bank, or your character to toggle the red and white slash mark. If the item doesn't have the slash, alt left clicking it will add the slash. If the item already has the slash, alt left clicking it will remove the slash. Alt left clicking items will stop working 30 seconds after you left clicked the minimap button (actually 30 sec after your last alt left click). After that, you would need to left click the minimap button again to resume more toggling.
Detailed Instructions:
This stores the itemID of the item in a DoNotVendor list and DoNotVendor only compares itemID's to see if it should add the red and white slash or not. That means if you alt left click an item in your bag, it will mark any item with that item’s itemID as DoNotVendor. So for example, if you alt left click one Goblin Glider, all Goblin Gliders in your bags and bank will get the red and white slash. If you had three Salvaged Viperid Band rings with only one of the rings enchanted and you set the enchanted ring to DoNotVendor, then all three rings will show up as do not vendor because all three rings have the same itemID.
The red and white DoNotVendor slashes will not actually prevent you from vendoring or disenchanting at all. It is merely a visual warning to you. If you mark a grey item as DoNotVendor and then open a vendoring dialog and click the Sell All Junk Items button, you’re going to sell that grey item. So if you want to not vendor grey items, don’t use the Sell All Junk Items icon in the vendoring dialog.
Since this doesn't actually prevent you from vendoring or disenchanting, you might be tempted to simply vendor or disenchant some item that has a red and white DoNotVendor slash on it because you changed your mind and now you want to vendor it. I recommend you not do this. Remove the red and white DoNotVendor slash first before you vendor or disenchant it. The reason for this is because every item with a red and white slash has its itemID stored in a list. If you vendor something that has a red and white slash in it, the itemID will remain in the DoNotVendor list and all these itemID's have to be searched every time you open your bag or bank or character pane and the search happens with every item in your bag. This uses a very fast binary search to minimize time needed to open your bags, but it is better if the list only contains items you actually want to prevent vendoring or disenchanting. I suspect you won't notice any change in the time to open bags until your list contains ten thousand or more items so most people won't need to worry about this.
In the example character pane image, you will see all my equipped gear is marked DoNotVendor. That is because when I use equipment manager to swap into my speed set gear, most of my high level gear is put into my bags. I don't want to accidentally vendor any of that gear while I'm doing an old content dungeon in speed set gear.
This does not work in the guild bank. There isn't much of a problem accidentally vendoring or disenchanting items directly from the guild bank anyway.
This also does not work with the popular addon Bagnon. Perhaps if someone who uses Bagnon and knows how to use Lua to iterate through the item frames that contain the icons for the items can post a comment telling me how to do that, I could add support in the future. I need access to those frames to add the red and white slash overlay.
Ideally, I’d like to make this addon so it prevents vendoring or disenchanting selected items, but it is easier said than done to do exactly what is desired in an addon given the limited access addon developers have to the user interface. This addon does what is currently easy to do, visually marking items with a red and white diagonal line so we can easily see we are about to do that which we don’t want to do. I’ll investigate further to see if I can physically prevent vendoring or disenchanting, but for now this addon will at least prevent most accidental vendoring and disenchanting.
Background History:
I decided to make this addon after my wife discovered she vendored some gear that she very much did not want to vendor. She had spent a lot of time going into old BfA dungeons to get longstrider speed gear and when she realized she had vendored a piece of longstrider speed gear and hadn’t realized it until it was too late and unavailable to buy back, she almost started to cry. She was frustrated with herself and it definitely destroyed her enjoyment for the day. Since my wife is precious to me, it destroyed my enjoyment for the day as well. I’ve got a lot more experience in wow and yet I know I’ve accidentally vendored gear I didn’t want vendored as well. I know someone with vastly more experience than I have and remembered him saying he deeply regretted vendoring his highest level weapon accidentally, leaving him with only a very low level weapon in its place and dismay at his new abysmally low ilvl. So I decided to make this addon to hopefully prevent more grief and tears for my family and for you as well.