-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathClickmenu.lua
348 lines (318 loc) · 9.99 KB
/
Clickmenu.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
local addon, ns = ...
local C, F, G, L = unpack(ns)
local Minimap, EasyMenu, ToggleDropDownMenu = Minimap, EasyMenu, ToggleDropDownMenu
local LibEasyMenu = LibStub:GetLibrary("LibEasyMenu")
local LibShowUIPanel = LibStub("LibShowUIPanel-1.0")
local ShowUIPanel = LibShowUIPanel.ShowUIPanel
local HideUIPanel = LibShowUIPanel.HideUIPanel
local function OnEvent()
if not EKMinimapDB["ClickMenu"] then return end
-- Right Click Menu List
local menuFrame = CreateFrame("Frame", "MinimapRightClickMenu", UIParent, "UIDropDownMenuTemplate")
local menuList = {
{ -- 標題
text = MAINMENU_BUTTON,
isTitle = true,
notCheckable = true,
},
{ -- 角色
text = CHARACTER_BUTTON,
icon = "Interface\\PVPFrame\\PVP-Banner-Emblem-3",
func = function()
--ToggleCharacter("PaperDollFrame")
--securecall(ToggleCharacter, "PaperDollFrame")
if not CharacterFrame:IsShown() then ShowUIPanel(CharacterFrame) CharacterFrameTab2:Click() CharacterFrameTab1:Click() else HideUIPanel(CharacterFrame) end
end,
notCheckable = true,
},
{ -- 專業技能
text = PROFESSIONS_BUTTON,
icon = "Interface\\MINIMAP\\TRACKING\\Class",
func = function()
if InCombatLockdown() then
print("|cffffff00"..ERR_NOT_IN_COMBAT.."|r") return
end
ToggleProfessionsBook()
end,
notCheckable = true,
},
--[[
{ -- 法術書
text = SPELLBOOK,
icon = "Interface\\MINIMAP\\TRACKING\\Class",
func = function()
-- edit mode error when toggle in combat
--securecall(TogglePlayerSpellsFrame, 3)
end,
notCheckable = true,
},
]]--
{ --天賦與法術書
text = PLAYERSPELLS_BUTTON, -- TALENTS_BUTTON
icon = "Interface\\HELPFRAME\\HelpIcon-CharacterStuck",
func = function()
--securecall(TogglePlayerSpellsFrame, 2)
if not PlayerSpellsFrame:IsShown() then ShowUIPanel(PlayerSpellsFrame) else HideUIPanel(PlayerSpellsFrame) end
end,
notCheckable = true,
},
{ -- 成就
text = ACHIEVEMENT_BUTTON,
icon = "Interface\\MINIMAP\\TRACKING\\QuestBlob",
func = function()
if not AchievementFrame then C_AddOns.LoadAddOn("Blizzard_AchievementUI") end
if not AchievementFrame:IsShown() then ShowUIPanel(AchievementFrame) else HideUIPanel(AchievementFrame) end
end,
notCheckable = true,
},
{ -- 地圖與任務日誌
text = MAP_AND_QUEST_LOG, -- OLD: QUESTLOG_BUTTON
icon = "Interface\\GossipFrame\\ActiveQuestIcon",
func = function()
if not WorldMapFrame:IsShown() then ShowUIPanel(WorldMapFrame) else HideUIPanel(WorldMapFrame) end
end,
notCheckable = true,
},
{ -- 社群
text = COMMUNITIES_FRAME_TITLE,
icon = "Interface\\FriendsFrame\\UI-Toast-ChatInviteIcon",
arg1 = IsInGuild("player"),
func = function()
if not CommunitiesFrame then C_AddOns.LoadAddOn("Blizzard_Communities") end
if not CommunitiesFrame:IsShown() then ShowUIPanel(CommunitiesFrame) else HideUIPanel(CommunitiesFrame) end
end,
notCheckable = true,
},
{ -- 好友
text = SOCIAL_BUTTON,
icon = "Interface\\CHATFRAME\\UI-ChatWhisperIcon",
func = function()
if not FriendsFrame:IsShown() then ShowUIPanel(FriendsFrame) else HideUIPanel(FriendsFrame) end
end,
notCheckable = true,
},
{ -- 地城與團隊
text = GROUP_FINDER, -- DUNGEONS_BUTTON
icon = "Interface\\TUTORIALFRAME\\UI-TutorialFrame-AttackCursor",
func = function()
--securecall(ToggleLFDParentFrame)
if not PVEFrame:IsShown() then ShowUIPanel(PVEFrame) PVEFrameTab1:Click() else HideUIPanel(PVEFrame) end
end,
notCheckable = true,
},
{ -- 收藏
text = COLLECTIONS,
icon = "Interface\\CURSOR\\Crosshair\\WildPetCapturable",
func = function()
if not CollectionsJournal then LoadAddOn("Blizzard_Collections") end
if not CollectionsJournal:IsShown() then ShowUIPanel(CollectionsJournal) else HideUIPanel(CollectionsJournal) end
end,
notCheckable = true,
},
{ -- 冒險指南
text = ADVENTURE_JOURNAL, -- OLD: ENCOUNTER_JOURNAL
icon = "Interface\\ENCOUNTERJOURNAL\\UI-EJ-HeroicTextIcon",
func = function()
if not EncounterJournal then LoadAddOn("Blizzard_EncounterJournal") end
if not EncounterJournal:IsShown() then ShowUIPanel(EncounterJournal) else HideUIPanel(EncounterJournal) end
end,
notCheckable = true,
},
{ -- 遊戲商城
text = BLIZZARD_STORE,
icon = "Interface\\MINIMAP\\TRACKING\\Auctioneer",
func = function()
if not StoreFrame then LoadAddOn("Blizzard_StoreUI") end
securecall(ToggleStoreUI)
--if not StoreFrame:IsShown() then ShowUIPanel(StoreFrame) else HideUIPanel(StoreFrame) end
end,
notCheckable = true,
},
{ -- 空行
text = "",
isTitle = true,
notCheckable = true,
},
{ -- 其他
text = OTHER,
isTitle = true,
notCheckable = true,
},
{ -- 要塞報告
text = GARRISON_LANDING_PAGE_TITLE,
icon = "Interface\\HELPFRAME\\OpenTicketIcon",
func = function()
--if not ExpansionLandingPage:IsShown() then ShowUIPanel(ExpansionLandingPage) else HideUIPanel(ExpansionLandingPage) end
securecall(ShowGarrisonLandingPage, 2)
end,
notCheckable = true,
},
--[[
{ -- 要塞報告 海軍行動
text = GARRISON_LANDING_PAGE_TITLE.." "..GARRISON_SHIPYARD_TITLE,
icon = "Interface\\HELPFRAME\\OpenTicketIcon",
func = function()
if not ExpansionLandingPage:IsShown() then ShowUIPanel(GarrisonShipyardFrame) else ShowUIPanel(GarrisonShipyardFrame) end
end,
notCheckable = true,
},
]]--
{ -- 職業大廳報告
text = ORDER_HALL_LANDING_PAGE_TITLE,
icon = "Interface\\GossipFrame\\WorkOrderGossipIcon",
func = function()
securecall(ShowGarrisonLandingPage, 3)
end,
notCheckable = true,
},
{ -- 任務指揮桌
text = EXPANSION_NAME7.." "..GARRISON_TYPE_8_0_LANDING_PAGE_TITLE,
icon = "Interface\\HELPFRAME\\OpenTicketIcon",
func = function()
securecall(ShowGarrisonLandingPage, 9)
end,
notCheckable = true,
},
{ -- 誓盟報告
text = GARRISON_TYPE_9_0_LANDING_PAGE_TITLE,
icon = "Interface\\GossipFrame\\WorkOrderGossipIcon",
func = function()
securecall(ShowGarrisonLandingPage, LE_GARRISON_TYPE_9_0)
end,
notCheckable = true,
},
--[[
{ -- 巨龍時代
text = DRAGONFLIGHT_LANDING_PAGE_TITLE,
icon = "Interface\\HELPFRAME\\OpenTicketIcon",
func = function()
if not ExpansionLandingPage:IsShown() then ShowUIPanel(GenericTraitFrame) else HideUIPanel(GenericTraitFrame) end
end,
notCheckable = true,
},
]]--
{ -- 客服支援
text = GM_EMAIL_NAME,
icon = "Interface\\CHATFRAME\\UI-ChatIcon-Blizz",
func = function()
if not HelpFrame:IsShown() then ShowUIPanel(HelpFrame) else HideUIPanel(HelpFrame) end
end,
notCheckable = true,
},
{ -- 語音
text = CHANNEL,
icon = "Interface\\CHATFRAME\\UI-ChatIcon-ArmoryChat-AwayMobile",
func = function()
if not ChannelFrame:IsShown() then ShowUIPanel(ChannelFrame) else HideUIPanel(ChannelFrame) end
end,
notCheckable = true
},
{ -- 行事曆
text = L.Calendar,
func = function()
if not CalendarFrame then C_AddOns.LoadAddOn("Blizzard_Calendar") end
if not CalendarFrame:IsShown() then ShowUIPanel(CalendarFrame) else HideUIPanel(CalendarFrame) end
end,
notCheckable = true,
},
{ -- 區域地圖
text = BATTLEFIELD_MINIMAP,
colorCode = "|cff999999",
func = function()
if not BattlefieldMapFrame then C_AddOns.LoadAddOn("Blizzard_BattlefieldMap") end
if not BattlefieldMapFrame:IsShown() then ShowUIPanel(BattlefieldMapFrame) else HideUIPanel(BattlefieldMapFrame) end
end,
notCheckable = true,
},
{
text = L.ToggleConfig,
colorCode = "|cff00FFFF",
func = function()
F.CreateEKMOptions()
end,
notCheckable = true,
},
{ -- 空行
text = "",
isTitle = true,
notCheckable = true,
},
{ -- 彈出乘客
text = EJECT_PASSENGER,
isTitle = true,
notCheckable = true,
},
{ -- 彈出乘客1
text = L.Left,
func = function()
EjectPassengerFromSeat(1)
end,
notCheckable = true,
},
{ -- 彈出乘客2
text = L.Right,
func = function()
EjectPassengerFromSeat(2)
end,
notCheckable = true,
},
{ -- 空行
text = "",
isTitle = true,
notCheckable = true,
},
{ -- 插件標題
text = ADDONS,
isTitle = true,
notCheckable = true,
},
--[[{ -- bigwigs
text = "BigWigs",
func = function()
if not IsAddOnLoaded("Bigwigs") then
print("尚未啟用Bigwigs")
else
SlashCmdList["BigWigs"]("BigWigs1")
end
end,
notCheckable = true,
},]]--
{ -- 重載
text = RELOADUI,
colorCode = "|cff999999",
func = function()
ReloadUI()
end,
notCheckable = true,
},
}
-- Right Click for Game Menu, Left Click for Track Menu / 右鍵遊戲選單,中鍵追蹤選單
Minimap:SetScript("OnMouseUp", function(self, button)
if button == "RightButton" then
LibEasyMenu:EasyMenu(menuList, menuFrame, self, (Minimap:GetWidth() * .7), -3, "MENU", 2)
elseif button == "MiddleButton" then
local button = MinimapCluster.Tracking.Button
if button then
button:OpenMenu()
if button.menu then
button.menu:ClearAllPoints()
button.menu:SetPoint("CENTER", self, (Minimap:GetWidth() * .7), -(Minimap:GetHeight()/2))
end
end
else
Minimap:OnClick()
end
end)
end
local frame = CreateFrame("FRAME")
frame:RegisterEvent("PLAYER_LOGIN")
frame:SetScript("OnEvent", OnEvent)
-- avoid spellbook taint / 避免taint
local initialize = CreateFrame("Frame")
initialize:SetScript("OnEvent", function()
C_AddOns.LoadAddOn("Blizzard_PlayerSpells")
C_AddOns.LoadAddOn("Blizzard_ProfessionsBook")
ShowUIPanel(PlayerSpellsFrame)
HideUIPanel(PlayerSpellsFrame)
end)
initialize:RegisterEvent("PLAYER_ENTERING_WORLD")