1.13.8 recruit menu customizing

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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.

1.13.8 recruit menu customizing

Postby Zap-Zarap » September 3rd, 2017, 12:50 pm

As gfgtdf recommended here https://forums.wesnoth.org/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.
User avatar
Zap-Zarap
 
Posts: 118
Joined: March 16th, 2015, 2:18 pm

Re: 1.13.8 recruit menu customizing

Postby gfgtdf » September 3rd, 2017, 5:11 pm

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.
gfgtdf
Developer
 
Posts: 912
Joined: February 10th, 2013, 2:25 pm

Re: 1.13.8 recruit menu customizing

Postby Zap-Zarap » September 3rd, 2017, 5:25 pm

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.
User avatar
Zap-Zarap
 
Posts: 118
Joined: March 16th, 2015, 2:18 pm


Return to WML Workshop

Who is online

Users browsing this forum: Bing [Bot] and 2 guests