Thread Tools Display Modes
07/23/22, 06:01 PM   #1
trollusk
AddOn Author - Click to view addons
Join Date: Nov 2020
Posts: 8
How to get the type of a location?

I'm making an addon that adds pins for certain town services to the compass. These are "Locations" in the API.

Currently I'm figuring out what type each location is by taking the icon filename using GetMapLocationIcon(n), then parsing it to get the filename, then comparing that with the icons for the location types I'm interested in (e.g. if filename == "servicepin_stable.dds")

Is there a better way to get the Location type?
  Reply With Quote
07/23/22, 11:53 PM   #2
Masteroshi430
 
Masteroshi430's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2020
Posts: 185
Originally Posted by trollusk View Post
I'm making an addon that adds pins for certain town services to the compass. These are "Locations" in the API.

Currently I'm figuring out what type each location is by taking the icon filename using GetMapLocationIcon(n), then parsing it to get the filename, then comparing that with the icons for the location types I'm interested in (e.g. if filename == "servicepin_stable.dds")

Is there a better way to get the Location type?
pin.m_PinType gives you the map display pin type. m_PinType == MAP_PIN_TYPE_LOCATION
Search for "h5. MapDisplayPinType" in the docs to get the full list :
https://github.com/esoui/esoui/blob/...umentation.txt

EDIT:
sorry, I wasn't fully awake and misread the question, personally I use texture file name too to identify them.

Last edited by Masteroshi430 : 07/24/22 at 12:00 AM.
  Reply With Quote
07/24/22, 06:37 AM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Afaik there is no "location type" ID or similar identifier.
The texture names currently seem to be the best way to find the locaiton type, because they do not need any "translation" (multi language support) like names of locations or contents of the location pin names would need (if the pin name even would provide that info, like a crafting station must not contain any "crafting" text or similar).


Maybe have a look at Votan's addon here where he changed some of the colors of the location pins:
https://www.esoui.com/downloads/info...PinColors.html
Votan is quite experienced with maps and pins so perhaps he shows you another way here.
-> If you spy or reuse code please give credit

Last edited by Baertram : 07/24/22 at 09:58 AM.
  Reply With Quote
07/24/22, 06:54 AM   #4
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by Baertram View Post
Votan is qutie experienced with maps and pins so perhaps he shows you another way here.
Thanks Beartram. Your word in God's ear
I have not found any other way, but using the texture path as an language-invariant identifier.
So, you are right. I would use the texture path.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » How to get the type of a location?

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