I been playing around with it and have figured out the problem is in the table and the call (imgQuests). I even did a test of my own and found that when I call the image like this
WindowNameImage:SetTexture("QuestVisions/Maps/auridon.dds")
It will come up. However if I call the image like this.
WindowNameImage:SetTexture(imgQuests)
It will dispaly a 700x700 white box which is my settings. So I'm pretty sure my problem is how to call it after I have tried to assign it to the table. In other words it's trying but not getting it fully. Here is my entire code. Only thing that isn't working is the image call from the table.
Lua Code:
--This code displays the image with lua so no need for any xml.
local tlw = WINDOW_MANAGER:CreateTopLevelWindow("WindowName")
tlw:SetDimensions(700,700)
tlw:SetAnchor(CENTER)
tlw:SetHidden(false)
local image = WINDOW_MANAGER:CreateControl("WindowNameImage", tlw, CT_TEXTURE)
image:SetAnchorFill(tlw)
--WindowNameImage:SetTexture("QuestVisions/Maps/auridon.dds")
--[[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]].
--[[IMPORTANT: The image seems like it's not able to pull from the table.
I'm having to do a direct call to the image to get it to come up. With the Table I just get a 700x700 white box.]]--
local questZone ={
--Aldmeri Dominion
[179] = "QuestVisions/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 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 = questZone[zoneIndex]
if imgQuests ~= nil then
WindowNameImage:SetTexture(imgQuests)
WindowName:SetHidden(false)
else
WindowName:SetHidden(true)
end
end
--This is to show and hide the image
local function ShowWindow()
if WindowName:IsHidden() then
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"] = ShowWindow
end
end
EVENT_MANAGER:RegisterForEvent("QuestVisions", EVENT_ADD_ON_LOADED, OnAddOnLoaded)
EVENT_MANAGER:RegisterForEvent("QuestVisions", EVENT_ZONE_CHANGED, QuestMaps)