Update dialog javadoc and example

This commit is contained in:
md_5 2025-05-29 21:53:59 +10:00
parent 89e66ed648
commit bec329352d
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11
2 changed files with 9 additions and 9 deletions

View File

@ -23,12 +23,15 @@ Sample Plugin
Dialog notice = new NoticeDialog( new DialogBase( new ComponentBuilder( "Hello" ).color( ChatColor.RED ).build() ) ); Dialog notice = new NoticeDialog( new DialogBase( new ComponentBuilder( "Hello" ).color( ChatColor.RED ).build() ) );
player.showDialog( notice ); player.showDialog( notice );
notice = new SimpleInputFormDialog( notice = new NoticeDialog(
new DialogBase( new ComponentBuilder( "Hello" ).color( ChatColor.RED ).build() ), new DialogBase( new ComponentBuilder( "Hello" ).color( ChatColor.RED ).build() )
new DialogSubmitAction( "submit", new CustomFormSubmission( "customform" ), new ComponentBuilder( "Submit Button" ).build() ), .inputs(
new TextInput( "first", new ComponentBuilder( "First" ).build() ), Arrays.asList( new TextInput( "first", new ComponentBuilder( "First" ).build() ),
new TextInput( "second", new ComponentBuilder( "Second" ).build() ) new TextInput( "second", new ComponentBuilder( "Second" ).build() )
); )
) )
.action( new DynamicAction( new ComponentBuilder( "Submit Button" ).build(), new Custom( "customform" ) ) );
player.sendMessage( new ComponentBuilder( "click me" ).event( new ShowDialogClickEvent( notice ) ).build() ); player.sendMessage( new ComponentBuilder( "click me" ).event( new ShowDialogClickEvent( notice ) ).build() );
} }
} }

View File

@ -21,9 +21,6 @@ public class RunCommand extends DynamicType
* The template to be applied, where variables of the form * The template to be applied, where variables of the form
* <code>$(key)</code> will be replaced by their * <code>$(key)</code> will be replaced by their
* {@link net.md_5.bungee.api.dialog.input.DialogInput#key} value. * {@link net.md_5.bungee.api.dialog.input.DialogInput#key} value.
* <br>
* The <code>action</code> key is special and will be replaced with the
* {@link net.md_5.bungee.api.dialog.action.DialogSubmitAction#id}.
*/ */
@NonNull @NonNull
private String template; private String template;