本文整理汇总了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);
}
示例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);
}
示例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();
}
}
示例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())));
}
});
}
示例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())));
}
});
}
示例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);
}