Here is a final version, you would of course have to setup the variables part but otherwise cut and paste. Full functioning, what it does is it turns off all the quest tracking and objectives on the WorldMap when you enter combat then turns it all back on according to what you had selected before going into combat. It will also close the Map apon entering combat, this was done so that if you had the map in fullsize mode it would close and resize it to small mode so that you could then reopen while in combat if need be.
This will fix taint issues in DHUD, PocketPlot and others and of course can be found in the GrimUI to fix my own worldmap button problem
In theory should fix any taint issues with any addons call to the worldmap. Should alleviate tainting on addons calling worldmap frame for position functions. In theory...
lua Code:
--##############################################################################
--## WorldMapBlobFrame and Combat taint on WorldMap toggles fix START ##
--##############################################################################
local GUIWorldMapEvents = CreateFrame("Frame", nil, UIParent)
GUIWorldMapEvents:RegisterEvent("PLAYER_ENTERING_WORLD")
GUIWorldMapEvents:RegisterEvent("PLAYER_REGEN_ENABLED")
GUIWorldMapEvents:RegisterEvent("PLAYER_REGEN_DISABLED")
GUIWorldMapEvents:SetScript("OnEvent", function(self)
local CurrentTrackState = WorldMapQuestShowObjectives:GetChecked()
if event == "PLAYER_ENTERING_WORLD" then
ShowUIPanel(WorldMapFrame)
HideUIPanel(WorldMapFrame)
elseif event == "PLAYER_REGEN_DISABLED" then
if CurrentTrackState == 1 then
GrimUIData.WorldMapQuestTrack = true
elseif CurrentTrackState == nil then
GrimUIData.WorldMapQuestTrack = false
end
HideUIPanel(WorldMapFrame)
WorldMap_ToggleSizeDown()
WatchFrame.showObjectives = nil;
WorldMapQuestShowObjectives:SetChecked(false)
WorldMapQuestShowObjectives:Hide()
WorldMapTrackQuest:Hide()
WorldMapTitleButton:Hide()
WorldMapFrameSizeUpButton:Hide()
WorldMapBlobFrame:Hide()
WorldMapPOIFrame:Hide()
WorldMapFrameSizeUpButton.Show = GrimUI.Dummy
WorldMapQuestShowObjectives.Show = GrimUI.Dummy
WorldMapTrackQuest.Show = GrimUI.Dummy
WorldMapTitleButton.Show = GrimUI.Dummy
WorldMapBlobFrame.Show = GrimUI.Dummy
WorldMapPOIFrame.Show = GrimUI.Dummy
WatchFrame_Update();
elseif event == "PLAYER_REGEN_ENABLED" then
WorldMapFrameSizeUpButton.Show = WorldMapFrameSizeUpButton:Show()
WorldMapQuestShowObjectives.Show = WorldMapQuestShowObjectives:Show()
WorldMapTrackQuest.Show = WorldMapTrackQuest:Show()
WorldMapTitleButton.Show = WorldMapTitleButton:Show()
WorldMapBlobFrame.Show = WorldMapBlobFrame:Show()
WorldMapPOIFrame.Show = WorldMapPOIFrame:Show()
WorldMapQuestShowObjectives:Show()
WorldMapTitleButton:Show()
WorldMapFrameSizeUpButton:Show()
if GrimUIData.WorldMapQuestTrack == true then
WatchFrame.showObjectives = true
WorldMapQuestShowObjectives:SetChecked(true)
WorldMapTrackQuest:Show()
WorldMapBlobFrame:Show()
WorldMapPOIFrame:Show()
WatchFrame_Update();
end
if GrimUIData.WorldMapQuestTrack == false then
WatchFrame.showObjectives = nil
WorldMapQuestShowObjectives:SetChecked(false)
end
end
end)
--############################################################################
--## WorldMapBlobFrame and Combat taint on WorldMap toggles fix END ##
--############################################################################