fix: stabilize minimap range cutoff and update release docs

This commit is contained in:
Xurkon
2026-06-03 06:05:55 -05:00
parent 93cfc17586
commit 4b7c295210
22 changed files with 198 additions and 77 deletions
+16 -9
View File
@@ -254,7 +254,15 @@ end
local function _GetArrowPreviewPath()
local style = _GetArrowStyle()
return style.previewPath
if not style then
return nil
end
if style.previewPath and (type(DoesFileExist) ~= "function" or DoesFileExist(style.previewPath)) then
return style.previewPath
end
return style.texturePath
end
local function _IsArrowSpriteSheet()
@@ -355,13 +363,9 @@ local function _UpdateObjectiveFramePosition()
end
if _IsObjectiveAttached() and arrowFrame then
local style = arrowFrame._arrowStyle or _GetArrowStyle()
local inset = (style and style.visualBottomInset) or 0
local scale = _GetArrowScale()
local visibleBottomOffset = math.floor(inset * scale + 0.5)
local gap = _GetObjectiveGap()
objectiveFrame:ClearAllPoints()
objectiveFrame:SetPoint("TOP", arrowFrame, "BOTTOM", 0, gap - visibleBottomOffset)
objectiveFrame:SetPoint("TOP", arrowFrame, "BOTTOM", 0, gap)
objectiveFrame._useDefaultPosition = false
return
end
@@ -810,9 +814,12 @@ EnsureArrowFrame = function()
local dist = HBD:GetWorldDistance(targetInstance, playerX, playerY, targetX, targetY)
if dist then
local area = 1
local alpha = dist - area
alpha = alpha > 1 and 1 or alpha
alpha = alpha < 0.5 and 0.5 or alpha
local alpha = 1
if dist <= area then
alpha = dist / area
alpha = alpha > 1 and 1 or alpha
alpha = alpha < 0.5 and 0.5 or alpha
end
local texalpha = (1 - alpha) * 2
texalpha = texalpha > 1 and 1 or texalpha
+19 -61
View File
@@ -13,9 +13,9 @@ QuestieArrowAssets.styles = {
displayWidth = 71,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.187500,
textureCoordRight = 0.812500,
textureCoordTop = 0.078125,
textureCoordLeft = 0.195312,
textureCoordRight = 0.808594,
textureCoordTop = 0.093750,
textureCoordBottom = 0.917969,
},
["arrow2"] = {
@@ -28,7 +28,7 @@ QuestieArrowAssets.styles = {
visualBottomInset = 0,
textureCoordLeft = 0.082031,
textureCoordRight = 0.917969,
textureCoordTop = 0.097656,
textureCoordTop = 0.101562,
textureCoordBottom = 0.898438,
},
["arrow3"] = {
@@ -36,13 +36,13 @@ QuestieArrowAssets.styles = {
texture = "Icons\\Arrows\\Arrow3.tga",
preview = "Icons\\Arrows\\Arrow3_preview.tga",
mode = "image",
displayWidth = 65,
displayWidth = 66,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.214844,
textureCoordRight = 0.785156,
textureCoordTop = 0.078125,
textureCoordBottom = 0.914062,
textureCoordLeft = 0.218750,
textureCoordRight = 0.781250,
textureCoordTop = 0.093750,
textureCoordBottom = 0.917969,
},
["arrow4"] = {
label = "Arrow 4",
@@ -52,21 +52,21 @@ QuestieArrowAssets.styles = {
displayWidth = 68,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.203125,
textureCoordRight = 0.796875,
textureCoordTop = 0.078125,
textureCoordBottom = 0.917969,
textureCoordLeft = 0.347656,
textureCoordRight = 0.648438,
textureCoordTop = 0.289062,
textureCoordBottom = 0.714844,
},
["hordearrow"] = {
label = "Horde Arrow",
texture = "Icons\\Arrows\\HordeArrow.tga",
preview = "Icons\\Arrows\\HordeArrow_preview.tga",
mode = "image",
displayWidth = 84,
displayWidth = 120,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.207031,
textureCoordRight = 0.789062,
textureCoordLeft = 0.078125,
textureCoordRight = 0.917969,
textureCoordTop = 0.078125,
textureCoordBottom = 0.917969,
},
@@ -75,50 +75,11 @@ QuestieArrowAssets.styles = {
texture = "Icons\\Arrows\\AllianceArrow.tga",
preview = "Icons\\Arrows\\AllianceArrow_preview.tga",
mode = "image",
displayWidth = 116,
displayWidth = 177,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.222656,
textureCoordRight = 0.773438,
textureCoordTop = 0.078125,
textureCoordBottom = 0.917969,
},
["minimal1"] = {
label = "Waypoint 1",
texture = "Icons\\Arrows\\Minimal1.tga",
preview = "Icons\\Arrows\\Minimal1_preview.tga",
mode = "image",
displayWidth = 68,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.203125,
textureCoordRight = 0.796875,
textureCoordTop = 0.078125,
textureCoordBottom = 0.917969,
},
["minimal2"] = {
label = "Waypoint 2",
texture = "Icons\\Arrows\\Minimal2.tga",
preview = "Icons\\Arrows\\Minimal2_preview.tga",
mode = "image",
displayWidth = 74,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.175781,
textureCoordRight = 0.820312,
textureCoordTop = 0.078125,
textureCoordBottom = 0.917969,
},
["minimal3"] = {
label = "Waypoint 3",
texture = "Icons\\Arrows\\Minimal3.tga",
preview = "Icons\\Arrows\\Minimal3_preview.tga",
mode = "image",
displayWidth = 83,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.132812,
textureCoordRight = 0.863281,
textureCoordLeft = 0.078125,
textureCoordRight = 0.917969,
textureCoordTop = 0.078125,
textureCoordBottom = 0.917969,
},
@@ -144,9 +105,6 @@ QuestieArrowAssets.order = {
"arrow4",
"hordearrow",
"alliancearrow",
"minimal1",
"minimal2",
"minimal3",
"arrowold",
}
+101 -2
View File
@@ -256,6 +256,7 @@ function QuestieMap:ProcessShownMinimapIcons()
while true do
count = 0
playerX, playerY = getWorldPos()
xd = (playerX or 0) - (QuestieMap.playerX or 0)
yd = (playerY or 0) - (QuestieMap.playerY or 0)
totalDistance = totalDistance + (xd * xd + yd * yd)
@@ -296,6 +297,30 @@ function QuestieMap:ProcessShownMinimapIcons()
end
end
function QuestieMap:RefreshMinimapIconVisibility()
if not HBDPins or not HBDPins.activeMinimapPins then
return
end
local minimapVisibilityCutoff = Questie.db.profile.minimapIconRangeCutoff or 100
if HBDPins.SetMinimapVisibilityCutoff then
HBDPins:SetMinimapVisibilityCutoff(minimapVisibilityCutoff)
end
if HBDPins.RefreshMinimap then
HBDPins:RefreshMinimap()
end
for minimapFrame, data in pairs(HBDPins.activeMinimapPins) do
if minimapFrame and minimapFrame.miniMapIcon and minimapFrame.FadeLogic then
minimapFrame.minimapVisibilityCutoff = minimapVisibilityCutoff
minimapFrame:FadeLogic()
if minimapFrame.GlowUpdate then
minimapFrame:GlowUpdate()
end
end
end
end
function QuestieMap:QueueDraw(drawType, ...)
if (not isDrawQueueDisabled) then
if _G.QuestieDebugPins then
@@ -570,6 +595,71 @@ function QuestieMap:DrawManualIcon(data, areaID, x, y, typ)
iconMinimap.texture:SetTexture(texture)
iconMinimap.texture:SetVertexColor(colorsMinimap[1], colorsMinimap[2], colorsMinimap[3], 1);
iconMinimap.miniMapIcon = true;
iconMinimap.minimapVisibilityCutoff = Questie.db.profile.minimapIconRangeCutoff or 100
if (not iconMinimap.FadeLogic) then
function iconMinimap:SetFade(value)
if self.lastGlowFade ~= value then
self.lastGlowFade = value
if self.glowTexture then
local r, g, b = self.glowTexture:GetVertexColor()
self.glowTexture:SetVertexColor(r, g, b, value)
end
self.texture:SetVertexColor(colorsMinimap[1], colorsMinimap[2], colorsMinimap[3], value)
end
end
function iconMinimap:FadeLogic()
local profile = Questie.db.profile
if self.miniMapIcon and self.x and self.y and self.texture and self.UiMapID and self.texture.SetVertexColor and HBD and HBD.GetPlayerZonePosition then
if (QuestieMap.playerX and QuestieMap.playerY) then
local x, y
if not self.worldX then
x, y = HBD:GetWorldCoordinatesFromZone(self.x / 100, self.y / 100, self.UiMapID)
self.worldX = x
self.worldY = y
else
x = self.worldX
y = self.worldY
end
if (x and y) then
local xd = QuestieMap.playerX - x
local yd = QuestieMap.playerY - y
local distance = math.sqrt(xd * xd + yd * yd)
local minimapVisibilityCutoff = self.minimapVisibilityCutoff or profile.minimapIconRangeCutoff or 100
if (distance > minimapVisibilityCutoff) then
self:FakeHide()
return
elseif self.hidden then
self:FakeShow()
elseif (distance > profile.fadeLevel) then
local fade = 1 - (math.min(10, (distance - profile.fadeLevel)) * normalizedValue)
self:SetFade(fade)
elseif (distance < profile.fadeOverPlayerDistance) and profile.fadeOverPlayer then
local fadeAmount = profile.fadeOverPlayerLevel + distance * (1 - profile.fadeOverPlayerLevel) / profile.fadeOverPlayerDistance
if self.faded and fadeAmount > profile.iconFadeLevel then
fadeAmount = profile.iconFadeLevel
end
self:SetFade(fadeAmount)
else
if self.faded then
self:SetFade(profile.iconFadeLevel)
else
self:SetFade(1)
end
end
end
else
if self.faded then
self:SetFade(profile.iconFadeLevel)
else
self:SetFade(1)
end
end
end
end
end
QuestieMap:QueueDraw(QuestieMap.ICON_MINIMAP_TYPE, Questie, iconMinimap, iconMinimap.UiMapID, x / 100, y / 100, true, true);
tinsert(QuestieMap.manualFrames[typ][data.id], iconMinimap:GetName())
@@ -650,6 +740,7 @@ function QuestieMap:DrawWorldIcon(data, areaID, x, y, showFlag)
iconMinimap.AreaID = areaID
iconMinimap.UiMapID = uiMapId
iconMinimap.miniMapIcon = true;
iconMinimap.minimapVisibilityCutoff = Questie.db.profile.minimapIconRangeCutoff or 100
iconMinimap:UpdateTexture(Questie.usedIcons[data.Icon]);
if (not iconMinimap.FadeLogic) then
@@ -680,9 +771,17 @@ function QuestieMap:DrawWorldIcon(data, areaID, x, y, showFlag)
if (x and y) then
local xd = QuestieMap.playerX - x
local yd = QuestieMap.playerY - y
local distance = math.sqrt(xd * xd + yd * yd) / 10;
local distance = math.sqrt(xd * xd + yd * yd);
local minimapVisibilityCutoff = self.minimapVisibilityCutoff or profile.minimapIconRangeCutoff or 100;
if (distance > profile.fadeLevel) then
-- Hard stop: keep minimap pins from remaining visible beyond
-- the configured minimap range cutoff.
if (distance > minimapVisibilityCutoff) then
self:FakeHide()
return
elseif self.hidden then
self:FakeShow()
elseif (distance > profile.fadeLevel) then
local fade = 1 - (math.min(10, (distance - profile.fadeLevel)) * normalizedValue);
self:SetFade(fade)
elseif (distance < profile.fadeOverPlayerDistance) and profile.fadeOverPlayer then
@@ -510,6 +510,21 @@ function QuestieOptions.tabs.icons:Initialize()
QuestieFramePool:UpdateColorConfig(true, value)
end,
},
minimapIconRangeCutoff = {
type = "range",
order = 4.35,
name = function() return l10n('Minimap Icon Range Cutoff'); end,
desc = function() return l10n('How far away minimap icons can remain visible.\n(Default: %s)', optionsDefaults.profile.minimapIconRangeCutoff); end,
width = 3.1,
min = 25,
max = 200,
step = 5,
disabled = function() return ((not Questie.db.profile.enabled) or (not Questie.db.profile.enableMiniMapIcons)); end,
get = function(info) return QuestieOptions:GetProfileValue(info); end,
set = function (info, value)
QuestieOptions:SetProfileValue(info, value)
end,
},
fadeLevel = {
type = "range",
order = 4.4,
+11 -3
View File
@@ -102,10 +102,18 @@ end
-- set option value
function QuestieOptions:SetProfileValue(info, value)
if debug and Questie.db.profile[info[#info]] ~= value then
Questie:Debug(Questie.DEBUG_SPAM, "DEBUG: global option", info[#info], "changed from '" .. tostring(Questie.db.profile[info[#info]]) .. "' to '" .. tostring(value) .. "'")
local key = info[#info]
if debug and Questie.db.profile[key] ~= value then
Questie:Debug(Questie.DEBUG_SPAM, "DEBUG: global option", key, "changed from '" .. tostring(Questie.db.profile[key]) .. "' to '" .. tostring(value) .. "'")
end
Questie.db.profile[key] = value
if key == "minimapIconRangeCutoff" then
local QuestieMap = QuestieLoader:ImportModule("QuestieMap")
if QuestieMap and QuestieMap.RefreshMinimapIconVisibility then
QuestieMap:RefreshMinimapIconVisibility()
end
end
Questie.db.profile[info[#info]] = value
end
function QuestieOptions:ClusterRedraw()
+2 -1
View File
@@ -20,7 +20,8 @@ function QuestieOptionsDefaults:Load()
objectScale = 1,
globalScale = 0.6,
globalMiniMapScale = 0.7,
fadeLevel = 20,
minimapIconRangeCutoff = 100,
fadeLevel = 100,
fadeOverPlayer = true,
fadeOverPlayerLevel = 0.5,
fadeOverPlayerDistance = 5,