This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Live
PTR
10.2.7
PTR
10.2.6
Beta
Auto-zooming When Mounted
Post Reply
Return to board index
Post by
182166
This post was from a user who has deleted their account.
Post by
Ketho
Something like this?
Had to use a 0.5 sec delay though because
IsMou
nted
, doesn't immediately return the correct value
The
SetZ
oom
widget accepts values ranging from 0 (furthest) to 5 (closest) zoom
local delay = 0
local function OnUpdate(self, elapsed)
delay = delay + elapsed
if delay > 0.5 then
delay = 0
if IsMounted() then
Minimap:SetZoom(0)
else
Minimap:SetZoom(4)
end
self:SetScript("OnUpdate", function() end)
end
end
local function OnEvent(self, event, arg1)
if arg1 == "MOUNT" then
self:SetScript("OnUpdate", OnUpdate)
end
end
local f = CreateFrame("Frame")
f:RegisterEvent("COMPANION_UPDATE")
f:SetScript("OnEvent", OnEvent)
http://www.mmo-champion.com/threads/709539-HowTo-Make-a-code-snippet-into-an-addon-in-twelve-easy-steps
http://www.mmo-champion.com/threads/817817-Creating-Your-Own-WoW-Addon
Post by
HighFive
God damn it, I've been on Reddit too much. I kept looking for the upvote button.
Post by
182166
This post was from a user who has deleted their account.
Post by
182166
This post was from a user who has deleted their account.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.