New/changed in build 26522.
I was looking over the code from the patch and here are a few of the things I noticed.
Old loot code has been removed. RIP Master Loot New functions and table info added to C_TaxiMap. Updated cancelaura macro command function. Now uses CancelSpellByName(name) instead of CancelUnitBuff(unit, spell, [filter or rank]). New leave vehicle slash function. Lua Code:
Small change to ITEM_QUALITY_COLORS. Lua Code:
Lua Code:
New map function. Lua Code:
New GameTooltip functions. Lua Code:
New Achievement function. Lua Code:
New util function. Lua Code:
|
:eek: Wow...this seems like a lot to get coords, am I doing this right?
Lua Code:
|
I dont understand why they did not make uiMapId the second parameter and optional,
defaulting to C_Map.GetBestMapForUnit(unit). |
Quote:
x, y = C_Map.GetPlayerMapPosition( C_Map.GetBestMapForUnit("player"), "party1"):GetXY() That'd be a damned weird way to ask "is party1 in the same zone I am?" |
Quote:
Lua Code:
/edited because GetCurrentMapID is tied to the world map display |
Quote:
Lua Code:
|
Quote:
The method to get x, y coords...feels like congress designed it. It works, but I cringe every time I see the code, even with pointers into C_Map. |
Quote:
|
Some people might like the actual coordinates of their party members. You could set waypoints to them, etc.
|
Quote:
But in 99% you will use C_Map.GetBestMapForUnit to find the units uiMapId. You'll alway pass the same unit to both functions. Coords are updated frequently so I guess its quite an impact if I query the uiMapId through C_Map.GetBestMapForUnit or if C_Map.GetPlayerMapPosition would do it itself (if I could skip it). |
Quote:
Tbh, if you were going to send back an array, why not have mapID as part of the array along with x and y rather than multiple queries? Lua Code:
I think Rilgamon has the right of it, and this method of getting x,y for addons feels like an afterthought in their overall rebuild of the mapping system. |
Quote:
|
The entire point of the new map API is to remove behind the scenes "magic", it now does exactly what it says on the tin and what you ask it to do. No ambiguity, no magic, no hidden C state. If you don't pass a zone, then you don't know which zone it choose to represent the coordinates in - and without that information, you can't use them properly.
Passing a uiMapID to GetPlayerZonePosition is certainly useful, since maps are an overlay on top of the real world, there is never just one map that applies to you, at least there is like the world map, the continent map, the zone map, and if you're anywhere deeper there is even more on top of that. If you're worried about the overhead of asking for the map everytime, you could just track zone changes and update it only then (although there is a bunch of events one needs to take care of) - but generally, don't worry about micro-optimizations like this. |
Dont get me wrong,Nevcairiel. I really love seeing a rewrite of the engine. When the cataclysm brought so many not working elements into our world and the expected repairs did not happen in pandaria (thats the reason for my tagline ;) ) I pretty much lost the fun in trying new things with addons.
With the documentation included it's really a new enabler for many great things I'm sure. Still a few shortcuts could help :) |
What Rilgamon said. Many long-delayed optimizations and expansive refactors create certain areas of (fairly unavoidable) usage-weaknesses. At a framework level, after refactors/redesigns, in a hand-shake environment there is a usage-optimization pass, looking at clustered function usage to create efficient (to use Rilgamon's term) 'shortcuts' which aid in coding, debugging, and long-term (and multi-person) maintenance -- the reason we write so many libraries -- but when there is a distinct performance issue (Lua vs C) there is an incentive to provide some of them at the most optimized layer; those helper-functions are a very minimal expense on the framework developer and improve the overall quality of products using the framework.
I mean, I can't believe someone looked at this and said "Yeah, that's a great idea! Huge usage improvement!" Lua Code:
As the sage says: Quote:
|
Well, the new system does allow you to get your player's (or party members') coordinates based on any map, not just your current zone. There may be some use for that, either in the default UI or for addon devs who feel they can utilize it. Either now or in the future.
If they made the uiMapID an optional second argument, defaulting to the "best map for unit", the API would still need to check which map that is before returning coordinates and location data. And if they gave you a shortcut function, it may very well still do C_Map.GetPlayerMapPosition( C_Map.GetBestMapForUnit("player"), "player") on the back-end. It's like Nev says: Quote:
|
Quote:
|
More Map API Changes (26567)
Removed
SetMap was removed but it could just be RequestPreloadMap. Both excisted in the last patch but now we only have RequestPreloadMap. Lua Code:
New Functions Lua Code:
Map event info added. Lua Code:
|
More (26567) Changes
IsWarModeEnabled was renamed to IsWarModeFeatureEnabled.
ShowUIPanel(WorldMapFrame); replaced with OpenWorldMap(); Quest Tag constants changed. Lua Code:
New Functions Lua Code:
|
Quote:
If you want to know which map the World Map is looking at, call WorldMapFrame:GetMapID(), or call WorldMapFrame:NavigateToMap() to change it. This allows you to implement other map-things without messing with the World Map, like the new BattlefieldMap that returned in the recent build. It uses much of the same logic of the World Map, but it could show a different map if you wanted to. |
All times are GMT -6. The time now is 09:09 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI