当前位置: 首页>>代码示例>>Java>>正文


Java MenuManager类代码示例

本文整理汇总了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);
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:27,代码来源:SingleplayerSaveDeleteMenu.java

示例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);
	}
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:19,代码来源:ClientAdapter.java

示例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);
  }
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:27,代码来源:AndroidCompatibility.java

示例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);
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:25,代码来源:SingleplayerSaveDeleteMenu.java

示例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);
  }
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:19,代码来源:ClientAdapter.java

示例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);
	}
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:28,代码来源:AndroidCompatibility.java

示例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
	}
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:12,代码来源:ClientAdapter.java


注:本文中的ethanjones.cubes.graphics.menu.MenuManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。