本文整理匯總了Java中cn.nukkit.form.window.FormWindowSimple類的典型用法代碼示例。如果您正苦於以下問題:Java FormWindowSimple類的具體用法?Java FormWindowSimple怎麽用?Java FormWindowSimple使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
FormWindowSimple類屬於cn.nukkit.form.window包,在下文中一共展示了FormWindowSimple類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: execute
import cn.nukkit.form.window.FormWindowSimple; //導入依賴的package包/類
@Override
public boolean execute(CommandSender player, String alias, String[] args) {
if (player instanceof Player) {
if (player.isOp()) {
final FormWindowSimple window = new FormWindowSimple("World Teleport UI", "Teleport to any world");
Map<Integer, Level> level = getPlugin().getServer().getLevels();
window.addButton(new ElementButton("Cancel"));
for (Level lvl : level.values()) {
window.addButton(new ElementButton(lvl.getFolderName()));
}
((Player) player).showFormWindow(window);
} else {
player.sendMessage(TextFormat.RED + "You have to be op to use this command!");
}
} else {
player.sendMessage(TextFormat.RED + "You can only use /hub in-game!");
}
return true;
}
示例2: addChallengesFormOverlay
import cn.nukkit.form.window.FormWindowSimple; //導入依賴的package包/類
public void addChallengesFormOverlay(Player player) {
FormWindowSimple panelIsland = new FormWindowSimple("Challenges Menu", getLocale(player).panelChallengesHeader);
for (String toButton : plugin.getChallenges().getChallengeConfig().getSection("challenges.challengeList").getKeys(false)) {
panelIsland.addButton(new ElementButton(toButton));
}
int id = player.showFormWindow(panelIsland);
panelDataId.put(id, PanelType.TYPE_CHALLENGES);
}
示例3: addHomeFormOverlay
import cn.nukkit.form.window.FormWindowSimple; //導入依賴的package包/類
public void addHomeFormOverlay(Player p) {
ArrayList<IslandData> listHome = plugin.getDatabase().getIslands(p.getName());
FormWindowSimple islandHome = new FormWindowSimple("Home list", getLocale(p).panelHomeHeader.replace("[function]", "teleport"));
for (IslandData pd : listHome) {
islandHome.addButton(new ElementButton(pd.getName()));
}
int id = p.showFormWindow(islandHome);
panelDataId.put(id, PanelType.TYPE_HOMES);
}