3 Commits

Author SHA1 Message Date
06b7f5fca0 Hook friends list show to NOT show while we're waiting for who
This way no window spop up :D
2025-05-20 20:12:59 +02:00
0ab14de0e2 CCP 2025-05-20 20:04:41 +02:00
a25b6a20d5 Release 3.12.0 2025-05-20 20:02:47 +02:00
4 changed files with 120 additions and 8 deletions

View File

@@ -2,7 +2,7 @@ local addonname, shared = ...
---@cast shared HeimdallShared
---@cast addonname string
local VERSION = "3.11.0"
local VERSION = "3.12.0"
shared.VERSION = VERSION
local function init()
@@ -541,3 +541,75 @@ loadedFrame:RegisterEvent("ADDON_LOADED")
loadedFrame:SetScript("OnEvent", function(self, event, addonName)
if addonName == addonname then init() end
end)
local loadedFrame = CreateFrame("Frame")
loadedFrame:RegisterEvent("ADDON_LOADED")
loadedFrame:SetScript("OnEvent", function(self, event, addonName)
if addonName == addonname then init() end
end)
-- Create the import/export frame
local ccpFrame = CreateFrame("Frame", "CCPFrame", UIParent)
ccpFrame:SetSize(512 * 1.5, 512 * 1.5)
ccpFrame:SetPoint("CENTER")
ccpFrame:SetFrameStrata("HIGH")
ccpFrame:EnableMouse(true)
ccpFrame:SetMovable(true)
ccpFrame:SetResizable(false)
ccpFrame:SetBackdrop({
bgFile = "Interface/Tooltips/UI-Tooltip-Background",
edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
tile = true,
tileSize = 4,
edgeSize = 4,
insets = {
left = 4,
right = 4,
top = 4,
bottom = 4,
},
})
ccpFrame:SetBackdropColor(0, 0, 0, 0.8)
ccpFrame:SetBackdropBorderColor(0.5, 0.5, 0.5, 1)
ccpFrame:SetMovable(true)
ccpFrame:EnableMouse(true)
ccpFrame:RegisterForDrag("LeftButton")
ccpFrame:SetScript("OnDragStart", function(self) self:StartMoving() end)
ccpFrame:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end)
ccpFrame:SetScript("OnShow", function(self) self:SetScale(1) end)
ccpFrame:Hide()
-- Create scroll frame
local scrollFrame = CreateFrame("ScrollFrame", "CCPFrameScrollFrame", ccpFrame, "UIPanelScrollFrameTemplate")
scrollFrame:SetPoint("TOPLEFT", ccpFrame, "TOPLEFT", 10, -10)
scrollFrame:SetPoint("BOTTOMRIGHT", ccpFrame, "BOTTOMRIGHT", -30, 10)
-- Create the text box
local ccpFrameTextBox = CreateFrame("EditBox", "CCPFrameTextBox", scrollFrame)
ccpFrameTextBox:SetSize(512 * 1.5 - 40, 512 * 1.5 - 20)
ccpFrameTextBox:SetPoint("TOPLEFT", scrollFrame, "TOPLEFT", 0, 0)
ccpFrameTextBox:SetFont("Fonts\\FRIZQT__.ttf", 12)
ccpFrameTextBox:SetTextColor(1, 1, 1, 1)
ccpFrameTextBox:SetTextInsets(10, 10, 10, 10)
ccpFrameTextBox:SetMultiLine(true)
ccpFrameTextBox:SetAutoFocus(true)
ccpFrameTextBox:SetMaxLetters(1000000)
ccpFrameTextBox:SetScript("OnEscapePressed", function(self) ccpFrame:Hide() end)
-- Set the scroll frame's scroll child
scrollFrame:SetScrollChild(ccpFrameTextBox)
CCP = function(window)
window = window or 1
local charFrame = _G["ChatFrame" .. window]
local maxLines = charFrame:GetNumMessages() or 0
local chat = {}
for i = 1, maxLines do
local currentMsg = charFrame:GetMessageInfo(i)
chat[#chat + 1] = currentMsg
end
ccpFrameTextBox:SetText(table.concat(chat, "\n"))
ccpFrame:Show()
ccpFrameTextBox:SetFocus()
end

View File

@@ -1,6 +1,6 @@
## Interface: 70300
## Title: Heimdall
## Version: 3.11.0
## Version: 3.12.0
## Notes: Watches over areas and alerts when hostiles spotted
## Author: Cyka
## SavedVariables: Heimdall_Data, Heimdall_Achievements

2
Meta

Submodule Meta updated: e0b57e39fc...46ecd9a143

View File

@@ -213,7 +213,30 @@ shared.Whoer = {
)
)
end
return true
local err = NotifyZoneChanged(player, zone)
if err then print(string.format("Error notifying for %s: %s", tostring(name), tostring(err))) end
end
player.zone = zone
player.lastSeen = timestamp
HeimdallStinkies[name] = player
if not Heimdall_Data.who then Heimdall_Data.who = {} end
if not Heimdall_Data.who.data then Heimdall_Data.who.data = {} end
Heimdall_Data.who.data[name] = player
end
end
-- Turns out WA cannot do this (
-- aura_env.UpdateMacro()
-- We MAY not need this
-- _G["FriendsFrameCloseButton"]:Click()
end)
do
local function UpdateStinkies()
for name, player in pairs(HeimdallStinkies) do
if player.lastSeenInternal + Heimdall_Data.config.who.ttl < GetTime() then
NotifyGone(player)
--PlaySoundFile("Interface\\Sounds\\Uncloak.ogg", "Master")
HeimdallStinkies[name] = nil
end
end
if not Heimdall_Data.config.who.debug then
@@ -644,10 +667,27 @@ shared.Whoer = {
Heimdall_Data.who.data[name] = player
end
end
-- Turns out WA cannot do this (
-- aura_env.UpdateMacro()
_G["FriendsFrameCloseButton"]:Click()
end)
whoQueryIdx = whoQueryIdx + 1
if whoQueryIdx > #shared.WhoQueryService.queries then whoQueryIdx = 1 end
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
do
local function UpdateStinkies()