Quantcast
WoWInterface - View Single Post - Weird performance bug on live 7.3.0 (Video Included)
View Single Post
10-22-17, 04:54 PM   #4
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 429
Lua Code:
  1. function WorldQuestPinMixin:OnMouseEnter()
  2.     WorldMap_HijackTooltip(self:GetMap());
  3.  
  4.     TaskPOI_OnEnter(self);
  5. end

Lua Code:
  1. function WorldMap_HijackTooltip(owner)
  2.     WorldMapTooltip:SetParent(owner);
  3.     WorldMapTooltip:SetFrameStrata("TOOLTIP");
  4.  
  5.     for i, tooltip in ipairs(WorldMapTooltip.ItemTooltip.Tooltip.shoppingTooltips) do
  6.         tooltip:SetParent(owner);
  7.         tooltip:SetFrameStrata("TOOLTIP");
  8.     end
  9. end

Lua Code:
  1. function TaskPOI_OnEnter(self)
  2.     WorldMapTooltip:SetOwner(self, "ANCHOR_RIGHT");
  3.  
  4.     if ( not HaveQuestData(self.questID) ) then
  5.         WorldMapTooltip:SetText(RETRIEVING_DATA, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b);
  6.         WorldMapTooltip:Show();
  7.         return;
  8.     end
  9.  
  10.     local title, factionID, capped = C_TaskQuest.GetQuestInfoByQuestID(self.questID);
  11.     if ( self.worldQuest ) then
  12.         local tagID, tagName, worldQuestType, rarity, isElite, tradeskillLineIndex = GetQuestTagInfo(self.questID);
  13.         local color = WORLD_QUEST_QUALITY_COLORS[rarity];
  14.         WorldMapTooltip:SetText(title, color.r, color.g, color.b);
  15.         QuestUtils_AddQuestTypeToTooltip(WorldMapTooltip, self.questID, NORMAL_FONT_COLOR);
  16.  
  17.         if ( factionID ) then
  18.             local factionName = GetFactionInfoByID(factionID);
  19.             if ( factionName ) then
  20.                 if (capped) then
  21.                     WorldMapTooltip:AddLine(factionName, GRAY_FONT_COLOR:GetRGB());
  22.                 else
  23.                     WorldMapTooltip:AddLine(factionName);
  24.                 end
  25.             end
  26.         end
  27.  
  28.         WorldMap_AddQuestTimeToTooltip(self.questID);
  29.     else
  30.         WorldMapTooltip:SetText(title);
  31.     end
  32.  
  33.     for objectiveIndex = 1, self.numObjectives do
  34.         local objectiveText, objectiveType, finished = GetQuestObjectiveInfo(self.questID, objectiveIndex, false);
  35.         if ( objectiveText and #objectiveText > 0 ) then
  36.             local color = finished and GRAY_FONT_COLOR or HIGHLIGHT_FONT_COLOR;
  37.             WorldMapTooltip:AddLine(QUEST_DASH .. objectiveText, color.r, color.g, color.b, true);
  38.         end
  39.     end
  40.  
  41.     local percent = C_TaskQuest.GetQuestProgressBarInfo(self.questID);
  42.     if ( percent ) then
  43.         GameTooltip_InsertFrame(WorldMapTooltip, WorldMapTaskTooltipStatusBar);
  44.         WorldMapTaskTooltipStatusBar.Bar:SetValue(percent);
  45.         WorldMapTaskTooltipStatusBar.Bar.Label:SetFormattedText(PERCENTAGE_STRING, percent);
  46.     end
  47.  
  48.     WorldMap_AddQuestRewardsToTooltip(self.questID);
  49.  
  50.     if ( self.worldQuest and WorldMapTooltip.AddDebugWorldQuestInfo ) then
  51.         WorldMapTooltip:AddDebugWorldQuestInfo(self.questID);
  52.     end
  53.  
  54.     WorldMapTooltip:Show();
  55.     WorldMapTooltip.recalculatePadding = true;
  56. end

Lua Code:
  1. -- from WorldMapTooltip in WorldMapFrame.xml
  2.     <OnUpdate>
  3.         if ( self.recalculatePadding ) then
  4.             self.recalculatePadding = nil;
  5.             WorldMapTooltip_CalculatePadding();
  6.         end
  7.         self.updateTooltip = (self.updateTooltip or TOOLTIP_UPDATE_TIME) - elapsed;
  8.         if ( self.updateTooltip > 0 ) then
  9.             return;
  10.         end
  11.         self.updateTooltip = TOOLTIP_UPDATE_TIME;
  12.  
  13.         local owner = self:GetOwner();
  14.         if ( owner and owner.UpdateTooltip ) then
  15.             owner:UpdateTooltip();
  16.         end
  17.     </OnUpdate>

All this stuff is running every 0.2 seconds on your game client, so I'm not surprised it causes your FPS to drop.
__________________

Last edited by MunkDev : 10-22-17 at 04:59 PM.
  Reply With Quote