Editing built in widgets, like "Red Resource Bars"

Editing built in widgets, like "Red Resource Bars"

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
Thundathigh
Posts: 2
Joined: 14 May 2014, 01:47

Editing built in widgets, like "Red Resource Bars"

Post by Thundathigh »

How would I go about changing colors and size in built in widgets like "Red Resource Bars"?
I see that when I change a position of a bar in game that it is saved to BA.lua in Documents\My Games\Spring\LuaUI\Config, but editing the file itself doesn't cause any updates in game, and the file is overwritten.

I also tried moving the (edited) BA.lua to Program Files (x86)\Spring\LuaUI\Config and Program Files (x86)\Spring\LuaUI\Widgets, but neither places changed anything in the game.

So how can I edit the built in widgets, or where should the updated BA.lua be placed?
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Editing built in widgets, like "Red Resource Bars"

Post by Jools »

Don't edit the ba.lua, it's just a config file.

I think red TM stuff are a bit more complicated than normal widgets, but usually you edit supplied widgets by grabbing a copy from the mod and putting it in spring/luaui/widgets, thereby overriding it with your local version.

I think ba has that widget here: http://imolarpg.dyndns.org/trac/balates ... cebars.lua
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Editing built in widgets, like "Red Resource Bars"

Post by Silentwings »

You can "edit" them locally by having a local copy of the widget file in your /luaui/widgets directory and then editing that. BA will load your local version in preference to the internal one, if it exists.

If you're going to do that - be aware that various widgets/gadgets communicate (especially for UI related stuff) and changing one can break other things.
Thundathigh
Posts: 2
Joined: 14 May 2014, 01:47

Re: Editing built in widgets, like "Red Resource Bars"

Post by Thundathigh »

Thanks Jools, that exactly what I was looking for!

And I'm just changing the alpha level on a couple of things, so it shouldn't break anything haha

Edit: Success
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Editing built in widgets, like "Red Resource Bars"

Post by Jools »

By the way, while we're talking about Red (TM) things: would be nice if someone could optimise them a bit, atm they are very heavy.

I also tried to work a bit on red tooltip, but it's very complicated code for what it does.
Post Reply

Return to “Help & Bugs”