diff --git a/Neuron-DB-Defaults.lua b/Neuron-DB-Defaults.lua index af8f72aa..44ae8b99 100644 --- a/Neuron-DB-Defaults.lua +++ b/Neuron-DB-Defaults.lua @@ -267,7 +267,6 @@ NeuronDefaults = { NeuronItemCache = {}, NeuronSpellCache = {}, - NeuronToyCache = {}, NeuronIcon = {hide = false,}, diff --git a/Neuron.lua b/Neuron.lua index 4d0b0143..e1b21066 100644 --- a/Neuron.lua +++ b/Neuron.lua @@ -43,7 +43,6 @@ Neuron.registeredGUIData = {} --these are the database tables that are going to hold our data. They are global because every .lua file needs access to them NeuronItemCache = {} --Stores a cache of all items that have been seen by a Neuron button NeuronSpellCache = {} --Stores a cache of all spells that have been seen by a Neuron button -NeuronToyCache = {} --Stores a cache of all toys that have been seen by a Neuron button Neuron.STRATAS = {"BACKGROUND", "LOW", "MEDIUM", "HIGH", "DIALOG", "TOOLTIP"} @@ -152,7 +151,6 @@ function Neuron:OnInitialize() --load saved variables into working variable containers NeuronItemCache = DB.NeuronItemCache NeuronSpellCache = DB.NeuronSpellCache - NeuronToyCache = DB.NeuronToyCache --these are the working pointers to our global database tables. Each class has a local GDB and CDB table that is a pointer to the root of their associated database Neuron.MAS = Neuron.MANAGED_ACTION_STATES @@ -194,10 +192,6 @@ function Neuron:OnEnable() Neuron:RegisterEvent("CHARACTER_POINTS_CHANGED") Neuron:RegisterEvent("LEARNED_SPELL_IN_TAB") - if not Neuron.isWoWClassic then - Neuron:RegisterEvent("TOYS_UPDATED") - end - Neuron:UpdateStanceStrings() --this allows for the "Esc" key to disable the Edit Mode instead of bringing up the game menu, but only if an edit mode is activated. @@ -276,10 +270,6 @@ function Neuron:PLAYER_ENTERING_WORLD() Neuron:UpdateSpellCache() Neuron:UpdateStanceStrings() - if not Neuron.isWoWClassic then - Neuron:UpdateToyCache() - end - --Fix for Titan causing the Main Bar to not be hidden if IsAddOnLoaded("Titan") then TitanUtils_AddonAdjust("MainMenuBar", true) @@ -316,10 +306,6 @@ function Neuron:SPELLS_CHANGED() Neuron:UpdateStanceStrings() end -function Neuron:TOYS_UPDATED(...) - Neuron:UpdateToyCache() -end - ------------------------------------------------------------------------- --------------------Profiles--------------------------------------------- ------------------------------------------------------------------------- @@ -548,27 +534,6 @@ function Neuron:SetCompanionData(creatureType, index, creatureID, creatureName, return curComp end - ---- Compiles a list of toys a player has. This table is used to refrence macro spell info to generate tooltips and cooldowns. --- toy cache is backwards due to bugs with secure action buttons' inability to --- cast a toy by item:id (and inability to SetMacroItem from a name /sigh) --- cache is indexed by the toyName and equals the itemID --- the attribValue for toys will be the toyName, and unsecure stuff can pull --- the itemID from toyCache where needed -function Neuron:UpdateToyCache() - - -- fill cache with itemIDs = name - for i=1,C_ToyBox.GetNumToys() do - local itemID = C_ToyBox.GetToyFromIndex(i) - local name = GetItemInfo(itemID) or "UNKNOWN" - local known = PlayerHasToy(itemID) - if known then - NeuronToyCache[name:lower()] = itemID - end - end - -end - function Neuron:UpdateStanceStrings() if Neuron.class == "DRUID" or Neuron.class == "ROGUE" then diff --git a/Objects/ACTIONBUTTON.lua b/Objects/ACTIONBUTTON.lua index ef6b1d6c..6253ca86 100644 --- a/Objects/ACTIONBUTTON.lua +++ b/Objects/ACTIONBUTTON.lua @@ -753,12 +753,6 @@ function ACTIONBUTTON:SetItemTooltip(item) else GameTooltip:SetText(NeuronItemCache[item:lower()], 1, 1, 1) end - elseif NeuronToyCache[item:lower()] then - if self.UberTooltips then - GameTooltip:SetToyByItemID(NeuronToyCache[item:lower()]) - else - GameTooltip:SetText(name, 1, 1, 1) - end end end @@ -818,8 +812,6 @@ function ACTIONBUTTON:SetItemIcon(item) if not texture then if NeuronItemCache[item:lower()] then texture = GetItemIcon("item:"..NeuronItemCache[item:lower()]..":0:0:0:0:0:0:0") - elseif NeuronToyCache[item:lower()] then - texture = GetItemIcon("item:"..NeuronToyCache[item:lower()]..":0:0:0:0:0:0:0") end end @@ -982,8 +974,12 @@ function ACTIONBUTTON:SetUsableItem(item) local isUsable, notEnoughMana = IsUsableItem(item) - if NeuronToyCache[item:lower()] then - isUsable = true + --for some reason toys don't show as usable items, so this is a workaround for that + if not isUsable then + local itemID = GetItemInfoInstant(item) + if itemID and PlayerHasToy(itemID) then + isUsable = true + end end if notEnoughMana and self.manacolor then