fix: finalize arrow asset and docs updates

This commit is contained in:
Xurkon
2026-06-03 00:26:39 -05:00
parent 4fc8d661fd
commit c3b91f3bee
22 changed files with 86 additions and 19 deletions
+33 -7
View File
@@ -221,15 +221,16 @@ local function _GetArrowStyle()
mode = isSheet and "sheet" or "image",
displayWidth = displayWidth,
displayHeight = displayHeight,
textureCoordLeft = 0,
textureCoordRight = 1,
textureCoordTop = 0,
textureCoordBottom = 1,
}
end
local style = _GetBundledArrowStyle(styleKey) or _GetBundledArrowStyle(ARROW_DEFAULT_STYLE)
local isSheet = _IsBundledSheetStyle(styleKey)
local runtimeTexture = style.preview
if isSheet then
runtimeTexture = style.texture
end
local runtimeTexture = style.texture
return {
label = style.label,
texturePath = QuestieLib.AddonPath .. runtimeTexture,
@@ -239,6 +240,10 @@ local function _GetArrowStyle()
displayWidth = isSheet and (style.displayWidth or ARROW_CELL_W) or (style.displayWidth or ARROW_IMAGE_SIZE),
displayHeight = isSheet and (style.displayHeight or ARROW_CELL_H) or (style.displayHeight or ARROW_IMAGE_SIZE),
visualBottomInset = style.visualBottomInset or 0,
textureCoordLeft = style.textureCoordLeft or 0,
textureCoordRight = style.textureCoordRight or 1,
textureCoordTop = style.textureCoordTop or 0,
textureCoordBottom = style.textureCoordBottom or 1,
}
end
@@ -262,13 +267,23 @@ local function _ApplyArrowStyle()
end
local style = _GetArrowStyle()
local styleSignature = table.concat({ _GetArrowStyleKey(), style.texturePath or "", style.previewPath or "", style.mode or "" }, "|")
local styleSignature = table.concat({
_GetArrowStyleKey(),
style.texturePath or "",
style.previewPath or "",
style.mode or "",
tostring(style.textureCoordLeft or 0),
tostring(style.textureCoordRight or 1),
tostring(style.textureCoordTop or 0),
tostring(style.textureCoordBottom or 1),
}, "|")
local styleChanged = arrowFrame._arrowStyleSignature ~= styleSignature
arrowFrame._arrowStyle = style
arrowFrame._arrowStyleSignature = styleSignature
if styleChanged then
arrowFrame.arrow:SetTexture(nil)
arrowFrame.arrow:SetTexture(style.texturePath)
arrowFrame._arrowStyleMode = nil
end
@@ -277,7 +292,12 @@ local function _ApplyArrowStyle()
if style.mode == "sheet" then
arrowFrame.arrow:SetTexCoord(0, ARROW_CELL_W / ARROW_SHEET_SIZE, 0, ARROW_CELL_H / ARROW_SHEET_SIZE)
else
arrowFrame.arrow:SetTexCoord(0, 1, 0, 1)
arrowFrame.arrow:SetTexCoord(
style.textureCoordLeft or 0,
style.textureCoordRight or 1,
style.textureCoordTop or 0,
style.textureCoordBottom or 1
)
end
if arrowFrame.arrow.SetRotation then
arrowFrame.arrow:SetRotation(0)
@@ -816,7 +836,13 @@ EnsureArrowFrame = function()
yend = yend - padY
self.arrow:SetTexCoord(xstart, xend, ystart, yend)
else
self.arrow:SetTexCoord(0, 1, 0, 1)
local style = self._arrowStyle or _GetArrowStyle()
self.arrow:SetTexCoord(
style.textureCoordLeft or 0,
style.textureCoordRight or 1,
style.textureCoordTop or 0,
style.textureCoordBottom or 1
)
if self.arrow.SetRotation then
self.arrow:SetRotation(angle)
end
+47 -7
View File
@@ -10,54 +10,78 @@ QuestieArrowAssets.styles = {
texture = "Icons\\Arrows\\Arrow1.tga",
preview = "Icons\\Arrows\\Arrow1_preview.tga",
mode = "image",
displayWidth = 77,
displayWidth = 71,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.187500,
textureCoordRight = 0.812500,
textureCoordTop = 0.078125,
textureCoordBottom = 0.917969,
},
["arrow2"] = {
label = "Arrow 2",
texture = "Icons\\Arrows\\Arrow2.tga",
preview = "Icons\\Arrows\\Arrow2_preview.tga",
mode = "image",
displayWidth = 75,
displayHeight = 96,
displayWidth = 96,
displayHeight = 92,
visualBottomInset = 0,
textureCoordLeft = 0.082031,
textureCoordRight = 0.917969,
textureCoordTop = 0.097656,
textureCoordBottom = 0.898438,
},
["arrow3"] = {
label = "Arrow 3",
texture = "Icons\\Arrows\\Arrow3.tga",
preview = "Icons\\Arrows\\Arrow3_preview.tga",
mode = "image",
displayWidth = 64,
displayWidth = 65,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.214844,
textureCoordRight = 0.785156,
textureCoordTop = 0.078125,
textureCoordBottom = 0.914062,
},
["arrow4"] = {
label = "Arrow 4",
texture = "Icons\\Arrows\\Arrow4.tga",
preview = "Icons\\Arrows\\Arrow4_preview.tga",
mode = "image",
displayWidth = 67,
displayWidth = 68,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.203125,
textureCoordRight = 0.796875,
textureCoordTop = 0.078125,
textureCoordBottom = 0.917969,
},
["hordearrow"] = {
label = "Horde Arrow",
texture = "Icons\\Arrows\\HordeArrow.tga",
preview = "Icons\\Arrows\\HordeArrow_preview.tga",
mode = "image",
displayWidth = 96,
displayWidth = 84,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.207031,
textureCoordRight = 0.789062,
textureCoordTop = 0.078125,
textureCoordBottom = 0.917969,
},
["alliancearrow"] = {
label = "Alliance Arrow",
texture = "Icons\\Arrows\\AllianceArrow.tga",
preview = "Icons\\Arrows\\AllianceArrow_preview.tga",
mode = "image",
displayWidth = 96,
displayWidth = 116,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.222656,
textureCoordRight = 0.773438,
textureCoordTop = 0.078125,
textureCoordBottom = 0.917969,
},
["minimal1"] = {
label = "Waypoint 1",
@@ -67,6 +91,10 @@ QuestieArrowAssets.styles = {
displayWidth = 68,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.203125,
textureCoordRight = 0.796875,
textureCoordTop = 0.078125,
textureCoordBottom = 0.917969,
},
["minimal2"] = {
label = "Waypoint 2",
@@ -76,6 +104,10 @@ QuestieArrowAssets.styles = {
displayWidth = 74,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.175781,
textureCoordRight = 0.820312,
textureCoordTop = 0.078125,
textureCoordBottom = 0.917969,
},
["minimal3"] = {
label = "Waypoint 3",
@@ -85,6 +117,10 @@ QuestieArrowAssets.styles = {
displayWidth = 83,
displayHeight = 96,
visualBottomInset = 0,
textureCoordLeft = 0.132812,
textureCoordRight = 0.863281,
textureCoordTop = 0.078125,
textureCoordBottom = 0.917969,
},
["arrowold"] = {
label = "Arrow Old",
@@ -94,6 +130,10 @@ QuestieArrowAssets.styles = {
displayWidth = 56,
displayHeight = 42,
visualBottomInset = 0,
textureCoordLeft = 0.001953,
textureCoordRight = 0.982422,
textureCoordTop = 0.005859,
textureCoordBottom = 0.984375,
},
}