Permalink
Browse files

right click opens tracking now, button hidden

  • Loading branch information...
1 parent 1b48e4b commit ce73b51847e1c567f723e4b6da9144cdaaf2802b @Industrial committed Dec 7, 2010
Showing with 43 additions and 20 deletions.
  1. +34 −18 Addon.lua
  2. +9 −2 README
View
@@ -1,32 +1,48 @@
-local _G = _G
-
local TL, TC, TR = 'TOPLEFT', 'TOP', 'TOPRIGHT'
local ML, MC, MR = 'LEFT', 'CENTER', 'RIGHT'
local BL, BC, BR = 'BOTTOMLEFT', 'BOTTOM', 'BOTTOMRIGHT'
-local frame
+local event_frame = CreateFrame('Frame')
-local function zoomMinimap(frame, delta)
+local function zoom(frame, delta)
if delta > 0 and Minimap:GetZoom() < 5 then
Minimap:SetZoom(Minimap:GetZoom() + 1)
elseif delta < 0 and Minimap:GetZoom() > 0 then
Minimap:SetZoom(Minimap:GetZoom() - 1)
end
end
-frame = CreateFrame('Frame', 'idMinimapFrame', Minimap)
-frame:SetAllPoints(Minimap)
-frame:EnableMouseWheel(true)
-frame:SetScript('OnMouseWheel', zoomMinimap)
-frame:Show()
+local function open_tracking(frame, button, ...)
+ if button == 'RightButton' then
+ MiniMapTrackingButton:GetScript('OnClick')()
+ else
+ Minimap_OnClick(Minimap)
+ end
+end
+
+local function enable()
+ Minimap:EnableMouseWheel(true)
+ Minimap:SetScript('OnMouseWheel', zoom)
+ Minimap:SetScript('OnMouseUp', open_tracking)
-GameTimeFrame:Hide()
-MinimapBorderTop:Hide()
-MiniMapWorldMapButton:Hide()
-MiniMapVoiceChatFrame:Hide()
-MiniMapVoiceChatFrame:SetScript('OnShow', MiniMapVoiceChatFrame.Hide)
-MiniMapWorldMapButton:Hide()
-MinimapZoneTextButton:Hide()
-MinimapZoomIn:Hide()
-MinimapZoomOut:Hide()
+ -- hide minimap elements
+ GameTimeFrame:Hide() -- calendar
+ TimeManagerClockButton:Hide()
+ MiniMapTracking:Hide()
+ MinimapBorderTop:Hide()
+ MiniMapWorldMapButton:Hide()
+ MiniMapVoiceChatFrame:Hide()
+ MiniMapVoiceChatFrame:SetScript('OnShow', MiniMapVoiceChatFrame.Hide)
+ MiniMapWorldMapButton:Hide()
+ MinimapZoneTextButton:Hide()
+ MinimapZoomIn:Hide()
+ MinimapZoomOut:Hide()
+end
+
+event_frame:SetScript('OnEvent', function(frame, event, ...)
+ if event == 'PLAYER_LOGIN' then
+ enable()
+ end
+end)
+event_frame:RegisterEvent('PLAYER_LOGIN')
View
11 README
@@ -1,6 +1,13 @@
This addon changes some things around the minimap
Features
- - Removes the zoom buttons, world map icon and zone text.
- - Zoom in and out with the mousewheel.
+ - Removes:
+ - Zone text
+ - World Map button
+ - Tracking button
+ - Zoom buttons
+ - Calendar button (I use /calendar)
+ - Adds:
+ - Mousewheel scrolling
+ - Right click to open the tracking menu

0 comments on commit ce73b51

Please sign in to comment.