Go to Page... |
|
Thread Tools | Display Modes |
|
01/06/19, 12:33 AM | #1 |
Is there a global public function to safely update the map?
I'd like to replace the use of ZO_WorldMap_UpdateMap() in my Addon to something public if available.
reference function https://esoapi.uesp.net/100025/src/i....lua.html#6073 |
|
01/06/19, 03:04 AM | #2 |
I highly doubt you want to update the whole map all the time.
I think you are looking for Code:
ZO_WorldMap_RefreshCustomPinsOfType(pinType) Code:
ZO_WorldMap_GetPinManager() |
|
01/07/19, 12:19 AM | #3 |
Thanks! That's precisely what I'm looking for. Just want to update the pin.
My custom pin is declared in Pointer.lua. Here's the abbreviated file, showing only snippets of code that is relevant here. lua Code:
The ZGV:SetWaypoint function is found in GuideHandling.lua and responsible for setting the pin on the map when the guide moves to the next or previous steps. I put the following snippet there. lua Code:
The good news is the print statement returns "ESOdot." However, ZO_WorldMap_RefreshCustomPinsOfType(k) doesn't update the pin on the map. For a brief moment the only time I see the pin change locations is when I close the map (or enable ZO_WorldMap_UpdateMap, which I want to move away from). Is ESOdot not the required pinType? Any ideas, thoughts, sage advice? Last edited by Hydra9268 : 01/07/19 at 12:36 AM. |
|
01/07/19, 02:53 AM | #4 |
01/07/19, 12:30 PM | #5 |
01/08/19, 03:47 AM | #6 |
I see what the problem is. Zygor isn't using the LibGPS. They created their own metatable overload! Which means ZO_WorldMap_RefreshCustomPinsOfType(_G[pinType]) doesn't work. WTF Zygor? Oh, and all the crap below ESOdot isn't used. Looks like they were doing something with marching ants?
lua Code:
And here's how they get the pin. lua Code:
The code is gross! This whole time I thought they were using LibGPS. It looks like they loaded the library into the txt file and never bothered to use it. Well, I guess that's good news. It means I can rip out all their bull**** and move to LibsGPS and hopefully make this Addon more friendly with other Addons like Bandit's mini-map. I'm not at that level of LUA scripting but I need to give it go out of necessity. Hopefully, it's not too too complicated with one pin. There's also this awesome HOW-TO guide by Garkin. I hope it is still relevant in 2018. If you know of a updated guide or a better guide please let me know. I'll take all the guidance I can get. |
|
01/09/19, 03:04 AM | #7 |
Based on Garkin's awesome script (Big kudos).
lua Code:
It looks like the code works but there's a problem with the level value in ZO_MapPin.SetData? https://esodata.uesp.net/100025/src/....lua.html#3347 lua Code:
Extra information: 1. The pinLayoutData array has a value for level. 2. The print(zone, subzone) on line 45 splits out what appears to be an endless list of zone, subzone. My conclusion is there needs to be a max value to stop it from overloading ZO_MapPin.SetData. Is that causing the problem? 3. An observational finding https://i.imgur.com/SpnGhqf.png Last edited by Hydra9268 : 01/09/19 at 03:40 AM. |
|
01/09/19, 08:09 AM | #8 |
|
The LUA error is caused because your ZGESO.pinLayoutData is a table inside a table.
You want to use one of the following two: Code:
ZGESO.pinLayoutData = { level = 50, texture = "/Arrows/Stealth/arrow-error.dds", size = 40 } Code:
ZO_WorldMap_AddCustomPin(ZGESO.pinType, ZGESO.pinTypeAddCallback, ZGESO.pinTypeOnResizeCallback, ZGESO.pinLayoutData[0], ZGESO.pinTooltipCreator) The ZGESO.pinTypeOnResizeCallback is called every time that scaling of the map changes. For example if you scroll your mouse wheel on the map, then this function will be called every single frame until the zoom animation finishes. Your pinTypeOnResizeCallback calls ZO_WorldMap_RefreshCustomPinsOfType. The function ZO_WorldMap_RefreshCustomPinsOfType will remove all your pins and then call ZGESO.pinTypeAddCallback to re-create your pins. Re-creating all your pins every single frame will cause tons of performance issues for you. Also this is probably also the reason why line 45 is executed so often. |
01/09/19, 01:00 PM | #9 |
Great insights and info. I'll review all your points. Thanks, Shinni!
Is there a more efficient way to handle pinTypeOnResizeCallback? Last edited by Hydra9268 : 01/09/19 at 01:04 PM. |
|
01/09/19, 11:14 PM | #10 |
|
|
ESOUI » Developer Discussions » General Authoring Discussion » Is there a global public function to safely update the map? |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Hybrid Mode |
Switch to Threaded Mode |
|
|