Commit c83d131a authored by Rhyster's avatar Rhyster
Browse files

PetTracker

parent 03bca798
......@@ -98,7 +98,7 @@
<Script file="Pawn.lua"/>
<Script file="PetBattleTeams.lua"/>
<Script file="PetJournalEnhanced.lua"/>
<!--Script file="PetTracker.lua"/-->
<Script file="PetTracker.lua"/>
<Script file="Postal.lua"/>
<Script file="PremadeGroupsFilter.lua"/>
<Script file="Quartz.lua"/>
......
......@@ -5,32 +5,49 @@ if not AS:CheckAddOn('PetTracker') then return end
function AS:PetTracker(event, addon)
if event == 'PLAYER_ENTERING_WORLD' then
if not AS:CheckAddOn('Carbonite.Quests') then
--AS:CreateBackdrop(PetTrackerProgressBar)
AS:Delay(1, function()
AS:StripTextures(PetTrackerProgressBar1.Overlay)
AS:CreateBackdrop(PetTrackerProgressBar1.Overlay)
PetTrackerProgressBar1.Overlay.Backdrop:SetBackdropColor(0,0,0,0)
local bar = PetTracker.Objectives.Anchor
AS:StripTextures(bar.Overlay)
AS:CreateBackdrop(bar.Overlay)
bar.Overlay.Backdrop:SetBackdropColor(0, 0, 0, 0)
for i = 1, PetTracker.MaxQuality do
PetTrackerProgressBar1.Bars[i]:SetStatusBarTexture(AS.NormTex)
bar.Bars[i]:SetStatusBarTexture(AS.NormTex)
end
end)
end
if AS:CheckAddOn('PetTracker_Switcher') then
AS:Delay(5, function()
AS:SkinTooltip(PetTracker.MapCanvas.Tip)
end)
end
if addon == 'PetTracker_Battle' or IsAddOnLoaded('PetTracker_Battle') then
AS:Delay(1, function()
local regions = {PetBattleFrame.BottomFrame:GetChildren()}
for _, region in ipairs(regions) do
if region.Tag and region.Tag == 'PETTRACKER_' then
for _, button in ipairs(region.Buttons) do
AS:SkinIconButton(button)
AS:SkinTexture(button.Icon)
end
break
end
end
AS:SkinFrame(PetTrackerSwitcher)
AS:SkinCloseButton(PetTrackerSwitcherCloseButton)
AS:StripTextures(PetTrackerSwitcher.Inset)
hooksecurefunc(PetTrackerSwitcher, 'Initialize', function()
for i = 1, PetTrackerSwitcher:GetNumChildren() do
local Region = select(i, PetTrackerSwitcher:GetChildren())
if Region and Region:IsObjectType('Frame') and Region.UpperSeparator then
Region:Hide()
end
for i = 1, PetTrackerSwitcher:GetNumChildren() do
local Region = select(i, PetTrackerSwitcher:GetChildren())
if Region and Region:IsObjectType('Frame') and Region.UpperSeparator then
Region:Hide()
end
end
for i = 1, 6 do
local Slot = _G['PetTrackerBattleSlot'..i]
for i = 1, 2 do
for j = 1, 3 do
local Slot = PetTrackerSwitcher[i .. j]
AS:SetTemplate(Slot)
AS:CreateBackdrop(Slot)
Slot.Bg:Hide()
......@@ -45,78 +62,81 @@ function AS:PetTracker(event, addon)
Slot.Highlight:HookScript('OnHide', function() Slot:SetBackdropBorderColor(unpack(AS.BorderColor)) end)
AS:SkinStatusBar(Slot.Health)
AS:SkinStatusBar(Slot.Xp)
end
for i = 1, 45 do
local Ability = _G['PetTrackerAbilityButton'..i]
if Ability and not Ability.isSkinned then
Ability:DisableDrawLayer("BACKGROUND")
AS:CreateBackdrop(Ability)
AS:SkinTexture(Ability.Icon)
Ability.isSkinned = true
for _, Ability in ipairs(Slot.Abilities) do
if not Ability.isSkinned then
Ability:DisableDrawLayer("BACKGROUND")
AS:CreateBackdrop(Ability)
AS:SkinTexture(Ability.Icon)
Ability.isSkinned = true
end
end
end
end)
end
AS:Delay(5, function()
AS:SkinTooltip(PetTracker.MapCanvas.tip)
for i = 1, 6 do
local button = _G["PetTrackerAbilityAction"..i]
if button then
AS:SkinIconButton(button)
AS:SkinTexture(button.Icon)
end
end
end)
end
if addon == 'PetTracker_Journal' or IsAddOnLoaded('PetTracker_Journal') then
AS:UnregisterSkinEvent('PetTracker_Journal', event)
AS:SkinCheckBox(PetTrackerTrackToggle)
if CollectionsJournalSecureTab0 then
AS:SkinTab(CollectionsJournalSecureTab0)
else
hooksecurefunc(PetTrackerRivalsJournal, 'OnEnable', function()
AS:SkinTab(CollectionsJournalSecureTab0)
end)
end
AS:SkinTab(CollectionsJournalSecureTab0)
hooksecurefunc(PetTrackerRivalJournal, 'Startup', function()
hooksecurefunc(PetTrackerRivalsJournal, 'OnShow', function()
AS:StripTextures(CollectionsJournalCoverTab, true)
PetTrackerRivalJournal:HookScript("OnShow", function(self)
PetTrackerRivalsJournal:HookScript("OnShow", function(self)
AS:Delay(0, function() _G[CollectionsJournalCoverTab:GetParent():GetName()..'Text']:Hide() end)
end)
PetTrackerRivalJournal:HookScript("OnHide", function(self)
PetTrackerRivalsJournal:HookScript("OnHide", function(self)
for i = 1, 5 do
_G['CollectionsJournalTab'..i..'Text']:Show()
end
end)
AS:SkinFrame(PetTrackerRivalJournal, 'Default')
AS:SkinCloseButton(PetTrackerRivalJournal.CloseButton)
AS:SkinFrame(PetTrackerRivalsJournal, 'Default')
AS:SkinCloseButton(PetTrackerRivalsJournal.CloseButton)
AS:SkinCheckBox(PetTrackerTrackToggle)
AS:SkinFrame(PetTrackerRivalJournal.Card)
AS:StripTextures(PetTrackerRivalJournal.Team)
AS:StripTextures(PetTrackerRivalJournal.Team.Border)
AS:StripTextures(PetTrackerRivalJournal.ListInset)
PetTrackerRivalJournalListButton11:SetFrameLevel(PetTrackerRivalJournal:GetFrameLevel()-1)
AS:SkinFrame(PetTrackerRivalsJournal.Card)
AS:StripTextures(PetTrackerRivalsJournal.Team)
AS:StripTextures(PetTrackerRivalsJournal.Team.Border)
AS:StripTextures(PetTrackerRivalsJournal.ListInset)
PetTrackerRivalsJournalListButton11:SetFrameLevel(PetTrackerRivalsJournal:GetFrameLevel()-1)
AS:SkinEditBox(PetTrackerRivalJournal.SearchBox)
AS:SkinFrame(PetTrackerRivalJournal.Count)
AS:SkinScrollBar(PetTrackerRivalJournalListScrollBar)
AS:SkinEditBox(PetTrackerRivalsJournal.SearchBox)
AS:SkinFrame(PetTrackerRivalsJournal.Count)
AS:SkinScrollBar(PetTrackerRivalsJournalListScrollBar)
for i = 1, 3 do
local Slot = _G['PetTrackerJournalSlot'..i]
local Slot = PetTrackerRivalsJournal.Slots[i]
AS:SetTemplate(Slot)
Slot.Bg:Hide()
Slot.Quality:Hide()
AS:Kill(Slot.Hover)
--AS:Kill(_G['PetTrackerJournalSlot'..i..'Highlight'])
AS:SkinTexture(Slot.Icon)
Slot.IconBorder:Hide()
Slot.LevelBG:Hide()
AS:SkinIconButton(PetTrackerRivalJournal['Tab'..i])
for _, Ability in ipairs(Slot.Abilities) do
if not Ability.isSkinned then
Ability:DisableDrawLayer("BACKGROUND")
AS:CreateBackdrop(Ability)
AS:SkinTexture(Ability.Icon)
Ability.isSkinned = true
end
end
AS:SkinIconButton(PetTrackerRivalsJournal['Tab'..i])
end
for i = 1, 11 do
local Button = _G["PetTrackerRivalJournalListButton"..i]
local Button = _G["PetTrackerRivalsJournalListButton"..i]
AS:StripTextures(Button)
AS:CreateBackdrop(Button)
AS:SetInside(Button.Backdrop, Button)
......@@ -132,24 +152,14 @@ function AS:PetTracker(event, addon)
Button.model.quality:SetAlpha(0)
Button.model.levelRing:SetAlpha(0)
hooksecurefunc(Button.model.quality, 'SetVertexColor', function(self, r, g, b, a)
Button.iconbg:SetBackdropBorderColor(r, g, b)
hooksecurefunc(Button.model.quality, 'SetVertexColor', function(self, r, g, b)
Button.icon.Backdrop:SetBackdropBorderColor(r, g, b)
end)
hooksecurefunc(Button.model.quality, 'Hide', function(self)
Button.iconbg:SetBackdropColor(unpack(AS.BorderColor))
Button.icon.Backdrop:SetBackdropColor(unpack(AS.BorderColor))
end)
end
for i = 1, 45 do
local Ability = _G['PetTrackerAbilityButton'..i]
if Ability and not Ability.isSkinned then
Ability:DisableDrawLayer("BACKGROUND")
AS:CreateBackdrop(Ability)
AS:SkinTexture(Ability.Icon)
Ability.isSkinned = true
end
end
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