本文整理汇总了Java中net.gtaun.shoebill.common.dialog.MsgboxDialog类的典型用法代码示例。如果您正苦于以下问题:Java MsgboxDialog类的具体用法?Java MsgboxDialog怎么用?Java MsgboxDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MsgboxDialog类属于net.gtaun.shoebill.common.dialog包,在下文中一共展示了MsgboxDialog类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onPlayerKeyStateChange
import net.gtaun.shoebill.common.dialog.MsgboxDialog; //导入依赖的package包/类
@Override
public void onPlayerKeyStateChange(PlayerKeyStateChangeEvent e) {
Player player = e.getPlayer();
playerLifecycle = EventSystem.getInstance().getPlayerLifecycleHolder().getObject(player, PlayerData.class);
EventData eventData = playerLifecycle.getCurrentEvent();
if(eventData.getState() == EventState.RUNNING) {
if(player.getKeyState().isKeyPressed(PlayerKey.CTRL_BACK)) {
if(!eventData.getDeadBodies().isEmpty()) {
TTTDeadBody deadBody = getDeadBodyInRange(player.getLocation(), eventData, 1.5f);
if(deadBody != null) {
if(!deadBody.isConfirmed()) {
if(!deadBody.isDialogOpened()) {
deadBodyDialog(player, deadBody, eventData);
}
else {
MsgboxDialog.create(player, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.get(player, "Dialog.NotAvailable"))
.message("{FF0000}" + localizedStringSet.get(player, "Event.Class.TTT.DeathBody.IsOpened"))
.buttonOk(localizedStringSet.get(player, "Dialog.Okay"))
.buttonCancel(localizedStringSet.get(player, "Dialog.Close"))
.build()
.show();
}
}
}
}
}
else {
if(eventData.getDataPlayerArray2().contains(player)) {
if(player.getKeyState().isKeyPressed(PlayerKey.NO)) {
TTTShop.show(player);
}
}
}
}
}
开发者ID:Alf21,项目名称:event-system,代码行数:37,代码来源:TTT.java
示例2: addToDialog
import net.gtaun.shoebill.common.dialog.MsgboxDialog; //导入依赖的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());
}
}
}
开发者ID:Alf21,项目名称:event-system,代码行数:46,代码来源:Catching.java
示例3: onStartFailed
import net.gtaun.shoebill.common.dialog.MsgboxDialog; //导入依赖的package包/类
@Override
public void onStartFailed(EventData eventData) {
Player player = eventData.getOwner();
if(eventData.getMission() == null) {
MsgboxDialog.create(player, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.get(player, "Event.Class.Missions.Start.Failed.NoMission.Caption"))
.message("{FF0000}" + localizedStringSet.get(player, "Event.Class.Missions.Start.Failed.NoMission.Message"))
.buttonCancel(localizedStringSet.get(player, "Dialog.Cancel"))
.buttonOk(localizedStringSet.get(player, "Dialog.Okay"))
.onClickOk((handler) -> EventBase.eventDialog(player))
.onClickCancel((handler) -> EventBase.eventDialog(player))
.build()
.show();
}
else {
MissionDescription missionDescription = MissionFunctions.getDescriptionForMission(eventData.getMission());
if (missionDescription != null) {
if(missionDescription.playerValueMin() > eventData.getPlayerList().size()+1 && missionDescription.playerValueMin() != -1) {
MsgboxDialog.create(player, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.get(player, "Event.Member.Memberlist"))
.message("{FF0000}" + localizedStringSet.get(player, "Event.Member.NotEnoughMembers"))
.buttonCancel(localizedStringSet.get(player, "Dialog.Cancel"))
.buttonOk(localizedStringSet.get(player, "Dialog.Okay"))
.onClickOk((handler) -> EventBase.eventDialog(player))
.onClickCancel((handler) -> EventBase.eventDialog(player))
.build()
.show();
}
else if(missionDescription.playerValueMax() < eventData.getPlayerList().size()+1 && missionDescription.playerValueMax() != -1) {
MsgboxDialog.create(player, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.get(player, "Event.Member.Memberlist"))
.message("{FF0000}" + localizedStringSet.get(player, "Event.Member.TooManyMembers"))
.buttonCancel(localizedStringSet.get(player, "Dialog.Cancel"))
.buttonOk(localizedStringSet.get(player, "Dialog.Okay"))
.onClickOk((handler) -> EventBase.eventDialog(player))
.onClickCancel((handler) -> EventBase.eventDialog(player))
.build()
.show();
}
}
try {
if(eventData.getMission() != null) {
((Mission) eventData.getMission().newInstance()).onStartFailed(eventData);
}
} catch (InstantiationException | IllegalAccessException e) {
System.out.println(e);
e.printStackTrace();
}
}
}
开发者ID:Alf21,项目名称:event-system,代码行数:52,代码来源:MissionBase.java
示例4: onStartFailed
import net.gtaun.shoebill.common.dialog.MsgboxDialog; //导入依赖的package包/类
/**
* do something if event is not able to start / the start fails
* @param eventData the event
*/
public static void onStartFailed(EventData eventData) {
Player player = eventData.getOwner();
if(eventData.getClz() != null) {
EventDescription eventDescription = EventFunctions.getDescriptionForEvent(eventData.getClz());
if (eventDescription != null) {
if(EventFunctions.getAllPlayers(eventData).size() > eventDescription.playerValueMax() && eventDescription.playerValueMax() != -1
|| EventFunctions.getAllPlayers(eventData).size() < eventDescription.playerValueMin() && eventDescription.playerValueMin() != -1) {
if(eventData.getPlayerList().isEmpty() && eventDescription.playerValueMin() > 1) {
MsgboxDialog.create(player, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.get(player, "Event.Member.Memberlist"))
.message("{FF0000}" + localizedStringSet.get(player, "Event.Member.NoMembers"))
.buttonCancel(localizedStringSet.get(player, "Dialog.Cancel"))
.buttonOk(localizedStringSet.get(player, "Dialog.Okay"))
.onClickOk((handler) -> dialog(player))
.onClickCancel((handler) -> dialog(player))
.build()
.show();
}
else if(eventDescription.playerValueMin() > eventData.getPlayerList().size()+1 && eventDescription.playerValueMin() != -1) {
MsgboxDialog.create(player, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.get(player, "Event.Member.Memberlist"))
.message("{FF0000}" + localizedStringSet.get(player, "Event.Member.NotEnoughMembers"))
.buttonCancel(localizedStringSet.get(player, "Dialog.Cancel"))
.buttonOk(localizedStringSet.get(player, "Dialog.Okay"))
.onClickOk((handler) -> dialog(player))
.onClickCancel((handler) -> dialog(player))
.build()
.show();
}
else if(eventDescription.playerValueMax() < eventData.getPlayerList().size()+1 && eventDescription.playerValueMax() != -1) {
MsgboxDialog.create(player, EventSystem.getInstance().getEventManagerInstance())
.caption("{FF8A05}" + localizedStringSet.get(player, "Event.Member.Memberlist"))
.message("{FF0000}" + localizedStringSet.get(player, "Event.Member.TooManyMembers"))
.buttonCancel(localizedStringSet.get(player, "Dialog.Cancel"))
.buttonOk(localizedStringSet.get(player, "Dialog.Okay"))
.onClickOk((handler) -> dialog(player))
.onClickCancel((handler) -> dialog(player))
.build()
.show();
}
}
else if(eventData.getLocation() == null) {
player.sendMessage(Color.YELLOW, localizedStringSet.get(player, "Event.Start.Failed.NoSpawn"));
}
else {
try {
if(eventData.getMap() == null && ((Event) eventData.getClz().newInstance()).dependsOnMaps()) {
player.sendMessage(Color.YELLOW, localizedStringSet.get(player, "Event.Start.Failed.NoMap"));
}
else {
((Event) eventData.getClz().newInstance()).onStartFailed(eventData);
}
} catch (InstantiationException | IllegalAccessException e) {
System.out.println(e);
e.printStackTrace();
}
}
}
}
}
开发者ID:Alf21,项目名称:event-system,代码行数:65,代码来源:EventBase.java
示例5: removeMemberDialog
import net.gtaun.shoebill.common.dialog.MsgboxDialog; //导入依赖的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());
}
开发者ID:Alf21,项目名称:event-system,代码行数:79,代码来源:EventBase.java
注:本文中的net.gtaun.shoebill.common.dialog.MsgboxDialog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论