View Single Post
02/21/18, 05:44 AM   #6
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Try to ask twice a day, maybe someone will have the time then (ironic) But I guess he/she won't have the desire to do it anymore because of your daily bumps

Lua Code:
  1. unction ZO_InventoryManager:OnInventoryItemAdded(inventoryType, bagId, slotIndex, newSlotData)
  2.     local inventory = self.inventories[inventoryType]
  3.     newSlotData.searchData = {type = SEARCH_TYPE_INVENTORY, bagId = bagId, slotIndex = slotIndex}
  4.  
  5.     newSlotData.inventory = inventory
  6.  
  7.     inventory.stringSearch:Insert(newSlotData.searchData)
  8.  
  9.     -- play a brief flash animation on all the filter tabs that match this item's filterTypes
  10.     if newSlotData.brandNew then
  11.         self:PlayItemAddedAlert(newSlotData.filterData, inventory.tabFilters)
  12.     end
  13. end

This function is called as a new item is put into your inventory.
The lower part is the important one that you don't want to happen anymore:
Lua Code:
  1. -- play a brief flash animation on all the filter tabs that match this item's filterTypes
  2.     if newSlotData.brandNew then

The class ZO_InventoryManager is assigned to the following variable ingame:
Lua Code:
  1. function ZO_PlayerInventory_Initialize()
  2.     -- ZO_PlayerInventory is used for event registration only. There are multiple inventory controls, but only one manager is needed.
  3.     PLAYER_INVENTORY = ZO_InventoryManager:New(ZO_PlayerInventory)
  4. end

PLAYER_INVENTORY is the variable you need to use to get into this function OnInventoryItemAdded then:

So learn to code addons at the wiki, there are many examples and helps:
http://wiki.esoui.com/Main_Page (check the right side!)
http://wiki.esoui.com/Getting_Started
http://wiki.esoui.com/Writing_your_first_addon
http://wiki.esoui.com/MyFirstAddon_t...Zenimax_Online
http://wiki.esoui.com/ISummonThee
http://wiki.esoui.com/SimpleNotebookTutorial/part1

You can use the function ZO_PreHook to pre-enter a function of the base game. You can modify values or run your own source code then prior to the original function.
After that be sure to "return false" so the original function code is executed after yours! Or "return true" to not run the original code!

Suggestion:
Build a small standalone addon and put some code in the Event_addon_loaded callback function of your addon which does a zo_PreHook for this function and just changes newSlotData.brandNew to false always.


The PreHook couldlook likes this e.g.:
Lua Code:
  1. ZO_PreHook(PLAYER_INVENTORY, "OnInventoryItemAdded", function(self, inventoryType, bagId, slotIndex, newSlotData)
  2.     --If it's a new item and marked as brandNew, mark it as not brandNew to block the animation and icon
  3.     if newSlotData and newSlotData.brandNew then
  4.         newSlotData.brandNew = false
  5.     end
  6.     return false -- call original function code of "OnInventoryItemAdded" now!
  7. end)

Taken some code form Writing your first adodn tutorial this could look like this then:
Lua Code:
  1. -- First, we create a namespace for our addon by declaring a top-level table that will hold everything else.
  2. FooAddon = {}
  3.  
  4. -- This isn't strictly necessary, but we'll use this string later when registering events.
  5. -- Better to define it in a single place rather than retyping the same string.
  6. FooAddon.name = "FooAddon"
  7.  
  8. -- Next we create a function that will initialize our addon
  9. function FooAddon:Initialize()
  10. --Remove animation and icon of brand new items in inventory
  11. ZO_PreHook(PLAYER_INVENTORY, "OnInventoryItemAdded", function(self, inventoryType, bagId, slotIndex, newSlotData)
  12.     --If it's a new item and marked as brandNew, mark it as not brandNew to block the animation and icon
  13.     if newSlotData and newSlotData.brandNew then
  14.         newSlotData.brandNew = false
  15.     end
  16.     return false -- call original function code of "OnInventoryItemAdded" now!
  17. end)
  18. end
  19.  
  20. -- Then we create an event handler function which will be called when the "addon loaded" event
  21. -- occurs. We'll use this to initialize our addon after all of its resources are fully loaded.
  22. function FooAddon.OnAddOnLoaded(event, addonName)
  23.   -- The event fires each time *any* addon loads - but we only care about when our own addon loads.
  24.   if addonName == FooAddon.name then
  25.     FooAddon:Initialize()
  26.   end
  27. end
  28.  
  29. -- Finally, we'll register our event handler function to be called when the proper event occurs.
  30. EVENT_MANAGER:RegisterForEvent(FooAddon.name, EVENT_ADD_ON_LOADED, FooAddon.OnAddOnLoaded)

Be sure to change FooAddon to some other name like "NoNewItem" and adapt the manifest txt file to the same name etc.

If you got questions,a fter you read into the materia and tried it, be free to ask here.
But please stop to bump such 1 user requests every 2nd day... This will only make the addon devs "Not help you anymore"!
Write to ZOs via /bug ingame instead and ask them to add a setting instead.

Last edited by Baertram : 02/21/18 at 05:47 AM.
  Reply With Quote