本文整理汇总了Java中ethanjones.cubes.graphics.menu.Menu类的典型用法代码示例。如果您正苦于以下问题:Java Menu类的具体用法?Java Menu怎么用?Java Menu使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Menu类属于ethanjones.cubes.graphics.menu包,在下文中一共展示了Menu类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SingleplayerSaveDeleteMenu
import ethanjones.cubes.graphics.menu.Menu; //导入依赖的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.Menu; //导入依赖的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: dispose
import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
public static void dispose() {
Log.debug("Disposing adapter");
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
Gdx.app.exit();
}
});
final Menu menu = adapter.getMenu();
try {
if (menu != null) {
menu.save();
InputChain.hideMenu(menu);
}
} catch (Exception e) {
Debug.crash(e);
}
stop();
stopBackground();
}
示例4: gotoMenu
import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
/**
* Will exit if server
*/
public static void gotoMenu(final Menu menu) {
if (isDedicatedServer())
quit();
if (menu == null || adapter.getMenu() instanceof RunnableMenu || menu.getClass().isInstance(adapter.getMenu()))
return;
adapter.setMenu(new RunnableMenu(new Runnable() {
@Override
public void run() {
if (adapter.getClient() == null && adapter.getServer() == null) {
adapter.setMenu(menu);
}
}
}));
stop();
}
示例5: update
import ethanjones.cubes.graphics.menu.Menu; //导入依赖的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);
}
}
示例6: SingleplayerSaveDeleteMenu
import ethanjones.cubes.graphics.menu.Menu; //导入依赖的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);
}
示例7: setMenu
import ethanjones.cubes.graphics.menu.Menu; //导入依赖的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);
}
}
示例8: dispose
import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
public static void dispose() {
Log.debug("Disposing adapter");
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
Gdx.app.exit();
}
});
final Menu menu = adapter.getMenu();
try {
if (menu != null) {
menu.save();
InputChain.hideMenu(menu);
}
} catch (Exception e) {
Debug.crash(e);
}
stop();
stopBackground();
}
示例9: update
import ethanjones.cubes.graphics.menu.Menu; //导入依赖的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);
}
}
示例10: gotoMenu
import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
/**
* Will exit if server
*/
public static void gotoMenu(final Menu menu) {
if (isDedicatedServer()) quit();
if (menu == null || adapter.getMenu() instanceof RunnableMenu || menu.getClass().isInstance(adapter.getMenu())) return;
adapter.setMenu(new RunnableMenu(new Runnable() {
@Override
public void run() {
if (adapter.getClient() == null && adapter.getServer() == null) {
adapter.setMenu(menu);
}
}
}));
stop();
}
示例11: getSkin
import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
@Override
public Skin getSkin() {
return Menu.skin;
}
示例12: showMenu
import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
public static void showMenu(Menu menu) {
inputMultiplexer.addProcessor(0, menu.stage);
if (menu.blockClientInput())
InputBlocker.BLOCK_INPUT = true;
}
示例13: hideMenu
import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
public static void hideMenu(Menu menu) {
inputMultiplexer.removeProcessor(menu.stage);
InputBlocker.BLOCK_INPUT = false;
}
示例14: setMenu
import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
@Override
public void setMenu(Menu menu) throws UnsupportedOperationException {
//throw new UnsupportedOperationException("Cannot set menu");
}
示例15: getMenu
import ethanjones.cubes.graphics.menu.Menu; //导入依赖的package包/类
@Override
public Menu getMenu() {
return null;
}