Author SHA1 Message Date
Dusk-92 04e21a8471 Add custom WowRadio minimap icon 2026-09-06 15:08:54 +02:00
3 changed files with 36 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
-- Custom WowRadio minimap icon.
-- Loaded after Core.lua so the button keeps all existing behavior.
local function ApplyWowRadioMinimapIcon()
if not WowRadioMinimapButton then
return
end
-- Do not depend on GetRegions()/region order on Vanilla.
-- Draw a dedicated texture directly over the stock icon instead.
if not WowRadioMinimapButton.WowRadioCustomIcon then
local icon = WowRadioMinimapButton:CreateTexture(nil, "ARTWORK")
icon:SetTexture("Interface\\AddOns\\WowRadio-Vanilla\\media\\WowRadio_MinimapIcon.tga")
-- The custom artwork is already tightly cropped for the 20x20 minimap slot.
icon:SetTexCoord(0, 1, 0, 1)
icon:SetWidth(20)
icon:SetHeight(20)
icon:SetPoint("TOPLEFT", WowRadioMinimapButton, "TOPLEFT", 7, -5)
WowRadioMinimapButton.WowRadioCustomIcon = icon
else
WowRadioMinimapButton.WowRadioCustomIcon:SetTexture("Interface\\AddOns\\WowRadio-Vanilla\\media\\WowRadio_MinimapIcon.tga")
WowRadioMinimapButton.WowRadioCustomIcon:SetTexCoord(0, 1, 0, 1)
WowRadioMinimapButton.WowRadioCustomIcon:Show()
end
end
local originalCreateMinimapButton = WowRadio.CreateMinimapButton
function WowRadio:CreateMinimapButton()
originalCreateMinimapButton(self)
ApplyWowRadioMinimapIcon()
end
-- Also handle the case where the button already exists when this file loads.
ApplyWowRadioMinimapIcon()
+1
View File
@@ -21,3 +21,4 @@ Locale-enEN.lua
Locale-enUS.lua
Stations.lua
Core.lua
MinimapIcon.lua
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB