Thread Tools Display Modes
Prev Previous Post   Next Post Next
10/15/16, 06:02 AM   #1
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
[outdated] Replace usage of map* with zone*

Please do away with the mapId/index/name. They make some things like getting the mapType from a zoneIndex impossible and some of the functions are confusing at first because they do not return what one would expect.

Code:
* GetCurrentMapIndex()
** _Returns:_ *luaindex:nilable* _index_
This function could just be replaced by GetCurrentMapZoneIndex() which already returns the zoneIndex.

Code:
* GetCyrodiilMapIndex()
** _Returns:_ *luaindex:nilable* _index_

* GetImperialCityMapIndex()
** _Returns:_ *luaindex:nilable* _index_
These two should also just return the zoneIndex.

Code:
* GetMapNameByIndex(*luaindex* _mapIndex_)
** _Returns:_ *string* _mapName_
This one is nasty because mapName is not always the same as zoneName. Please consider just using the zone name instead and drop map name completely. GetMapName and GetPlayerLocationName are the same.

Code:
* GetNumMaps()
** _Returns:_ *integer* _numMaps_
This should become GetNumZones() and return the amount of zones. Currently there is no such function for zones and we have to use an ugly hack like this to get all zones:
Lua Code:
  1. local zoneIndex = 1
  2. while true do
  3.     local zoneName = GetZoneNameByIndex(zoneIndex)
  4.     if(zoneName == "") then break end
  5.     -- do something
  6.     zoneIndex = zoneIndex + 1
  7. end

Code:
* GetMapInfo(*luaindex* _index_)
** _Returns:_ *string* _name_, *[UIMapType|#UIMapType]* _mapType_, *[MapContentType|#MapContentType]* _mapContentType_, *integer* _zoneId_, *string* _description_
This function should take a zoneIndex and return an additional boolean "showInLocationTab". Nasty fact: the zoneId it returns is actually the mapId. Really confusing.

Code:
* GetZoneDescription(*integer* _zoneId_)
** _Returns:_ *string* _description_
This one takes the fake zoneId from the previous method to return the description. Not sure why it is even necessary.

Code:
* GetMapParentCategories(*luaindex* _index_)
** _Uses variable returns..._
** _Returns:_ *string* _categoryName_, *luaindex* _categoryIndex_
Should again just take the zoneIndex.

Code:
* WouldProcessMapClick(*number* _normalizedClickX_, *number* _normalizedClickY_)
** _Returns:_ *bool* _wouldProcess_, *luaindex:nilable* _resultingMapIndex_
Should return a zoneIndex.

Not sure if I missed any functions, but please consider this going forward.
In the meantime it would be very helpful if there were functions to get the mapType and mapContentType for a zoneId or maybe just to convert between mapIndex and zoneIndex.
 
 

ESOUI » Developer Discussions » Wish List » [outdated] Replace usage of map* with zone*


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