Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit 50349ca

Browse files
committed
Get rid of CollectionCache it's unnecessary
1 parent eef6c11 commit 50349ca

4 files changed

Lines changed: 0 additions & 62 deletions

File tree

Neuron-DB-Defaults.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ NeuronDefaults = {
267267

268268
NeuronItemCache = {},
269269
NeuronSpellCache = {},
270-
NeuronCollectionCache = {},
271270
NeuronToyCache = {},
272271

273272
NeuronIcon = {hide = false,},

Neuron-GUI.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2535,8 +2535,6 @@ function NeuronGUI:specUpdateIcon(button,state)
25352535
if (NeuronSpellCache[spell]) then
25362536
local spell_id = NeuronSpellCache[spell].spellID
25372537
texture = GetSpellTexture(spell_id)
2538-
elseif (NeuronCollectionCache[spell]) then
2539-
texture = NeuronCollectionCache[spell].icon
25402538
elseif (spell) then
25412539
texture = GetSpellTexture(spell)
25422540
end

Neuron.lua

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ Neuron.registeredGUIData = {}
4343
--these are the database tables that are going to hold our data. They are global because every .lua file needs access to them
4444
NeuronItemCache = {} --Stores a cache of all items that have been seen by a Neuron button
4545
NeuronSpellCache = {} --Stores a cache of all spells that have been seen by a Neuron button
46-
NeuronCollectionCache = {} --Stores a cache of all Mounts and Battle Pets that have been seen by a Neuron button
4746
NeuronToyCache = {} --Stores a cache of all toys that have been seen by a Neuron button
4847

4948

@@ -153,7 +152,6 @@ function Neuron:OnInitialize()
153152
--load saved variables into working variable containers
154153
NeuronItemCache = DB.NeuronItemCache
155154
NeuronSpellCache = DB.NeuronSpellCache
156-
NeuronCollectionCache = DB.NeuronCollectionCache
157155
NeuronToyCache = DB.NeuronToyCache
158156

159157
--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
@@ -197,9 +195,7 @@ function Neuron:OnEnable()
197195
Neuron:RegisterEvent("LEARNED_SPELL_IN_TAB")
198196

199197
if not Neuron.isWoWClassic then
200-
Neuron:RegisterEvent("COMPANION_LEARNED")
201198
Neuron:RegisterEvent("TOYS_UPDATED")
202-
Neuron:RegisterEvent("PET_JOURNAL_LIST_UPDATE")
203199
end
204200

205201
Neuron:UpdateStanceStrings()
@@ -281,7 +277,6 @@ function Neuron:PLAYER_ENTERING_WORLD()
281277
Neuron:UpdateStanceStrings()
282278

283279
if not Neuron.isWoWClassic then
284-
Neuron:UpdateCollectionCache()
285280
Neuron:UpdateToyCache()
286281
end
287282

@@ -321,14 +316,6 @@ function Neuron:SPELLS_CHANGED()
321316
Neuron:UpdateStanceStrings()
322317
end
323318

324-
function Neuron:COMPANION_LEARNED()
325-
Neuron:UpdateCollectionCache()
326-
end
327-
328-
function Neuron:PET_JOURNAL_LIST_UPDATE()
329-
Neuron:UpdateCollectionCache()
330-
end
331-
332319
function Neuron:TOYS_UPDATED(...)
333320
Neuron:UpdateToyCache()
334321
end
@@ -582,44 +569,6 @@ function Neuron:UpdateToyCache()
582569

583570
end
584571

585-
586-
--- Compiles a list of battle pets & mounts a player has. This table is used to refrence macro spell info to generate tooltips and cooldowns.
587-
--- If a companion is not displaying its tooltip or cooldown, then the item in the macro probably is not in the database
588-
function Neuron:UpdateCollectionCache()
589-
590-
local _, numpet = C_PetJournal.GetNumPets()
591-
592-
for i=1,numpet do
593-
594-
local petID, speciesID, owned, _, _, _, _, speciesName, icon = C_PetJournal.GetPetInfoByIndex(i)
595-
596-
if petID and owned then
597-
local spell = speciesName
598-
if spell then
599-
local companionData = Neuron:SetCompanionData("CRITTER", i, speciesID, speciesName, petID, icon)
600-
NeuronCollectionCache[spell:lower()] = companionData
601-
NeuronCollectionCache[spell:lower().."()"] = companionData
602-
end
603-
end
604-
end
605-
606-
local mountIDs = C_MountJournal.GetMountIDs()
607-
for i,id in pairs(mountIDs) do
608-
local creatureName , spellID, _, _, _, _, _, _, _, _, collected = C_MountJournal.GetMountInfoByID(id)
609-
610-
if spellID and collected then
611-
local spell, _, icon = GetSpellInfo(spellID)
612-
if spell then
613-
local companionData = Neuron:SetCompanionData("MOUNT", i, spellID, creatureName, spellID, icon)
614-
NeuronCollectionCache[spell:lower()] = companionData
615-
NeuronCollectionCache[spell:lower().."()"] = companionData
616-
end
617-
end
618-
end
619-
end
620-
621-
622-
623572
function Neuron:UpdateStanceStrings()
624573
if Neuron.class == "DRUID" or Neuron.class == "ROGUE" then
625574

Objects/ACTIONBUTTON.lua

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -733,12 +733,6 @@ function ACTIONBUTTON:SetSpellTooltip(spell)
733733
else
734734
GameTooltip:SetText(NeuronSpellCache[spell:lower()].spellName, 1, 1, 1)
735735
end
736-
elseif NeuronCollectionCache[spell:lower()] then
737-
if self.UberTooltips and NeuronCollectionCache[spell:lower()].creatureType =="MOUNT" then
738-
GameTooltip:SetHyperlink("spell:"..NeuronCollectionCache[spell:lower()].spellID)
739-
else
740-
GameTooltip:SetText(NeuronCollectionCache[spell:lower()].creatureName, 1, 1, 1)
741-
end
742736
else
743737
GameTooltip:SetText(UNKNOWN, 1, 1, 1)
744738
end
@@ -806,8 +800,6 @@ function ACTIONBUTTON:SetSpellIcon(spell)
806800
if not texture then
807801
if NeuronSpellCache[spell:lower()] then
808802
texture = NeuronSpellCache[spell:lower()].icon
809-
elseif NeuronCollectionCache[spell:lower()] then
810-
texture = NeuronCollectionCache[spell:lower()].icon
811803
end
812804
end
813805

0 commit comments

Comments
 (0)