-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathAtlasTitan.lua
111 lines (84 loc) · 3.12 KB
/
AtlasTitan.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
--[[
Atlas, a World of Warcraft instance map browser
Email me at [email protected]
This file is part of Atlas.
Atlas is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Atlas is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Atlas; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--]]
-- Credit goes to Krakhaan of Khaz'goroth for providing basic Titan Panel support
TITAN_ATLAS_ID = "Atlas";
function TitanPanelAtlasButton_OnLoad()
-- register plugin
this.registry = {
id = TITAN_ATLAS_ID,
menuText = "Atlas",
buttonTextFunction = "TitanPanelAtlasButton_GetButtonText",
tooltipTitle = "Atlas",
tooltipTextFunction = "TitanPanelAtlasButton_GetTooltipText",
icon = "Interface\\WorldMap\\WorldMap-Icon",
iconWidth = 16,
savedVariables = {
ShowIcon = 1,
ShowLabelText = 1,
ShowColoredText = 1,
ShowMapName = 1
}
};
TitanPanelAtlasButtonIcon:SetVertexColor(1, 1, 0);
end
function TitanPanelAtlasButton_GetButtonText(id)
local retstr = "";
-- supports turning off labels
if ( TitanGetVar(TITAN_ATLAS_ID, "ShowLabelText") ) then
retstr = "Atlas";
if ( TitanGetVar(TITAN_ATLAS_ID, "ShowMapName") ) then
retstr = retstr..": ";
end
end
if ( TitanGetVar(TITAN_ATLAS_ID, "ShowMapName") ) then
local zoneID = ATLAS_DROPDOWNS[AtlasOptions.AtlasType][AtlasOptions.AtlasZone];
local name = AtlasMaps[zoneID].ZoneName[1];
if ( TitanGetVar(TITAN_ATLAS_ID, "ShowColoredText") ) then
retstr = retstr..TitanUtils_GetGreenText(name);
else
retstr = retstr..TitanUtils_GetNormalText(name);
end
end
if (
not TitanGetVar(TITAN_ATLAS_ID, "ShowIcon") and
not TitanGetVar(TITAN_ATLAS_ID, "ShowLabelText") and
not TitanGetVar(TITAN_ATLAS_ID, "ShowMapName") ) then
return "A";
end
return retstr;
end
function TitanPanelAtlasButton_GetTooltipText()
return ATLAS_TITAN_HINT;
end
function TitanPanelAtlasButton_MapNameToggle()
TitanToggleVar(TITAN_ATLAS_ID, "ShowMapName");
TitanPanelButton_UpdateButton("Atlas");
end
function TitanPanelRightClickMenu_PrepareAtlasMenu()
TitanPanelRightClickMenu_AddTitle(TitanPlugins[TITAN_ATLAS_ID].menuText);
TitanPanelRightClickMenu_AddSpacer();
TitanPanelRightClickMenu_AddToggleIcon(TITAN_ATLAS_ID);
TitanPanelRightClickMenu_AddToggleLabelText(TITAN_ATLAS_ID);
TitanPanelRightClickMenu_AddToggleColoredText(TITAN_ATLAS_ID);
info = {};
info.text = ATLAS_OPTIONS_SHOWMAPNAME;
info.func = TitanPanelAtlasButton_MapNameToggle;
info.checked = TitanGetVar(TITAN_ATLAS_ID, "ShowMapName");
UIDropDownMenu_AddButton(info);
TitanPanelRightClickMenu_AddSpacer();
TitanPanelRightClickMenu_AddCommand(TITAN_PANEL_MENU_HIDE, TITAN_ATLAS_ID, TITAN_PANEL_MENU_FUNC_HIDE);
end