Go Back   WowAce Forums > General > Lua Code Discussion
Lua Code Discussion You scared? Terrified. Mortified. Petrified. Stupefied... by [coding].

Reply
 
Thread Tools
Old 02-27-2009   #1
Dridzt
Hero Member
 
Dridzt's Avatar
 
Join Date: Nov 2005
Posts: 872
Default 3.1.0 the self help thread

3.0.x -> 3.1.0

ChatFrame_AddMessageEventFilter
(event, filterfunc)

filterfunc signature has changed from
Code:
function filterfunc(message)
    if condition then
        return true
    end
    return false
end
to
Code:
function filterfunc(self, event, ...)
    local message = ... -- if you need this
    if condition then
        return true, ...
    end
    return false, ...
end
Mods affected: BigWigs (bossblock, raidwarn), Headcount (whisper system), WIM
-----------------------------------------------------------------
QuestWatchFrame -> WatchFrame
QuestWatch_Update -> WatchFrame_Update

Mods affected: QuestGuru, TourGuide
-----------------------------------------------------------------
BuffFrame_UpdateDuration -> AuraButton_UpdateDuration

Mods affected: Telo's BuffTimers
-----------------------------------------------------------------
Minimap_OnUpdate -> MinimapPing_OnUpdate
MiniMapCompassRing "model" -> MinimapCompassTexture "texture"
MiniMapCompassRing:GetFacing() -> MinimapCompassTexture:GetTexCoord() and derive offset in radians from there.

Mods affected: Astrolabe (lib) and everything that embeds it,
TomTom, MapNotes, GatherHUD (apart from Astrolabe bug)
Quote:
Originally Posted by Drool View Post
Okay, thought so...
Try this as a direct real-time replacement for MiniMapCompassRing:GetFacing() (should return same radians value):
Code:
local function GetFacing()
    local ULx, ULy, LLx, LLy = MinimapCompassTexture:GetTexCoord()
    local dir = math.atan2(ULx-LLx, LLy-ULy)
    if dir > 0 then
        return dir - math.pi * 2
    else
        return dir
    end
end
I plugged it into Astrolabe and it seems to behave normally.
Note one downside to the above method - the MinimapCompassTexture frame cannot be hidden (some addons might Hide() it for aesthetics). Using SetAlpha(0) would allow it to work though...
Degree->radian workarounds are no longer needed as of latest ptr builds/3.1 live
local radians = GetPlayerFacing();
(GetPlayerFacing() was changed to return radians instead of degrees)
-----------------------------------------------------------------
Quote:
Originally Posted by Tristanian View Post
I thought I should wait a bit, but might as well post it now. It would appear that addons using Blizzard's dropdown menu system will error if they are initializing a menu containing more than 2 levels, once the 3rd level (listframe) needs to be shown. Simply put the dropdown code does not create a listframe with a level of 3 or above (e.g DropDownList3), which would imply that the UIDropDownMenu_CreateFrames(level, index) function isn't being called properly (it should be normally called when the secure? attribute "createframes" is being set). I first noticed this in Postal but seems to be a generic issue.

As a workaround, you can call the CreateFrames function in your addon directly (let's say after performing a check, using UIDROPDOWNMENU_MAXLEVELS) with the desired level (>2) variable and from that point on, things seem to work fine, however you should not be doing that in the first place.
Quote:
Originally Posted by Adirelle View Post
I just noticed that UnitAura (and the likes) returns a unit token instead of a boolean for "isMine" in 3.1 (confirmation). Notice that it returns "npc" for anything that is not in the party/raid and do not have a valid unit (like "target" or "focus").
to be continued... (?)

Last edited by Dridzt; 04-15-2009 at 07:09 AM.
Dridzt is offline   Reply With Quote
Old 02-27-2009   #2
Tekkub
Wiki Master
 
Tekkub's Avatar
 
Join Date: Feb 2005
Posts: 5,086
Default Re: 3.1.0 the self help thread

About damn time they fixed ChatFrame_AddMessageEventFilter. The filter system is wonderful, but the fact they never passed the event args was always sucky.

I'll probably write up fixes for TG this weekend.
Tekkub is offline   Reply With Quote
Old 02-27-2009   #3
Mera_LaCroisadeEcarlate
Full Member
 
Join Date: May 2007
Location: France
Posts: 110
Send a message via MSN to Mera_LaCroisadeEcarlate
Default Re: 3.1.0 the self help thread

lots of mods will need a patch, the first I think to are antispam mods and IgnoreMore
__________________
addons: SpamBayes, BrokerCPU
projects: ThunderBayes
Mera[xeh]? - La CroisadeEcarlate (wow)
Mera_LaCroisadeEcarlate is offline   Reply With Quote
Old 02-27-2009   #4
Adirelle
Legendary Member
 
Adirelle's Avatar
 
Join Date: Dec 2006
Posts: 2,385
Default Re: 3.1.0 the self help thread

Quote:
Originally Posted by Dridzt View Post
QuestWatchFrame -> WatchFrame
QuestWatch_Update -> WatchFrame_Update

Mods affected: QuestGuru, TourGuide
Add LibJostle to affected mods.

Moreover both QuestWatchFrame and AchievementWatchFrame have been joined into WatchFrame, which is now easily movable and resizable.

There is also some changes that screw up TomTom, HandyNotes and GatherMate and the like. (I will add more input later.)
__________________
Author of AdiButtonAuras, AdiBags, Squire2 and several other addons.

Each time you hit your "copy" command with a block of code, think about a way to refactor it so it did what you want without using the "paste" command.
Adirelle is offline   Reply With Quote
Old 02-27-2009   #5
Tristanian
Senior Member
 
Tristanian's Avatar
 
Join Date: Dec 2006
Posts: 422
Default Re: 3.1.0 the self help thread

I thought I should wait a bit, but might as well post it now. It would appear that addons using Blizzard's dropdown menu system will error if they are initializing a menu containing more than 2 levels, once the 3rd level (listframe) needs to be shown. Simply put the dropdown code does not create a listframe with a level of 3 or above (e.g DropDownList3), which would imply that the UIDropDownMenu_CreateFrames(level, index) function isn't being called properly (it should be normally called when the secure? attribute "createframes" is being set). I first noticed this in Postal but seems to be a generic issue.

As a workaround, you can call the CreateFrames function in your addon directly (let's say after performing a check, using UIDROPDOWNMENU_MAXLEVELS) with the desired level (>2) variable and from that point on, things seem to work fine, however you should not be doing that in the first place.
Tristanian is offline   Reply With Quote
Old 02-27-2009   #6
Adirelle
Legendary Member
 
Adirelle's Avatar
 
Join Date: Dec 2006
Posts: 2,385
Default Re: 3.1.0 the self help thread

Quote:
Originally Posted by Adirelle View Post
There is also some changes that screw up TomTom, HandyNotes and GatherMate and the like. (I will add more input later.)
Ok, so basically MinimapCompassRing is not defined anymore. Astrolabe chokes on this so any addons using Astroalbe is doomed.
__________________
Author of AdiButtonAuras, AdiBags, Squire2 and several other addons.

Each time you hit your "copy" command with a block of code, think about a way to refactor it so it did what you want without using the "paste" command.
Adirelle is offline   Reply With Quote
Old 02-27-2009   #7
Nevcairiel
Super Moderator
 
Nevcairiel's Avatar
 
Join Date: Aug 2005
Location: Germany/Hamburg
Posts: 1,804
Default Re: 3.1.0 the self help thread

Quote:
Originally Posted by Adirelle View Post
Ok, so basically MinimapCompassRing is not defined anymore. Astrolabe chokes on this so any addons using Astroalbe is doomed.
That was already in the original post of this thread
__________________
Author/Maintainer of Ace3, Bartender4, Mapster, Quartz, HotCandy, and various small and helpful addons.
You can Donate if you want, any help is appreciated!
Nevcairiel is offline   Reply With Quote
Old 02-27-2009   #8
Mikari
Senior Member
 
Join Date: Sep 2008
Posts: 260
Default Re: 3.1.0 the self help thread

Any idea what they did with the secure headers, 3.1 completely broke one of my favourite mods

http://www.wowinterface.com/download...uffs.html#info
Mikari is offline   Reply With Quote
Old 02-27-2009   #9
Adirelle
Legendary Member
 
Adirelle's Avatar
 
Join Date: Dec 2006
Posts: 2,385
Default Re: 3.1.0 the self help thread

Huh... It seems I was half awake.
__________________
Author of AdiButtonAuras, AdiBags, Squire2 and several other addons.

Each time you hit your "copy" command with a block of code, think about a way to refactor it so it did what you want without using the "paste" command.
Adirelle is offline   Reply With Quote
Old 02-27-2009   #10
Tristanian
Senior Member
 
Tristanian's Avatar
 
Join Date: Dec 2006
Posts: 422
Default Re: 3.1.0 the self help thread

local x, y = GetPlayerMapPosition("player") seems to return valid coordinates in instances now. Note that this only seems to work inside Northrend instances. It will still return zeros in lets say Eastern Kingdoms (tested in The Stockade) or Outland (tested in Auchindoun).
Tristanian is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:50 PM.