ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Accessing Custom Textures (https://www.esoui.com/forums/showthread.php?t=2454)

circonian 11/20/14 05:42 PM

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]]

merlight 11/20/14 06:56 PM

Quote:

Originally Posted by circonian (Post 13377)
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.

Quote:

Originally Posted by circonian (Post 13377)
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 ;))

circonian 11/20/14 07:40 PM

Quote:

Originally Posted by merlight (Post 13378)
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
:D

As always though thanks for the help.

Sasky 11/21/14 11:35 AM

Quote:

Originally Posted by circonian (Post 13379)
Rofl, embarrassing...It would help if I put the addon folder that contains the textures into:
Elder Scrolls Online -> Live -> AddOns
:D

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.

circonian 11/21/14 04:04 PM

Quote:

Originally Posted by Sasky (Post 13386)
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.


All times are GMT -6. The time now is 10:01 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI