This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
The :Diable() call triggers :OnDisable() which should remove map icons; however, the dataprovider is not being removed from the WorldMapFrame so the icons remain on the map -- this is a problem
Note that MapCanvas_DataProviderBase performs an assert() when providers are removed so if HandyNotes initializes in enabled=false, this assert will fail and an error will be thrown, so it should only be called when a dataprovider has, in fact, been added.
HandyNotes:OnEnable()
WorldMapFrame:AddDataProvider(HandyNotes.WorldMapDataProvider) self.WorldMapHasDataProvider = true -- This flag lets HandyNotes it is safe to call :RemoveDataProvider()
HandyNotes:OnDisable()
if self.WorldMapHasDataProvider then -- only attempt to remove if a provider has been given WorldMapFrame:RemoveDataProvider(HandyNotes.WorldMapDataProvider) end self.WorldMapHasDataProvider = false
HandyNotes loads both Enabled and Disabled without error and the map icons are properly removed with :Disable()
To post a comment, please login or register a new account.