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


Java ClientSaveManager类代码示例

本文整理汇总了Java中ethanjones.cubes.world.client.ClientSaveManager的典型用法代码示例。如果您正苦于以下问题:Java ClientSaveManager类的具体用法?Java ClientSaveManager怎么用?Java ClientSaveManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ClientSaveManager类属于ethanjones.cubes.world.client包,在下文中一共展示了ClientSaveManager类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SingleplayerSaveDeleteMenu

import ethanjones.cubes.world.client.ClientSaveManager; //导入依赖的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: SingleplayerSaveDeleteMenu

import ethanjones.cubes.world.client.ClientSaveManager; //导入依赖的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

示例3: updateSavesList

import ethanjones.cubes.world.client.ClientSaveManager; //导入依赖的package包/类
public void updateSavesList() {
  listLabel.setItems(ClientSaveManager.getSaves());
  if (listLabel.getItems().size > 0) {
    noSaves.setVisible(false);
    noSaves.toBack();
  } else {
    noSaves.setVisible(true);
    noSaves.toFront();
  }
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:11,代码来源:SingleplayerSavesMenu.java

示例4: SingleplayerTemporarySaveMenu

import ethanjones.cubes.world.client.ClientSaveManager; //导入依赖的package包/类
public SingleplayerTemporarySaveMenu() {
	title.setText(Localization.get("menu.singleplayer.create.temporary_title"));
	name.setVisible(false);

	start.removeListener(startListener);
	start.addListener(new ChangeListener() {
		@Override
		public void changed(ChangeEvent event, Actor actor) {
			Adapter.setMenu(new SingleplayerLoadingMenu(ClientSaveManager
					.createTemporarySave(generator.getSelected().id, mode.getSelected(), seed.getText())));
		}
	});
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:14,代码来源:SingleplayerTemporarySaveMenu.java

示例5: SingleplayerTemporarySaveMenu

import ethanjones.cubes.world.client.ClientSaveManager; //导入依赖的package包/类
public SingleplayerTemporarySaveMenu() {
  title.setText(Localization.get("menu.singleplayer.create.temporary_title"));
  name.setVisible(false);
  
  start.removeListener(startListener);
  start.addListener(new ChangeListener() {
    @Override
    public void changed(ChangeEvent event, Actor actor) {
      Adapter.setMenu(new SingleplayerLoadingMenu(ClientSaveManager.createTemporarySave(generator.getSelected().id, mode.getSelected(), seed.getText())));
    }
  });
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:13,代码来源:SingleplayerTemporarySaveMenu.java

示例6: SingleplayerSaveCreateMenu

import ethanjones.cubes.world.client.ClientSaveManager; //导入依赖的package包/类
public SingleplayerSaveCreateMenu() {
  super();
  title = new Label(Localization.get("menu.singleplayer.create.title"), skin.get("title", Label.LabelStyle.class));
  name = new TextField("", skin);
  name.setMessageText(Localization.get("menu.singleplayer.create.name"));
  name.setTextFieldFilter(new TextField.TextFieldFilter() {
    @Override
    public boolean acceptChar(TextField textField, char c) {
      return c >= 0x20 && c < 0x7F;
    }
  });

  generator = new SelectBox<SaveTypeDisplay>(skin);
  String[] types = GeneratorManager.ids();
  SaveTypeDisplay[] display = new SaveTypeDisplay[types.length];
  for (int i = 0; i < types.length; i++) {
    display[i] = new SaveTypeDisplay(types[i]);
  }
  generator.setItems(display);

  mode = new SelectBox<Gamemode>(skin);
  mode.setItems(Gamemode.values());

  seed = new TextField("", skin);
  seed.setMessageText(Localization.get("menu.singleplayer.create.seed"));

  start = new TextButton(Localization.get("menu.singleplayer.create.start"), skin);
  back = MenuTools.getBackButton(this);

  start.addListener(startListener = new ChangeListener() {
    @Override
    public void changed(ChangeEvent event, Actor actor) {
      Adapter.setMenu(new SingleplayerLoadingMenu(ClientSaveManager.createSave(name.getText(), generator.getSelected().id, mode.getSelected(), seed.getText())));
    }
  });

  stage.addActor(title);
  stage.addActor(name);
  stage.addActor(generator);
  stage.addActor(mode);
  stage.addActor(seed);
  stage.addActor(start);
  stage.addActor(back);
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:45,代码来源:SingleplayerSaveCreateMenu.java


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