Alright, I have NO clue why this is happening, but no matter what I pass to Fetch, I'm getting back "Interface\TargetingFrame\UI-StatusBar" as a texture. SharedMedia is enabled and injecting textures properly (other addons such as Omen and pitbull can find the texture I'm trying to use just fine). Did I miss something?
you asking for Smooth, if that texture hasnt been loaded yet, youll get the ui-Statusbar default. You should add a callback so you know when a texture is registered.
function mediaRegistered(mediaType,mediaKey)
if mediaKey == "Smooth" then
-- HEY the bar is was looking for was registered!
end
end
LSM:RegisterCallback("LibSharedMedia_Registered",mediaRegistered)
Ah okay, I saw that bit of code when I was rummaging around in Omen, but I assumed it was watching for the stuff that omen registers itself, and not waiting for LSM to get around to registering stuff from SharedMedia.
Which is a bad idea. Use the callbacks or don't use the library at all. SharedMedia is not the only addon that registers media to LibSharedMedia-3.0 so OptDep'ing SharedMedia is not a viable solution.
I have to agree with Arrowmaster that OptDep'ing SharedMedia is half-assed at best now that there are a good number of addons that inject their own textures into the mix. The callback mechanism is there and should be used.
Alright, I have NO clue why this is happening, but no matter what I pass to Fetch, I'm getting back "Interface\TargetingFrame\UI-StatusBar" as a texture. SharedMedia is enabled and injecting textures properly (other addons such as Omen and pitbull can find the texture I'm trying to use just fine). Did I miss something?
You may refer to LibSharedMedia callback code in Omen3. It is similar to what kagaro posted.
You SHOULD OptDep embedded libraries. LibSharedMedia-3.0 is an embedded library and SHOULD be OptDeped. SharedMedia is not an embedded library and SHOULD NOT be OptDeped.
Initializing LSM3:
embeds.xml:
Top of main Lua file:
Code using it:
You may refer to LibSharedMedia callback code in Omen3. It is similar to what kagaro posted.
Or, more specific:
Why shouldn't i OptDep it, if I use the callback?