@@ -840,60 +840,60 @@ SlashCmdList["DFAPI"] = function(msg)
840840 DF :FireAPICallback (" OnFramesSorted" , " party" )
841841 DF :FireAPICallback (" OnFramesSorted" , " raid" )
842842 DF :FireAPICallback (" OnFramesSorted" , " arena" )
843- print ( " |cff00ff00DandersFrames:|r Fired test OnFramesSorted (party + raid + arena)" )
843+ DF : Say ( " Fired test OnFramesSorted (party + raid + arena)" )
844844
845845 elseif msg == " fire" then
846846 -- Re-apply the party header sort. Real sorting happens via the
847847 -- nameList/groupBy attributes on the SecureGroupHeaderTemplate
848848 -- (Headers.lua), not the SecureSort snippet path. This is what
849849 -- actually drives OnFramesSorted in production.
850850 if InCombatLockdown () then
851- print ( " |cffff0000DandersFrames:|r Cannot fire sort in combat (header attributes are protected)" )
851+ DF : Err ( " Cannot fire sort in combat (header attributes are protected)" )
852852 return
853853 end
854854 if DF .ApplyPartyGroupSorting then
855855 DF :ApplyPartyGroupSorting ()
856- print ( " |cff00ff00DandersFrames:|r Applied party sort - callback fires ~1 frame later" )
856+ DF : Say ( " Applied party sort - callback fires ~1 frame later" )
857857 else
858- print ( " |cffff0000DandersFrames:|r ApplyPartyGroupSorting not available" )
858+ DF : Err ( " ApplyPartyGroupSorting not available" )
859859 end
860860
861861 elseif msg == " snippet" then
862862 -- Isolation test: run a bare secure snippet that ONLY calls CallMethod.
863- -- If this fires the [DF API TRACE] chat line, secure->Lua hop works and
863+ -- If this fires the API trace chat line, secure->Lua hop works and
864864 -- the sort-path failure is elsewhere (snippet bailing early, etc.).
865865 if DF .SecureSort and DF .SecureSort .handler and DF .SecureSort .initialized then
866866 if InCombatLockdown () then
867- print ( " |cffff0000DandersFrames:|r Cannot run snippet test in combat" )
867+ DF : Err ( " Cannot run snippet test in combat" )
868868 return
869869 end
870870 DF .SecureSort .handler :Execute ([[
871871 self:CallMethod("NotifySortComplete", "snippet-test")
872872 ]] )
873- print ( " |cff00ff00DandersFrames:|r Executed bare snippet with CallMethod - expect [DF API TRACE] chat line" )
873+ DF : Say ( " Executed bare snippet with CallMethod" , " expect an API trace line" , " NEUTRAL " )
874874 else
875- print ( " |cffff0000DandersFrames:|r SecureSort.handler not ready (initialized=" .. tostring (DF .SecureSort and DF .SecureSort .initialized ) .. " )" )
875+ DF : Err ( " SecureSort.handler not ready (initialized=" .. tostring (DF .SecureSort and DF .SecureSort .initialized ) .. " )" )
876876 end
877877
878878 elseif msg == " watch" then
879879 if DF ._apiWatchToken then
880880 DandersFrames .UnregisterCallback (DF ._apiWatchToken , " OnFramesSorted" )
881881 DF ._apiWatchToken = nil
882- print ( " |cff00ff00DandersFrames:|r API watch OFF" )
882+ DF : Say ( " API watch OFF" )
883883 else
884884 DF ._apiWatchToken = {}
885885 DandersFrames .RegisterCallback (DF ._apiWatchToken , " OnFramesSorted" , function (event , sortType )
886- print (format (" |cff00ccff[DF API]|r %s: %s @ %.3f " , event , tostring (sortType ), GetTime ()))
886+ DF : Say (format (" %s: %s" , event , tostring (sortType )), format ( " @ %.3f " , GetTime ()), " NEUTRAL " )
887887 end )
888- print ( " |cff00ff00DandersFrames:|r API watch ON - chat messages on every OnFramesSorted" )
888+ DF : Say ( " API watch ON - chat messages on every OnFramesSorted" )
889889 end
890890
891891 elseif msg == " list" then
892892 if not DF .APICallbacks or not DF .APICallbacks .events then
893- print ( " |cffff0000DandersFrames:|r callback registry not initialized" )
893+ DF : Err ( " callback registry not initialized" )
894894 return
895895 end
896- print ( " |cff00ccffDandersFrames API callbacks:|r " )
896+ DF : Out ( " API" , " registered callbacks" )
897897 local any = false
898898 for event , subs in pairs (DF .APICallbacks .events ) do
899899 local count = 0
@@ -906,11 +906,13 @@ SlashCmdList["DFAPI"] = function(msg)
906906 end
907907
908908 else
909- print (" |cff00ff00DandersFrames API commands:|r" )
910- print (" /dfapi test - fire a test callback (bypasses sort)" )
911- print (" /dfapi fire - trigger a real sort (with pipeline diagnostics)" )
912- print (" /dfapi snippet - run a bare secure snippet that only calls CallMethod" )
913- print (" /dfapi watch - toggle a chat-printing subscriber" )
914- print (" /dfapi list - list current subscribers per event" )
909+ local o = DF :Out (" API" )
910+ o :Section (" Commands" )
911+ o :Item (" test" , " fire a test callback (bypasses sort)" )
912+ o :Item (" fire" , " trigger a real sort, with pipeline diagnostics" )
913+ o :Item (" snippet" , " run a bare secure snippet that only calls CallMethod" )
914+ o :Item (" watch" , " toggle a chat-printing subscriber" )
915+ o :Item (" list" , " current subscribers per event" )
916+ o :Siblings (" api" )
915917 end
916918end
0 commit comments