本文整理汇总了Java中ethanjones.cubes.core.localization.Localization类的典型用法代码示例。如果您正苦于以下问题:Java Localization类的具体用法?Java Localization怎么用?Java Localization使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Localization类属于ethanjones.cubes.core.localization包,在下文中一共展示了Localization类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ServerSetupMenu
import ethanjones.cubes.core.localization.Localization; //导入依赖的package包/类
public ServerSetupMenu(final Save save) {
super();
title = new Label(Localization.get("menu.server.title"), skin.get("title", Label.LabelStyle.class));
saveLabel = new Label(Localization.get("menu.server.save", save.name), skin);
saveLabel.setAlignment(Align.center);
port = new TextField("", skin);
port.setMessageText(Localization.get("menu.server.port", Settings.getIntegerSettingValue(Settings.NETWORKING_PORT)));
port.setTextFieldFilter(new TextField.TextFieldFilter.DigitsOnlyFilter());
start = new TextButton(Localization.get("menu.server.start"), skin);
back = MenuTools.getBackButton(this);
start.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
int p = port.getText().isEmpty() ? Settings.getIntegerSettingValue(Settings.NETWORKING_PORT) : Integer.parseInt(port.getText());
Adapter.setMenu(new ServerRunningMenu(save, p));
}
});
stage.addActor(title);
stage.addActor(saveLabel);
stage.addActor(port);
stage.addActor(start);
stage.addActor(back);
}
示例2: handlePacket
import ethanjones.cubes.core.localization.Localization; //导入依赖的package包/类
@Override
public void handlePacket() {
if (Side.isServer()) {
Player player = Cubes.getServer().getClient(getSocketMonitor()).getPlayer();
Log.info("[" + Localization.get("server.chat") + "] [" + player.username + "] " + msg);
if (msg.startsWith("/")) {
CommandManager.run(msg.substring(1), player);
} else {
PacketChat packetChat = new PacketChat();
packetChat.msg = "[" + player.username + "] " + msg;
NetworkingManager.sendPacketToAllClients(packetChat);
}
} else {
Cubes.getClient().renderer.guiRenderer.print(msg);
}
}
示例3: SingleplayerSaveDeleteMenu
import ethanjones.cubes.core.localization.Localization; //导入依赖的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);
}
示例4: ServerRunningMenu
import ethanjones.cubes.core.localization.Localization; //导入依赖的package包/类
public ServerRunningMenu(Save save, int port) {
super(Localization.get("menu.general.loading"), Localization.get("menu.server.stop"));
this.save = save;
this.port = port;
addButtonListener(new EventListener() {
@Override
public boolean handle(Event event) {
if (!(event instanceof ChangeListener.ChangeEvent)) return false;
try {
Adapter.gotoMainMenu();
} catch (StopLoopException ignored) {
}
return true;
}
});
}
示例5: render
import ethanjones.cubes.core.localization.Localization; //导入依赖的package包/类
public void render() {
super.render();
frameNum++;
if (frameNum != 2) return;
try {
NetworkingManager.serverPreInit(new ServerNetworkingParameter(port));
Adapter.setServer(new ServerOnlyServer(save));
Adapter.setClient(null);
} catch (Exception e) {
Log.error("Failed to start server", e);
Adapter.setMenu(new FailedStartingServerMenu(e));
Adapter.setClient(null);
Adapter.setServer(null);
return;
}
text.setText(Localization.get("menu.server.running"));
resize(GUI_WIDTH, GUI_HEIGHT);
}
示例6: MultiplayerConnectMenu
import ethanjones.cubes.core.localization.Localization; //导入依赖的package包/类
public MultiplayerConnectMenu() {
super();
title = new Label(Localization.get("menu.multiplayer.title"), skin.get("title", Label.LabelStyle.class));
address = new TextField("", skin);
address.setMessageText(Localization.get("menu.multiplayer.address"));
port = new TextField("", skin);
port.setMessageText(Localization.get("menu.multiplayer.port", 24842)); //Not "Settings.getIntegerSettingValue(Settings.NETWORKING_PORT)" because the port is set on the server
port.setTextFieldFilter(new TextField.TextFieldFilter.DigitsOnlyFilter());
connect = new TextButton(Localization.get("menu.multiplayer.connect"), skin);
back = MenuTools.getBackButton(this);
connect.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
Adapter.setMenu(new MultiplayerLoadingMenu(address.getText().isEmpty() ? "localhost" : address.getText(), port.getText().isEmpty() ? 24842 : Integer.parseInt(port.getText())));
}
});
stage.addActor(title);
stage.addActor(address);
stage.addActor(port);
stage.addActor(connect);
stage.addActor(back);
}
示例7: init
import ethanjones.cubes.core.localization.Localization; //导入依赖的package包/类
public static void init() {
CommandBuilder save = new CommandBuilder("save").register().setCommandPermission(CommandPermission.Extended);
save.setCommandListener(new CommandListener() {
@Override
public void onCommand(CommandBuilder builder, List<CommandArgument> arguments, CommandSender sender) {
World world = Cubes.getServer().world;
if (world.save.readOnly) {
sender.print(Localization.get("command.save.readOnly"));
} else {
sender.print(Localization.get( "command.save.starting"));
Cubes.getServer().world.save();
}
}
});
}
示例8: handlePacket
import ethanjones.cubes.core.localization.Localization; //导入依赖的package包/类
@Override
public void handlePacket() {
if (Side.isServer()) {
Player player = Cubes.getServer().getClient(getSocketMonitor()).getPlayer();
Log.info("[" + Localization.get("server.chat") + "] [" + player.username + "] " + msg);
if (msg.startsWith("/")) {
CommandManager.run(msg.substring(1), player);
} else {
PacketChat packetChat = new PacketChat();
packetChat.msg = "[" + player.username + "] " + msg;
NetworkingManager.sendPacketToAllClients(packetChat);
}
} else {
Cubes.getClient().renderer.guiRenderer.print(msg);
}
}
示例9: SingleplayerSaveDeleteMenu
import ethanjones.cubes.core.localization.Localization; //导入依赖的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);
}
示例10: ServerSetupMenu
import ethanjones.cubes.core.localization.Localization; //导入依赖的package包/类
public ServerSetupMenu(final Save save) {
super();
title = new Label(Localization.get("menu.server.title"), skin.get("title", Label.LabelStyle.class));
saveLabel = new Label(Localization.get("menu.server.save", save.name), skin);
saveLabel.setAlignment(Align.center);
port = new TextField("", skin);
port.setMessageText(
Localization.get("menu.server.port", Settings.getIntegerSettingValue(Settings.NETWORKING_PORT)));
port.setTextFieldFilter(new TextField.TextFieldFilter.DigitsOnlyFilter());
start = new TextButton(Localization.get("menu.server.start"), skin);
back = MenuTools.getBackButton(this);
start.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
int p = port.getText().isEmpty() ? Settings.getIntegerSettingValue(Settings.NETWORKING_PORT)
: Integer.parseInt(port.getText());
Adapter.setMenu(new ServerRunningMenu(save, p));
}
});
stage.addActor(title);
stage.addActor(saveLabel);
stage.addActor(port);
stage.addActor(start);
stage.addActor(back);
}
示例11: SingleplayerTemporarySaveMenu
import ethanjones.cubes.core.localization.Localization; //导入依赖的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())));
}
});
}
示例12: getBackButton
import ethanjones.cubes.core.localization.Localization; //导入依赖的package包/类
public static TextButton getBackButton(final Menu menu) {
TextButton textButton = new TextButton(Localization.get("menu.general.back"), Menu.skin);
textButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
Menu prev = MenuManager.getPrevious(menu);
if (prev == null)
return;
Adapter.setMenu(prev);
}
});
return textButton;
}
示例13: create
import ethanjones.cubes.core.localization.Localization; //导入依赖的package包/类
@Override
public void create() {
super.create();
consoleCommandSender = new ConsoleCommandSender();
Log.info(Localization.get("server.server_loaded"));
Log.info(Localization.get("server.server_port",
((ServerNetworking) NetworkingManager.getNetworking(Side.Server)).getPort()));
loop();
}
示例14: init
import ethanjones.cubes.core.localization.Localization; //导入依赖的package包/类
public static void init() {
new CommandBuilder("stop").register().setCommandPermission(CommandPermission.All).setCommandListener(new CommandListener() {
@Override
public void onCommand(CommandBuilder builder, List<CommandArgument> arguments, CommandSender sender) {
sender.print(Localization.get("Stopping..."));
Cubes.getServer().dispose();
}
});
}
示例15: print
import ethanjones.cubes.core.localization.Localization; //导入依赖的package包/类
public static void print(CommandBuilder builder, CommandSender sender) {
String base = builder.getCommandString();
sender.print(Localization.get("command.help.command", base));
if (builder.getCommandListener() != null) {
if (builder.getHelpText() != null) {
sender.print(format(base, builder.getHelpText()));
} else {
sender.print(base);
}
}
for (CommandBuilder child : builder.getChildren()) {
print(child, sender, base);
}
}