Files
WhoDidIt/DopingLoader.lua
bdot1andClaude Opus 5.5 1674bd0c5e v1.26.3: DopingControl 0.7.0, from its new home on octowow.st
DopingControl moved to octowow.st/git/ShempError/DopingControl with 0.7.0
(GitHub stops at 0.6.4), so WhoDidIt's copy had stopped updating. Pinned
at e6561d3: an Addons tab (who runs BigWigs, Threat Meter, EPGP, SuperWoW,
Rinse), enchant names on the Equipment tab, a silent scan on BigWigs pull
timers, a test-mode reminder.

Reviewed for running inside WhoDidIt: scan/pull.lua replaces the global
SendAddonMessage with a pass-through (pcall-guarded, all returns kept), so
every WhoDidIt send goes through it unchanged; the Addons tab sends hidden
queries to the raid and SWOW_Q to GUILD (tab open, at most every 30 s,
never in combat). DopingLoader's leader-only wraps still fit. No changes.

tools/EmbedUpdate.ps1: octowow.st shows scripts and git an anti-bot page
and the tool doesn't try to get past it, so DopingControl's spec is Manual:
download <Web>/archive/<Pin>.zip in a browser and run -Only Doping
-FromZip <zip>. The zip's comment (git archive) is the commit; another one
is refused unless -Latest. The tool keeps WDI_NOTICE.txt across updates,
names the real source in wdi_version.lua, and counts a WoW whose path
Windows hides (started as administrator) as running.

Checked: test install in a scratch game folder (wrong-commit zip refused),
LuaCheck on all 31 files, a smoke test in OctoBG's 1.12 mock (67 checks:
every tab, the wrapper, the queries, the loader's wraps), a /reload before
restarting (old .toc) loads without errors. Not tried in game. New files:
restart WoW fully once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 21:19:48 +01:00

62 lines
2.7 KiB
Lua

--[[--------------------------------------------------------------------
WhoDidIt - built-in DopingControl
WhoDidIt carries its own copy of DopingControl, the raid consumables,
class buffs, debuffs, resistances, hit and enchant checker by ShempError
(MIT licence). It lives in the DopingControl\ folder and ships with
WhoDidIt, at the commit in DopingControl\wdi_version.lua (from
octowow.st/git/ShempError/DopingControl, its LICENSE kept). Its window opens
from the Consumes tab ("Open DopingControl") or with /dc.
tools\EmbedUpdate.ps1 (maintainer) makes small changes so it runs from inside WhoDidIt: its
version comes from DopingControl\wdi_version.lua, its images are found
in this folder, it starts on WhoDidIt's ADDON_LOADED, and each file
starts with "if WDI_DOPING_SKIP then return end".
If the separate DopingControl addon is switched on, it has already loaded
by now (it's an optional dependency), so the built-in copy stands down
and WhoDidIt asks once whether to switch the separate one off.
----------------------------------------------------------------------]]
WDI_DOPING_SKIP = IsAddOnLoaded("DopingControl") and true or nil
-- the version its options window shows
function WDI_DopingVersion()
return WDI_DOPING_VERSION or ""
end
-- Both declare DopingControlDB (that's how settings move to the built-in
-- copy), so WhoDidIt's saved copy would replace the separate addon's table
-- while it's running. Give it its own table back once WhoDidIt has loaded.
local standaloneDB = WDI_DOPING_SKIP and DopingControlDB
local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript("OnEvent", function()
if event == "ADDON_LOADED" then
if arg1 ~= "WhoDidIt" then return end
if standaloneDB then DopingControlDB = standaloneDB end
return
end
this:UnregisterAllEvents()
-- in a raid its "Send to raid chat" and its whispers are for the raid leader
-- and assistants (WhoDidIt.CanLead), like everything WhoDidIt posts
if not WDI_DOPING_SKIP and WhoDidIt.CanLead then
if DC_Report and DC_Report.SendDisabled then
local sendOff = DC_Report.SendDisabled
DC_Report.SendDisabled = function(source) return sendOff(source) or not WhoDidIt.CanLead() end
end
if DC_Matrix and DC_Matrix.CanWhisper then
local canWhisper = DC_Matrix.CanWhisper
DC_Matrix.CanWhisper = function(row, now, last)
if not WhoDidIt.CanLead() then WhoDidIt.LeadOnly(); return false, nil end
return canWhisper(row, now, last)
end
end
end
-- only offer to switch it off when the built-in copy is really there
if WDI_DOPING_SKIP and WDI_DOPING_VERSION and WhoDidIt.AskHandover then
WhoDidIt:AskHandover("DopingControl", "DopingControl (Full check on the Consumes tab)")
end
end)