From 315f6bb4f159e860e54eecad922c6d12289c4468 Mon Sep 17 00:00:00 2001 From: DuvelCorp Date: Tue, 15 Sep 2026 07:34:39 +0200 Subject: [PATCH] Load marker texture by actual addon folder name (case-proof) --- api/constants.lua | 17 +++++++++++++++++ api/map-markers.lua | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/api/constants.lua b/api/constants.lua index 24b74e8..089341e 100644 --- a/api/constants.lua +++ b/api/constants.lua @@ -1,6 +1,23 @@ MTH_CONST = MTH_CONST or {} MTH_CONST.version = MTH_CONST.version or "2.0.0" +-- Our AddOns folder name as actually installed. Forgejo/Codeberg zip downloads +-- force the archive's root folder to lowercase (forgejo bug #800), so resolve +-- the real casing here and build texture paths from it. +MTH_CONST.addonFolder = MTH_CONST.addonFolder or "MetaHunt" +if type(GetNumAddOns) == "function" and type(GetAddOnInfo) == "function" then + local i = 1 + local total = GetNumAddOns() or 0 + while i <= total do + local folder = GetAddOnInfo(i) + if type(folder) == "string" and string.lower(folder) == "metahunt" then + MTH_CONST.addonFolder = folder + break + end + i = i + 1 + end +end + MTH_CONST.WEAPON_TYPES = { BOWS = "Bows", CROSSBOWS = "Crossbows", diff --git a/api/map-markers.lua b/api/map-markers.lua index a8444d6..2fdb08d 100644 --- a/api/map-markers.lua +++ b/api/map-markers.lua @@ -908,7 +908,7 @@ function MTH_Map:BuildPin(parent, name, isMinimap) pin.tex = pin:CreateTexture(nil, "ARTWORK") pin.tex:SetAllPoints(pin) - pin.tex:SetTexture("Interface\\AddOns\\MetaHunt\\img\\node") + pin.tex:SetTexture("Interface\\AddOns\\" .. (MTH_CONST and MTH_CONST.addonFolder or "MetaHunt") .. "\\img\\node") pin.tex:SetVertexColor(1, 1, 1, 1) pin:SetScript("OnEnter", function()