本文整理汇总了Java中net.gtaun.shoebill.common.dialog.ListDialogItem类的典型用法代码示例。如果您正苦于以下问题:Java ListDialogItem类的具体用法?Java ListDialogItem怎么用?Java ListDialogItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ListDialogItem类属于net.gtaun.shoebill.common.dialog包,在下文中一共展示了ListDialogItem类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: chooseCatcher
import net.gtaun.shoebill.common.dialog.ListDialogItem; //导入依赖的package包/类
/**
* dialog of choosing a catcher
* @param eventData the event
*/
private static void chooseCatcher(EventData eventData) {
Player player = eventData.getOwner();
ListDialog hunterDialog = ListDialog.create(player, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.get(player, "Event.Class.Catching.Catcher.Choose"))
.buttonOk(localizedStringSet.get(player, "Dialog.Choose"))
.buttonCancel(localizedStringSet.get(player, "Dialog.Back"))
.onClickCancel((handler) -> EventBase.settingsDialog(eventData))
.build();
ArrayList<Player> allEventMembers = eventData.getPlayerList().stream().collect(Collectors.toCollection(ArrayList::new));
allEventMembers.add(player);
EventFunctions.sortPlayerlist(allEventMembers);
for (Player pl : allEventMembers) {
hunterDialog.getItems().add(ListDialogItem.create()
.itemText(pl.getName().equals("")?"{FF0000}" + localizedStringSet.get(player, "Dialog.Error.Error"):(eventData.getDataPlayerArray2().contains(pl)?("{00FF00}"+pl.getName()):("{FF0000}"+pl.getName())))
.onSelect((listDialogItem2, o2) -> {
String playerString = listDialogItem2.getItemText().split("\\}")[1];
Player target = Player.get(playerString);
if(target != null) {
if(eventData.getDataPlayerArray2().contains(target))
unsetCatcher(eventData, target);
else setCatcher(eventData, target);
}
chooseCatcher(eventData);
})
.build());
}
hunterDialog.show();
}
示例2: show
import net.gtaun.shoebill.common.dialog.ListDialogItem; //导入依赖的package包/类
public static void show(Player player) {
PlayerData playerLifecycle = EventSystem.getInstance().getPlayerLifecycleHolder().getObject(player, PlayerData.class);
EventData eventData = playerLifecycle.getCurrentEvent();
if(eventData != null) {
TabListDialog traitorShop = TabListDialog.create(player, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.get(player, "Event.Class.TTT.Shop.Shop") + " - " + playerLifecycle.getEventPoints() + localizedStringSet.get(player, "Event.Class.TTT.Shop.Money"))
.buttonOk(localizedStringSet.get(player, "Dialog.Choose"))
.buttonCancel(localizedStringSet.get(player, "Dialog.Back"))
.header(0, localizedStringSet.get(player, "Event.Class.TTT.Shop.Object"))
.header(1, localizedStringSet.get(player, "Event.Class.TTT.Shop.Price") + " (" + localizedStringSet.get(player, "Event.Class.TTT.Shop.Money") + ")")
.build();
if(!playerLifecycle.getTraitorShop().getOrDefault("GPS", false)) {
traitorShop.addItem(TabListDialogItem.create()
.column(0, ListDialogItem.create().itemText("GPS").build())
.column(1, ListDialogItem.create().itemText("1 " + localizedStringSet.get(player, "Event.Class.TTT.Shop.Money")).build())
.onSelect((listDialogItem2, o2) -> {
if(playerLifecycle.getEventPoints() >= 1) {
playerLifecycle.getTraitorShop().put("GPS", true);
playerLifecycle.setEventPoints(playerLifecycle.getEventPoints()-1);
}
else {
player.sendMessage(Color.YELLOW, localizedStringSet.get(player, "Event.Class.TTT.Shop.MorePoints"));
}
})
.build());
}
traitorShop.show();
}
}
示例3: addToDialog
import net.gtaun.shoebill.common.dialog.ListDialogItem; //导入依赖的package包/类
@Override
public void addToDialog(Player player, ListDialog dialog) {
playerLifecycle = EventSystem.getInstance().getPlayerLifecycleHolder().getObject(player, PlayerData.class);
EventData eventData = playerLifecycle.getCurrentEvent();
if(eventData != null) {
if(eventData.getState() == EventState.RUNNING) {
dialog.getItems().add(ListDialogItem.create()
.itemText(localizedStringSet.get(player, "Event.Class.Catching.Catchinglist.Catchinglist"))
.onSelect((listDialogItem, o) -> {
ListDialog catchDialog = ListDialog.create(player, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.format(player, "Event.Class.Catching.Catcher.CatchedByHunters", EventFunctions.arrayToString(eventData.getDataPlayerArray2())))
.buttonOk(localizedStringSet.get(player, "Dialog.Okay"))
.buttonCancel(localizedStringSet.get(player, "Dialog.Back"))
.onClickCancel((handler) -> EventBase.eventDialog(player))
.build();
ArrayList<Player> eventDataPlayerArray = eventData.getDataPlayerArray();
EventFunctions.sortPlayerlist(eventDataPlayerArray);
if(!eventDataPlayerArray.isEmpty()) {
for (Player pl : eventDataPlayerArray) {
catchDialog.getItems().add(ListDialogItem.create()
.itemText(((pl.getName().equals("")) ? ("") : (pl.getName())))
.onSelect((listDialogItem2, o2) -> {
EventBase.eventDialog(player);
})
.build());
}
catchDialog.show();
}
else {
MsgboxDialog.create(player, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.get(player, "Event.Class.Catching.Finish.Finished"))
.message("{FF0000}" + localizedStringSet.format(player, "Event.Class.Catching.Finish.Message", EventFunctions.arrayToString(eventData.getDataPlayerArray2())))
.buttonOk(localizedStringSet.get(player, "Dialog.Okay"))
.buttonCancel(localizedStringSet.get(player, "Dialog.Back"))
.onClickOk((handler) -> EventBase.eventDialog(player))
.onClickCancel((handler) -> EventBase.eventDialog(player))
.build()
.show();
}
})
.build());
}
}
}
示例4: removeMemberDialog
import net.gtaun.shoebill.common.dialog.ListDialogItem; //导入依赖的package包/类
/**
* dialog to select members who should be removed
* @param player the player
* @param eventData the event
* @param settingsDialog the settingsdialog of main dialog
*/
private static void removeMemberDialog(Player player, EventData eventData, ListDialog settingsDialog) {
settingsDialog.getItems().add(ListDialogItem.create()
.itemText(localizedStringSet.get(player, "Event.Remove.Member"))
.onSelect((listDialogItem, o) -> {
ListDialog memberDialog = ListDialog.create(player, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.get(player, "Event.Remove.SelectMember"))
.buttonOk(localizedStringSet.get(player, "Dialog.Remove"))
.buttonCancel(localizedStringSet.get(player, "Dialog.Back"))
.onClickCancel((handler) -> EventBase.settingsDialog(eventData))
.build();
if(!eventData.getPlayerList().isEmpty()) {
ArrayList<Player> members = eventData.getPlayerList();
EventFunctions.sortPlayerlist(members);
for (Player pl : members) {
memberDialog.getItems().add(ListDialogItem.create()
.itemText(((pl.getName().equals("")) ? ("") : (pl.getName())))
.onSelect((listDialogItem2, o2) -> {
Player target = Player.get(listDialogItem2.getItemText());
if(target != null) {
MsgboxDialog.create(player, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.get(player, "Event.Remove.Caption"))
.message("{FFFF00}" + localizedStringSet.format(player, "Event.Remove.Question", target.getName()))
.buttonOk(localizedStringSet.get(player, "Dialog.Yes"))
.buttonCancel(localizedStringSet.get(player, "Dialog.No"))
.onClickOk((handler) -> {
removePlayer(target);
MsgboxDialog.create(target, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.get(target, "Event.Remove.Removed.Removed"))
.message("{FF0000}" + localizedStringSet.get(target, "Event.Remove.Removed.Target"))
.buttonOk(localizedStringSet.get(target, "Dialog.Okay"))
.buttonCancel(localizedStringSet.get(target, "Dialog.Close"))
.build()
.show();
MsgboxDialog.create(player, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.get(player, "Event.Remove.Removed.Removed"))
.message("{00FF00}" + localizedStringSet.format(player, "Event.Remove.Removed.Owner", target.getName()))
.buttonOk(localizedStringSet.get(player, "Dialog.Okay"))
.buttonCancel(localizedStringSet.get(player, "Dialog.Close"))
.onClickOk((handler2) -> removeMemberDialog(player, eventData, settingsDialog))
.onClickCancel((handler2) -> removeMemberDialog(player, eventData, settingsDialog))
.build()
.show();
})
.onClickCancel((handler) -> memberDialog.show())
.build()
.show();
}
else {
settingsDialog.show();
}
})
.build());
}
memberDialog.show();
}
else {
MsgboxDialog.create(player, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.get(player, "Event.Member.Memberlist"))
.message("{FF0000}" + localizedStringSet.get(player, "Event.Member.NoMembers"))
.buttonOk(localizedStringSet.get(player, "Dialog.Okay"))
.buttonCancel(localizedStringSet.get(player, "Dialog.Back"))
.onClickOk((handler) -> EventBase.settingsDialog(eventData))
.onClickCancel((handler) -> EventBase.settingsDialog(eventData))
.build()
.show();
}
})
.build());
}