- DucielPerf addon embedded in the DLL (always served, listed in the addon list): minimap button and /ducielperf (/dperf) open a window with Performance, Diagnostics, Features (module switches, world markers on me/target/clear, interact key bindings, loot all corpses) and Status tabs. - settings.cpp: one table of every ducielperf.cfg setting with live apply where possible; DucielPerf_SettingInfo / GetSetting / SetSetting. config_set_int writes ducielperf.cfg keeping comments and other keys. - Live switches: decompression, file cache, Lua strings, SavedVariables buffering, frame raising and clickthrough keep their hooks and call the client's code while off. New keys: inflate, filecache, luastrings, alloctrack, worldmarkers, interact, clickthrough, transmogfix, exitfix, minimap, minimap_angle. - Tests: test_config (cfg writing), test_addon (the addon on a mock WoW API in Lua 5.0). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
1.3 KiB
Lua
23 lines
1.3 KiB
Lua
-- Drives the settings window: open, tabs, checkbox, number field, minimap
|
|
-- button drag/hide, slash commands. Fails on any Lua error.
|
|
-- Drive the UI: open, switch tabs, click, edit, drag, slash
|
|
local f = DucielPerfFrame
|
|
assert(f, "no frame")
|
|
SlashCmdList["DUCIELPERF"]("")
|
|
assert(f:IsShown(), "not shown")
|
|
for i = 1, 4 do DucielPerfTab1:_fire("OnClick"); getglobal("DucielPerfTab" .. i):_fire("OnClick") end
|
|
f:_fire("OnUpdate", 1.5)
|
|
-- toggle first checkbox
|
|
DucielPerfCheck1:SetChecked(nil); DucielPerfCheck1:_fire("OnClick")
|
|
-- edit box
|
|
DucielPerfEdit3:SetText("200"); DucielPerfEdit3:_fire("OnEnterPressed")
|
|
-- minimap
|
|
DucielPerfMinimapButton:_fire("OnDragStart"); DucielPerfMinimapButton:_fire("OnUpdate"); DucielPerfMinimapButton:_fire("OnDragStop")
|
|
DucielPerfMinimapButton:_fire("OnClick", "RightButton")
|
|
DucielPerfMinimapCheck:SetChecked(nil); DucielPerfMinimapCheck:_fire("OnClick")
|
|
SlashCmdList["DUCIELPERF"]("minimap"); SlashCmdList["DUCIELPERF"]("status"); SlashCmdList["DUCIELPERF"]("help")
|
|
DucielPerfCheck1:_fire("OnEnter"); DucielPerfCheck1:_fire("OnLeave")
|
|
local want = { "set inflate=0", "set gcdefer_mb=200", "set minimap_angle=315", "set minimap=0", "set minimap=1" }
|
|
for i, w in ipairs(want) do assert(calls[i] == w, "expected " .. w .. ", got " .. tostring(calls[i])) end
|
|
print("test_addon: all passed")
|