Quantcast Missing Frames, Events and Functions in Battle For Azeroth - Page 2 - WoWInterface
Thread Tools Display Modes
04-25-18, 09:26 AM   #21
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 913
In the latest export, Blizzard is still using:
Code:
elseif ( event == "UNIT_POWER_BAR_HIDE" ) then
	if ( arg1 == self.unit ) then
		UnitPowerBarAlt_UpdateAll(self);
	end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle and Move Pad Plus.
  Reply With Quote
04-25-18, 10:12 AM   #22
thomasjohnshannon
A Theradrim Guardian
 
thomasjohnshannon's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 60
Originally Posted by Rilgamon View Post
Is an invite required? I just installed beta and logged in.
Yeah you only have the option of installing beta if your account has been flagged for it.
__________________
Thomas aka Urnn
  Reply With Quote
04-27-18, 06:01 AM   #23
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,704
Got my invite yesterday too. Eager to test my addons against the beta. Hopefully not all of them are bricked?! >_<
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
04-30-18, 09:14 AM   #24
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,704
My Vignette addon stopped working. The event VIGNETTE_ADDED is nowhere to be found. Is there a new system for rare mob icons on the minimap? If so how can it be accessed?

Lua Code:
  1. local function OnVignetteAdded(self,event,id)
  2.   if not id then return end
  3.   self.vignettes = self.vignettes or {}
  4.   if self.vignettes[id] then return end
  5.   local x, y, name, icon = C_Vignettes.GetVignetteInfoFromInstanceID(id)
  6.   local left, right, top, bottom = GetObjectIconTextureCoords(icon)
  7.   PlaySoundFile("Sound\\Interface\\RaidWarning.ogg")
  8.   local str = "|TInterface\\MINIMAP\\ObjectIconsAtlas:0:0:0:0:256:256:"..(left*256)..":"..(right*256)..":"..(top*256)..":"..(bottom*256).."|t"
  9.   RaidNotice_AddMessage(RaidWarningFrame, str..name.." spotted!", ChatTypeInfo["RAID_WARNING"])
  10.   print(str..name,"spotted!")
  11.   self.vignettes[id] = true
  12. end
  13.  
  14. --eventHandler
  15. local eventHandler = CreateFrame("Frame")
  16. eventHandler:RegisterEvent("VIGNETTE_ADDED")
  17. eventHandler:SetScript("OnEvent", OnVignetteAdded)
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
04-30-18, 11:54 AM   #25
sezz
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 98
Originally Posted by zork View Post
My Vignette addon stopped working. The event VIGNETTE_ADDED is nowhere to be found. Is there a new system for rare mob icons on the minimap? If so how can it be accessed?
the new event is VIGNETTE_MINIMAP_UPDATED vignetteGUID, onMinimap
C_VignetteInfo.GetVignetteInfo(vignetteGUID) returns a table containing name and other stuff
  Reply With Quote
04-30-18, 12:39 PM   #26
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,704
Thanks that worked. I cannot find a replacement for the icon though. I had to disable the icon for now. The name is working fine but I seem to not find any information on the texture.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
04-30-18, 02:46 PM   #27
thomasjohnshannon
A Theradrim Guardian
 
thomasjohnshannon's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 60
Originally Posted by zork View Post
Thanks that worked. I cannot find a replacement for the icon though. I had to disable the icon for now. The name is working fine but I seem to not find any information on the texture.
The api says this is the table structure.

Code:
Name = "VignetteInfo",
Type = "Structure",
Fields =
{
	{ Name = "vignetteGUID", Type = "string", Nilable = false },
	{ Name = "name", Type = "string", Nilable = false },
	{ Name = "isDead", Type = "bool", Nilable = false },
	{ Name = "onWorldMap", Type = "bool", Nilable = false },
	{ Name = "onMinimap", Type = "bool", Nilable = false },
	{ Name = "isUnique", Type = "bool", Nilable = false },
	{ Name = "inFogOfWar", Type = "bool", Nilable = false },
	{ Name = "atlasName", Type = "string", Nilable = false },
	{ Name = "hasTooltip", Type = "bool", Nilable = false },
	{ Name = "vignetteID", Type = "number", Nilable = false },
},
Can you use the atlasName to get the icon? I would check but I haven't gotten an invite yet.
__________________
Thomas aka Urnn
  Reply With Quote
04-30-18, 04:48 PM   #28
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,704
Thanks. The missing link was GetAtlasInfo() which is not described anywhere.

It is working now.

Lua Code:
  1. local function OnVignetteAdded(self,event,id)
  2.   if not id then return end
  3.   self.vignettes = self.vignettes or {}
  4.   if self.vignettes[id] then return end
  5.   local vignetteInfo = C_VignetteInfo.GetVignetteInfo(id)
  6.   if not vignetteInfo then return end
  7.   local _, width, height, txLeft, txRight, txTop, txBottom = GetAtlasInfo(vignetteInfo.atlasName)
  8.   PlaySoundFile("Sound\\Interface\\RaidWarning.ogg")
  9.   local str = "|TInterface\\MINIMAP\\ObjectIconsAtlas:0:0:0:0:256:256:"..(txLeft*256)..":"..(txRight*256)..":"..(txTop*256)..":"..(txBottom*256).."|t"
  10.   RaidNotice_AddMessage(RaidWarningFrame, str.." "..vignetteInfo.name.." spotted!", ChatTypeInfo["RAID_WARNING"])
  11.   print(str.." "..vignetteInfo.name,"spotted!")
  12.   self.vignettes[id] = true
  13. end
  14.  
  15. -----------------------------
  16. -- Init
  17. -----------------------------
  18.  
  19. --eventHandler
  20. local eventHandler = CreateFrame("Frame")
  21. eventHandler:RegisterEvent("VIGNETTE_MINIMAP_UPDATED")
  22. eventHandler:SetScript("OnEvent", OnVignetteAdded)

Btw here is sth I found in the Blizzard_TutorialLogic.lua. It is a atlas to string texture converter if I see that right. It might be able to upgrade my current solution.

Lua Code:
  1. function TutorialHelper:FormatAtlasString(str)
  2.     return (string.gsub(str, "{Atlas|([%w_]+):?(%d*)}", function(atlasName, size)
  3.                 size = tonumber(size) or 0;
  4.  
  5.                 local filename, width, height, txLeft, txRight, txTop, txBottom = GetAtlasInfo(atlasName);
  6.  
  7.                 if (not filename) then return; end
  8.  
  9.                 local atlasWidth = width / (txRight - txLeft);
  10.                 local atlasHeight = height / (txBottom - txTop);
  11.  
  12.                 local pxLeft    = atlasWidth    * txLeft;
  13.                 local pxRight   = atlasWidth    * txRight;
  14.                 local pxTop     = atlasHeight   * txTop;
  15.                 local pxBottom  = atlasHeight   * txBottom;
  16.  
  17.                 return string.format("|T%s:%d:%d:0:0:%d:%d:%d:%d:%d:%d|t", filename, size, size, atlasWidth, atlasHeight, pxLeft, pxRight, pxTop, pxBottom);
  18.             end));
  19. end

Nice that actually was helpful. Instead of the texture path hard coded you can use the texture file id instead. Got it working now.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 04-30-18 at 05:01 PM.
  Reply With Quote
05-07-18, 04:00 PM   #29
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,176
C_Map api in BfA

Updated 2nd May

Code:
api C_Map list
MapUI

functions:
string name = C_Map.GetAreaInfo(areaID)
number uiMapID = C_Map.GetBestMapForUnit(unitToken)
number uiMapID = C_Map.GetCurrentMapID()
string atlasName = C_Map.GetMapArtBackgroundAtlas(uiMapID)
MapCanvasPosition position = C_Map.GetMapArtHelpTextPosition(uiMapID)
table textures { numbers values} = C_Map.GetMapArtLayerTextures(uiMapID, layerIndex)
table layerInfo { uiMapLayerInfo values } C_Map.GetMapArtLayers(uiMapID)
table info {uiMapDetails values } C_Map.GetMapChildrenInfo(uiMapID, opt mapType, opt allDescendants)
bool hideIcons = C_Map.GetMapDisplayInfo(uiMapID)
number uiMapGroupID = C_Map.GetMapGroupID(uiMapID)
table info {uiMapGroupMemberInfo values } = C_Map.GetMapGroupMembersInfo(uiMapGroupID)
fileDataID, texturePercentageX, texturePercentageY, textureX, textureY, scrollChildX, scrollChildY = C_Map.GetMapHighlightInfoAtPosition(uiMapID, x,y)
uiMapDetails info = C_Map.GetMapInfo(uiMapID)
uiMapDetails info = C_Map.GetMapInfoAtPosition(uiMapID,x,y)
playerMinLevel, playerMaxLevel, petMinLevel, petMaxLevel = C_Map.GetMapLevels(uiMapID)
minX, maxX, minY, maxY = C_Map.GetMapRectOnMap(uiMapID,topUIMapID)
C_Map.RequestPreloadMap(uiMapID)
C_Map.SetMap(uiMapID)

enumerations:
Enum.MapCanvasPosition { None, BottomLeft, BottomRight, TopLeft, TopRight }
Enum.UIMapType { Cosmic, World, Continent, Zone, Dungeon, Micro, Orphan }
Enum.UIMapSystem { World, Taxi, Adventure }

structures:
UIMapLayerInfo { layerWidth, layerHeight, tileWidth, tileHeight, minScale, maxScale, additionalZoomSteps }
UIMapDetails { mapID, name, mapType, parentMapID }
UIMapGroupMemberInfo { mapID, relativeHeightIndex, name }
__________________
  Reply With Quote
05-20-18, 08:09 PM   #30
Rainrider
A Scalebane Royal Guard
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 449
RegisterUnitEvent is still bugged.

Frame:RegisterUnitEvent(event, unit) behaves as if Frame:RegisterEvent(event) was called - it register the event for all units. Submitted this, but since it was reported a month ago, maybe this needs a push
  Reply With Quote
05-21-18, 12:16 PM   #31
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,176
UNIT_SPELLCAST_SUCCEEDED changes

The UNIT_SPELLCAST_SUCCEEDED event now returns 3 values:

1. unit
2. code string - see below for an example
3. spell id

Teleport Dalaran (Northrend) resulted in the following

1. player
2. Cast-3-2084-571-11759-53140-000503097C
3. 53140

Portal Dalaran (Northrend) resulted in the following

1. player
2. Cast-3-2084-571-11759-53142-0000830AEF
3. 53142

After doing a few tests only the last two values changed, the spell ID depending on the spell cast and the last value intermittently and may be the same on different spells cast close together so could be a timestamp of sorts.

Edit: Correction, it appears that last value changes per cast, with multiples sometimes appearing on a single button click. Looks like validating argument 2 against the previous to confirm if it is a repeat or not may be required

Edit2: Correction again ... forgot that my code was doing the event test on several buttons with each checking its relevance rofl. Only 1 event per spell cast
__________________

Last edited by Xrystal : 05-21-18 at 12:40 PM.
  Reply With Quote
05-24-18, 07:40 AM   #32
aallkkaa
A Theradrim Guardian
 
aallkkaa's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2017
Posts: 63
Originally Posted by Xrystal View Post
What is interesting is that the following code block
Code:
    GameTooltip:AddLine(IsHarmfulSpell(spellName) or "Helpful",1.0,1.0,1.0)
    GameTooltip:AddLine(IsHelpfulSpell(spellName) or "Harmful",1.0,1.0,1.0)
Resulted in Helpful in all cases except for the spells I didn't know/have in my spellbook, or were party specific spells - AKA Portals. Those returned both settings.
The logic in that block is literally reversed, but should not - i.e. "noharm" does not equate "help" nor vice versa.
Try this instead:
Code:
    GameTooltip:AddLine(IsHarmfulSpell(spellName) and "Harmful",1.0,1.0,1.0)
    GameTooltip:AddLine(IsHelpfulSpell(spellName) and "Helpful",1.0,1.0,1.0)
  Reply With Quote
05-24-18, 11:04 AM   #33
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,176
You are right of course .. can't think what I was doing there... but seeing as it was more the case of testing the results of the function and avoiding a nil it might explain the results I mentioned rofl. Thanks for pointing it out, in case someone decided to use it
__________________
  Reply With Quote
05-24-18, 11:01 PM   #34
aallkkaa
A Theradrim Guardian
 
aallkkaa's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2017
Posts: 63
Yeah, I didn't think of it as a mere test for whether the function is present or not - though the thread title does imply that... lol

Still, getting "Helpful" as the result for a spell known as harmful being tested against IsHarmfulSpell might mean either that the function were present but bugged or that the function weren't there at all. Then again, the later case would also raise a Lua error, thus alerting you to the function being amiss, so...

Well, at least, like you said, it might prevent false results "in case someone decided to use" the code.

Last edited by aallkkaa : 05-24-18 at 11:02 PM. Reason: bad grammar fixed - I think
  Reply With Quote
05-31-18, 09:51 AM   #35
sezz
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 98
RegisterUnitEvent is fixed
GetFramesRegisteredForEvent is completely broken and always returns nil

Edit: GetFramesRegisteredForEvent fixed aswell.

Last edited by sezz : 06-07-18 at 03:06 PM.
  Reply With Quote
06-12-18, 04:19 AM   #36
Voxxel
A Chromatic Dragonspawn
Join Date: Mar 2009
Posts: 168
Does anyone know how to get the Map IDs in BfA? The "/dump GetCurrentMapAreaID()" doesn't seem to work anymore.
  Reply With Quote
06-12-18, 05:02 AM   #37
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 705
Take a look a little up ...

number uiMapID = C_Map.GetBestMapForUnit(unitToken)
number uiMapID = C_Map.GetCurrentMapID()
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
06-12-18, 06:40 AM   #38
Voxxel
A Chromatic Dragonspawn
Join Date: Mar 2009
Posts: 168
I found that I'm just noob enough to convert it into a working script. Would you elaborate please?

Code:
/run print(C_Map.GetCurrentMapID())
doesn't return anything for me, no idea why.

I heard somewhere the map ID for Tiragarde Sound is supposed to be 895. And when doing
Code:
/run for k, v in pairs(C_Map.GetMapInfo(895)) do print(k, v) end
it returns
Code:
mapType 3
mapID 895
name Tiragarde Sound
parentMapID 876
My problem is it doesn't seem to do anything with mapIDs used by wowhead, wowdb and other dataminer sites. I'm looking for a way to print the current map ID (where my character is) used by dataminer sites. For example, Tiragarde Sound is 8567 (same as the zone ID). But what is it for Boralus map where there's no standalone zone?

Is there a way to get information about those map IDs?

Last edited by Voxxel : 06-12-18 at 02:14 PM.
  Reply With Quote
06-12-18, 06:25 PM   #39
Nimhfree
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 244
The various sites do not use the new mapIds that the new Blizzard API returns. If you need to be able to use a value from in game and refer to values various sites use, you will have to come up with a mapping for them, and have your addon use that mapping.

Using the new Blizzard map API you can get access to every map in the system very easily. However, mapping those to external sites is not easy.

I would advise everyone to use the new Blizzard mapIDs for all maps.
  Reply With Quote
06-12-18, 06:46 PM   #40
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,176
That number might be a reference to the map image they display on their website.

It may not have an in game api equivalent if it was retrieved via data mining. Maybe contact wowhead to see where they get their numbers from ( they may have generated their own set of numbers for their site after all).

Using the various available map functions I haven't seen any number remotely similar.


However, I can't remember what zone related functions are available pre BFA. Maybe the old zone IDs match the ones on the website but the new ones are just followed on to make the site consistent due to the big map api change.


Edit ... Or as Nimh says
__________________
  Reply With Quote

WoWInterface » PTR » PTR API and Graphics Changes » Missing Frames, Events and Functions in Battle For Azeroth

Thread Tools
Display Modes

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

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