1.13.8 recruit menu customizing

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

1.13.8 recruit menu customizing

Post by Zap-Zarap »

As gfgtdf recommended here viewtopic.php?f=21&t=46322&start=15#p616541 I'm trying to use the new unit_preview_pane.
Now some questions arise:

Alignment and race are shown as small icons in the new recruit menu... unit_preview_pane.cfg says:

Code: Select all

[column]
    ......
    [image]
        id = "type_alignment"
    [/image]
[/column]

[column]
    ......
    [image]
        id = "type_race"
    [/image]
[/column]
But in the various .cfg of the units, this is simply e.g.

Code: Select all

alignment=chaotic
How can i do now, so that the icons are shown? Do i need to check the alignment by myself manually in a [switch] or something, and then set the path to the right icon image? Where are those icons, i couldn't find them in 1.13.8 core/images folders? Or is this substitution done automatically somehow?

In short: what do i write into my wesnoth.set_dialog_value(...)? :hmm:

Is there some example somewhere, where i could see how to use the unit_preview_pane?

Thanks.
I like beavers.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: 1.13.8 recruit menu customizing

Post by gfgtdf »

Zap-Zarap wrote:
In short: what do i write into my wesnoth.set_dialog_value(...)? :hmm:
You give the unit object or unit type, for example:
wesnoth.set_dialog_value(wesnoth.unit_types["Lich"], "unit_preview_pane_id") for unit types or wesnoth.set_dialog_value(wesnoth.get_unit(8,3), "unit_preview_pane_id") to show the unit that stands at (8,3). (Assuming you have a unit_preview_pane with the id 'unit_preview_pane_id' at toplevel of your dialog)
Zap-Zarap wrote: Is there some example somewhere, where i could see how to use the unit_preview_pane?

Thanks.
My addon "Pick Your recruits no preperation turn" uses unit_preview_pane if you download it from the 1.13.8 addon server.
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: 1.13.8 recruit menu customizing

Post by Zap-Zarap »

gfgtdf wrote:
My addon "Pick Your recruits no preperation turn" uses unit_preview_pane.
Great. I'm sure i can get every information i need from that example.
Thank you for the valuable hint.
I like beavers.
Post Reply