Thread Tools Display Modes
05-31-10, 07:50 PM   #1
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
A fix? WorldMapBlobFrame taint issues.

I think i have come up with a fix for the infamous worldmapblobframe. Now the only problem with it is that when you leave combat it will automaticlly turn on quest tracking on the WorldMap. I always have mine on so to me this is not a big issue. I think somehow one could add a GetChecked to the begining and store a variable then use the variable to make the exiting combat function load your checked state accordingly. But for the most part this will fix any of the WorldMapBlobFrame issues when it comes to toggling the worldmap in combat for any reason via an addon.

lua Code:
  1. local GUIWorldMapEvents = CreateFrame("Frame", nil, UIParent)
  2. GUIWorldMapEvents:RegisterEvent("PLAYER_ENTERING_WORLD")
  3. GUIWorldMapEvents:RegisterEvent("PLAYER_REGEN_ENABLED")
  4. GUIWorldMapEvents:RegisterEvent("PLAYER_REGEN_DISABLED")
  5.  
  6. GUIWorldMapEvents:SetScript("OnEvent", function(self)
  7.     if event == "PLAYER_ENTERING_WORLD" then
  8.         ShowUIPanel(WorldMapFrame)
  9.         HideUIPanel(WorldMapFrame)
  10.    
  11.     elseif event == "PLAYER_REGEN_DISABLED" then
  12.         WatchFrame.showObjectives = nil;
  13.         WorldMapQuestShowObjectives:SetChecked(false)
  14.         WorldMapQuestShowObjectives:Hide()
  15.         WorldMapTrackQuest:Hide()
  16.         WorldMapTitleButton:Hide()
  17.         WorldMapFrameSizeUpButton:Hide()
  18.         WorldMapBlobFrame:Hide()
  19.         WorldMapPOIFrame:Hide()
  20.        
  21.         WorldMapFrameSizeUpButton.Show = GrimUI.Dummy
  22.         WorldMapQuestShowObjectives.Show = GrimUI.Dummy
  23.         WorldMapTrackQuest.Show = GrimUI.Dummy
  24.         WorldMapTitleButton.Show = GrimUI.Dummy
  25.         WorldMapBlobFrame.Show = GrimUI.Dummy
  26.         WorldMapPOIFrame.Show = GrimUI.Dummy
  27.        
  28.        
  29.         WatchFrame_Update();
  30.    
  31.     elseif event == "PLAYER_REGEN_ENABLED" then
  32.        
  33.         WorldMapFrameSizeUpButton.Show = WorldMapFrameSizeUpButton:Show()
  34.         WorldMapQuestShowObjectives.Show = WorldMapQuestShowObjectives:Show()
  35.         WorldMapTrackQuest.Show = WorldMapTrackQuest:Show()
  36.         WorldMapTitleButton.Show = WorldMapTitleButton:Show()
  37.         WorldMapBlobFrame.Show = WorldMapBlobFrame:Show()
  38.         WorldMapPOIFrame.Show = WorldMapPOIFrame:Show()
  39.        
  40.         WatchFrame.showObjectives = true;
  41.         WorldMapQuestShowObjectives:SetChecked(true)
  42.  
  43.         WorldMapQuestShowObjectives:Show()
  44.         WorldMapTrackQuest:Show()
  45.         WorldMapTitleButton:Show()
  46.         WorldMapFrameSizeUpButton:Show()
  47.         WorldMapBlobFrame:Show()
  48.         WorldMapPOIFrame:Show()
  49.        
  50.         WatchFrame_Update();
  51.     end
  52. end)
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
05-31-10, 07:58 PM   #2
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Also note that there is an issue if you go into combat with the worldmap in the large mode... not sure yet how to force small mode in combat...
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
06-05-10, 11:06 AM   #3
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
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:
  1. --##############################################################################
  2. --##    WorldMapBlobFrame and Combat taint on WorldMap toggles fix    START   ##
  3. --##############################################################################
  4.  
  5. local GUIWorldMapEvents = CreateFrame("Frame", nil, UIParent)
  6. GUIWorldMapEvents:RegisterEvent("PLAYER_ENTERING_WORLD")
  7. GUIWorldMapEvents:RegisterEvent("PLAYER_REGEN_ENABLED")
  8. GUIWorldMapEvents:RegisterEvent("PLAYER_REGEN_DISABLED")
  9.  
  10. GUIWorldMapEvents:SetScript("OnEvent", function(self)
  11.     local CurrentTrackState = WorldMapQuestShowObjectives:GetChecked()
  12.    
  13.     if event == "PLAYER_ENTERING_WORLD" then
  14.         ShowUIPanel(WorldMapFrame)
  15.         HideUIPanel(WorldMapFrame)
  16.    
  17.     elseif event == "PLAYER_REGEN_DISABLED" then
  18.        
  19.          
  20.         if CurrentTrackState == 1 then
  21.         GrimUIData.WorldMapQuestTrack = true
  22.         elseif CurrentTrackState == nil then
  23.         GrimUIData.WorldMapQuestTrack = false
  24.         end
  25.        
  26.         HideUIPanel(WorldMapFrame)
  27.         WorldMap_ToggleSizeDown()
  28.         WatchFrame.showObjectives = nil;
  29.         WorldMapQuestShowObjectives:SetChecked(false)
  30.         WorldMapQuestShowObjectives:Hide()
  31.         WorldMapTrackQuest:Hide()
  32.         WorldMapTitleButton:Hide()
  33.         WorldMapFrameSizeUpButton:Hide()
  34.         WorldMapBlobFrame:Hide()
  35.         WorldMapPOIFrame:Hide()
  36.        
  37.         WorldMapFrameSizeUpButton.Show = GrimUI.Dummy
  38.         WorldMapQuestShowObjectives.Show = GrimUI.Dummy
  39.         WorldMapTrackQuest.Show = GrimUI.Dummy
  40.         WorldMapTitleButton.Show = GrimUI.Dummy
  41.         WorldMapBlobFrame.Show = GrimUI.Dummy
  42.         WorldMapPOIFrame.Show = GrimUI.Dummy
  43.        
  44.        
  45.         WatchFrame_Update();
  46.    
  47.     elseif event == "PLAYER_REGEN_ENABLED" then
  48.        
  49.         WorldMapFrameSizeUpButton.Show = WorldMapFrameSizeUpButton:Show()
  50.         WorldMapQuestShowObjectives.Show = WorldMapQuestShowObjectives:Show()
  51.         WorldMapTrackQuest.Show = WorldMapTrackQuest:Show()
  52.         WorldMapTitleButton.Show = WorldMapTitleButton:Show()
  53.         WorldMapBlobFrame.Show = WorldMapBlobFrame:Show()
  54.         WorldMapPOIFrame.Show = WorldMapPOIFrame:Show()
  55.        
  56.  
  57.         WorldMapQuestShowObjectives:Show()
  58.         WorldMapTitleButton:Show()
  59.         WorldMapFrameSizeUpButton:Show()
  60.        
  61.        
  62.         if GrimUIData.WorldMapQuestTrack == true then
  63.            
  64.             WatchFrame.showObjectives = true
  65.             WorldMapQuestShowObjectives:SetChecked(true)
  66.            
  67.             WorldMapTrackQuest:Show()
  68.             WorldMapBlobFrame:Show()
  69.             WorldMapPOIFrame:Show()
  70.            
  71.             WatchFrame_Update();
  72.         end
  73.        
  74.         if GrimUIData.WorldMapQuestTrack == false then
  75.            
  76.             WatchFrame.showObjectives = nil
  77.             WorldMapQuestShowObjectives:SetChecked(false)
  78.         end
  79.        
  80.        
  81.        
  82.        
  83.  
  84.     end
  85. end)
  86.  
  87. --############################################################################
  88. --##    WorldMapBlobFrame and Combat taint on WorldMap toggles fix    END   ##
  89. --############################################################################
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
06-05-10, 02:02 PM   #4
Guardix
A Cyclonian
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 42
You do know that Mapster has a workaround, which looks a bit like yours ?
  Reply With Quote
06-05-10, 02:29 PM   #5
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
really? i did not but that does not surprise me. i found the problem in a lot of addons when trying to figure out why it was happening with my own code... eventually i wrote this workaround which should work with any addon. should mind you.

I did think one thing that could be added is to check weather or not the full size quest view is open or not and decide about closing in combat based on that. the only reason the force close on combat enter was to compensate for people who might have that full view version open when they go into combat. If you dont force close and toggle to the small view when its reopened after combat its all kinds of funny. That though is the only change i think i would make to this... i imagine what is in mapster might be a bit better. If you really wanted to dig into the bliz code there might be an even better way that allows you to still have the quest objectives and such open since in making this i noticed it wasnt the frame itself being open but rather the quest objectives locations on the worldmap frame itself being updated is what causes the taint. Im not quite that advanced yet but maybe some secure code for opening the worldmap would be better in fact it was referenced to me at one point... one thing i know about the secure code is :Show and :Hide fire hmmmm.... interesting so it just dawned on me that using a secure toggle for show hide fires an x/y calculation error but if you toggle the map out of combat via some normal nonsecure method IE ShowUIPanel or Toggle or how you want to do it that it will then work useing the secure button SOOO maybe an easier and better way would be to create the secure toggle function then on player entering world have it do the show hide on the map real quick as the code does currently and then you would technically be able to use the secure toggle method with no problems.

i will test this and see if it works but anyhow for now this is here for anyone whos interested

edit - oh it dawned on me to why i cant use or at lest i have not figured out how to use the secure method... it requires a secure frame be overlayed on the minimap and when i do this i lose the tooltips for minimap POI's... im sure there is a work around for that to but... It would work if you were just making a button and not overlaying rightclick on the minimap as i have done...
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 06-05-10 at 02:36 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » A fix? WorldMapBlobFrame taint issues.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off