(1.12) When are GUI CFG loaded?
Moderator: Forum Moderators
(1.12) When are GUI CFG loaded?
When do the things in
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
(This may be a WML question, but it didn't seem like a WML Workshop question, to me at least.)
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#p584840I 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
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
Re: (1.12) When are GUI CFG 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 indoofus-01 wrote:When do the things indata/gui
get loaded?
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.Not in an add-on, no.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 withdata/gui/default/widget/<widgetname>_default.cfg
versus<widgetname>_wml_message/_title_screen/etc.cfg
.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
Re: (1.12) When are GUI CFG loaded?
So, that would mean something if I knew the C++ code? Well, maybe some day...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.
Bummer, dude.shadowm wrote:Not in an add-on, no.
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
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
Re: (1.12) When are GUI CFG loaded?
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!
- Pentarctagon
- Project Manager
- Posts: 5597
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: (1.12) When are GUI CFG loaded?
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
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: (1.12) When are GUI CFG loaded?
Hey guys, thanks for noticing this.
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.)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.
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?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.
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
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
Re: (1.12) When are GUI CFG loaded?
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.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.
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.doofus-01 wrote: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?Pentarctagon wrote:Would a "core" add-on [...]
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.