Commit bd93bf92 authored by Azilroka's avatar Azilroka

Spellbook

parent df0b7d58
...@@ -2,11 +2,16 @@ local AS = unpack(AddOnSkins) ...@@ -2,11 +2,16 @@ local AS = unpack(AddOnSkins)
function AS:Blizzard_Spellbook() function AS:Blizzard_Spellbook()
AS:SkinFrame(SpellBookFrame, nil, nil, true) AS:SkinFrame(SpellBookFrame, nil, nil, true)
AS:SkinCloseButton(SpellBookFrameCloseButton) AS:SkinCloseButton(SpellBookFrame.CloseButton)
AS:StripTextures(SpellBookFrameInset) AS:StripTextures(SpellBookFrame.Inset)
SpellBookPageText:SetTextColor(0.6, 0.6, 0.6) for i = 1, 5 do
AS:SkinTab(_G["SpellBookFrameTabButton"..i])
end
SpellBookPageText:SetTextColor(1, 1, 1)
SpellBookPageText:SetPoint("BOTTOMRIGHT", -100, 32) SpellBookPageText:SetPoint("BOTTOMRIGHT", -100, 32)
AS:SkinNextPrevButton(SpellBookPrevPageButton) AS:SkinNextPrevButton(SpellBookPrevPageButton)
AS:SkinNextPrevButton(SpellBookNextPageButton) AS:SkinNextPrevButton(SpellBookNextPageButton)
...@@ -17,161 +22,106 @@ function AS:Blizzard_Spellbook() ...@@ -17,161 +22,106 @@ function AS:Blizzard_Spellbook()
local Button = _G["SpellButton"..i] local Button = _G["SpellButton"..i]
local Icon = _G["SpellButton"..i.."IconTexture"] local Icon = _G["SpellButton"..i.."IconTexture"]
Button.EmptySlot:SetTexture(nil) AS:SkinFrame(Button)
Button.TextBackground:SetTexture(nil)
Button.TextBackground2:SetTexture(nil)
Button.IconTextureBg:SetTexture(nil)
Button:SetCheckedTexture(nil)
Button:SetPushedTexture(nil)
hooksecurefunc(Button, 'SetChecked', function(self, checked)
if checked then
self:SetBackdropBorderColor(1, 1, 0)
else
self:SetBackdropBorderColor(unpack(AS.BorderColor))
end
end)
_G["SpellButton"..i..'SlotFrame']:SetTexture(nil)
Button.UnlearnedFrame:SetTexture(nil)
Button.TrainFrame:SetTexture(nil)
Button.TrainTextBackground:SetTexture(nil)
AS:SkinFrame(Button, nil, true)
Button:GetHighlightTexture():SetColorTexture(1, 1, 1, 0.3)
Button:GetHighlightTexture():SetInside()
Button.cooldown:SetInside()
AS:SkinTexture(Icon) AS:SkinTexture(Icon)
Icon:SetInside() Icon:SetInside()
Button:SetCheckedTexture('')
Button:SetPushedTexture('')
Button:SetHighlightTexture('')
Button.cooldown:SetInside()
Button.AutoCastShine = CreateFrame('Frame', '$parentShine', Button, 'AutoCastShineTemplate')
Button.AutoCastShine:SetAllPoints()
for _, sparks in pairs(Button.AutoCastShine.sparkles) do
sparks:SetSize(sparks:GetWidth() * 2, sparks:GetHeight() * 2)
end
hooksecurefunc(Button.SpellHighlightTexture, 'SetShown', function(self, value)
if value == true then
AutoCastShine_AutoCastStart(Button.AutoCastShine, unpack(AS.Color))
end
end)
hooksecurefunc(Button.SpellHighlightTexture, 'Hide', function() AutoCastShine_AutoCastStop(Button.AutoCastShine) end)
end end
hooksecurefunc("SpellButton_UpdateButton", function() hooksecurefunc("SpellButton_UpdateButton", function()
for i = 1, SPELLS_PER_PAGE do for i = 1, SPELLS_PER_PAGE do
local Button = _G["SpellButton"..i] local Button = _G["SpellButton"..i]
Button.SpellName:SetPoint("LEFT", Button, "RIGHT", 8, 10) Button.SpellName:SetTextColor(1, 1, 1)
if Button.SpellName:GetTextColor() < 0.8 then
Button.SpellName:SetTextColor(0.6, 0.6, 0.6)
end
Button.SpellSubName:SetTextColor(0.6, 0.6, 0.6) Button.SpellSubName:SetTextColor(0.6, 0.6, 0.6)
Button.RequiredLevelString:SetTextColor(0.6, 0.6, 0.6) Button.RequiredLevelString:SetTextColor(0.6, 0.6, 0.6)
Button:GetHighlightTexture():SetColorTexture(1, 1, 1, 0.3)
Button:GetHighlightTexture():SetInside()
end end
end) end)
-- Skill Line Tabs for i = 1, 8 do
local Tab = _G["SpellBookSkillLineTab"..i]
hooksecurefunc('SpellBookFrame_UpdateSkillLineTabs', function() AS:SkinFrame(Tab)
local NumSkillLineTabs = GetNumSpellTabs() AS:SkinTexture(Tab:GetNormalTexture())
for i = 1, MAX_SKILLLINE_TABS do Tab:GetNormalTexture():SetInside()
local Tab = _G["SpellBookSkillLineTab"..i] hooksecurefunc(Tab, 'SetChecked', function(self, value)
if ( i <= NumSkillLineTabs and SpellBookFrame.bookType == BOOKTYPE_SPELL ) then if value == true then
if Tab and not Tab.isSkinned then self:SetBackdropBorderColor(1, 1, 0)
AS:SkinFrame(Tab) else
AS:StyleButton(Tab) self:SetBackdropBorderColor(unpack(AS.BorderColor))
local Texture = select(2, GetSpellTabInfo(i))
Tab:SetNormalTexture(Texture)
if Tab:GetNormalTexture() then
Tab:GetNormalTexture():SetInside()
AS:SkinTexture(Tab:GetNormalTexture())
end
local point, relatedTo, point2, x, y = Tab:GetPoint()
Tab:SetPoint(point, relatedTo, point2, 1, y)
Tab.isSkinned = true
end
end end
end end)
end)
SpellBookFrame_UpdateSkillLineTabs()
-- Profession Tab
local ProfessionButtons = {
PrimaryProfession1SpellButtonTop,
PrimaryProfession1SpellButtonBottom,
PrimaryProfession2SpellButtonTop,
PrimaryProfession2SpellButtonBottom,
SecondaryProfession1SpellButtonLeft,
SecondaryProfession1SpellButtonRight,
SecondaryProfession2SpellButtonLeft,
SecondaryProfession2SpellButtonRight,
SecondaryProfession3SpellButtonLeft,
SecondaryProfession3SpellButtonRight,
SecondaryProfession4SpellButtonLeft,
SecondaryProfession4SpellButtonRight
}
local ProfessionHeaders = {
PrimaryProfession1,
PrimaryProfession2,
SecondaryProfession1,
SecondaryProfession2,
SecondaryProfession3,
SecondaryProfession4
}
for _, Header in pairs(ProfessionHeaders) do
Header.missingHeader:SetTextColor(1, 0.8, 0)
Header.missingHeader:SetShadowColor(0, 0, 0)
Header.missingHeader:SetShadowOffset(1, -1)
Header.missingText:SetTextColor(0.6, 0.6, 0.6)
end end
for _, Button in pairs(ProfessionButtons) do -- Professions
AS:SkinFrame(Button)
AS:SkinTexture(Button.iconTexture) for _, Button in pairs({ PrimaryProfession1, PrimaryProfession2, SecondaryProfession1, SecondaryProfession2, SecondaryProfession3 }) do
Button.iconTexture:SetInside() Button.professionName:SetTextColor(1, 1, 1)
Button.missingHeader:SetTextColor(1, 1, 1)
Button.missingText:SetTextColor(1, 1, 1)
AS:SkinStatusBar(Button.statusBar, true)
Button.statusBar.Backdrop:SetOutside(Button.statusBar, 1, 1)
Button.statusBar.rankText:SetPoint("CENTER")
Button.statusBar:SetPoint("TOPLEFT", "$parentRank", "BOTTOMLEFT", 1, -3)
end end
hooksecurefunc('SpellBook_UpdateProfTab', function() for i = 1, 2 do
for _, Button in pairs(ProfessionButtons) do local Button = _G["PrimaryProfession"..i]
Button:GetHighlightTexture():SetColorTexture(1, 1, 1, 0.3) _G["PrimaryProfession"..i.."IconBorder"]:Hide()
Button:GetHighlightTexture():SetInside()
end Button.professionName:SetPoint("TOPLEFT", 100, -4)
end)
local ProfessionStatusBars = { AS:CreateBackdrop(Button.icon)
PrimaryProfession1StatusBar, AS:SkinTexture(Button.icon)
PrimaryProfession2StatusBar,
SecondaryProfession1StatusBar, Button.icon:SetAlpha(1)
SecondaryProfession2StatusBar, Button.icon:SetDesaturated(false)
SecondaryProfession3StatusBar,
SecondaryProfession4StatusBar
}
for _, StatusBar in pairs(ProfessionStatusBars) do
AS:SkinStatusBar(StatusBar)
StatusBar:SetStatusBarColor(0, .8, 0)
StatusBar.rankText:ClearAllPoints()
StatusBar.rankText:SetPoint("CENTER")
end end
-- Bottom Tabs for _, Button in pairs({ PrimaryProfession1SpellButtonTop, PrimaryProfession1SpellButtonBottom, PrimaryProfession2SpellButtonTop, PrimaryProfession2SpellButtonBottom, SecondaryProfession1SpellButtonLeft, SecondaryProfession1SpellButtonRight, SecondaryProfession2SpellButtonLeft, SecondaryProfession2SpellButtonRight, SecondaryProfession3SpellButtonLeft, SecondaryProfession3SpellButtonRight }) do
for i = 1, 5 do AS:SkinFrame(Button)
AS:SkinTab(_G["SpellBookFrameTabButton"..i])
if Button.iconTexture then
AS:SkinTexture(Button.iconTexture)
Button.iconTexture:SetInside()
end
end end
SpellBookFrameTabButton1:ClearAllPoints() hooksecurefunc("FormatProfession", function(frame, index)
SpellBookFrameTabButton1:SetPoint("TOPLEFT", SpellBookFrame, "BOTTOMLEFT", -5, 2) if index then
local _, texture = GetProfessionInfo(index)
if not AS:CheckAddOn('ElvUI') then if frame.icon and texture then
hooksecurefunc('SharedActionButton_RefreshSpellHighlight', function(self, shown) frame.icon:SetTexture(texture)
if shown then
self.SpellHighlightTexture:Hide()
self.SpellHighlightAnim:Stop()
if not self.AutoCastShine.Resized then
for _, sparks in pairs(self.AutoCastShine.sparkles) do
sparks:SetSize(sparks:GetWidth() * 2, sparks:GetHeight() * 2)
end
self.AutoCastShine.Resized = true
end
self.AutoCastShine:Show()
AutoCastShine_AutoCastStart(self.AutoCastShine, 1, .82, 0)
else
AutoCastShine_AutoCastStop(self.AutoCastShine)
end end
end) end
end end)
hooksecurefunc("UpdateProfessionButton", function(self)
self.spellString:SetTextColor(1, 1, 1);
self.subSpellString:SetTextColor(1, 1, 1)
end)
SpellBookFrameTabButton1:SetPoint("TOPLEFT", SpellBookFrame, "BOTTOMLEFT", -5, 2)
end end
AS:RegisterSkin('Blizzard_Spellbook', AS.Blizzard_Spellbook) AS:RegisterSkin('Blizzard_Spellbook', AS.Blizzard_Spellbook)
\ No newline at end of file
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