[solved] two [grid] tags
Moderator: Forum Moderators
- ZombieKnight
- Posts: 249
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
[solved] two [grid] tags
Hi
Can I put two [grid] tags insto my custom dialog?
(So they are on top of each other)
Can I put two [grid] tags insto my custom dialog?
(So they are on top of each other)
Last edited by ZombieKnight on April 27th, 2024, 2:43 pm, edited 1 time in total.
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- Celtic_Minstrel
- Developer
- Posts: 2273
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: two [grid] tags
That's what
[stacked_widget]
is for.- ZombieKnight
- Posts: 249
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: two [grid] tags
Thanks!
I can't find it in wiki...
I can't find it in wiki...
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
-
- Posts: 1280
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: two [grid] tags
Your installation should have data/gui/widget/addon_list.cfg which uses it.
It looks like a stacked_widget contains layers, and each layer is something that looks like a grid.
It looks like a stacked_widget contains layers, and each layer is something that looks like a grid.
Speak softly, and carry Doombringer.
- Celtic_Minstrel
- Developer
- Posts: 2273
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: two [grid] tags
The default mode of a stacked widget is to stack its layers on top of one another. A lot of actual uses of it instead use it as a way to swap between different layers, showing only one layer at a time. I'm not sure if there's an example of its intended use in mainline. On the other hand, it's probably easier to use it that way compared to most of the mainline uses anyway.
- ZombieKnight
- Posts: 249
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: two [grid] tags
What do you mean?white_haired_uncle wrote: ↑April 26th, 2024, 4:52 am Your installation should have data/gui/widget/addon_list.cfg which uses it.
I have my add-on om different place.
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- ZombieKnight
- Posts: 249
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: two [grid] tags
[story]?Celtic_Minstrel wrote: ↑April 26th, 2024, 4:57 am The default mode of a stacked widget is to stack its layers on top of one another. A lot of actual uses of it instead use it as a way to swap between different layers, showing only one layer at a time. I'm not sure if there's an example of its intended use in mainline. On the other hand, it's probably easier to use it that way compared to most of the mainline uses anyway.
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
-
- Posts: 1280
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: two [grid] tags
I mean relative to wherever you have wesnoth installed. For exampleZombieKnight wrote: ↑April 26th, 2024, 5:00 amWhat do you mean?white_haired_uncle wrote: ↑April 26th, 2024, 4:52 am Your installation should have data/gui/widget/addon_list.cfg which uses it.
I have my add-on om different place.
Code: Select all
/usr/share/games/wesnoth/1.16/data/gui/widget/addon_list.cfg
Code: Select all
$ locate addon_list.cfg
Speak softly, and carry Doombringer.
- ZombieKnight
- Posts: 249
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: two [grid] tags
Ok, where should I look for examples?
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
-
- Posts: 1280
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: two [grid] tags
Do you have any examples of it being used?Celtic_Minstrel wrote: ↑April 26th, 2024, 4:57 am The default mode of a stacked widget is to stack its layers on top of one another. A lot of actual uses of it instead use it as a way to swap between different layers, showing only one layer at a time. I'm not sure if there's an example of its intended use in mainline. On the other hand, it's probably easier to use it that way compared to most of the mainline uses anyway.
Looking at the public member functions I think I have an idea of more or less what should be supported by the API. I tried wesnoth.print_attributes(), but I'm dumping core at the moment.
Speak softly, and carry Doombringer.
- Celtic_Minstrel
- Developer
- Posts: 2273
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: two [grid] tags
I'm not aware of any examples of it being used outside of mainline. In mainline it's used in the following windows:
addon_list
mp_create_game
addon_manager
campaign_dialog
campaign_difficulty
game_stats
game_version
mp_create_game
preferences
server_info
story_viewer
title_screen
It's also used in a number of others for a hack that forces a widget to have a minimum size (that is, to prevent a widget from getting any smaller than the specified size). There's a macro in core that implements this hack, GUI_FORCE_WIDGET_MINIMUM_SIZE.
addon_list
mp_create_game
addon_manager
campaign_dialog
campaign_difficulty
game_stats
game_version
mp_create_game
preferences
server_info
story_viewer
title_screen
It's also used in a number of others for a hack that forces a widget to have a minimum size (that is, to prevent a widget from getting any smaller than the specified size). There's a macro in core that implements this hack, GUI_FORCE_WIDGET_MINIMUM_SIZE.
- ZombieKnight
- Posts: 249
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: two [grid] tags
How do you show two layers at once?
Putting there:
Shows only the first defined layer
Putting there:
Code: Select all
T.grid {
T.row {
T.column {
T.stacked_widget{
id = "narration",
definition = "default",
T.layer{...},
T.layer{...}
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
-
- Posts: 1280
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: two [grid] tags
That sounds like exactly what I wanted it for. I was thinking if I used blank.png scaled to some size one on layer, then my actual data (on a different layer) couldn't be shrunk to near useless by another row which I can't seem to stop from growing out of control (described as issue#2 at):Celtic_Minstrel wrote: ↑April 26th, 2024, 1:59 pm
It's also used in a number of others for a hack that forces a widget to have a minimum size (that is, to prevent a widget from getting any smaller than the specified size). There's a macro in core that implements this hack, GUI_FORCE_WIDGET_MINIMUM_SIZE.
viewtopic.php?t=58000
I'll have to look into that macro and see if I can do anything with it.
I found .cfg files that use stacked_widget, but I was hoping to find corresponding lua files that manipulate the widget so I could determine of its properties (select_layer(s), layer_selected, etc).
Speak softly, and carry Doombringer.
- ZombieKnight
- Posts: 249
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: two [grid] tags
That's what I'm looking for... how to select layers?
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
-
- Posts: 1280
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: two [grid] tags
I don't know, but I did figure out thatZombieKnight wrote: ↑April 26th, 2024, 2:41 pm How do you show two layers at once?
Putting there:Shows only the first defined layerCode: Select all
T.grid { T.row { T.column { T.stacked_widget{ id = "narration", definition = "default", T.layer{...}, T.layer{...}
dialog.narration.selected_index=2
would cause it to display your second layer INSTEAD of the first.
And now I'm wondering if you can use something like dialog.narration:add_item() to add layers. Completely off topic, but I either mess with that or mow the lawn.
Speak softly, and carry Doombringer.