This commit is contained in:
DuvelCorp
2026-03-09 13:41:30 +01:00
parent 4aed1174dd
commit 27d37564ce
47 changed files with 6786 additions and 399 deletions
+29 -32
View File
@@ -240,6 +240,34 @@ local function MTH_CommandPetSpellScanFallback()
end
end
local function MTH_CommandFoodData(limitText)
if type(FOM_PrintCollectedFoodData) ~= "function" then
MTH:Print("Food data command is not available yet")
return
end
local trimmed = string.gsub(tostring(limitText or ""), "^%s+", "")
trimmed = string.gsub(trimmed, "%s+$", "")
if string.lower(trimmed) == "purge" then
if type(FOM_PruneCollectedFoodData) ~= "function" then
MTH:Print("Food data purge is not available yet")
return
end
local removed = tonumber(FOM_PruneCollectedFoodData()) or 0
MTH:Print("Food data purge removed rows: " .. tostring(removed))
return
end
if trimmed == "" then
FOM_PrintCollectedFoodData(nil)
return
end
local limit = tonumber(trimmed)
if not limit then
MTH:Print("Usage: /mth food [limit|purge]")
return
end
FOM_PrintCollectedFoodData(limit)
end
if type(MTH_PS_ScanNow) ~= "function" then
function MTH_PS_ScanNow(trigger)
local ok, count = MTH_CommandPetSpellScanFallback()
@@ -282,49 +310,18 @@ function SlashCmdList.MTH(msg, editbox)
msg = string.gsub(tostring(msg), "^%s+", "")
msg = string.gsub(msg, "%s+$", "")
local lowerMsg = string.lower(msg)
local _, _, lowerCmd, lowerArg = string.find(lowerMsg, "^(%S+)%s*(.-)%s*$")
if msg == "" then
MTH:Print("Available: /mth options, /mth book")
MTH:Print("Debug: /mth petsstate, /mth petsdump, /mth petssnap, /mth petsdiff")
elseif lowerMsg == "options" then
MTH_CommandOptions()
elseif lowerMsg == "book" or lowerMsg == "hunterbook" then
MTH_CommandBook()
elseif lowerMsg == "peers" or lowerMsg == "who" then
MTH_CommandPeers()
elseif lowerMsg == "petsstate" then
if type(MTH_CommandPetsState) == "function" then
MTH_CommandPetsState()
else
MTH:Print("Pets state command is not available yet")
end
elseif lowerMsg == "petsdump" then
if type(MTH_CommandPetsDump) == "function" then
MTH_CommandPetsDump()
else
MTH:Print("Pets dump command is not available yet")
end
elseif lowerMsg == "petssnap" then
if type(MTH_CommandPetsSnap) == "function" then
MTH_CommandPetsSnap()
else
MTH:Print("Pets snapshot command is not available yet")
end
elseif lowerMsg == "petsdiff" then
if type(MTH_CommandPetsDiff) == "function" then
MTH_CommandPetsDiff()
else
MTH:Print("Pets diff command is not available yet")
end
elseif lowerMsg == "err" then
if MTH_DebugFrame and type(MTH_DebugFrame.Toggle) == "function" then
MTH_DebugFrame:Toggle()
else
MTH:Print("Debug frame is not available yet")
end
else
MTH:Print("Unknown command: " .. tostring(msg))
MTH:Print("Available: /mth options, /mth book")
MTH:Print("Debug: /mth petsstate, /mth petsdump, /mth petssnap, /mth petsdiff")
end
end