vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --[ WIM Titan Panel Addon ] |
2 | WIM_TITAN_IS_LOADED = false; |
||
3 | WIM_CurMessageState = false; |
||
4 | |||
5 | |||
6 | function WIM_TitanButton_OnLoad() |
||
7 | if (IsAddOnLoaded("Titan")) then |
||
8 | WIM_TITAN_IS_LOADED = true; |
||
9 | this.registry = { |
||
10 | id = "WIM", |
||
11 | version = WIM_VERSION, |
||
12 | menuText = "WIM", |
||
13 | buttonTextFunction = "WIM_Titan_GetButtonText", |
||
14 | tooltipTitle = "WIM", |
||
15 | tooltipTextFunction = "WIM_Titan_GetToolTipText", |
||
16 | frequency = .5, |
||
17 | iconWidth = 20, |
||
18 | savedVariables = { |
||
19 | ShowIcon = 1, |
||
20 | ShowLabelText = 1, |
||
21 | } |
||
22 | }; |
||
23 | |||
24 | TitanPanelButton_OnLoad(); |
||
25 | end |
||
26 | end |
||
27 | |||
28 | |||
29 | function WIM_Titan_GetButtonText() |
||
30 | local msgColor = "|cffedc300"; |
||
31 | if(WIM_NewMessageFlag) then |
||
32 | if( WIM_CurMessageState ~= WIM_NewMessageFlag) then |
||
33 | local icon = getglobal("TitanPanelWIMButtonIcon"); |
||
34 | icon:SetTexture("Interface\\AddOns\\WIM\\Images\\miniEnabled"); |
||
35 | WIM_CurMessageState = WIM_NewMessageFlag; |
||
36 | end |
||
37 | if(WIM_Titan_NewMessageFlash:IsVisible()) then |
||
38 | WIM_Titan_NewMessageFlash:Hide(); |
||
39 | else |
||
40 | WIM_Titan_NewMessageFlash:Show(); |
||
41 | msgColor = "|cffffffff"; |
||
42 | end |
||
43 | else |
||
44 | if( WIM_CurMessageState ~= WIM_NewMessageFlag) then |
||
45 | local icon = getglobal("TitanPanelWIMButtonIcon"); |
||
46 | icon:SetTexture("Interface\\AddOns\\WIM\\Images\\miniDisabled"); |
||
47 | WIM_Titan_NewMessageFlash:Hide(); |
||
48 | WIM_CurMessageState = WIM_NewMessageFlag; |
||
49 | end |
||
50 | end |
||
51 | |||
52 | return msgColor.."Messages: ", "|cffffffff"..WIM_NewMessageCount; |
||
53 | end |
||
54 | |||
55 | function WIM_Titan_GetToolTipText() |
||
56 | --[WIM shows its own tooltip |
||
57 | return; |
||
58 | end |
||
59 | |||
60 | function WIM_Titan_ToggleDropDown() |
||
61 | WIM_Titan_DropDown.point = "TOPLEFT"; |
||
62 | WIM_Titan_DropDown.relativePoint = "BOTTOMLEFT"; |
||
63 | ToggleDropDownMenu(1, nil, WIM_Titan_DropDown); |
||
64 | end |
||
65 | |||
66 | |||
67 | function WIM_TitanButton_OnShow() |
||
68 | if(WIM_TITAN_IS_LOADED) then |
||
69 | local icon = getglobal("TitanPanelWIMButtonIcon"); |
||
70 | icon:SetHeight(20); |
||
71 | icon:SetWidth(20); |
||
72 | icon:SetTexture("Interface\\AddOns\\WIM\\Images\\miniDisabled"); |
||
73 | TitanPanelButton_OnShow(); |
||
74 | end |
||
75 | end |
||
76 | |||
77 | function WIM_Titan_InitMenu() |
||
78 | UIDropDownMenu_Initialize(this, WIM_Icon_DropDown_Init, "MENU"); |
||
79 | end |