Commit 766bdca3 authored by Azilroka's avatar Azilroka

Trainer

parent 4100ddd8
......@@ -2,78 +2,64 @@ local AS = unpack(AddOnSkins)
function AS:Blizzard_Trainer(event, addon)
if addon ~= 'Blizzard_TrainerUI' then return end
AS:UnregisterSkinEvent("Blizzard_Trainer", event)
AS:SkinFrame(ClassTrainerFrame, nil, nil, true)
AS:SkinCloseButton(ClassTrainerFrameCloseButton)
AS:SkinButton(ClassTrainerTrainButton, true)
AS:StripTextures(ClassTrainerFrameInset)
AS:StripTextures(ClassTrainerFrameBottomInset)
AS:StripTextures(ClassTrainerScrollFrameScrollChild)
AS:SkinCloseButton(ClassTrainerFrame.CloseButton)
AS:StripTextures(ClassTrainerFrame.Inset)
AS:SkinStatusBar(ClassTrainerStatusBar)
--ClassTrainerStatusBar:SetStatusBarColor(0, 1, 0)
ClassTrainerStatusBar:ClearAllPoints()
ClassTrainerStatusBar:SetPoint("TOPLEFT", ClassTrainerFrame, "TOPLEFT", 15, -35)
AS:SkinButton(ClassTrainerTrainButton, true)
AS:StripTextures(ClassTrainerFrame.bottomInset)
AS:SkinDropDownBox(ClassTrainerFrameFilterDropDown, 155)
ClassTrainerFrameFilterDropDown:ClearAllPoints()
ClassTrainerFrameFilterDropDown:SetPoint("TOPRIGHT", ClassTrainerFrame, "TOPRIGHT", 0, -32)
AS:SkinScrollBar(ClassTrainerScrollFrameScrollBar)
ClassTrainerFrameFilterDropDown:SetPoint("TOPRIGHT", ClassTrainerFrame, "TOPRIGHT", -6, -32)
AS:SkinBackdropFrame(ClassTrainerFrameSkillStepButton)
AS:SkinTexture(ClassTrainerFrameSkillStepButton.icon)
ClassTrainerFrameSkillStepButtonHighlight:SetTexture('')
AS:SkinScrollBar(ClassTrainerScrollFrameScrollBar)
AS:StripTextures(ClassTrainerFrame.scrollFrame.ScrollChild)
ClassTrainerFrameSkillStepButton.icon.Backdrop = CreateFrame('Frame', nil, ClassTrainerFrameSkillStepButton)
AS:SetTemplate(ClassTrainerFrameSkillStepButton.icon.Backdrop)
ClassTrainerFrameSkillStepButton.icon.Backdrop:SetBackdropColor(0, 0, 0, 0)
ClassTrainerFrameSkillStepButton.icon.Backdrop:SetOutside(ClassTrainerFrameSkillStepButton.icon)
AS:SkinFrame(ClassTrainerFrame.skillStepButton)
AS:SkinTexture(ClassTrainerFrame.skillStepButton.icon)
ClassTrainerFrame.skillStepButton:SetHighlightTexture('')
ClassTrainerFrameSkillStepButton:HookScript('OnEnter', function(self)
self.Backdrop:SetBackdropBorderColor(1, .82, 0)
ClassTrainerFrame.skillStepButton:HookScript('OnEnter', function(self)
self:SetBackdropBorderColor(1, .82, 0)
end)
ClassTrainerFrameSkillStepButton:HookScript('OnLeave', function(self)
ClassTrainerFrame.skillStepButton:HookScript('OnLeave', function(self)
if self.selectedTex:IsShown() then
self.Backdrop:SetBackdropBorderColor(unpack(AS.Color))
self:SetBackdropBorderColor(unpack(AS.Color))
else
self.Backdrop:SetBackdropBorderColor(unpack(AS.BorderColor))
self:SetBackdropBorderColor(unpack(AS.BorderColor))
end
end)
for i = 1, #ClassTrainerFrame.scrollFrame.buttons do
local Button = _G["ClassTrainerScrollFrameButton"..i]
AS:StripTextures(Button)
AS:StyleButton(Button)
for _, Button in pairs(ClassTrainerFrame.scrollFrame.buttons) do
AS:SkinFrame(Button)
AS:SkinTexture(Button.icon)
AS:CreateBackdrop(Button)
Button.Backdrop:SetInside(Button, 1, 1)
Button:SetHighlightTexture('')
Button:SetPushedTexture('')
Button:HookScript('OnEnter', function(self)
self.Backdrop:SetBackdropBorderColor(1, .82, 0)
self:SetBackdropBorderColor(1, .82, 0)
end)
Button:HookScript('OnLeave', function(self)
if self.selectedTex:IsShown() then
self.Backdrop:SetBackdropBorderColor(unpack(AS.Color))
self:SetBackdropBorderColor(unpack(AS.Color))
else
self.Backdrop:SetBackdropBorderColor(unpack(AS.BorderColor))
self:SetBackdropBorderColor(unpack(AS.BorderColor))
end
end)
Button.icon.Backdrop = CreateFrame('Frame', nil, Button)
AS:SetTemplate(Button.icon.Backdrop)
Button.icon.Backdrop:SetBackdropColor(0, 0, 0, 0)
Button.icon.Backdrop:SetOutside(Button.icon)
Button.selectedTex:SetTexture('')
end
hooksecurefunc('ClassTrainerFrame_SetServiceButton', function(skillButton, skillIndex, playerMoney, selected, isTradeSkill)
if ( ClassTrainerFrame.selectedService and selected == skillIndex ) then
skillButton.Backdrop:SetBackdropBorderColor(0, 0.44, .87)
skillButton:SetBackdropBorderColor(unpack(AS.Color))
else
skillButton.Backdrop:SetBackdropBorderColor(unpack(AS.BorderColor))
skillButton:SetBackdropBorderColor(unpack(AS.BorderColor))
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