PHP код:
local menuFrame = CreateFrame("Frame", "MinimapRightClickMenu", UIParent, "UIDropDownMenuTemplate")
local micromenu = {
{text = CHARACTER_BUTTON,
func = function() ToggleCharacter("PaperDollFrame") end},
{text = SPELLBOOK_ABILITIES_BUTTON,
func = function() ToggleFrame(SpellBookFrame) end},
{text = TALENTS_BUTTON,
func = function() ToggleTalentFrame() end},
{text = ACHIEVEMENT_BUTTON,
func = function() ToggleAchievementFrame() end},
{text = QUESTLOG_BUTTON,
func = function() ToggleFrame(QuestLogFrame) end},
{text = SOCIAL_BUTTON,
func = function() ToggleFriendsFrame(1) end},
{text = PLAYER_V_PLAYER,
func = function() ToggleFrame(PVPParentFrame) end},
{text = LFG_TITLE,
func = function() ToggleFrame(LFDParentFrame) end},
{text = LOOKING_FOR_RAID,
func = function() ToggleFrame(LFRParentFrame) end},
{text = HELP_BUTTON,
func = function() ToggleHelpFrame() end},
{text = L_MINIMAP_CALENDAR,
func = function()
if(not CalendarFrame) then LoadAddOn("Blizzard_Calendar") end
Calendar_Toggle()
end},
}
Minimap:SetScript("OnMouseUp", function(self, button)
local position = Minimap:GetPoint()
if button == "RightButton" then
if position:match("LEFT") then
EasyMenu(micromenu, menuFrame, "cursor", 0, 0, "MENU")
else
EasyMenu(micromenu, menuFrame, "cursor", -160, 0, "MENU")
end
elseif button == "MiddleButton" then
if position:match("LEFT") then
ToggleDropDownMenu(nil, nil, MiniMapTrackingDropDown, "cursor", 0, 0, "MENU", 2)
else
ToggleDropDownMenu(nil, nil, MiniMapTrackingDropDown, "cursor", -160, 0, "MENU", 2)
end
elseif button == "LeftButton" then
Minimap_OnClick(self)
end
end)