feat: refine learner data source and pin rendering

This commit is contained in:
Xurkon
2026-06-06 00:04:50 -05:00
parent 1532b70af3
commit 6597d20b7d
12 changed files with 576 additions and 58 deletions
@@ -19,6 +19,8 @@ local IsleOfQuelDanas = QuestieLoader:ImportModule("IsleOfQuelDanas");
local l10n = QuestieLoader:ImportModule("l10n")
---@type QuestieCompat
local QuestieCompat = QuestieLoader:ImportModule("QuestieCompat")
---@type QuestieDB
local QuestieDB = QuestieLoader:ImportModule("QuestieDB")
QuestieOptions.tabs.advanced = {}
local optionsDefaults = QuestieOptionsDefaults:Load()
@@ -50,6 +52,9 @@ local function GetLearnerSettings()
if settings.minConfidencePins == nil then
settings.minConfidencePins = 1
end
if settings.spawnDedupRadius == nil then
settings.spawnDedupRadius = 4.0
end
return settings
end
@@ -168,6 +173,22 @@ function QuestieOptions.tabs.advanced:Initialize()
QuestieOptionsUtils.DetermineTheme()
end,
},
clusterDensityAggressiveness = {
type = "range",
order = 1.41,
name = function() return l10n('Dense pin clustering aggressiveness'); end,
desc = function() return l10n('How aggressively crowded kill objectives are consolidated into fewer pins. 0 shows every pin; higher values tighten clustering where many pins share a zone. Coincident pins are always deduplicated.'); end,
width = 1.5,
disabled = function() return (not Questie.db.profile.enabled); end,
min = 0,
max = 100,
step = 5,
get = function(info) return QuestieOptions:GetProfileValue(info); end,
set = function(info, value)
QuestieOptions:SetProfileValue(info, value)
QuestieOptionsUtils:Delay(0.5, QuestieOptions.ClusterRedraw, l10n('Setting dense pin clustering aggressiveness to %s : Redrawing!', value))
end,
},
quelDanasSpacer1 = QuestieOptionsUtils:Spacer(1.45, (not Questie.IsTBC)),
npcrules_group = {
type = "group",
@@ -323,6 +344,26 @@ function QuestieOptions.tabs.advanced:Initialize()
settings.performanceMode = "manual"
end,
},
learnerSpawnDedupRadius = {
type = "range",
order = 2.55,
name = function() return l10n('Spawn Pin Dedup Radius'); end,
desc = function() return l10n('How close two learned kill positions must be (in map %) to merge into a single pin. Higher values show fewer, tighter pins per spawn; 0 shows every distinct position.'); end,
min = 0,
max = 15,
step = 0.5,
width = 1.5,
get = function() return GetLearnerSettings().spawnDedupRadius or 4.0 end,
set = function(_, value)
GetLearnerSettings().spawnDedupRadius = value
-- Spawn tables are cached per NPC; clear so the new radius is
-- applied on the redraw instead of serving stale merged coords.
if QuestieDB and QuestieDB.ClearModeCaches then
QuestieDB:ClearModeCaches()
end
QuestieOptionsUtils:Delay(0.5, QuestieQuest.SmoothReset, l10n('Setting spawn pin dedup radius to %s : Redrawing!', value))
end,
},
learnerCommsIntensity = {
type = "select",
order = 2.6,
@@ -52,14 +52,18 @@ local function ApplyLearnerMode()
QuestieLearner:ApplyDataSourceMode()
end
local QuestieEventHandler = QuestieLoader:ImportModule("QuestieEventHandler")
if QuestieEventHandler and QuestieEventHandler.UpdateAllQuests then
QuestieEventHandler:UpdateAllQuests()
end
local QuestieTracker = QuestieLoader:ImportModule("QuestieTracker")
if QuestieTracker and QuestieTracker.Update then
QuestieTracker:Update()
-- SmoothReset is the canonical full refresh: it clears all map/minimap notes
-- and tooltips, recalculates and redraws available quests, re-updates every
-- active quest, and refreshes the tracker. This makes a data-source-mode
-- switch (auto/learner/static/none) take effect everywhere in real time.
local QuestieQuest = QuestieLoader:ImportModule("QuestieQuest")
if QuestieQuest and QuestieQuest.SmoothReset then
QuestieQuest:SmoothReset()
else
local QuestieTracker = QuestieLoader:ImportModule("QuestieTracker")
if QuestieTracker and QuestieTracker.Update then
QuestieTracker:Update()
end
end
end
@@ -9,6 +9,11 @@ function QuestieOptionsDefaults:Load()
ascensionScalingAsked = false,
--Ascension
clusterLevelHotzone = 50,
-- How aggressively dense objectives (many pins in one zone) get
-- consolidated. 0 = off (every pin shown); higher tightens the
-- clustering range for crowded kill objectives. Coincident pins are
-- always deduplicated regardless of this value. See QuestieQuest:_DrawObjectiveIcons.
clusterDensityAggressiveness = 35,
enableIconLimit = false,
iconLimit = 200,
availableScale = 1.2,