View Single Post
11/01/14, 07:31 PM   #1
zireko
 
zireko's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 63
How do you call an image up?

I have a custom image I want to call up. So my question is how exactly do I call an image from a folder within my addon?

I'm pretty sure this isn't correct but this lua code should give you an idea of what I'm doing. The code is no where near finished so don't worry about the other parts. If you'll also read my comments within my code you see where and what I'm trying to do. I'm using the zone index for when a player enters a specific zone to call up the image with a name above the image. I'll add the slash command later in the code so don't worry. Also I remembered someone saying the image can't be jpg but another type please let me know what format the image has to be in and if I can use paint or what free program I might need to change it from jpg to what ever format I need to put it in.

[highlight="Lua"]
--[[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.]]--

local questZone ={
--Aldmeri Dominion
[179] = QuestMaps\Maps\auridon.jpg, --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.]]--

local function QuestMaps()
local zoneIndex = GetCurrentMapZoneIndex()
local imgQuests = questImage[zoneIndex]
if imgQuests ~= nil then
QuestLurkerQuest:SetText(zo_strformat("<<1>>: <<2>>", GetUnitZone("player"), imgQuests))
QuestLurker:SetHidden(false)
else
QuestLurker:SetHidden(true)
end
end[/highlight]

Don't mind the QuestLurker stuff I will rename it I'm just using some of my other code as a short cut to put my code togeather for this new addon I'm building.

Last edited by zireko : 11/01/14 at 07:34 PM.
  Reply With Quote