Last active
November 16, 2015 23:15
-
-
Save Sleaker/2991b7a6035d5a4f28f9 to your computer and use it in GitHub Desktop.
PetTracker Aurora skin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local _, mods = ... | |
mods["PLAYER_LOGIN"]["PetTracker"] = function(self, F, C) | |
local r, g, b = C.r, C.g, C.b | |
--print("PetTracker", F, C) | |
local function HideInsets(element) | |
element.InsetBorderBottom:Hide() | |
element.InsetBorderTop:Hide() | |
element.InsetBorderRight:Hide() | |
element.InsetBorderLeft:Hide() | |
element.InsetBorderBottomRight:Hide() | |
element.InsetBorderBottomLeft:Hide() | |
element.InsetBorderTopRight:Hide() | |
element.InsetBorderTopLeft:Hide() | |
end | |
-- [ Main Collection Tab 'Rivals' ] -- | |
F.ReskinTab(PetTrackerTamerJournal.Tab) | |
-- [ Sub-tabs ] -- | |
for i = 1,3 do | |
local tab = PetTrackerTamerJournal['Tab' .. i] | |
F.ReskinTab(tab) | |
F.ReskinIcon(tab.Icon) | |
local h = tab:GetHighlightTexture() | |
h:SetPoint("TOPLEFT", 0, 0) | |
h:SetPoint("BOTTOMRIGHT", 0, 0) | |
local bg = CreateFrame("Frame", nil, tab) | |
bg:SetPoint("TOPLEFT", -1, 1) | |
bg:SetPoint("BOTTOMRIGHT", 1, -1) | |
bg:SetFrameLevel(tab:GetFrameLevel() -1 ) | |
F.CreateBD(bg) | |
end | |
-- [ Tamer Selection Scrollbar and Search ] -- | |
for i = 1, 9 do | |
select(i, PetTrackerTamerJournal.Count:GetRegions()):Hide() | |
end | |
PetTrackerTamerJournal.ListInset:Hide() | |
F.ReskinScroll(PetTrackerTamerJournal.List.scrollBar) | |
F.ReskinInput(PetTrackerTamerJournal.SearchBox) | |
local function updateTamerJournalList() | |
local list = PetTrackerTamerJournal.List.buttons | |
for i, button in pairs(list) do | |
button:GetRegions():Hide() | |
button:SetHighlightTexture("") | |
button.iconBorder:SetTexture("") | |
button.selectedTexture:SetTexture("") | |
button.model.levelRing:Hide() | |
button.model.level:SetTextColor(1, 1, 1) | |
button.model.quality:Hide() | |
if (button.bg == nil) then | |
local bg = CreateFrame("Frame", nil, button) | |
bg:SetPoint("TOPLEFT", 0, -1) | |
bg:SetPoint("BOTTOMRIGHT", 0, 1) | |
bg:SetFrameLevel(button:GetFrameLevel()-1) | |
F.CreateBD(bg, .25) | |
button.bg = bg | |
end | |
if button.selectedTexture:IsShown() then | |
button.bg:SetBackdropColor(r, g, b, .25) | |
else | |
button.bg:SetBackdropColor(0, 0, 0, .25) | |
end | |
local name = button.name | |
name:SetParent(button.bg) | |
name:SetTextColor(PetTracker:GetQualityColor(button.tamer:GetQuality())) | |
local icon = button.icon | |
icon:SetTexCoord(.08, .92, .08, .92) | |
icon.bg = F.CreateBG(icon) | |
end | |
end | |
hooksecurefunc(PetTrackerTamerJournal.List, "update", updateTamerJournalList) | |
-- [ Rival Card ] -- | |
local function PetTrackerCardDisplay() | |
local tamer = PetTrackerTamerJournal.List.selected | |
local card = PetTrackerTamerJournal.Card | |
HideInsets(card) | |
select(1, card:GetRegions()):Hide() | |
select(10, card:GetRegions()):Hide() | |
F.CreateBD(card, .25) | |
card.name:SetTextColor(PetTracker:GetQualityColor(tamer:GetQuality())) | |
-- [ Reward Icons ] -- | |
for i = 1,4 do | |
card[i].Count:SetTextColor(1, 1, 1) | |
-- TODO text is the only thing that seems to work properly for changing text color can't seem to adjust icon settings | |
--F.ReskinIcon(card[i]) | |
--card[i].icon:SetTexCoord(.08, .92, .08, .92) | |
--F.CreateBG(card[i].icon) | |
end | |
end | |
hooksecurefunc(PetTrackerTamerJournal.Card, "Display", PetTrackerCardDisplay) | |
-- [ History Load Button ] -- | |
F.Reskin(PetTrackerTamerJournal.History.LoadButton) | |
local function PetTrackerTamerJournalHook() | |
local journal = PetTrackerTamerJournal | |
local Team = PetTrackerTamerJournal.Team | |
local History = PetTrackerTamerJournal.History | |
-- [ Team Frame] -- | |
if Team:IsShown() then | |
HideInsets(Team) | |
local border = Team.Border | |
for i = 1,15 do | |
select(i, border:GetRegions()):Hide() | |
end | |
border.Text:Show() | |
border.Text:SetPoint("CENTER", Team, "TOP", 0, 5) | |
select(1, Team:GetRegions()):Hide() | |
for i, slot in pairs(journal.Slots) do | |
if (not slot.pet) then | |
slot:Hide() | |
else | |
select(1, slot:GetRegions()):Hide() | |
F.CreateBD(slot, .25) | |
slot:Show() | |
end | |
end | |
end | |
-- [ History Frame] -- | |
if History:IsShown() then | |
HideInsets(History) | |
select(1, History:GetRegions()):Hide() | |
select(10, History:GetRegions()):Hide() | |
end | |
end | |
hooksecurefunc(PetTrackerTamerJournal, "Update", PetTrackerTamerJournalHook) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment