WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Minimap Scroll not working after 4.0.1 (https://www.wowinterface.com/forums/showthread.php?t=36301)

sacrife 10-27-10 07:00 AM

Minimap Scroll not working after 4.0.1
 
This worked fine before, now it does not.
I know that I have to replace arg1 with something, but I really do not know what? Can anyone point me in the right direction here?

Code:

----------------------------------
-- Zoom
----------------------------------
Minimap:EnableMouseWheel(true)
Minimap:SetScript('OnMouseWheel', function()
    if (arg1 > 0) then
        Minimap_ZoomIn()
    else
        Minimap_ZoomOut()
    end
end)


v6o 10-27-10 07:03 AM

Read How to Deal With Loss of "this", "event", "arg#"
and wowwiki.com/UIHANDLER_OnMouseWheel or wowprogramming.com/docs/scripts/OnMouseWheel


Code:

----------------------------------
-- Zoom
----------------------------------
Minimap:EnableMouseWheel(true)
Minimap:SetScript('OnMouseWheel', function(self, direction)
    if (direction > 0) then
        Minimap_ZoomIn()
    else
        Minimap_ZoomOut()
    end
end)


Nuggs 10-27-10 07:11 AM

This is what I do. No clue why I use MinimapZoomIn/Out:Click but it works. :p

Code:

Minimap:SetScript("OnMouseWheel", function(self, delta)
        if (delta == 1) then
                _G.MinimapZoomIn:Click()
        else
                _G.MinimapZoomOut:Click()
        end
end)

As for the argX changes and other information with a few examples, you can check out this thread:

http://forums.worldofwarcraft.com/th...26580975&sid=1

And I was beat.

sacrife 10-27-10 07:12 AM

Oh I see, I have to name the arg1 manually now.

Thanks man.


All times are GMT -6. The time now is 05:38 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI