Holybunny tested it: players had to run CMD files to get half the addon, the "not downloaded yet" prompt sent them to the sync helper (which then read 2,929 raid logs for ~50 minutes), and the built-in Chronicle logger started logging for someone who had switched ChronicleCompanion off. - Chronicle\, RollFor\ and DopingControl\ now ship in the repository at their pinned commits, each with a WDI_NOTICE.txt crediting its authors (DopingControl keeps its MIT LICENSE; ChronicleCompanion and RollFor state no licence: not under WhoDidIt's MIT licence, removed on request). The maintainer's decision. - the built-in Chronicle logger logs nothing until the player says yes (asked the first time they enter a raid, or Start logging); until then its auto-logging is off. If the separate ChronicleCompanion is installed but switched off, the built-in copy stays off too. - no player is told to run a CMD any more: missing parts say "download WhoDidIt again"; raid times aren't counted as missing (they come from the master feed); the Rankings bar shows the feed for players, and Sync now / helper states only for the master's characters - the sync helper and AutoSync are maintainer-only: they check the WTF folder for a B.MASTERS character and otherwise explain and stop (-Force overrides; AutoSync-Off works for anyone). The helper no longer installs addons; EmbedUpdate.ps1 is the maintainer tool for moving pins. - README (install = drag and drop), CLAUDE.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
60 lines
1.8 KiB
Lua
60 lines
1.8 KiB
Lua
if WDI_ROLLFOR_SKIP then return end RollFor = RollFor or {}
|
|
local m = RollFor
|
|
|
|
if m.EventFrame then return end
|
|
|
|
local M = m.Module.new( "EventFrame" )
|
|
---@diagnostic disable-next-line: undefined-field
|
|
local lua50 = table.setn and true or false
|
|
|
|
function M.new( api )
|
|
local frame = api.CreateFrame( "Frame" )
|
|
local event_handlers = {}
|
|
|
|
local function subscribe( event_name, callback )
|
|
if not event_name then error( "event_name was nil." ) end
|
|
if not event_handlers[ event_name ] then
|
|
frame:RegisterEvent( event_name )
|
|
end
|
|
|
|
event_handlers[ event_name ] = event_handlers[ event_name ] or {}
|
|
table.insert( event_handlers[ event_name ], callback )
|
|
end
|
|
|
|
local function event_handler( event, arg1, arg2, arg3, arg4, arg5 )
|
|
for event_name, handlers in pairs( event_handlers ) do
|
|
if event_name == event then
|
|
M.debug.add( event_name )
|
|
|
|
for _, handle_event in ipairs( handlers ) do
|
|
handle_event( arg1, arg2, arg3, arg4, arg5 )
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
frame:SetScript( "OnEvent", function( _, _event, _arg1, _arg2, _arg3, _arg4, _arg5 )
|
|
---@diagnostic disable-next-line: undefined-global
|
|
local event = lua50 and event or _event
|
|
---@diagnostic disable-next-line: undefined-global
|
|
local arg1 = lua50 and arg1 or _arg1
|
|
---@diagnostic disable-next-line: undefined-global
|
|
local arg2 = lua50 and arg2 or _arg2
|
|
---@diagnostic disable-next-line: undefined-global
|
|
local arg3 = lua50 and arg3 or _arg3
|
|
---@diagnostic disable-next-line: undefined-global
|
|
local arg4 = lua50 and arg4 or _arg4
|
|
---@diagnostic disable-next-line: undefined-global
|
|
local arg5 = lua50 and arg5 or _arg5
|
|
---@diagnostic disable-next-line: undefined-global
|
|
event_handler( event, arg1, arg2, arg3, arg4, arg5 )
|
|
end )
|
|
|
|
return {
|
|
subscribe = subscribe
|
|
}
|
|
end
|
|
|
|
m.EventFrame = M
|
|
return M
|