[theme]-hacking: status box and minimap

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
Zap-Zarap
Posts: 159
Joined: March 16th, 2015, 2:18 pm

[theme]-hacking: status box and minimap

Post by Zap-Zarap »

Hello.
I cannot find any information about this in the wiki, so probably it cannot be done.
Is it possible, to change the kind of information shown on minimap, e.g. make the units coding toggle show melee fighters in green and archers in blue and mages in red, or whatever? So:

1) Is minimap hackable? (with WML ofc, not C++)

Another slightly related question i have is concerning theme hacking as well:

2) Can i add some more top panel info boxes to display extra info?

I mean, e.g. if apart of turn number, villages, units, gold, income and upkeep, i wanted to display, let's say, the number of mages in an additional box?
How do i address such an extra box? I mean, i already achieved to add more boxes, but how can i (dynamically) put some content in?
I know how to make e.g. village box show the number of mage units instead of number of villages (or make gold box say "Hello World"). But these things are done by overwriting "wesnoth.theme-items.blah" behaviour, and those theme-items are restricted to the ones that already exist.---> NOT TRUE (see below)

I'm trying to code something for 1.12 still, but i've been reading somewhere, that for future versions it is planned to make display and theme issues more adaptable/changeable/hackable for UMC creators.. will the things i'm trying to do now be possible then?

"A boy can dream."
^_^

______________________________________________________________________
EDIT:
Meanwhile i could solve question 2) on my own. 8)
What caused misunderstandings on my side was the first sentence here (from http://wiki.wesnoth.org/ThemeWML):
Screenshot from wiki
Screenshot from wiki
Because that gave the impression to me, that one is restricted to the use of only these [status] and no others ("are recognized"), but that's not true:

You can add any new "status" of your own to your "my_theme.cfg" and access it easily via the usual wesnoth.theme_items.my_new_status code construct.

See here http://wiki.wesnoth.org/LuaWML/Display# ... heme_items for an example.

I added that here, in case someone has a similar problem somewhen in a future WML project.
I like beavers.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: [theme]-hacking: status box and minimap

Post by gfgtdf »

Iirc similar is also true for [menu]: you can add more items under items than the ones listed thwre if you add a custom handler (via [set_menu_item]). Not sure whether this information was useful.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Zap-Zarap
Posts: 159
Joined: March 16th, 2015, 2:18 pm

Re: [theme]-hacking: status box and minimap

Post by Zap-Zarap »

Thanks for posting, gfgtdf.
Yes that was useful, well it belongs to the same kind of issues, i mean, everything shown in top and side-panels on screen. All that is changeble/adaptable/extendable, which is nice for projects like the one that i'm planning, projects that involve things that exceed the normal Wesnoth.

The only thing that seems to be not acessible via WML is the minimap (see question 1 above). I am referring to its content, not size or aspect (the latter yes, can be changed in [theme] somewhere).
I like beavers.
User avatar
Zap-Zarap
Posts: 159
Joined: March 16th, 2015, 2:18 pm

Re: [theme]-hacking: status box and minimap

Post by Zap-Zarap »

For future generations, still trying to do stuff for 1.12.6, i've posted some code examples here:

http://forums.wesnoth.org/viewtopic.php ... 88#p616572

I'm wondering, if that example should go into Wiki somewhere, or if it is more logical to wait a little, and then update the Wiki to the according mechanisms in 1.14.x, once that is stable (or maybe 1.13.x)..
I like beavers.
Post Reply