10.11.2014, 15:08
@DrumYum:
You can use shoebill-common for easy dialog-creation. If you don't have shoebill-common in your project, you can use maven:
or download the newest library here:
http://ci.gtaun.net/job/shoebill-common/
And this is how you can create a InputDialog :
If you don't want to use shoebill-common, you can create a DialogId like this (not recommended):
You can use shoebill-common for easy dialog-creation. If you don't have shoebill-common in your project, you can use maven:
PHP код:
<dependency>
<groupId>net.gtaun</groupId>
<artifactId>shoebill-common</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
http://ci.gtaun.net/job/shoebill-common/
And this is how you can create a InputDialog :
PHP код:
InputDialog.create(player, rootEventManager)
.caption("Login for Player " + player.getName())
.message("Please enter the password for account " + player.getName())
.buttonCancel("Disconnect")
.buttonOk("Login")
.onClickOk((inputDialog, s) -> player.sendMessage(Color.ORANGE, "You entered the password " + s))
.onClickCancel(abstractDialog -> player.kick())
.build()
.show();
PHP код:
DialogId myDialog = DialogId.create();
//Or
DialogId myDialog2 = DialogId.create((dialogId, player1, i, i1, s) -> {
player1.sendMessage(Color.RED, "Response");
return true;
});