Making Help and Hotkeys WML accessible to UMC authors

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
User avatar
Dixie
Posts: 1757
Joined: February 10th, 2010, 1:06 am
Location: $x1,$y1

Making Help and Hotkeys WML accessible to UMC authors

Post by Dixie »

Dixie wrote:Well, well, let's get back to my old thread :)

I have recently been looking into greater costumization of Wesnoth for campaigns/scenarios. I have been looking at mainline files quite a bit, as well as at the wiki. I understand these are obscure bits of WML, that are not used often and may not be the cleanest out there. I am mainly talking about [theme], [help] and [hotkeys].

1) Theme.
This one is not too bad, actually. The documentation in the wiki is fairly good and with support from the mainline theme files, it is possible to achieve results relatively easily. I was wondering, though: since this basically allows us to change Wesnoth's skin (if we make costum theme pngs), is it possible to xtend that costum skin to other menus, such as the saves, help, recruit, etc? I understand this is all in data/gui, but I have so far not found from where the file is read/called, and I'm not sure how it could be integrated to a costum theme. Agreed, I haven't delved into the deepest depths yet.

2) Help
I have of course found the [hide_help] tag to hide units, and the help.cfg in data/core and the wiki page about help. Given all these, I figured there probably is a way to modify the game's help, if not to redo it entirely, at least to add pages to it. I could see it as being pretty useful for add-ons that use costum systems, such as Paintball Era advancement charts or the project I am currently working on. I have tried making a very basic help file, but I can't get it to be read instead/added to the default help. I tried calling it outside [campaign] and {IF_DEF CAMPAIGN} like themes, but it has produced no results so far. I thought that maybe it would behave like game_configs, by which I mean: if I defined another [top_level] or used the same ids or something, maybe it would override the default one, but so far it seems not. Anybody has any cues on this matter?

3) Hotkeys
Let's not shy ourselves away from it: adding stuff to context menus can be ugly and unKISS. That's why I figured it could be nice to define costum hotkeys for the course of a scenario/campaign. Be it to call the costum help page, to call a costum menu/funtcion which doesn't require a location, or just to disable a default hotkey which works against the current scenario's functionnality. I of course found hotkeys.cfg in data/core, and while I have not tried playing with it a lot yet, I figured I would run into the same problems than I am with the help menu. Still, I am mentionning it in case someone knew something special about it.

While I'm at it, I haven't looked into this a lot yet either, but I wondered if there was a way to launch some menu actions (as seen in ThemeWML) from some other place than menus. Like, creating save points or a save/load option in a menu-dialog. Also, while dialogs clearly are the easy way to build costum menus, would it be possible to define a costum menu or "widget" (like the recruit menu, for instance), which I could call through WML? Now that I think of it, though, I think I saw something like that in new Lua functions for 1.9, but it looked really complicated... It might also answer itself if I find a way to access the GUI like I mentionned in the Theme paragraph above...

Thanks! :)
:eng: So I came to the conclusions that unless some stuff was changed a bit in the core files, all of the above remains out of our grasp. I really think UMC authors should be given these tools: used carefully, they can be powerful and helpful indeed, especially the Help and Hotkeys ones.

:geek: To that effect, I have been working on a crude patch that could be applied to core if it was polished a little. I have only explored the Help side of the matter, but I am fairly certain that the other functionnalities could be enabled in much the same way. Here it is:
Dixie_Help_Patch.zip
(23.84 KiB) Downloaded 145 times
There are a few issue with the patch, you can read the included READ_ME.

I would have worked some more on it, but since I essentially use the pre-processor, there are two issues:
1) The pre-processor syntax is destined to change in 1.9, so too much work would ultimately "be lost". Just a basic outline is good to go for now, I think.
2) Even then, I'd have worked on polishing it some more, but I discovered this morning, much to my dismay, that the pre-processor help page on the wiki had recently been stripped of all pre-1.9 syntax.

I have also been trying my hand at a macro that could simply add pages to the help, but I have been so far unsuccesful: a macro usually defines text somewhere and copies it where it is used, while I am trying to define one that could be defined/altered locally, but send lines to the help file.

By the way, this is somewhat related, so I,ll state it here:
I have found the [hide_help] included in [units] in 1.7, but it is not perfect: using the "d" hotkey while highlighting a unit will still open a generated help page for it, even though it is hidden and not normally accessible from the help. This comes out as a bug to me :?
Jazz is not dead, it just smells funny - Frank Zappa
Current projects: Internet meme Era, The Settlers of Wesnoth
Alink
Inactive Developer
Posts: 181
Joined: March 5th, 2007, 6:45 am
Location: Belgium

Re: Making Help and Hotkeys WML accessible to UMC authors

Post by Alink »

Yes some way to add custom help pages would be nice. However, I don't think that total freedom should be given to add-on, even if would be cool for a full mod to replace wesnoth-specific help pages. Some possibilities would be to give more description to some elements like the current scenario/map or campaign. Or maybe even a "current campaign" section with custom pages in it (make them dynamics would be cool too, as a campaign logs things, but maybe the help is not the best place for that).

Un-hardcode few things will help too (and it's needed/planned), like terrain and traits descriptions.

One problem with modifiable core parts in your proposal is how multiplayer is currently handled: all active at the same time. Maybe put stuff in era and use it only then? BTW, as an example of things that we should do more, there is already a faction help section where multiplayer add-on can add description of era and factions.
Dixie wrote:By the way, this is somewhat related, so I,ll state it here:
I have found the [hide_help] included in [units] in 1.7, but it is not perfect: using the "d" hotkey while highlighting a unit will still open a generated help page for it, even though it is hidden and not normally accessible from the help. This comes out as a bug to me :?
[hide_help] is supposed to be used to hide unused units (like a race not used in a campaign) or to preserve some surprise (even if they are other way to do that). We never want to disable "unit description" and there is no real point to do so. Once the unit is accessible to the mouse (on map or by help button in recruit dialog), all the info are already visible in sidebar, there is nothing to hide anymore. Also, I don't know what page you wanted to open, but it would be annoying to have a "404 page" when clicking on unit description. And 1.9 will make this worse, since elements from sidebar like type, race, abilities etc will be clickable to open related help pages.
Post Reply