-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathMacros.Tele.lua
62 lines (53 loc) · 2.51 KB
/
Macros.Tele.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
--This file is part of Game Master Genie.
--Copyright 2011-2014 Chocochaos
--Game Master Genie 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, version 3 of the License.
--Game Master Genie 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 Game Master Genie. If not, see <http://www.gnu.org/licenses/>.
GMGenie.Macros.Tele = {};
function GMGenie.Macros.Tele.run(name, title)
if GMGenie_SavedVars.tele[title] == "RECALL" then
SendChatMessage('.recall ' .. name, "GUILD");
else
SendChatMessage('.tele name ' .. name .. ' ' .. GMGenie_SavedVars.tele[title], "GUILD");
end
end
function GMGenie.Macros.Tele.runFromSpy(self)
CloseDropDownMenus();
if GMGenie.Spy.currentRequest["name"] then
GMGenie.Macros.Tele.run(GMGenie.Spy.currentRequest["name"], self.value);
end
end
function GMGenie.Macros.Tele.addToUnitMenu()
UnitPopupMenus["GMGenie_Tele"] = {};
local TeleTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.tele);
for _, name in pairs(TeleTemp) do
table.insert(UnitPopupMenus["GMGenie_Tele"], "GMGenie_Tele_" .. name);
UnitPopupButtons["GMGenie_Tele_" .. name] = { text = name, dist = 0, };
end
table.insert(UnitPopupMenus["GMGenie_Tele"], "GMGenie_TeleOptions");
UnitPopupButtons["GMGenie_TeleOptions"] = { text = "Manage macros", dist = 0, };
end
function GMGenie.Macros.Tele.loadDropdown(_, level)
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
info.isTitle = true;
info.text = "Teleport Macros";
UIDropDownMenu_AddButton(info, level);
local TeleTemp = GMGenie.pairsByKeys2(GMGenie_SavedVars.tele);
for _, name in pairs(TeleTemp) do
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
info.text = name;
info.func = GMGenie.Macros.Tele.runFromSpy;
info.value = name;
UIDropDownMenu_AddButton(info, level);
end
local info = UIDropDownMenu_CreateInfo();
info.hasArrow = false;
info.notCheckable = true;
info.text = "Manage Macros";
info.func = GMGenie.Macros.Tele.showOptions;
UIDropDownMenu_AddButton(info, level);
end