From b89f7e3d516f557f8e33f32b8700e30306755b7e Mon Sep 17 00:00:00 2001 From: shagu Date: Tue, 1 Dec 2020 17:18:00 +0100 Subject: [PATCH] panel: only show tooltip when friends are online --- modules/panel.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/panel.lua b/modules/panel.lua index f1acf200..28432ad6 100644 --- a/modules/panel.lua +++ b/modules/panel.lua @@ -307,16 +307,19 @@ pfUI:RegisterModule("panel", "vanilla:tbc", function() widget:RegisterEvent("PLAYER_ENTERING_WORLD") widget:RegisterEvent("FRIENDLIST_UPDATE") widget.Tooltip = function() - GameTooltip_SetDefaultAnchor(GameTooltip, this) - GameTooltip:ClearLines() - GameTooltip:AddLine("|cff555555" .. T["Friends Online"]) - + local init = nil local all = GetNumFriends() local playerzone = GetRealZoneText() for friendIndex=1, all do local friend_name, friend_level, friend_class, friend_area, friend_connected = GetFriendInfo(friendIndex) if friend_connected and friend_class and friend_level then + if not init then + GameTooltip_SetDefaultAnchor(GameTooltip, this) + GameTooltip:ClearLines() + GameTooltip:AddLine("|cff555555" .. T["Friends Online"]) + init = true + end local ccolor = RAID_CLASS_COLORS[L["class"][friend_class]] or { 1, 1, 1 } local lcolor = GetDifficultyColor(tonumber(friend_level)) or { 1, 1, 1 } local zcolor = friend_area == playerzone and "|cff33ffcc" or "|cffcccccc"