29.11.2015, 19:48
The new Dialog types of SAMP 0.3.7 can now be accessed via shoebill-common-1.2-SNAPSHOT.
You need to change / add the following in your pom.xml:
After that, you can create TabListDialogs with and without headers like this:
You can set 0-3 headers via the .header() function and add rows via the .item() function.
You will need to use TabListDialogItems instead of normal ListDialogItems. When using the TabListDialogItem, you can use .column() to set the content of column 0-3. The content will be a ListDialogItem and can be everything you can do with a ListDialogItem (also RadioItems etc.). You will want to add a handler via the .onSelect() method.
Here's a screenshot:
You need to change / add the following in your pom.xml:
Код:
<dependency> <groupId>net.gtaun</groupId> <artifactId>shoebill-common</artifactId> <version>1.2-SNAPSHOT</version> <type>jar</type> <scope>compile</scope> </dependency>
PHP код:
TabListDialog.create(player, eventManager)
.caption("My Dialog")
.buttonOk("Buy")
.buttonCancel("Cancel")
.header(0, "Weapon")
.header(1, "Price ($)")
.item(TabListDialogItem.create()
.column(0, ListDialogItem.create().itemText("Deagle").build())
.column(1, ListDialogItem.create().itemText("$500").build())
.onSelect((item, o) -> {
//Give player a Deagle
})
.build())
.item(TabListDialogItem.create()
.column(0, ListDialogItem.create().itemText("M4").build())
.column(1, ListDialogItem.create().itemText("$12000").build())
.onSelect((item1, o1) -> {
//Give player a m4
})
.build())
.build()
.show();
You will need to use TabListDialogItems instead of normal ListDialogItems. When using the TabListDialogItem, you can use .column() to set the content of column 0-3. The content will be a ListDialogItem and can be everything you can do with a ListDialogItem (also RadioItems etc.). You will want to add a handler via the .onSelect() method.
Here's a screenshot: