[GUI] Listbox questions
Moderator: Forum Moderators
[GUI] Listbox questions
I work on stable Wesnoth version. I can't change to dev now, becouse i face there of lot of strange errors in code, that on stable works perfect.
1. How can I set listbox variables? I'm trying like this:
But does not work.
2. How can I delete all items from listbox?
3. I have situation where one listbox is that player chooses from. Rest of listbox, should reload any time selection in first listbox changes. They are only for info purpose. How can I make them unselectable or imitate listbox with unselectable components (but i want to use listbox features like header) ? I tought of solution like: change minimum selected items to 0, use something like this in callback: wesnoth.set_dialog_value(nill, "the_list").
1. How can I set listbox variables? I'm trying like this:
Code: Select all
T.listbox {
id = "the_list",
has_minimum = false,
T.list_definition...
2. How can I delete all items from listbox?
3. I have situation where one listbox is that player chooses from. Rest of listbox, should reload any time selection in first listbox changes. They are only for info purpose. How can I make them unselectable or imitate listbox with unselectable components (but i want to use listbox features like header) ? I tought of solution like: change minimum selected items to 0, use something like this in callback: wesnoth.set_dialog_value(nill, "the_list").
Re: [GUI] Listbox questions
1. I think has_minimum is not a key recognized by the API. Otherwise, the id = key is set correctly.
2. 1.13 has a wesnoth.remove_dialog_item() function, but that is not in 1.12 (stable). I'm not sure how to delete items otherwise.
3. You should try a listbox without the toggle_panel sub-widget.
2. 1.13 has a wesnoth.remove_dialog_item() function, but that is not in 1.12 (stable). I'm not sure how to delete items otherwise.
3. You should try a listbox without the toggle_panel sub-widget.
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
Re: [GUI] Listbox questions
vultraz wrote:1. I think has_minimum is not a key recognized by the API. Otherwise, the id = key is set correctly.
2. 1.13 has a wesnoth.remove_dialog_item() function, but that is not in 1.12 (stable). I'm not sure how to delete items otherwise.
3. You should try a listbox without the toggle_panel sub-widget.
1. Here: https://wiki.wesnoth.org/GUIWidgetInstanceWML#Listbox
3. Listbox can contain only toggle_panels and buttons.
Re: [GUI] Listbox questions
Hmm even it if supports it somehow it doent mean it is for example tested to work with the lua api which was afaik written with the asumption that listbox have exactly one selected element. So, you can test it but i wouldnt be too suprised i it doesn't work very well.Smok wrote:
1. Here: https://wiki.wesnoth.org/GUIWidgetInstanceWML#Listbox
In 1.13 you coudl try to use treeviews, they have similar functionality to listboxes but can contain different type of elements, so you coudl define a 'selectable' and a 'non-selectable' node type.
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.