Commit c83d131a authored by Rhyster's avatar Rhyster

PetTracker

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