WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   WorldMapFrame:Refresh() or WorlmapFrame:Reload() (https://www.wowinterface.com/forums/showthread.php?t=59775)

Ssesmar 01-27-24 03:40 AM

WorldMapFrame:Refresh() or WorlmapFrame:Reload()
 
I've now found a way to display my pins via Blizzard pins. When the option is enabled in my addon, I simply remove certain Blizzard pins on the map and replace them with my pins. The problem; When you activate or deactivate the option, the Blizzard Pins on the map do not simply disappear, you first have to reopen/close the map or switch to another map so that the Blizzard Pins are no longer displayed.

Is there a command to refresh the map to show the changes? something like WorldMapFrame:Refresh() or WorlmapFrame:Reload() that works?

Fizzlemizz 01-27-24 07:44 AM

Closing/Opening would run

Code:

WorldMapFrame:OnHide()
and
Code:

WorldMapFrame:OnShow()
Maybe just running the OnShow() would do what you need?

Ssesmar 01-27-24 03:57 PM

Quote:

Originally Posted by Fizzlemizz (Post 343253)
Closing/Opening would run

Code:

WorldMapFrame:OnHide()
and
Code:

WorldMapFrame:OnShow()
Maybe just running the OnShow() would do what you need?

No, unfortunately not, because I don't want to open the map I'm currently on, but the map I just opened

Czechbig 01-29-24 08:47 AM

Try running WorldMapFrame:Reload() to refresh the map and see if it displays the changes after enabling or disabling the option in your addon.

Xrystal 01-29-24 07:40 PM

Bear in mind I have never dabbled with the world map, let alone the new data provider code. So what I say below may be utter garbage rofl. But just in case it isn't.


Looking at Blizzard_WorldMap addon, I see multiple types of pins, so it might depend on which type of pin you have based your pins on.

From: https://www.townlong-yak.com/framexm...taProvider.lua

function WorldMap_WorldQuestDataProviderMixin:RefreshAllData(fromOnShow)
> This appears to be for the various quest related pins and includes a call to *clear and refresh* the pin data.


From: https://www.townlong-yak.com/framexm...taProvider.lua

function WorldMap_EventOverlayDataProviderMixin:RefreshAllData(fromOnShow)
> This one clears the pins, and then recreates them based on the current events


From: https://www.townlong-yak.com/framexm...d_WorldMap.lua

function WorldMapMixin:RefreshOverlayFrames()
> This one might be useful if your pins are part of your own overlay frame.

Hopefully these will offer you some ideas on what might work for you :) Good Luck.


All times are GMT -6. The time now is 10:30 AM.

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