ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   How to get the type of a location? (https://www.esoui.com/forums/showthread.php?t=10283)

trollusk 07/23/22 06:01 PM

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?

Masteroshi430 07/23/22 11:53 PM

Quote:

Originally Posted by trollusk (Post 46390)
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.

Baertram 07/24/22 06:37 AM

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

votan 07/24/22 06:54 AM

Quote:

Originally Posted by Baertram (Post 46392)
Votan is qutie experienced with maps and pins so perhaps he shows you another way here.

Thanks Beartram. Your word in God's ear :D
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.


All times are GMT -6. The time now is 06:55 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI