Maybe you can see what I'm doing wrong. I feel like I'm doing everything perfectly but the image just isn't showing up. I have it converted to dds however it doesn't display. In the xml I set hidden as false just to test the addon and everything. So here is my code currently.
txt
Lua Code:
## Title: |cFFFFB0QuestVisions 1.0|r by - |c00C000Zireko|r
## APIVersion: 100009
## Description:
## Version: 1.0
QuestVisions.lua
QuestVisions.xml
xml
Lua Code:
<GuiXml>
<Controls>
<TopLevelControl name="WindowName" hidden="true">
<Dimensions x="256" y="256">
<Anchor point="CENTER">
<Controls>
<Texture name="$(parent)Image">
<AnchorFill />
</Texture>
</Controls>
</TopLevelControl>
</Controls>
</GuiXml>
lua
Lua Code:
--[[This table is the zone index map and what I want it to display. Example [179] = 51, would be quest number to display. However
instead of 51, we could place an image here.]]--
--Custom images must be in .dds format a picture program like photoshop or gimp should be able to convert the image.
--To call an image it would be example "QuestVisions/Maps/auridon.dds" or [[QuestVisions/Maps/auridon.dds]].
local questImage ={
--Aldmeri Dominion
[179] = "QuestMaps/Maps/auridon.dds", --Auridon
[295] = 11, --Khenarthi's Roost
[181] = 44, --Grahtwood
[19] = 50, --Greenshade
[12] = 45, --Malabal Tor
[180] = 60, --Reaper's March
--Daggerfall Covenant
[293] = 15, --Stros M'Kai
[294] = 9, --Betnikh
[2] = 67, --Glenumbra
[4] = 70, --Stormhaven
[5] = 48, --Rivenspir
[18] = 53, --Alik'r Desert
[15] = 47, --Bangkorai
--Ebonheart Pact
[110] = 12, --Bleakrock Isle
[111] = 9, --Bal Foyen
[9] = 76, --Stonefalls
[11] = 67, --Deshaan
[20] = 64, --Shadowfen
[16] = 52, --Eastmarch
[17] = 73, --The Rift
--All other quest/other
[155] = 32, --Coldharbour
[353] = 18, --Craglorn
[38] = 566, --Cyrodiil
}
--This code defines the window within the game which will get the image to show up in the window.
local tlw = WINDOW_MANAGER:CreateTopLevelWindow("WindowName")
tlw:SetDimensions(256,256)
tlw:SetAnchor(CENTER)
tlw:SetHidden(true)
local image = WINDOW_MANAGER:CreateControl("WindowNameImage", tlw, CT_TEXTURE)
image:SetAnchorFill(tlw)
--[[This function pulls up what I want displayed for each zone like in questlurker it uses the zone index map to find the zone then
display the quest number I've provided. Instead of a quest number I can add an image.]]--
-- QuestMapsQuest:SetTexture is how we call the texture which is our image. MyBackdropElement:SetCenterTexture([[Maps/auridon.dds]])
local function QuestMaps()
local zoneIndex = GetCurrentMapZoneIndex()
local imgQuests = questImage[zoneIndex]
if imgQuests ~= nil then
WindowNameImage:SetTexture(imgQuests)
WindowName:SetHidden(false)
else
WindowName:SetHidden(true)
end
end
--This loads your addon and registers/unregisters the events so that the addon will know what it needs to do. Also it sets up the slash command.
local function OnAddOnLoaded(eventCode, addon)
if addon == "QuestVisions" then
EVENT_MANAGER:UnregisterForEvent("QuestVisions", EVENT_ADD_ON_LOADED)
SLASH_COMMANDS["/maps"] = function()
QuestVisions:ToggleHidden()
QuestMaps()
end
end
end
EVENT_MANAGER:RegisterForEvent("QuestVisions", EVENT_ADD_ON_LOADED, OnAddOnLoaded)
EVENT_MANAGER:RegisterForEvent("QuestVisions", EVENT_ZONE_CHANGED, QuestMaps)