a | b | |
---|
| 0 | + | setfenv(1, select(2, ...)) |
---|
| 0 | + | local Minimap, MinimapCluster, MinimapBackdrop = Minimap, MinimapCluster, MinimapBackdrop |
---|
| 0 | + | local MiniMapMailFrame, MiniMapTracking = MiniMapMailFrame, MiniMapTracking |
---|
| 0 | + | local MiniMapLFGFrame, MiniMapVoiceChatFrame, MiniMapBattlefieldFrame = MiniMapLFGFrame, MiniMapVoiceChatFrame, MiniMapBattlefieldFrame |
---|
| 0 | + | |
---|
| 0 | + | -- Drag ability |
---|
| 0 | + | MinimapCluster:SetPoint("TOPRIGHT", -10, -10) |
---|
| 0 | + | MinimapCluster:SetClampedToScreen(true) |
---|
| 0 | + | MinimapCluster:SetMovable(true) |
---|
| 0 | + | |
---|
| 0 | + | MinimapZoneTextButton:SetScript("OnMouseDown", function(_, button) |
---|
| 0 | + | if button == "LeftButton" and IsAltKeyDown() then |
---|
| 0 | + | MinimapCluster:StartMoving() |
---|
| 0 | + | end |
---|
| 0 | + | end) |
---|
| 0 | + | |
---|
| 0 | + | MinimapZoneTextButton:SetScript("OnMouseUp", function() |
---|
| 0 | + | MinimapCluster:StopMovingOrSizing() |
---|
| 0 | + | end) |
---|
| 0 | + | |
---|
| 0 | + | -- Hide zoom buttons, mousewheel zooming |
---|
| 0 | + | MinimapZoomIn:Hide() |
---|
| 0 | + | MinimapZoomOut:Hide() |
---|
| 0 | + | |
---|
| 0 | + | Minimap:SetScript("OnMouseWheel", function(self, delta) |
---|
| 0 | + | local zoom = Minimap:GetZoom() |
---|
| 0 | + | if delta == 1 and zoom < Minimap:GetZoomLevels() then |
---|
| 0 | + | if IsShiftKeyDown() then |
---|
| 0 | + | Minimap:SetZoom(Minimap:GetZoomLevels()) |
---|
| 0 | + | else |
---|
| 0 | + | Minimap:SetZoom(zoom + 1) |
---|
| 0 | + | end |
---|
| 0 | + | elseif delta == -1 and zoom > 0 then |
---|
| 0 | + | if IsShiftKeyDown() then |
---|
| 0 | + | Minimap:SetZoom(0) |
---|
| 0 | + | else |
---|
| 0 | + | Minimap:SetZoom(zoom - 1) |
---|
| 0 | + | end |
---|
| 0 | + | end |
---|
| 0 | + | end) |
---|
| 0 | + | |
---|
| 0 | + | -- Hide map button |
---|
| 0 | + | MiniMapWorldMapButton:Hide() |
---|
| 0 | + | |
---|
| 0 | + | -- Hide compass |
---|
| 0 | + | hooksecurefunc("Minimap_UpdateRotationSetting", function() |
---|
| 0 | + | MinimapNorthTag:Hide() |
---|
| 0 | + | MinimapCompassTexture:Hide() |
---|
| 0 | + | end) |
---|
| 0 | + | |
---|
| 0 | + | -- Hide calendar |
---|
| 0 | + | GameTimeFrame:Hide() |
---|
| 0 | + | |
---|
| 0 | + | -- Hide time manager |
---|
| 0 | + | local dummy = CreateFrame("Frame") |
---|
| 0 | + | dummy:RegisterEvent("ADDON_LOADED") |
---|
| 0 | + | dummy:SetScript("OnEvent", function(_, event, ...) |
---|
| 0 | + | if event == "ADDON_LOADED" then |
---|
| 0 | + | if ... == "Blizzard_TimeManager" then |
---|
| 0 | + | TimeManagerClockButton:Hide() |
---|
| 0 | + | end |
---|
| 0 | + | end |
---|
| 0 | + | end) |
---|
| 0 | + | |
---|
| 0 | + | -- Hide LFG button |
---|
| 0 | + | local showLFGMenu = MiniMapLFGFrame:IsShown() |
---|
| 0 | + | hooksecurefunc("MiniMapLFG_UpdateIsShown", function() |
---|
| 0 | + | showLFGMenu = MiniMapLFGFrame:IsShown() |
---|
| 0 | + | MiniMapLFGFrame:Hide() |
---|
| 0 | + | end) |
---|
| 0 | + | |
---|
| 0 | + | -- Hide voice chat button |
---|
| 0 | + | local showVoiceMenu = MiniMapVoiceChatFrame:IsShown() |
---|
| 0 | + | hooksecurefunc("MiniMapVoiceChat_Update", function() |
---|
| 0 | + | showVoiceMenu = MiniMapVoiceChatFrame:IsShown() |
---|
| 0 | + | MiniMapVoiceChatFrame:Hide() |
---|
| 0 | + | end) |
---|
| 0 | + | |
---|
| 0 | + | -- Hide PvP button |
---|
| 0 | + | local showPvPMenu = MiniMapBattlefieldFrame:IsShown() |
---|
| 0 | + | hooksecurefunc("PVP_UpdateStatus", function() |
---|
| 0 | + | showPvPMenu = MiniMapBattlefieldFrame:IsShown() |
---|
| 0 | + | --MiniMapBattlefieldFrame:Hide() |
---|
| 0 | + | end) |
---|
| 0 | + | |
---|
| 0 | + | -- Skin minimap |
---|
| 0 | + | Minimap:SetPoint("CENTER", MinimapCluster, 0, -10) |
---|
| 0 | + | Minimap:SetMaskTexture(media.background["Flat"]) |
---|
| 0 | + | Minimap:SetFrameLevel(3) |
---|
| 0 | + | |
---|
| 0 | + | MinimapBackdrop:SetFrameLevel(2) |
---|
| 0 | + | MinimapBackdrop:SetPoint("TOPLEFT", Minimap, -11, 11) |
---|
| 0 | + | MinimapBackdrop:SetPoint("BOTTOMRIGHT", Minimap, 11, -11) |
---|
| 0 | + | MinimapBackdrop:SetBackdrop({ |
---|
| 0 | + | bgFile = media.background["Flat"], |
---|
| 0 | + | edgeFile = media.border["hankui: Thin Glow"], |
---|
| 0 | + | edgeSize = 16, |
---|
| 0 | + | insets = { left = 4, right = 4, top = 4, bottom = 4 } |
---|
| 0 | + | }) |
---|
| 0 | + | MinimapBackdrop:SetBackdropColor(unpack(colors["Background"].applyAlpha(1))) |
---|
| 0 | + | MinimapBackdrop:SetBackdropBorderColor(unpack(colors["Background"].applyAlpha(0.8))) |
---|
| 0 | + | MinimapBorder:Hide() |
---|
| 0 | + | |
---|
| 0 | + | local glow = MinimapBackdrop:CreateTexture("MinimapGlow", "BACKGROUND", nil, -8) |
---|
| 0 | + | glow:SetPoint("TOPLEFT", MinimapBackdrop, -110, 110) |
---|
| 0 | + | glow:SetPoint("BOTTOMRIGHT", MinimapBackdrop, 110, -110) |
---|
| 0 | + | glow:SetBlendMode("ADD") |
---|
| 0 | + | glow:SetTexture(media.background["hankui: Minimap glow"]) |
---|
| 0 | + | glow:SetVertexColor(unpack(colors["Signature color"].applyAlpha(1))) |
---|
| 0 | + | |
---|
| 0 | + | MinimapBorderTop:Hide() |
---|
| 0 | + | fonts.overrides["hMinimapZone"] = {"Tahoma Bold", 14, "OUTLINE"} |
---|
| 0 | + | MinimapZoneText:SetFontObject("hMinimapZone") |
---|
| 0 | + | |
---|
| 0 | + | -- Skin buttons |
---|
| 0 | + | local MiniMapBin = CreateFrame("Button", "MiniMapBin", Minimap) |
---|
| 0 | + | local MiniMapBinIcon = MiniMapBin:CreateTexture("MiniMapBinIcon", "ARTWORK") |
---|
| 0 | + | local MiniMapBinBorder = MiniMapBin:CreateTexture("MiniMapBinBorder", "BORDER") |
---|
| 0 | + | |
---|
| 0 | + | for i, v in ipairs({ "MiniMapMail", "MiniMapTracking", "MiniMapBin" }) do |
---|
| 0 | + | local frame = _G[v .. "Frame"] or _G[v] |
---|
| 0 | + | local btn = _G[v .. "Button"] |
---|
| 0 | + | local ico = _G[v .. "Icon"] |
---|
| 0 | + | local bd = _G[v .. "Border"] or _G[v .. "ButtonBorder"] |
---|
| 0 | + | |
---|
| 0 | + | frame:SetSize(32, 32) |
---|
| 0 | + | frame:ClearAllPoints() |
---|
| 0 | + | frame:SetAlpha(0) |
---|
| 0 | + | |
---|
| 0 | + | if btn then |
---|
| 0 | + | btn:SetAllPoints() |
---|
| 0 | + | btn:SetHighlightTexture(nil) |
---|
| 0 | + | btn:SetScript("OnMouseDown", nil) |
---|
| 0 | + | btn:SetScript("OnMouseUp", nil) |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | local scriptRef = btn or frame |
---|
| 0 | + | scriptRef:HookScript("OnEnter", function(_, motion) |
---|
| 0 | + | ico:SetVertexColor(unpack(colors["Signature color"].applyAlpha(1))) |
---|
| 0 | + | bd:SetVertexColor(unpack(colors["Signature color"].applyAlpha(1))) |
---|
| 0 | + | end) |
---|
| 0 | + | scriptRef:HookScript("OnLeave", function(_, motion) |
---|
| 0 | + | ico:SetVertexColor(unpack(colors["Background light"].applyAlpha(1))) |
---|
| 0 | + | bd:SetVertexColor(unpack(colors["Background"].applyAlpha(1))) |
---|
| 0 | + | end) |
---|
| 0 | + | |
---|
| 0 | + | ico:SetAllPoints() |
---|
| 0 | + | ico:SetTexture(media.button["Minimap"]) |
---|
| 0 | + | ico:SetTexCoord((i - 1) * 0.25, i * 0.25, 0, 0.5) |
---|
| 0 | + | ico:SetVertexColor(unpack(colors["Background light"].applyAlpha(1))) |
---|
| 0 | + | |
---|
| 0 | + | bd:SetAllPoints() |
---|
| 0 | + | bd:SetTexture(media.button["Minimap"]) |
---|
| 0 | + | bd:SetTexCoord((i - 1) * 0.25, i * 0.25, 0.5, 1) |
---|
| 0 | + | bd:SetVertexColor(unpack(colors["Background"].applyAlpha(1))) |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | MiniMapTracking:SetPoint("BOTTOM", 0, 10) |
---|
| 0 | + | MiniMapMailFrame:SetPoint("RIGHT", MiniMapTracking, "LEFT", -5, 0) |
---|
| 0 | + | MiniMapBin:SetPoint("LEFT", MiniMapTracking, "RIGHT", 5, 0) |
---|
| 0 | + | |
---|
| 0 | + | -- Show buttons on mouseover |
---|
| 0 | + | local function showBtns() |
---|
| 0 | + | MiniMapBin:SetAlpha(1) |
---|
| 0 | + | MiniMapTracking:SetAlpha(1) |
---|
| 0 | + | MiniMapMailFrame:SetAlpha(1) |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | local function hideBtns() |
---|
| 0 | + | if not Minimap:IsMouseOver() then |
---|
| 0 | + | MiniMapBin:SetAlpha(0) |
---|
| 0 | + | MiniMapTracking:SetAlpha(0) |
---|
| 0 | + | MiniMapMailFrame:SetAlpha(0) |
---|
| 0 | + | end |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | for _, v in ipairs({ "Minimap", "MiniMapBin", "MiniMapTrackingButton", "MiniMapMailFrame" }) do |
---|
| 0 | + | _G[v]:HookScript("OnEnter", showBtns) |
---|
| 0 | + | _G[v]:HookScript("OnLeave", hideBtns) |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | hideBtns() |
---|
| 0 | + | |
---|
| 0 | + | -- Button bin: Try to get all external addon buttons off the map |
---|
| 0 | + | local external = { |
---|
| 0 | + | frames = {}, |
---|
| 0 | + | factoryFrames = { |
---|
| 0 | + | "MinimapZoneTextButton", |
---|
| 0 | + | "MiniMapBattlefieldFrame", |
---|
| 0 | + | "GameTimeFrame", |
---|
| 0 | + | "MiniMapVoiceChatFrame", |
---|
| 0 | + | "MiniMapBin", |
---|
| 0 | + | "TimeManagerClockButton", |
---|
| 0 | + | "MiniMapWorldMapButton", |
---|
| 0 | + | "MiniMapLFGFrame", |
---|
| 0 | + | "MinimapZoomIn", |
---|
| 0 | + | "MinimapZoomOut", |
---|
| 0 | + | "MiniMapRecordingButton" |
---|
| 0 | + | }, |
---|
| 0 | + | filteredStrings = { |
---|
| 0 | + | "Minimap", |
---|
| 0 | + | "Icon", |
---|
| 0 | + | "Button", |
---|
| 0 | + | "Frame", |
---|
| 0 | + | "LibDB[%d]*", |
---|
| 0 | + | "_" |
---|
| 0 | + | } |
---|
| 0 | + | } |
---|
| 0 | + | |
---|
| 0 | + | Minimap:RegisterEvent("PLAYER_LOGIN") |
---|
| 0 | + | Minimap:HookScript("OnEvent", function(_, event) |
---|
| 0 | + | if event == "PLAYER_LOGIN" then |
---|
| 0 | + | local externalButtons = {} |
---|
| 0 | + | for _, frame in ipairs({ "MinimapCluster", "Minimap", "MinimapBackdrop" }) do |
---|
| 0 | + | if _G[frame]:GetChildren() then |
---|
| 0 | + | for i = 1, select("#", _G[frame]:GetChildren()) do |
---|
| 0 | + | local child = select(i, _G[frame]:GetChildren()) |
---|
| 0 | + | if child:GetObjectType() == "Button" and not tContains(external.factoryFrames, child:GetName()) then |
---|
| 0 | + | table.insert(external.frames, child) |
---|
| 0 | + | child:Hide() |
---|
| 0 | + | end |
---|
| 0 | + | end |
---|
| 0 | + | end |
---|
| 0 | + | end |
---|
| 0 | + | end |
---|
| 0 | + | end) |
---|
| 0 | + | |
---|
| 0 | + | -- Button bin: Dropdown |
---|
| 0 | + | local dropdown = CreateFrame("Frame", "MiniMapBinDropDown", MiniMapBin, "UIDropDownMenuTemplate") |
---|
| 0 | + | local tblDropDown = {} |
---|
| 0 | + | |
---|
| 0 | + | local function showDropDown(self, level) |
---|
| 0 | + | -- Root menu |
---|
| 0 | + | if level == 1 then |
---|
| 0 | + | -- Calendar |
---|
| 0 | + | tblDropDown = { |
---|
| 0 | + | text = "Calendar" .. (CalendarGetNumPendingInvites() > 0 and (" (" .. CalendarGetNumPendingInvites() .. " pending)") or ""), |
---|
| 0 | + | notCheckable = true, |
---|
| 0 | + | tooltipOnButton = true, |
---|
| 0 | + | func = function() GameTimeFrame_OnClick(GameTimeFrame) end |
---|
| 0 | + | } |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown) |
---|
| 0 | + | |
---|
| 0 | + | -- Voice chat |
---|
| 0 | + | if showVoiceMenu then |
---|
| 0 | + | tblDropDown = { |
---|
| 0 | + | text = "Voice chat", |
---|
| 0 | + | notCheckable = true, |
---|
| 0 | + | hasArrow = true, |
---|
| 0 | + | value = "Voice", |
---|
| 0 | + | func = function() ToggleFriendsFrame(3) end |
---|
| 0 | + | } |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown) |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | -- LFG root menu |
---|
| 0 | + | if showLFGMenu then |
---|
| 0 | + | tblDropDown = { |
---|
| 0 | + | text = "Dungeon finder", |
---|
| 0 | + | notCheckable = true, |
---|
| 0 | + | hasArrow = true, |
---|
| 0 | + | value = "LFG", |
---|
| 0 | + | func = function() |
---|
| 0 | + | mode, submode = GetLFGMode() |
---|
| 0 | + | if mode == "proposal" and not LFDDungeonReadyPopup:IsShown() then |
---|
| 0 | + | PlaySound("igCharacterInfoTab"); |
---|
| 0 | + | StaticPopupSpecial_Show(LFDDungeonReadyPopup) |
---|
| 0 | + | elseif mode == "queued" or mode == "rolecheck" then |
---|
| 0 | + | ToggleLFDParentFrame() |
---|
| 0 | + | elseif mode == "listed" then |
---|
| 0 | + | ToggleLFRParentFrame() |
---|
| 0 | + | end |
---|
| 0 | + | end |
---|
| 0 | + | } |
---|
| 0 | + | |
---|
| 0 | + | local mode, submode = GetLFGMode() |
---|
| 0 | + | |
---|
| 0 | + | if mode == "queued" then |
---|
| 0 | + | tblDropDown.tooltipTitle = LOOKING_FOR_DUNGEON |
---|
| 0 | + | tblDropDown.tooltipText = LFDSearchStatusStatistic:GetText() |
---|
| 0 | + | tblDropDown.tooltipOnButton = true |
---|
| 0 | + | elseif mode == "proposal" then |
---|
| 0 | + | tblDropDown.tooltipTitle = LOOKING_FOR_DUNGEON |
---|
| 0 | + | tblDropDown.tooltipText = DUNGEON_GROUP_FOUND_TOOLTIP |
---|
| 0 | + | tblDropDown.tooltipOnButton = true |
---|
| 0 | + | elseif mode == "rolecheck" then |
---|
| 0 | + | tblDropDown.tooltipTitle = LOOKING_FOR_DUNGEON |
---|
| 0 | + | tblDropDown.tooltipText = ROLE_CHECK_IN_PROGRESS_TOOLTIP |
---|
| 0 | + | tblDropDown.tooltipOnButton = true |
---|
| 0 | + | elseif mode == "listed" then |
---|
| 0 | + | tblDropDown.tooltipTitle = LOOKING_FOR_RAID |
---|
| 0 | + | tblDropDown.tooltipText = YOU_ARE_LISTED_IN_LFR |
---|
| 0 | + | tblDropDown.tooltipOnButton = true |
---|
| 0 | + | elseif mode == "lfgparty" then |
---|
| 0 | + | tblDropDown.tooltipTitle = LOOKING_FOR_DUNGEON |
---|
| 0 | + | tblDropDown.tooltipText = YOU_ARE_IN_DUNGEON_GROUP |
---|
| 0 | + | tblDropDown.tooltipOnButton = true |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown) |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | -- PvP root menu |
---|
| 0 | + | if showPvPMenu then |
---|
| 0 | + | tblDropDown = { |
---|
| 0 | + | text = "PvP", |
---|
| 0 | + | notCheckable = true, |
---|
| 0 | + | hasArrow = true, |
---|
| 0 | + | value = "PvP", |
---|
| 0 | + | tooltipTitle = "lolol", |
---|
| 0 | + | tooltipText = string.gsub(MiniMapBattlefieldFrame.tooltip, RIGHT_CLICK_MESSAGE, ""), |
---|
| 0 | + | tooltipOnButton = true, |
---|
| 0 | + | func = function() |
---|
| 0 | + | end |
---|
| 0 | + | } |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown) |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | -- External addons |
---|
| 0 | + | if #external.frames > 0 then |
---|
| 0 | + | tblDropDown = { notCheckable = true, notClickable = true } |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown) |
---|
| 0 | + | tblDropDown = { isTitle = true, text = "Addons", notCheckable = true } |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown) |
---|
| 0 | + | |
---|
| 0 | + | for i = 1, #external.frames do |
---|
| 0 | + | local caption |
---|
| 0 | + | if external.frames[i]:GetName() then |
---|
| 0 | + | caption = external.frames[i]:GetName() |
---|
| 0 | + | -- Filter out all the crap |
---|
| 0 | + | for _, filter in ipairs(external.filteredStrings) do |
---|
| 0 | + | caption = string.gsub(caption, filter, "") |
---|
| 0 | + | end |
---|
| 0 | + | else |
---|
| 0 | + | caption = "Unknown addon" |
---|
| 0 | + | end |
---|
| 0 | + | tblDropDown = { |
---|
| 0 | + | text = caption, |
---|
| 0 | + | notCheckable = true, |
---|
| 0 | + | func = function() |
---|
| 0 | + | external.frames[i]:GetScript("OnClick")(external.frames[i], "LeftButton", true) |
---|
| 0 | + | end |
---|
| 0 | + | } |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown) |
---|
| 0 | + | end |
---|
| 0 | + | end |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | -- Voice submenu |
---|
| 0 | + | if level == 2 and UIDROPDOWNMENU_MENU_VALUE == "Voice" then |
---|
| 0 | + | for id = 1, GetNumVoiceSessions() do |
---|
| 0 | + | local name, active = GetVoiceSessionInfo(id); |
---|
| 0 | + | tblDropDown = { |
---|
| 0 | + | text = name, |
---|
| 0 | + | checked = active, |
---|
| 0 | + | func = function (self, id) |
---|
| 0 | + | SetActiveVoiceChannelBySessionID(id) |
---|
| 0 | + | end, |
---|
| 0 | + | arg1 = id |
---|
| 0 | + | } |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown, 2) |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | tblDropDown = { |
---|
| 0 | + | text = NONE, |
---|
| 0 | + | checked = not GetVoiceCurrentSessionID() and 1 or nil, |
---|
| 0 | + | func = function (self, id) |
---|
| 0 | + | SetActiveVoiceChannelBySessionID(id) |
---|
| 0 | + | end, |
---|
| 0 | + | arg1 = 0 |
---|
| 0 | + | } |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown, 2) |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | -- LFG submenu |
---|
| 0 | + | if level == 2 and UIDROPDOWNMENU_MENU_VALUE == "LFG" then |
---|
| 0 | + | local mode, submode = GetLFGMode() |
---|
| 0 | + | |
---|
| 0 | + | -- Teleport |
---|
| 0 | + | if IsPartyLFG() then |
---|
| 0 | + | local addButton = false |
---|
| 0 | + | if IsInLFGDungeon() then |
---|
| 0 | + | tblDropDown = { |
---|
| 0 | + | text = TELEPORT_OUT_OF_DUNGEON, |
---|
| 0 | + | notCheckable = true, |
---|
| 0 | + | func = function() |
---|
| 0 | + | MiniMapLFGFrame_TeleportOut() |
---|
| 0 | + | ToggleDropDownMenu(1, nil, dropdown) |
---|
| 0 | + | end |
---|
| 0 | + | } |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown, 2) |
---|
| 0 | + | elseif GetNumPartyMembers() > 0 or GetNumRaidMembers() > 0 then |
---|
| 0 | + | tblDropDown = { |
---|
| 0 | + | text = TELEPORT_TO_DUNGEON, |
---|
| 0 | + | notCheckable = true, |
---|
| 0 | + | func = function() |
---|
| 0 | + | MiniMapLFGFrame_TeleportIn() |
---|
| 0 | + | ToggleDropDownMenu(1, nil, dropdown) |
---|
| 0 | + | end |
---|
| 0 | + | } |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown, 2) |
---|
| 0 | + | end |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | -- Proposals, list grp / player |
---|
| 0 | + | if mode == "proposal" and submode == "unaccepted" then |
---|
| 0 | + | tblDropDown = { |
---|
| 0 | + | text = ENTER_DUNGEON, |
---|
| 0 | + | notCheckable = true, |
---|
| 0 | + | func = function() |
---|
| 0 | + | AcceptProposal() |
---|
| 0 | + | ToggleDropDownMenu(1, nil, dropdown) |
---|
| 0 | + | end |
---|
| 0 | + | } |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown, 2) |
---|
| 0 | + | tblDropDown = { |
---|
| 0 | + | text = LEAVE_QUEUE, |
---|
| 0 | + | notCheckable = true, |
---|
| 0 | + | func = function() |
---|
| 0 | + | RejectProposal() |
---|
| 0 | + | ToggleDropDownMenu(1, nil, dropdown) |
---|
| 0 | + | end |
---|
| 0 | + | } |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown, 2) |
---|
| 0 | + | elseif mode == "queued" then |
---|
| 0 | + | tblDropDown = { |
---|
| 0 | + | text = LEAVE_QUEUE, |
---|
| 0 | + | notCheckable = true, |
---|
| 0 | + | func = function() |
---|
| 0 | + | LeaveLFG() |
---|
| 0 | + | ToggleDropDownMenu(1, nil, dropdown) |
---|
| 0 | + | end, |
---|
| 0 | + | disabled = submode == "unempowered" |
---|
| 0 | + | } |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown, 2) |
---|
| 0 | + | elseif mode == "listed" then |
---|
| 0 | + | tblDropDown = { |
---|
| 0 | + | text = (GetNumPartyMembers() > 0 or GetNumRaidMembers() > 0) and UNLIST_MY_GROUP or UNLIST_ME, |
---|
| 0 | + | notCheckable = true, |
---|
| 0 | + | func = function() |
---|
| 0 | + | LeaveLF() |
---|
| 0 | + | ToggleDropDownMenu(1, nil, dropdown) |
---|
| 0 | + | end, |
---|
| 0 | + | disabled = submode == "unempowered" |
---|
| 0 | + | } |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown, 2) |
---|
| 0 | + | end |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | -- PvP submenu |
---|
| 0 | + | if level == 2 and UIDROPDOWNMENU_MENU_VALUE == "PvP" then |
---|
| 0 | + | -- ##2DO## |
---|
| 0 | + | -- ************************************************************************** |
---|
| 0 | + | -- * http://wowprogramming.com/utils/xmlbrowser/live/FrameXML/PVPFrame.lua * |
---|
| 0 | + | -- * MiniMapBattlefieldDropDown_Initialize() * |
---|
| 0 | + | -- ************************************************************************** |
---|
| 0 | + | for i = 1, MAX_BATTLEFIELD_QUEUES do |
---|
| 0 | + | local status, mapName, instanceID, levelRangeMin, levelRangeMax, teamSize, registeredMatch = GetBattlefieldStatus(i) |
---|
| 0 | + | if status == "queued" or status == "confirm" then |
---|
| 0 | + | if teamSize ~= 0 then |
---|
| 0 | + | tblDropDown = { |
---|
| 0 | + | text = ARENA_RATED_MATCH .. " " .. format(PVP_TEAMSIZE, teamSize, teamSize), |
---|
| 0 | + | isTitle = 1, |
---|
| 0 | + | notCheckable = 1 |
---|
| 0 | + | } |
---|
| 0 | + | else |
---|
| 0 | + | tblDropDown = { |
---|
| 0 | + | text = ARENA_RATED_MATCH .. " " .. format(PVP_TEAMSIZE, teamSize, teamSize), |
---|
| 0 | + | isTitle = 1, |
---|
| 0 | + | notCheckable = 1 |
---|
| 0 | + | } |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | UIDropDownMenu_AddButton(tblDropDown) |
---|
| 0 | + | end |
---|
| 0 | + | end |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | end |
---|
| 0 | + | |
---|
| 0 | + | UIDropDownMenu_Initialize(dropdown, showDropDown, "MENU") |
---|
| 0 | + | dropdown.noResize = true |
---|
| 0 | + | |
---|
| 0 | + | MiniMapBin:SetScript("OnClick", function() |
---|
| 0 | + | PlaySound("igMainMenuOptionCheckBoxOn") |
---|
| 0 | + | ToggleDropDownMenu(1, nil, dropdown, "MiniMapBin", 0, -5) |
---|
| 0 | + | end) |
---|
... | |
---|