本文整理汇总了Java中ethanjones.cubes.graphics.menu.MenuManager类的典型用法代码示例。如果您正苦于以下问题:Java MenuManager类的具体用法?Java MenuManager怎么用?Java MenuManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MenuManager类属于ethanjones.cubes.graphics.menu包,在下文中一共展示了MenuManager类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SingleplayerSaveDeleteMenu
import ethanjones.cubes.graphics.menu.MenuManager; //导入依赖的package包/类
public SingleplayerSaveDeleteMenu(final Save save) {
title = new Label(Localization.get("menu.singleplayer.delete.title"),
skin.get("title", Label.LabelStyle.class));
text = new Label(Localization.get("menu.singleplayer.delete.text", save.name), skin);
delete = new TextButton(Localization.get("menu.singleplayer.delete.delete", save.name), skin);
back = MenuTools.getBackButton(this);
text.setAlignment(Align.center);
delete.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
ClientSaveManager.deleteSave(save);
Menu prev = MenuManager.getPrevious(SingleplayerSaveDeleteMenu.this);
if (!(prev instanceof SingleplayerSavesMenu))
return;
((SingleplayerSavesMenu) prev).updateSavesList();
Adapter.setMenu(prev);
}
});
stage.addActor(title);
stage.addActor(text);
stage.addActor(delete);
stage.addActor(back);
}
示例2: setMenu
import ethanjones.cubes.graphics.menu.MenuManager; //导入依赖的package包/类
@Override
public void setMenu(Menu menu) {
// CubesSecurity.checkSetMenu();
Menu old = this.menu;
if (old != null) {
old.save();
InputChain.hideMenu(old);
}
this.menu = menu;
if (menu != null) {
Log.debug("Menu set to " + menu.getClass().getSimpleName());
MenuManager.setMenu(menu);
setupMenu.set(true);
} else {
Log.debug("Menu set to null");
setupMenu.set(false);
}
}
示例3: update
import ethanjones.cubes.graphics.menu.MenuManager; //导入依赖的package包/类
@Override
public void update() {
if (back) {
back = false;
Menu current = Adapter.getMenu();
if (current instanceof MainMenu) {
Adapter.quit();
return;
}
if (current instanceof PauseMenu) {
Adapter.gotoMainMenu();
return;
}
if (Cubes.getClient() != null || Cubes.getServer() != null || current == null) {
Adapter.setMenu(new PauseMenu());
return;
}
Menu prev = MenuManager.getPrevious(current);
if (prev == null) return;
Adapter.setMenu(prev);
}
}
示例4: SingleplayerSaveDeleteMenu
import ethanjones.cubes.graphics.menu.MenuManager; //导入依赖的package包/类
public SingleplayerSaveDeleteMenu(final Save save) {
title = new Label(Localization.get("menu.singleplayer.delete.title"), skin.get("title", Label.LabelStyle.class));
text = new Label(Localization.get("menu.singleplayer.delete.text", save.name), skin);
delete = new TextButton(Localization.get("menu.singleplayer.delete.delete", save.name), skin);
back = MenuTools.getBackButton(this);
text.setAlignment(Align.center);
delete.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
ClientSaveManager.deleteSave(save);
Menu prev = MenuManager.getPrevious(SingleplayerSaveDeleteMenu.this);
if (!(prev instanceof SingleplayerSavesMenu)) return;
((SingleplayerSavesMenu) prev).updateSavesList();
Adapter.setMenu(prev);
}
});
stage.addActor(title);
stage.addActor(text);
stage.addActor(delete);
stage.addActor(back);
}
示例5: setMenu
import ethanjones.cubes.graphics.menu.MenuManager; //导入依赖的package包/类
@Override
public void setMenu(Menu menu) {
//CubesSecurity.checkSetMenu();
Menu old = this.menu;
if (old != null) {
old.save();
InputChain.hideMenu(old);
}
this.menu = menu;
if (menu != null) {
Log.debug("Menu set to " + menu.getClass().getSimpleName());
MenuManager.setMenu(menu);
setupMenu.set(true);
} else {
Log.debug("Menu set to null");
setupMenu.set(false);
}
}
示例6: update
import ethanjones.cubes.graphics.menu.MenuManager; //导入依赖的package包/类
@Override
public void update() {
if (back) {
back = false;
Menu current = Adapter.getMenu();
if (current instanceof MainMenu) {
Adapter.quit();
return;
}
if (current instanceof PauseMenu) {
Adapter.gotoMainMenu();
return;
}
if (Cubes.getClient() != null || Cubes.getServer() != null || current == null) {
Adapter.setMenu(new PauseMenu());
return;
}
Menu prev = MenuManager.getPrevious(current);
if (prev == null)
return;
Adapter.setMenu(prev);
}
}
示例7: renderIf2
import ethanjones.cubes.graphics.menu.MenuManager; //导入依赖的package包/类
private void renderIf2(){
if (menu != null) {
if (setupMenu.getAndSet(false)) {
menu.resize(Graphics.GUI_WIDTH, Graphics.GUI_HEIGHT);
InputChain.showMenu(menu);
}
if (menu.shouldRenderBackground())
MenuManager.renderBackground();
menu.render(); // Render menu over client
}
}