From 1a8746b3c5e22da3e63ffcd03ab13c2325d8f633 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Wed, 15 Apr 2009 20:41:53 +0000 Subject: [PATCH] Fixing an issue with creating waypoints via the world map --- TomTom.lua | 15 ++++++--------- TomTom.toc | 3 ++- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/TomTom.lua b/TomTom.lua index e3997fa..81aa77b 100755 --- a/TomTom.lua +++ b/TomTom.lua @@ -322,20 +322,20 @@ function TomTom:ShowHideCoordBlock() end -- Hook the WorldMap OnClick -local Orig_WorldMapButton_OnClick = WorldMapButton_OnClick local world_click_verify = { ["A"] = function() return IsAltKeyDown() end, ["C"] = function() return IsControlKeyDown() end, ["S"] = function() return IsShiftKeyDown() end, } -function WorldMapButton_OnClick(self, ...) +local origScript = WorldMapButton:GetScript("OnMouseUp") +WorldMapButton:SetScript("OnMouseUp", function(self, ...) local mouseButton, button = ... if mouseButton == "RightButton" then -- Check for all the modifiers that are currently set for mod in TomTom.db.profile.worldmap.create_modifier:gmatch("[ACS]") do if not world_click_verify[mod] or not world_click_verify[mod]() then - return Orig_WorldMapButton_OnClick(self, ...) + return origScript and origScript(self, ...) or true end end @@ -344,17 +344,14 @@ function WorldMapButton_OnClick(self, ...) local x,y = GetCurrentCursorPosition() if z == 0 then - return Orig_WorldMapButton_OnClick(self, ...) + return origScript and origScript(self, ...) or true end local uid = TomTom:AddZWaypoint(c,z,x*100,y*100) else - return Orig_WorldMapButton_OnClick(self, ...) + return origScript and origScript(self, ...) or true end -end - -local oldText = WorldMapMagnifyingGlassButton:GetText() -WorldMapMagnifyingGlassButton:SetText(oldText .. "\n" .. L["Ctrl+Right Click To Add a Waypoint"]) +end) local function WaypointCallback(event, arg1, arg2, arg3) if event == "OnDistanceArrive" then diff --git a/TomTom.toc b/TomTom.toc index d242023..1f6296e 100755 --- a/TomTom.toc +++ b/TomTom.toc @@ -1,5 +1,6 @@ -## Interface: 30000 +## Interface: 30100 ## Title: TomTom +## Author: jnwhiteh ## Version: wowi:revision ## Notes: Acts as your portable navigation assistant ## Notes-zhCN:一个简单的导航助手。 -- 1.7.9.5