-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathWIM_Titan.lua
78 lines (68 loc) · 1.97 KB
/
WIM_Titan.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
--[ WIM Titan Panel Addon ]
WIM_TITAN_IS_LOADED = false;
WIM_CurMessageState = false;
function WIM_TitanButton_OnLoad()
if (IsAddOnLoaded("Titan")) then
WIM_TITAN_IS_LOADED = true;
this.registry = {
id = "WIM",
version = WIM_VERSION,
menuText = "WIM",
buttonTextFunction = "WIM_Titan_GetButtonText",
tooltipTitle = "WIM",
tooltipTextFunction = "WIM_Titan_GetToolTipText",
frequency = .5,
iconWidth = 20,
savedVariables = {
ShowIcon = 1,
ShowLabelText = 1,
}
};
TitanPanelButton_OnLoad();
end
end
function WIM_Titan_GetButtonText()
local msgColor = "|cffedc300";
if(WIM_NewMessageFlag) then
if( WIM_CurMessageState ~= WIM_NewMessageFlag) then
local icon = getglobal("TitanPanelWIMButtonIcon");
icon:SetTexture("Interface\\AddOns\\WIM\\Images\\miniEnabled");
WIM_CurMessageState = WIM_NewMessageFlag;
end
if(WIM_Titan_NewMessageFlash:IsVisible()) then
WIM_Titan_NewMessageFlash:Hide();
else
WIM_Titan_NewMessageFlash:Show();
msgColor = "|cffffffff";
end
else
if( WIM_CurMessageState ~= WIM_NewMessageFlag) then
local icon = getglobal("TitanPanelWIMButtonIcon");
icon:SetTexture("Interface\\AddOns\\WIM\\Images\\miniDisabled");
WIM_Titan_NewMessageFlash:Hide();
WIM_CurMessageState = WIM_NewMessageFlag;
end
end
return msgColor.."Messages: ", "|cffffffff"..WIM_NewMessageCount;
end
function WIM_Titan_GetToolTipText()
--[WIM shows its own tooltip
return;
end
function WIM_Titan_ToggleDropDown()
WIM_ConversationMenu:ClearAllPoints();
WIM_ConversationMenu:Show();
WIM_ConversationMenu:SetPoint("TOPLEFT", TitanPanelWIMButton, "BOTTOMLEFT");
end
function WIM_TitanButton_OnShow()
if(WIM_TITAN_IS_LOADED) then
local icon = getglobal("TitanPanelWIMButtonIcon");
icon:SetHeight(20);
icon:SetWidth(20);
icon:SetTexture("Interface\\AddOns\\WIM\\Images\\miniDisabled");
TitanPanelButton_OnShow();
end
end
function WIM_Titan_InitMenu()
UIDropDownMenu_Initialize(this, WIM_Icon_DropDown_Init, "MENU");
end