fix: rewrite QuestRouteOptimizer module

This commit is contained in:
Xurkon
2026-03-19 21:48:02 -05:00
parent 7857340c37
commit 156a184da4
2 changed files with 160 additions and 189 deletions
+28
View File
@@ -21,6 +21,8 @@ local QuestieDB = QuestieLoader:ImportModule("QuestieDB")
local l10n = QuestieLoader:ImportModule("l10n")
---@type QuestieCombatQueue
local QuestieCombatQueue = QuestieLoader:ImportModule("QuestieCombatQueue")
---@type QuestieRouteOptimizer
local QuestieRouteOptimizer = QuestieLoader:ImportModule("QuestieRouteOptimizer")
function QuestieSlash.RegisterSlashCommands()
@@ -64,6 +66,7 @@ function QuestieSlash.HandleCommands(input)
print(Questie:Colorize("/questie doable [questID] - " .. l10n("Prints whether you are eligibile to do a quest"), "yellow"));
print(Questie:Colorize("/questie version - " .. l10n("Prints Questie and client version info"), "yellow"));
print(Questie:Colorize("/questie learn [toggle/stats/clear/export] - " .. l10n("Self-learning database: toggle on/off, view stats, clear data, or export"), "yellow"));
print(Questie:Colorize("/questie route [off/single/all/tsp] - " .. l10n("Toggle quest route optimization. off=disable, single=single quest, all=all tracked, tsp=TSP approximation"), "yellow"));
return;
end
@@ -218,5 +221,30 @@ function QuestieSlash.HandleCommands(input)
return
end
-- /questie route [off/single/all/tsp]
if mainCommand == "route" then
local ROUTE_MODE_OFF = 1
local ROUTE_MODE_SINGLE_QUEST = 2
local ROUTE_MODE_ALL_TRACKED = 3
local ROUTE_MODE_TSP_APPROXIMATION = 4
if subCommand == "off" or not subCommand then
QuestieRouteOptimizer:SetMode(ROUTE_MODE_OFF)
Questie:Print("Quest route " .. l10n("disabled"))
elseif subCommand == "single" then
QuestieRouteOptimizer:SetMode(ROUTE_MODE_SINGLE_QUEST)
Questie:Print("Quest route " .. l10n("set to single quest mode"))
elseif subCommand == "all" then
QuestieRouteOptimizer:SetMode(ROUTE_MODE_ALL_TRACKED)
Questie:Print("Quest route " .. l10n("set to all tracked quests mode"))
elseif subCommand == "tsp" then
QuestieRouteOptimizer:SetMode(ROUTE_MODE_TSP_APPROXIMATION)
Questie:Print("Quest route " .. l10n("set to TSP approximation mode"))
else
Questie:Print("Usage: /questie route [off/single/all/tsp]")
end
return
end
print(Questie:Colorize("[Questie] ", "yellow") .. l10n("Invalid command. For a list of options please type: ") .. Questie:Colorize("/questie help", "yellow"));
end