Commit fc5fd30c authored by Robin Schoonover's avatar Robin Schoonover

On second thought, the Pet stuff into Other.lua

parent 1b9d1578
......@@ -6,5 +6,4 @@
## X-Email: end@cornhooves.org
AllTheIDs.lua
GameTooltip.lua
Pets.lua
Other.lua
local addon_name, addon = ...
--
-- PetJournal
--
do
local function HookPetCard()
PetJournalPetCardPetInfo:HookScript("OnEnter", function(self)
if GameTooltip:GetOwner() == self then
local speciesID = PetJournalPetCard.speciesID
local _, _, _, creatureID = C_PetJournal.GetPetInfoBySpeciesID(speciesID)
addon:AddIDLine(GameTooltip, "Species", speciesID, "NPC", creatureID)
end
end)
end
local origSharedPetBattleAbilityTooltip_SetAbility = SharedPetBattleAbilityTooltip_SetAbility
SharedPetBattleAbilityTooltip_SetAbility = function(tip, abilityInfo, additionalInfo)
local abilityID = abilityInfo:GetAbilityID()
if abilityID then
local line = addon:IDLine("Ability", abilityID)
if additionalInfo then
additionaInfo = additionalInfo.."\n"..line
else
additionalInfo = line
end
end
return origSharedPetBattleAbilityTooltip_SetAbility(tip, abilityInfo, additionalInfo)
end
if IsAddOnLoaded("Blizzard_Collections") then
HookPetCard()
else
local frame = CreateFrame("FRAME")
frame:RegisterEvent("ADDON_LOADED")
frame:SetScript("OnEvent", function(self, event, addon_name)
if addon_name == "Blizzard_Collections" then
HookPetCard()
self:UnregisterEvent("ADDON_LOADED")
end
end)
end
end
--
-- Quest Frame
--
......
local addon_name, addon = ...
local function HookPetCard()
PetJournalPetCardPetInfo:HookScript("OnEnter", function(self)
if GameTooltip:GetOwner() == self then
local speciesID = PetJournalPetCard.speciesID
local _, _, _, creatureID = C_PetJournal.GetPetInfoBySpeciesID(speciesID)
addon:AddIDLine(GameTooltip, "Species", speciesID, "NPC", creatureID)
end
end)
end
local origSharedPetBattleAbilityTooltip_SetAbility = SharedPetBattleAbilityTooltip_SetAbility
SharedPetBattleAbilityTooltip_SetAbility = function(tip, abilityInfo, additionalInfo)
local abilityID = abilityInfo:GetAbilityID()
if abilityID then
local line = addon:IDLine("Ability", abilityID)
if additionalInfo then
additionaInfo = additionalInfo.."\n"..line
else
additionalInfo = line
end
end
return origSharedPetBattleAbilityTooltip_SetAbility(tip, abilityInfo, additionalInfo)
end
--
-- hook on addon load
--
if IsAddOnLoaded("Blizzard_Collections") then
HookPetCard()
else
local frame = CreateFrame("FRAME")
frame:RegisterEvent("ADDON_LOADED")
frame:SetScript("OnEvent", function(self, event, addon_name)
if addon_name == "Blizzard_Collections" then
HookPetCard()
self:UnregisterEvent("ADDON_LOADED")
end
end)
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment