Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 23rd, 2012  |  syntax: Lua  |  size: 8.13 KB  |  views: 45  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. if config.modules.minimap.enable ~= 1 then
  2.     function GetMinimapShape() return 'ROUND' end
  3. return end
  4.  
  5. local configMain = config
  6. local config = config.modules.minimap
  7.  
  8. SetDimensions(Minimap, 120, 120, 1, 1)
  9. CreateBackdrop(Minimap)
  10. Minimap:EnableMouse(true)
  11. Minimap:SetMaskTexture(media.flat)
  12.  
  13. function fixTooltip(self)
  14.         if self ~= MiniMapMailFrame then
  15.                 GameTooltip:SetOwner(self, 'ANCHOR_NONE')
  16.         end
  17.         GameTooltip:ClearAllPoints()
  18.         GameTooltip:SetPoint('TOPLEFT', Minimap, 'TOPRIGHT', 2, 0)
  19. end
  20. function dropdownOnClick(self)
  21.         GameTooltip:Hide()
  22.         DropDownList1:ClearAllPoints()
  23.         DropDownList1:SetPoint('TOPLEFT', Minimap, 'TOPRIGHT', 2, 0)
  24. end
  25. MiniMapBattlefieldFrame:HookScript('OnClick', dropdownOnClick)
  26.  
  27. Minimap:SetPoint(unpack(config.spawn))
  28. ----------------------------------
  29. -- Hide Shit
  30. ----------------------------------
  31. for _, hide in next,{MinimapBorder, MinimapBorderTop, MinimapZoomIn, MinimapZoomOut, MiniMapVoiceChatFrame,
  32.     GameTimeFrame, MinimapZoneTextButton, MiniMapTracking, MiniMapMailBorder, MiniMapBattlefieldBorder, MiniMapWorldMapButton, MiniMapLFGFrameBorder.
  33.     MinimapBackdrop,MinimapCluster,GameTimeFrame} do
  34.     hide:Hide()
  35. end
  36.  
  37. WorldStateAlwaysUpFrame:SetPoint('TOP', Minimap, 'BOTTOM', 0, 10)
  38.  
  39. for i = 1, TicketStatusFrameButton:GetNumRegions() do
  40.         select(i, TicketStatusFrameButton:GetRegions()):Hide()
  41. end
  42. CreateBackdrop(TicketStatusFrameButton)
  43. TicketStatusFrame:ClearAllPoints()
  44. TicketStatusFrame:SetPoint('TOPRIGHT', Minimap, 'TOPRIGHT', 4, 0)
  45.  
  46.  
  47. for i = 1, GhostFrame:GetNumRegions() do
  48.         select(i, GhostFrame:GetRegions()):Hide()
  49. end
  50. CreateBackdrop(GhostFrame)
  51. GhostFrame:ClearAllPoints()
  52. GhostFrame:SetPoint('BOTTOMLEFT', Minimap, 'TOPLEFT', 0, -4)
  53.  
  54. MinimapNorthTag:SetAlpha(0)
  55.  
  56. MiniMapMailFrame:ClearAllPoints()
  57. MiniMapMailFrame:SetPoint("TOPRIGHT", Minimap, 3, 4)
  58.  
  59. MiniMapMailIcon:SetTexture('Interface\\Minimap\\TRACKING\\Mailbox')
  60. MiniMapMailIcon:SetAllPoints(MiniMapMailFrame)
  61. MiniMapMailIcon:SetRotation(rad(-36))
  62. MiniMapMailBorder:Hide()
  63.  
  64. MiniMapMailFrame:ClearAllPoints()
  65. MiniMapMailFrame:SetHeight(24)
  66. MiniMapMailFrame:SetWidth(24)
  67. MiniMapMailFrame:SetPoint(unpack(config.mailposition))
  68. MiniMapMailFrame:HookScript('OnEnter', fixTooltip)
  69.  
  70. MiniMapBattlefieldFrame:ClearAllPoints()
  71. MiniMapBattlefieldFrame:SetPoint("BOTTOMLEFT", Minimap, "BOTTOMLEFT", 2, 0)
  72. MiniMapBattlefieldFrame:HookScript('OnEnter', fixTooltip)
  73. MiniMapBattlefieldBorder:Hide()
  74.  
  75. GuildInstanceDifficulty:ClearAllPoints()
  76. GuildInstanceDifficulty:SetScale(.5)
  77. GuildInstanceDifficulty:SetPoint("BOTTOMRIGHT", Minimap, "BOTTOMRIGHT", -2,2)
  78. GuildInstanceDifficulty:SetFrameStrata("HIGH")
  79.  
  80. MiniMapInstanceDifficulty:ClearAllPoints()
  81. MiniMapInstanceDifficulty:SetParent(Minimap)
  82. MiniMapInstanceDifficulty:SetPoint("TOPLEFT", Minimap, "TOPLEFT", 0, 0)
  83.  
  84. MiniMapLFGFrame:ClearAllPoints()
  85. MiniMapLFGFrame:SetParent(Minimap)
  86. MiniMapLFGFrame:SetPoint("BOTTOMLEFT", Minimap, "BOTTOMLEFT", 2, 1)
  87. MiniMapLFGFrameBorder:Hide()
  88.  
  89. MiniMapLFGFrame:HookScript('OnEnter', function(self)
  90.         if GetLFGMode() == 'queued' then
  91.                 LFGSearchStatus:Hide()
  92.                 --        true, _, 2, 6, 16, _, 6, 17, 1, 3, "Belagerung des Wyrmruhtempels", 147, -1, 22, 646, 646, 15019.273
  93.                 local data, _, tank, healer, dps, _, _, _, _, _, instance, _, tankWait, healerWait, damageWait, myWait, queuedTime = GetLFGQueueStats()
  94.                 --data, _, tank, healer, dps, _, instance, _, tankWait, healerWait, damageWait = GetLFGQueueStats()
  95.                
  96.                 GameTooltip:SetOwner(self, 'ANCHOR_NONE')
  97.                 GameTooltip:ClearLines()
  98.                
  99.                 if data then
  100.                         GameTooltip:AddLine('In queue for:')
  101.                         GameTooltip:AddLine(instance, 1, 1, 1)
  102.                         GameTooltip:AddLine(' ')
  103.                        
  104.                         local totalWait = tankWait + healerWait + damageWait
  105.                         local dpsNumber = dps > 1 and ' ('..dps..')' or ''
  106.                        
  107.                         GameTooltip:AddDoubleLine('Tanking Class',                              formatTime(tankWait),   tank,   1, 0, configMain.API.colorGradient[(1 - (tankWait/totalWait))])
  108.                         GameTooltip:AddDoubleLine('Healing Class',                              formatTime(healerWait), healer, 1, 0, configMain.API.colorGradient[(1 - (healerWait/totalWait))])
  109.                         GameTooltip:AddDoubleLine('Damage Class'..dpsNumber,    formatTime(damageWait), dps,    1, 0, configMain.API.colorGradient[(1 - (damageWait/totalWait))])
  110.                 else
  111.                         GameTooltip:AddLine('Acquiring LFG Queue Statistics')
  112.                         GameTooltip:AddLine('One Moment Please')
  113.                 end
  114.                 GameTooltip:Show()
  115.         end
  116.         GameTooltip:ClearAllPoints()
  117.         GameTooltip:SetPoint('TOPLEFT', Minimap, 'TOPRIGHT', 2, 0)
  118. end)
  119. MiniMapLFGFrame:HookScript('OnClick', dropdownOnClick)
  120.    
  121. Minimap:EnableMouseWheel(true)
  122. Minimap:SetScript('OnMouseWheel', function(self, delta)
  123.     if delta > 0 then
  124.         MinimapZoomIn:Click()
  125.     elseif delta < 0 then
  126.         MinimapZoomOut:Click()
  127.     end
  128. end)
  129.  
  130. Minimap:SetScript('OnMouseUp', function (self, button)
  131.         if button == 'RightButton' then
  132.                 ToggleDropDownMenu(1, nil, MiniMapTrackingDropDown, Minimap, (Minimap:GetWidth()+2), (Minimap:GetHeight()))
  133.                 GameTooltip:Hide()
  134.         else
  135.                 Minimap_OnClick(self)
  136.         end
  137. end)
  138.  
  139. Minimap:SetScript('OnEnter', function(self)
  140.         if InCombatLockdown() then return end
  141.         collectgarbage('collect')
  142.         UpdateAddOnMemoryUsage()
  143.  
  144.         local memory = {}
  145.         local total = 0
  146.  
  147.         for i = 1, GetNumAddOns() do
  148.                 if IsAddOnLoaded(i) then
  149.                         local mem = GetAddOnMemoryUsage(i)
  150.                         tinsert (memory, {select(2, GetAddOnInfo(i)), mem})
  151.                         total = total + mem
  152.                 end
  153.         end
  154.  
  155.         table.sort(memory, function(a, b)
  156.                 return a[2] > b[2]
  157.         end)
  158.  
  159.         fixTooltip(self)
  160.         GameTooltip:AddDoubleLine('Total Usage', formatMemory(total), 1, 1, 1, 1, 1, 1)
  161.         GameTooltip:AddLine(' ')
  162.         for i = 1, #memory do
  163.                 GameTooltip:AddDoubleLine(memory[i][1], formatMemory(memory[i][2]), 1, 1, 1, colorGradient(1 - memory[i][2]/total))
  164.         end
  165.         GameTooltip:Show()
  166. end)
  167. Minimap:SetScript('OnLeave', function() GameTooltip:Hide() end)
  168.  
  169. local function makeit(frame, txt, posx, posy)
  170.     frame:SetHeight(20)
  171.     frame:SetWidth(40)
  172.     frame:SetPoint("LEFT", Minimap, "TOPRIGHT", posx, posy)
  173.     frame:SetParent(Minimap)
  174.     txt:SetPoint("LEFT", frame, "LEFT", 0,0)
  175.     txt:SetFont(media.font, 11, "OUTLINE")
  176. end
  177.  
  178. local Loc = CreateFrame("Frame", "Location", UIParent)
  179. local LocText = Loc:CreateFontString(nil)
  180. makeit(Loc, LocText, 6, -10)
  181.  
  182. local SubLoc = CreateFrame("Frame", "Sub Location", UIParent)
  183. local SubText = SubLoc:CreateFontString(nil)
  184. makeit(SubLoc, SubText, 6, -90)
  185.  
  186. local Lag = CreateFrame("Frame", "Lag", UIParent)
  187. local LagText = Lag:CreateFontString(nil)
  188. makeit(Lag, LagText, 6, -30)
  189.  
  190. local FPS = CreateFrame("Frame", "FPS", UIParent)
  191. FPS:EnableMouse(true)
  192. local FPSText = FPS:CreateFontString(nil)
  193. makeit(FPS, FPSText, 6, -50)
  194.  
  195. LoadAddOn('Blizzard_TimeManager')
  196. TimeManagerClockTicker:ClearAllPoints()
  197. TimeManagerClockTicker:SetPoint(unpack(config.clockposition))
  198. TimeManagerClockTicker:SetFont(media.font, 10)
  199. TimeManagerClockTicker: SetJustifyH('RIGHT')
  200.  
  201. TimeManagerClockButton:ClearAllPoints()
  202. TimeManagerClockButton:SetPoint("TOPLEFT", TimeManagerClockTicker, -3, 3)
  203. TimeManagerClockButton:SetPoint("BOTTOMRIGHT", TimeManagerClockTicker, 3, -3)
  204. select(1, TimeManagerClockButton:GetRegions()):Hide()
  205. TimeManagerClockButton:HookScript('OnEnter', fixTooltip)
  206.  
  207. local colorlag = function(number)
  208.         if number <= 100 then
  209.                 return '|cff00ff00'
  210.         elseif number <= 200 then
  211.                 return '|cffffff00'
  212.         else
  213.                 return '|cffff0000'
  214.         end
  215. end
  216. local colorfps = function(number)
  217.         if number >= 30 then
  218.                 return '|cff00ff00'
  219.         elseif number < 30 then
  220.                 return '|cffffff00'
  221.         elseif number < 15 then
  222.                 return '|cffff0000'
  223.         end
  224. end
  225.  
  226. local interval = 0
  227. FPS:SetScript('OnUpdate', function(self, elapsed)
  228.         interval = interval - elapsed
  229.     hour, minute = GetGameTime()
  230.         if interval <= 0 then
  231.         FPSText:SetText(string.format('%s%d|r fps', colorfps(GetFramerate()), GetFramerate()))
  232.             LagText:SetText(string.format('%s%d|r ms', colorlag(select(3,GetNetStats())), select(3,GetNetStats())))
  233.         LocText:SetText(GetZoneText())
  234.         SubText:SetText(GetSubZoneText())
  235.                 interval = .5
  236.         end
  237. end)
  238.  
  239. local FormatMemoryNumber = function(number)
  240.         if number > 1000 then
  241.                 return string.format('%.2f mb', number / 1000)
  242.         else
  243.                 return string.format('%.1f kb', number)
  244.         end
  245. end
  246.  
  247. function GetMinimapShape() return 'SQUARE' end
clone this paste RAW Paste Data