Language:
Lua     Change language:
Pastebin: 94283
Author: Anonymous
Subject: Untitled
Created: 2008-08-20 16:43:52
Download and save
Toggle line numbers
1--[[------------------------------------------------------------------------- 
2  Copyright (c) 2007-2008, Trond A Ekseth 
3  All rights reserved. 
4 
5  Redistribution and use in source and binary forms, with or without 
6  modification, are permitted provided that the following conditions are 
7  met: 
8 
9      * Redistributions of source code must retain the above copyright 
10        notice, this list of conditions and the following disclaimer. 
11      * Redistributions in binary form must reproduce the above 
12        copyright notice, this list of conditions and the following 
13        disclaimer in the documentation and/or other materials provided 
14        with the distribution. 
15      * Neither the name of Fane nor the names of its contributors 
16        may be used to endorse or promote products derived from this 
17        software without specific prior written permission. 
18 
19  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
20  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
21  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
22  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
23  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
24  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
25  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
26  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
27  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
28  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
29  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
30---------------------------------------------------------------------------]] 
31 
32local event = CreateFrame"Frame" 
33local dummy = function() end 
34local inherit = GameFontNormalSmall 
35 
36local OnEnter = function(self) 
37    local f, s = inherit:GetFont() 
38    self:SetTextColor(.64, .207, .933
39    self:SetFont(f, s, "OUTLINE"
40end 
41local OnLeave = function(self) 
42    if(_G["ChatFrame"..self:GetID()] == SELECTED_CHAT_FRAME) then 
43        self:SetTextColor(.64, .207, .933
44    else 
45        self:SetTextColor(1, 1, 1
46    end 
47 
48    local f, s = inherit:GetFont() 
49    self:SetFont(f, s) 
50end 
51local OnShow = function(self) 
52    local f, s = inherit:GetFont() 
53    self:GetParent():SetFont(f, s+1
54    self:GetParent():SetTextColor(1, 0, 0
55end 
56local OnHide = function(self) 
57    local f, s = inherit:GetFont() 
58    self:GetParent():SetFont(f, s) 
59    self:GetParent():SetTextColor(1, 1, 1
60end 
61 
62local rollCF = function() 
63    for i = 1, 7 do 
64        local chat = _G["ChatFrame"..i] 
65        local tab = _G["ChatFrame"..i.."Tab"
66        local flash = _G["ChatFrame"..i.."TabFlash"
67 
68        flash:GetRegions():SetTexture(nil
69        flash:SetScript("OnShow", OnShow) 
70        flash:SetScript("OnHide", OnHide) 
71 
72        _G["ChatFrame"..i.."TabLeft"]:Hide() 
73        _G["ChatFrame"..i.."TabMiddle"]:Hide() 
74        _G["ChatFrame"..i.."TabRight"]:Hide() 
75 
76        tab:SetScript("OnEnter", OnEnter) 
77        tab:SetScript("OnLeave", OnLeave) 
78 
79 
80        if(chat == SELECTED_CHAT_FRAME) then 
81            tab:SetTextColor(.64, .207, .933
82        else 
83            tab:SetTextColor(1, 1, 1
84        end 
85        tab:GetHighlightTexture():SetTexture(nil
86 
87    end 
88end 
89 
90event.PLAYER_LOGIN = function() 
91    rollCF() 
92    hooksecurefunc("FCF_OpenNewWindow", rollCF) 
93    hooksecurefunc("FCF_Close", function(self) 
94        UIParent.Hide(_G[self:GetName().."Tab"]) 
95    end
96 
97    local _orig_FCF_Tab_OnClick = FCF_Tab_OnClick 
98    FCF_Tab_OnClick = function(button) 
99        _orig_FCF_Tab_OnClick(button) 
100 
101        for k, v in pairs(DOCKED_CHAT_FRAMES) do 
102            if(v == SELECTED_CHAT_FRAME) then 
103                _G[v:GetName().."Tab"]:SetTextColor(.64, .207, .933
104            else 
105                _G[v:GetName().."Tab"]:SetTextColor(1, 1, 1
106            end 
107        end 
108    end 
109 
110end 
111 
112event:SetScript("OnEvent", function(self, event, ...) 
113    self[event](self, event, ...) 
114end
115event:RegisterEvent"PLAYER_LOGIN" 
116 
Download and save
Toggle line numbers
Thread:
[94283] Untitled by Anonymous at 2008-08-20 16:43:52
  [94291] Re: Untitled by Anonymous at 2008-08-20 18:53:02 (diff)
Tip: Click the line numbers to toggle highliting on that line.

Paste followup:

Language:
Author:
Subject:


    Tabstop:     bigger biggest
Note: You can prefix a line with "@@@" to highlight it.