Can GUI2 tags be used directly in WML?
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.
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Can GUI2 tags be used directly in WML?
Is it possible to directly call [grid]/[helptip]/[tooltip]/etc in WML? Or can they only be used via wesnoth.show_dialog()? The wiki says show_dialog() is equivalent to [resolution], but then using [resolution] gives an error about it not being supported.
Also, since the wiki documentation for the widgets is rather sparse, is there anything that is essentially a popup box that can be dismissed by a click anywhere on the screen?
Also, since the wiki documentation for the widgets is rather sparse, is there anything that is essentially a popup box that can be dismissed by a click anywhere on the screen?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: Can GUI2 tags be used directly in WML?
I was looking for functions like this some time ago, but didnt found any. I think you cant make gui in wml. If none of developers will prove Im wrong, im going to write framework for this.
Re: Can GUI2 tags be used directly in WML?
Not that I know of, but I was considering the possibility to create a WML tag with lua that would add this possibility. Showing it should be a trivial thing to do. However, the callbacks are quite easy to manage. Should I try to create something like that for you (maybe with a callback support inferior equal to the possibilities in lua)?
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Can GUI2 tags be used directly in WML?
It's not a huge deal for me at least, since I can sort-of-mostly work around it like this:
but if there was a way to do it without a workaround, then obviously I'd rather do it that way. Honestly I'm more interested in the documentation, since right now the wiki on GUI2 tags is incomplete at best.
Code: Select all
[set_variables]
name="dialog_box"
[value]
[tooltip]
id="tooltip_large"
[/tooltip]
[helptip]
id="tooltip_large"
[/helptip]
[grid]
[row]
[column]
[grid]
[row]
[column]
horizontal_grow="true"
[listbox]
id="help_list"
[list_definition]
[row]
[column]
horizontal_grow="true"
[toggle_panel]
[grid]
[row]
[column]
horizontal_alignment="left"
[image]
id="help_list_icon"
[/image]
[/column]
[column]
[label]
id="help_list_label"
[/label]
[/column]
[/row]
[/grid]
[/toggle_panel]
[/column]
[/row]
[/list_definition]
[/listbox]
[/column]
[/row]
[row]
[column]
[grid]
[row]
[column]
[button]
id="ok"
label="OK"
[/button]
[/column]
[column]
[button]
id="cancel"
label="Cancel"
[/button]
[/column]
[/row]
[/grid]
[/column]
[/row]
[/grid]
[/column]
[column]
[image]
id="the_image"
[/image]
[/column]
[/row]
[/grid]
[/value]
[/set_variables]
[lua]
code=<<
local result = wesnoth.show_dialog(wesnoth.get_variable("dialog_box"), preshow, postshow)
>>
[/lua]
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
- Celtic_Minstrel
- Developer
- Posts: 2207
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Can GUI2 tags be used directly in WML?
There is currently no way to embed GUIWML inside ActionWML, unless of course you create a custom WML tag that invokes
wesnoth.show_dialog
.The config passed toPentarctagon wrote:The wiki says show_dialog() is equivalent to [resolution], but then using [resolution] gives an error about it not being supported.
wesnoth.show_dialog
is equivalent to the contents of a [resolution]
tag. The [resolution]
tag cannot be nested within itself, so naturally including one in the config passed to wesnoth.show_dialog
would be an error.If you're looking for a popup menu such as the resolution selector in preferences, that would be aPentarctagon wrote:Also, since the wiki documentation for the widgets is rather sparse, is there anything that is essentially a popup box that can be dismissed by a click anywhere on the screen?
[menu_button]
. Since the wiki documentation for GUIWML hasn't been updated for awhile, it may still be listed there as [combo_box]
instead, and if you were working in 1.12 you'd have to use that as well. For a popup with checkboxes, like addon types dropdown, it would be [multimenu_button]
, but there may be some problems with using those from Lua at the moment.