LUA Option Menus

Discussion of Lua and LuaWML support, development, and ideas.

Moderators: Forum Moderators, Developers

Post Reply
User avatar
LordAwsomeness
Posts: 96
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

LUA Option Menus

Post by LordAwsomeness » October 5th, 2019, 12:57 pm

Hey all! How do you use lua for creating option menus such as:

Code: Select all

	[command]
	[message]
	speaker=narrator
	message=""
[option]
image=""
label=""
[/option]


	[/message]

	[/command]
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure

User avatar
Ravana
Forum Moderator
Posts: 2242
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: LUA Option Menus

Post by Ravana » October 5th, 2019, 1:01 pm

wesnoth.show_dialog is the powerful way.

You can still use wesnoth.wml_actions.message though.

User avatar
LordAwsomeness
Posts: 96
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: LUA Option Menus

Post by LordAwsomeness » October 6th, 2019, 1:34 pm

how would I use it to change the format of how options are displayed though? such as the photo below with the big box being the narrator and the smaller boxes being the options.
Attachments
forum.png
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure

User avatar
Ravana
Forum Moderator
Posts: 2242
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: LUA Option Menus

Post by Ravana » October 6th, 2019, 1:45 pm

T.row and T.column. Check wiki example.

User avatar
LordAwsomeness
Posts: 96
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: LUA Option Menus

Post by LordAwsomeness » October 6th, 2019, 1:58 pm

Thank you so much! Hope I can figure it out! Do you have a link to the wiki? Where would I find the wiki if not?
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure

User avatar
Pentarctagon
Forum Administrator
Posts: 4055
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: LUA Option Menus

Post by Pentarctagon » October 6th, 2019, 7:13 pm

The lua UI-related functions are on the wiki here.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

Post Reply