LoTROInterface

LoTROInterface (https://www.lotrointerface.com/forums/index.php)
-   Lua Programming Help (L) (https://www.lotrointerface.com/forums/forumdisplay.php?f=50)
-   -   SetBackground(), Asset IDs and custom skins (https://www.lotrointerface.com/forums/showthread.php?t=2024)

Lynx3d 06-06-2013 04:40 PM

SetBackground(), Asset IDs and custom skins
 
Maybe someone can help me.

We have Control:SetBackground(), which accepts a numeric Asset ID to use the client-internal images. I have some interface code that uses them, so I don't need to pack all these files which are already in the client anyway.

Now comes the tricky part. These images are obviously affected by custom skins, which is fantastic since my UI elements are supposed to look like the rest of the client. But the behaviour seems very inconsistent.
Basically, only images that are used by a control that have some active parent control get updated when you set a new skin.

Example:
I have a Control that uses 0x410001c9 as background. When I switch skin, it updates its appearance, yay! Now the control switches background on mouse-over to 0x410001ca. But that image was not used by any control when I activated the skin, so it gets the original version.
But if a control used 0x410001ca as background (can be invisible but apparently must have a parent control/window) when switching skin, also the mouse-over suddenly works.
And logging in with a custom skin doesn't skin Lua controls properly either.

Any ideas how to get at least consistent behaviour?

Thurallor 06-07-2013 03:58 PM

I'm not sure I'm exactly following, but would it suffice to simply always have at least one instance of every asset ID in use, e.g. in hidden or off-screen windows?

Lynx3d 06-09-2013 12:20 AM

No unfortunately not.

Seems the whole thing is even more tricky. Apparently the skin is applied before plugins are loaded on login, so after login most assets are not skinned properly. Even if the skin would apply after plugin loading, reloading a plugin would screw it again.

Some assets however are always skinned, so I think Turbine only marked a few IDs to check for a skin overriding them, while activating a skin for some reason checks all Lua controls and replaces images.
For example 0x410001c9 (default "left" button in dressing room and when splitting stacks) does always get skinned properly, 0x410001ca however only shows properly when a control already uses it when a skin gets activated.

I'm not really sure why those IDs behave differently...do the skinnable ArtAssetID in the SkinDefinition.xml have a 1:1 relation to the numeric asset ID we can use in Lua? Or are several ArtAssetID refering to the same internal image by default?
Somehow seems like an unfinished attempt to make ("custom") Lua controls support skins...
Too bad Turbine.UI.Lotro lacks several vital elemets to do a proper configuration panel :(


All times are GMT -5. The time now is 04:11 AM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI