-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtabs.lua
125 lines (99 loc) · 3.01 KB
/
tabs.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
local Fane = CreateFrame'Frame'
local inherit = GameFontNormalSmall
local updateFS = function(self, inc, flags, ...)
local fstring = self:GetFontString()
local font, fontSize = inherit:GetFont()
if(inc) then
fstring:SetFont(font, fontSize + 1, flags)
else
fstring:SetFont(font, fontSize, flags)
end
if((...)) then
fstring:SetTextColor(...)
end
end
local OnEnter = function(self)
local emphasis = _G["ChatFrame"..self:GetID()..'TabFlash']:IsShown()
updateFS(self, emphasis, 'OUTLINE', .64, .207, .933)
end
local OnLeave = function(self)
local r, g, b
local id = self:GetID()
local emphasis = _G["ChatFrame"..id..'TabFlash']:IsShown()
if (_G["ChatFrame"..id] == SELECTED_CHAT_FRAME) then
r, g, b = .64, .207, .933
elseif emphasis then
r, g, b = 1, 0, 0
else
r, g, b = 1, 1, 1
end
updateFS(self, emphasis, nil, r, g, b)
end
local ChatFrame2_SetAlpha = function(self, alpha)
if(CombatLogQuickButtonFrame_Custom) then
CombatLogQuickButtonFrame_Custom:SetAlpha(alpha)
end
end
local ChatFrame2_GetAlpha = function(self)
if(CombatLogQuickButtonFrame_Custom) then
return CombatLogQuickButtonFrame_Custom:GetAlpha()
end
end
local faneifyTab = function(frame, sel)
local i = frame:GetID()
if(not frame.Fane) then
frame.leftTexture:Hide()
frame.middleTexture:Hide()
frame.rightTexture:Hide()
frame.leftSelectedTexture:Hide()
frame.middleSelectedTexture:Hide()
frame.rightSelectedTexture:Hide()
frame.leftSelectedTexture.Show = frame.leftSelectedTexture.Hide
frame.middleSelectedTexture.Show = frame.middleSelectedTexture.Hide
frame.rightSelectedTexture.Show = frame.rightSelectedTexture.Hide
frame.leftHighlightTexture:Hide()
frame.middleHighlightTexture:Hide()
frame.rightHighlightTexture:Hide()
frame:HookScript('OnEnter', OnEnter)
frame:HookScript('OnLeave', OnLeave)
frame:SetAlpha(1)
if(i ~= 2) then
-- Might not be the best solution, but we avoid hooking into the UIFrameFade
-- system this way.
frame.SetAlpha = UIFrameFadeRemoveFrame
else
frame.SetAlpha = ChatFrame2_SetAlpha
frame.GetAlpha = ChatFrame2_GetAlpha
-- We do this here as people might be using AddonLoader together with Fane.
if(CombatLogQuickButtonFrame_Custom) then
CombatLogQuickButtonFrame_Custom:SetAlpha(.4)
end
end
frame.Fane = true
end
-- We can't trust sel. :(
if(i == SELECTED_CHAT_FRAME:GetID()) then
updateFS(frame, nil, nil, .64, .207, .933)
else
updateFS(frame, nil, nil, 1, 1, 1)
end
end
hooksecurefunc('FCF_StartAlertFlash', function(frame)
local tab = _G['ChatFrame' .. frame:GetID() .. 'Tab']
updateFS(tab, true, nil, 1, 0, 0)
end)
hooksecurefunc('FCFTab_UpdateColors', faneifyTab)
for i=1,7 do
faneifyTab(_G['ChatFrame' .. i .. 'Tab'])
end
function Fane:ADDON_LOADED(event, addon)
if(addon == 'Blizzard_CombatLog') then
self:UnregisterEvent(event)
self[event] = nil
return CombatLogQuickButtonFrame_Custom:SetAlpha(.4)
end
end
Fane:RegisterEvent'ADDON_LOADED'
Fane:SetScript('OnEvent', function(self, event, ...)
return self[event](self, event, ...)
end)