Thread Tools Display Modes
11/20/14, 05:42 PM   #1
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Accessing Custom Textures

Is it possible to Access textures in another addons folders?

I'm not planning on using someone elses textures, but was wanting to open an addon up so people can create their own textures that they could register with my addon. I have everything working except I can't figure out how to access the textures in another addons folder. Right now it only works if the other addon registers textures built into the game.

I was trying to use something like this, but nothing is showing up:
Lua Code:
  1. texture = "/OtherAddonName/textures/some_custom_texture.dds"
  2. cCntrl:GetNamedChild("Texture"):SetTexture(texture)

While I'm at it what is the difference, if any, to using either of these:
Lua Code:
  1. texture = "/OtherAddonName/textures/some_custome_texture.dds"
  2. texture = [[/OtherAddonName/textures/some_custome_texture.dds]]
  Reply With Quote
11/20/14, 06:56 PM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Originally Posted by circonian View Post
Lua Code:
  1. texture = "/OtherAddonName/textures/some_custom_texture.dds"
  2. cCntrl:GetNamedChild("Texture"):SetTexture(texture)
I'd try without the initial slash. I assume this works from inside OtherAddonName, it only doesn't work from yet another addon, right?
If the string directly doesn't work, you could create virtual texture controls in OtherAddonName, and clone those using CreateControlFromVirtual.

Originally Posted by circonian View Post
While I'm at it what is the difference, if any, to using either of these:
Lua Code:
  1. texture = "/OtherAddonName/textures/some_custome_texture.dds"
  2. texture = [[/OtherAddonName/textures/some_custome_texture.dds]]
Alternate syntax, no difference. It's for someone who wants double-quotes in the string and hates backslashes (I don't believe such person exists )
  Reply With Quote
11/20/14, 07:40 PM   #3
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by merlight View Post
I'd try without the initial slash. I assume this works from inside OtherAddonName, it only doesn't work from yet another addon, right?
If the string directly doesn't work, you could create virtual texture controls in OtherAddonName, and clone those using CreateControlFromVirtual.
Rofl, embarrassing...It would help if I put the addon folder that contains the textures into:
Elder Scrolls Online -> Live -> AddOns


As always though thanks for the help.
  Reply With Quote
11/21/14, 11:35 AM   #4
Sasky
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 231
Originally Posted by circonian View Post
Rofl, embarrassing...It would help if I put the addon folder that contains the textures into:
Elder Scrolls Online -> Live -> AddOns


As always though thanks for the help.
Also consider defining the texture paths as globals in your texture addon and have addons use those instead of the actual texture name directly. That way if you ever need to mess with the path or something you can do that without worrying about breaking addons that use it.
  Reply With Quote
11/21/14, 04:04 PM   #5
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Sasky View Post
Also consider defining the texture paths as globals in your texture addon and have addons use those instead of the actual texture name directly. That way if you ever need to mess with the path or something you can do that without worrying about breaking addons that use it.
Thats a good idea, didn't think of that. Thanks.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Accessing Custom Textures


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off