當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。