Hook friends list show to NOT show while we're waiting for who

This way no window spop up :D
This commit is contained in:
2025-05-20 20:12:04 +02:00
parent e6525c6443
commit d4fd72ec71

View File

@@ -8,6 +8,8 @@ function shared.Whoer.Init()
if not Heimdall_Data.who then Heimdall_Data.who = {} end
if not Heimdall_Data.who.data then Heimdall_Data.who.data = {} end
local whoWaiting = false
---@type table<string, Player>
HeimdallStinkies = {}
@@ -583,7 +585,8 @@ function shared.Whoer.Init()
end
-- Turns out WA cannot do this (
-- aura_env.UpdateMacro()
_G["FriendsFrameCloseButton"]:Click()
-- We MAY not need this
-- _G["FriendsFrameCloseButton"]:Click()
end)
do
@@ -635,13 +638,21 @@ function shared.Whoer.Init()
lastQuery = query
---@diagnostic disable-next-line: param-type-mismatch
SetWhoToUI(1)
SetWhoToUI(1)
SendWho(query.query)
whoWaiting = true
end
local function Tick()
DoQuery()
C_Timer.NewTimer(1, Tick, 1)
end
Tick()
local original_FriendsFrame_OnEvent = FriendsFrame_OnEvent
local function my_FriendsFrame_OnEvent(event)
if not (event == "WHO_LIST_UPDATE" and whoWaiting) then original_FriendsFrame_OnEvent() end
end
FriendsFrame_OnEvent = my_FriendsFrame_OnEvent
end
print("[Heimdall] Whoer loaded")