Quantcast Changing textures and backgrounds in .lua - WoWInterface
Thread Tools Display Modes
Unread 10-18-10, 10:39 AM   #1
A Murloc Raider
Toecheese's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2010
Posts: 8
Changing textures and backgrounds in .lua

Hi all
forgive me if this is a dumb question but I'm new to lua and and completely stuck!

I understand that nUI textures can be changed in skins using:
nUI_TopBars1:SetTexture("Interface\\AddOns\\nUI_TESTSKIN\\nUI_TESTSKIN_01" );
I understand that this changes the textures called in the .xml file, but how can I change the bgFile and edgeFile to change the background and edges of various frames.

Theres two things stopping me here, first is I simply don't know what the .lua would be!
Could it be something like:
nUI_UNITFRAME_SOLOPLAYER: bgFile ("Interface\\AddOns\\nUI_TESTSKIN\\nUI_TESTSKINbg.blp" ) ;
Secondly, unlike the top bar, bottom bar and dashboard which have their texture applied in the .xml, the untiframe borders and backgrounds are applied in each of the relevant .lua files which by my count is 82 different files!!
(every file in nUI\Layouts\Default\UnitPanels)

Is it possible to add lines in the .lua of a skin to also change all these borders and backgrounds together, or would each file need manually changing?

Thanks a lot

What people don't get is that I am, ultimately, a rip-off artist at heart.
My brush has two colours, Copy and Paste, and my canvas is someone else's!

(Sorry Spiel2001 I couldn't resist )
Toecheese is offline  
Unread 10-18-10, 10:48 AM   #2
nUI's Author
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
What you would want to do is catch the "ADDON_LOADED" event and test of "nUI" then you would assign new values to the background elements in the respective layout files from within your addon. This would allow you to modify which textures are used at runtime without having to edit the nUI sources.

Have a look at the nUI_AuraButtons mod for a peek at how the layout files can be changed at runtime.

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.

Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
spiel2001 is offline  

Go BackWoWInterface » Featured Projects » nUI, MozzFullWorldMap and PartySpotter » Customization » nUI: Customizing Layouts » Changing textures and backgrounds in .lua

Thread Tools
Display Modes

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