(1.12) When are GUI CFG loaded?

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
User avatar
doofus-01
Art Director
Posts: 4128
Joined: January 6th, 2008, 9:27 pm
Location: USA

(1.12) When are GUI CFG loaded?

Post by doofus-01 »

When do the things in data/gui get loaded? In data/gui/default.cfg there is mention of loading it with "themes", but I don't see anything in themes that I recognize as loading the GUI .cfg. They must be loaded at some point, because they are recognized: http://forums.wesnoth.org/viewtopic.php ... 40#p584840

I looked at _main.cfg, but couldn't find any leads from there.

I'm wondering if I can define my own GUI2 widget in a straight-forward way. Really just creating different version, like is done with data/gui/default/widget/<widgetname>_default.cfg versus <widgetname>_wml_message/_title_screen/etc.cfg.

(This may be a WML question, but it didn't seem like a WML Workshop question, to me at least.)
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
User avatar
Iris
Site Administrator
Posts: 6798
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: (1.12) When are GUI CFG loaded?

Post by Iris »

doofus-01 wrote:When do the things in data/gui get loaded?
The GUI2 initialization chain is called after setting up the loadscreen state and before loading the core game WML, very early from the last step in main() before exiting or handling exceptions. It runs data/gui/default.cfg through the usual WML pipeline and consumes the output, and then it’s never called again.
doofus-01 wrote:I'm wondering if I can define my own GUI2 widget in a straight-forward way. Really just creating different version, like is done with data/gui/default/widget/<widgetname>_default.cfg versus <widgetname>_wml_message/_title_screen/etc.cfg.
Not in an add-on, no.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
User avatar
doofus-01
Art Director
Posts: 4128
Joined: January 6th, 2008, 9:27 pm
Location: USA

Re: (1.12) When are GUI CFG loaded?

Post by doofus-01 »

shadowm wrote:The GUI2 initialization chain is called after setting up the loadscreen state and before loading the core game WML, very early from the last step in main() before exiting or handling exceptions. It runs data/gui/default.cfg through the usual WML pipeline and consumes the output, and then it’s never called again.
So, that would mean something if I knew the C++ code? Well, maybe some day...
shadowm wrote:Not in an add-on, no.
Bummer, dude.

Thanks for your reply, shadowm.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: (1.12) When are GUI CFG loaded?

Post by Crendgrim »

AFAIK, the only options you have for add-ons are to either change the theme via ThemeWML (somewhat undocumented, needs some trial and error), use the standard [message] system or create complex dialogues via the wesnoth.show_dialog() lua function.
UMC Story Images — Story images for your campaign!
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: (1.12) When are GUI CFG loaded?

Post by Pentarctagon »

Would a "core" add-on work for this? I can find very little documentation about them, but it sounds like they might be able to do what you want.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
doofus-01
Art Director
Posts: 4128
Joined: January 6th, 2008, 9:27 pm
Location: USA

Re: (1.12) When are GUI CFG loaded?

Post by doofus-01 »

Hey guys, thanks for noticing this.
Crendgrim wrote:AFAIK, the only options you have for add-ons are to either change the theme via ThemeWML (somewhat undocumented, needs some trial and error), use the standard [message] system or create complex dialogues via the wesnoth.show_dialog() lua function.
It's possible to summon the GUI2 widgets with Lua, but can you define, say, [state_enabled] for new widget? (Not saying you are wrong, I just couldn't find an example to work from.)
Pentarctagon wrote:Would a "core" add-on work for this? I can find very little documentation about them, but it sounds like they might be able to do what you want.
Based on shadowm's reply, I suspect not, but that does sound like a good idea. Maybe with the renewed attention to Wesnoth development, this could become reality? I think fabi was the developer responsible for the "core" stuff, but he disappeared?
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
User avatar
Iris
Site Administrator
Posts: 6798
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: (1.12) When are GUI CFG loaded?

Post by Iris »

Pentarctagon wrote:Would a "core" add-on work for this? I can find very little documentation about them, but it sounds like they might be able to do what you want.
Not right now, no. As I said, GUI2 initialization takes place only once, very early in the Wesnoth process’ lifecycle, and has the GUI2 WML base file’s path hardcoded so it wouldn’t be able to see add-ons anyway.
doofus-01 wrote:
Pentarctagon wrote:Would a "core" add-on [...]
Based on shadowm's reply, I suspect not, but that does sound like a good idea. Maybe with the renewed attention to Wesnoth development, this could become reality? I think fabi was the developer responsible for the "core" stuff, but he disappeared?
Indeed he was, and I may soon have to figure out exactly how it works since I’ll be messing with the code responsible for loading add-ons and breaking everyone’s stuff anyway.

Having GUI2 load WML from add-ons would be a great idea (and would also save us the hassle of expressing WML in Lua for dialogs) but I’m not sure how architecturally feasible it is at the moment.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
Post Reply