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.

Lua Code:
  1. --[[This table is the zone index map and what I want it to display. Example [179] = 51, would be quest number to display. However
  2. instead of 51, we could place an image here.]]--
  3.  
  4. local questZone ={
  5. --Aldmeri Dominion
  6.     [179] = QuestMaps\Maps\auridon.jpg, --Auridon
  7.     [295] = 11, --Khenarthi's Roost
  8.     [181] = 44, --Grahtwood
  9.     [19]  = 50, --Greenshade
  10.     [12]  = 45, --Malabal Tor
  11.     [180] = 60, --Reaper's March
  12.  
  13. --Daggerfall Covenant
  14.     [293] = 15, --Stros M'Kai
  15.     [294] = 9,  --Betnikh
  16.     [2]   = 67, --Glenumbra
  17.     [4]   = 70, --Stormhaven
  18.     [5]   = 48, --Rivenspir
  19.     [18]  = 53, --Alik'r Desert
  20.     [15]  = 47, --Bangkorai
  21.  
  22. --Ebonheart Pact
  23.     [110] = 12, --Bleakrock Isle
  24.     [111] = 9,  --Bal Foyen
  25.     [9]   = 76, --Stonefalls
  26.     [11]  = 67, --Deshaan
  27.     [20]  = 64, --Shadowfen
  28.     [16]  = 52, --Eastmarch
  29.     [17]  = 73, --The Rift
  30.  
  31. --All other quest/other
  32.     [155] = 32, --Coldharbour
  33.     [353] = 18, --Craglorn
  34.     [38] = 566, --Cyrodiil
  35. }
  36.  
  37. --[[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
  38. display the quest number I've provided. Instead of a quest number I can add an image.]]--
  39.  
  40. local function QuestMaps()
  41.     local zoneIndex = GetCurrentMapZoneIndex()
  42.     local imgQuests = questImage[zoneIndex]
  43.     if imgQuests ~= nil then
  44.         QuestLurkerQuest:SetText(zo_strformat("<<1>>: <<2>>", GetUnitZone("player"), imgQuests))
  45.         QuestLurker:SetHidden(false)
  46.     else
  47.         QuestLurker:SetHidden(true)
  48.     end
  49. end

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