Removed 'text.*' prefix

This commit is contained in:
Anuken
2019-01-09 16:58:06 -05:00
parent daa7b20e4a
commit b9618d66f2
68 changed files with 6895 additions and 6895 deletions

View File

@@ -142,7 +142,7 @@ public class Control implements ApplicationListener{
Net.host(port);
players[0].isAdmin = true;
}catch(IOException e){
ui.showError(Core.bundle.format("text.server.error", Strings.parseException(e, false)));
ui.showError(Core.bundle.format("server.error", Strings.parseException(e, false)));
Core.app.post(() -> state.set(State.menu));
}
}
@@ -254,7 +254,7 @@ public class Control implements ApplicationListener{
Time.run(5f, () -> {
FloatingDialog dialog = new FloatingDialog("WARNING!");
dialog.buttons().addButton("$text.ok", () -> {
dialog.buttons().addButton("$ok", () -> {
dialog.hide();
Core.settings.put("4.0-warning-2", true);
Core.settings.save();

View File

@@ -70,7 +70,7 @@ public class NetClient implements ApplicationListener{
reset();
ui.loadfrag.hide();
ui.loadfrag.show("$text.connecting.data");
ui.loadfrag.show("$connecting.data");
ui.loadfrag.setButton(() -> {
ui.loadfrag.hide();
@@ -88,7 +88,7 @@ public class NetClient implements ApplicationListener{
c.uuid = Platform.instance.getUUID();
if(c.uuid == null){
ui.showError("$text.invalidid");
ui.showError("$invalidid");
ui.loadfrag.hide();
disconnectQuietly();
return;
@@ -104,7 +104,7 @@ public class NetClient implements ApplicationListener{
state.set(State.menu);
ui.showError("$text.disconnect");
ui.showError("$disconnect");
connecting = false;
Platform.instance.updateRPC();
@@ -158,7 +158,7 @@ public class NetClient implements ApplicationListener{
if(reason.extraText() != null){
ui.showText(reason.toString(), reason.extraText());
}else{
ui.showText("$text.disconnect", reason.toString());
ui.showText("$disconnect", reason.toString());
}
}
ui.loadfrag.hide();
@@ -177,7 +177,7 @@ public class NetClient implements ApplicationListener{
ui.chatfrag.clearMessages();
Net.setClientLoaded(false);
ui.loadfrag.show("$text.connecting.data");
ui.loadfrag.show("$connecting.data");
ui.loadfrag.setButton(() -> {
ui.loadfrag.hide();
@@ -276,7 +276,7 @@ public class NetClient implements ApplicationListener{
Log.err("Failed to load data!");
ui.loadfrag.hide();
quiet = true;
ui.showError("$text.disconnect.data");
ui.showError("$disconnect.data");
Net.disconnect();
timeoutTime = 0f;
}

View File

@@ -398,7 +398,7 @@ public class NetServer implements ApplicationListener{
if(!headless && !closing && Net.server() && state.is(State.menu)){
closing = true;
ui.loadfrag.show("$text.server.closing");
ui.loadfrag.show("$server.closing");
Time.runTask(5f, () -> {
Net.closeServer();
ui.loadfrag.hide();

View File

@@ -337,7 +337,7 @@ public class Renderer implements ApplicationListener{
pixelSurface.setSize(pw, ph, false);
Graphics.getEffectSurface().setSize(pw, ph, false);
ui.showInfoFade(Core.bundle.format("text.screenshot", file.toString()));*/
ui.showInfoFade(Core.bundle.format("screenshot", file.toString()));*/
}
}

View File

@@ -201,7 +201,7 @@ public class UI implements ApplicationListener{
}
public void loadGraphics(Runnable call){
loadGraphics("$text.loading", call);
loadGraphics("$loading", call);
}
public void loadGraphics(String text, Runnable call){
@@ -213,7 +213,7 @@ public class UI implements ApplicationListener{
}
public void loadLogic(Runnable call){
loadLogic("$text.loading", call);
loadLogic("$loading", call);
}
public void loadLogic(String text, Runnable call){
@@ -233,11 +233,11 @@ public class UI implements ApplicationListener{
field.setTextFieldFilter((f, c) -> field.getText().length() < 12 && filter.acceptChar(f, c));
Platform.instance.addDialog(field);
buttons().defaults().size(120, 54).pad(4);
buttons().addButton("$text.ok", () -> {
buttons().addButton("$ok", () -> {
confirmed.accept(field.getText());
hide();
}).disabled(b -> field.getText().isEmpty());
buttons().addButton("$text.cancel", this::hide);
buttons().addButton("$cancel", this::hide);
}}.show();
}
@@ -257,7 +257,7 @@ public class UI implements ApplicationListener{
new Dialog("", "dialog"){{
getCell(content()).growX();
content().margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center);
buttons().addButton("$text.ok", this::hide).size(90, 50).pad(4);
buttons().addButton("$ok", this::hide).size(90, 50).pad(4);
}}.show();
}
@@ -265,7 +265,7 @@ public class UI implements ApplicationListener{
new Dialog("", "dialog"){{
getCell(content()).growX();
content().margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center);
buttons().addButton("$text.ok", () -> {
buttons().addButton("$ok", () -> {
clicked.run();
hide();
}).size(90, 50).pad(4);
@@ -273,16 +273,16 @@ public class UI implements ApplicationListener{
}
public void showError(String text){
new Dialog("$text.error.title", "dialog"){{
new Dialog("$error.title", "dialog"){{
content().margin(15).add(text).width(400f).wrap().get().setAlignment(Align.center, Align.center);
buttons().addButton("$text.ok", this::hide).size(90, 50).pad(4);
buttons().addButton("$ok", this::hide).size(90, 50).pad(4);
}}.show();
}
public void showText(String title, String text){
new Dialog(title, "dialog"){{
content().margin(15).add(text).width(400f).wrap().get().setAlignment(Align.center, Align.center);
buttons().addButton("$text.ok", this::hide).size(90, 50).pad(4);
buttons().addButton("$ok", this::hide).size(90, 50).pad(4);
}}.show();
}
@@ -291,8 +291,8 @@ public class UI implements ApplicationListener{
dialog.content().add(text).width(400f).wrap().pad(4f).get().setAlignment(Align.center, Align.center);
dialog.buttons().defaults().size(200f, 54f).pad(2f);
dialog.setFillParent(false);
dialog.buttons().addButton("$text.cancel", dialog::hide);
dialog.buttons().addButton("$text.ok", () -> {
dialog.buttons().addButton("$cancel", dialog::hide);
dialog.buttons().addButton("$ok", () -> {
dialog.hide();
confirmed.run();
});

View File

@@ -207,7 +207,7 @@ public class World implements ApplicationListener{
} catch(Exception e){
Log.err(e);
if(!headless){
ui.showError("$text.map.invalid");
ui.showError("$map.invalid");
Core.app.post(() -> state.set(State.menu));
invalidMap = true;
}
@@ -221,7 +221,7 @@ public class World implements ApplicationListener{
if(!headless){
if(state.teams.get(players[0].getTeam()).cores.size == 0){
ui.showError("$text.map.nospawn");
ui.showError("$map.nospawn");
invalidMap = true;
}else if(state.mode.isPvp){
invalidMap = true;
@@ -231,7 +231,7 @@ public class World implements ApplicationListener{
}
}
if(invalidMap){
ui.showError("$text.map.nospawn.pvp");
ui.showError("$map.nospawn.pvp");
}
}
}else{

View File

@@ -57,7 +57,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
infoDialog = new MapInfoDialog(editor);
menu = new FloatingDialog("$text.menu");
menu = new FloatingDialog("$menu");
menu.addCloseButton();
float isize = 16 * 2f;
@@ -66,27 +66,27 @@ public class MapEditorDialog extends Dialog implements Disposable{
menu.content().table(t -> {
t.defaults().size(swidth, 60f).padBottom(5).padRight(5).padLeft(5);
t.addImageTextButton("$text.editor.savemap", "icon-floppy-16", isize, this::save).size(swidth * 2f + 10, 60f).colspan(2);
t.addImageTextButton("$editor.savemap", "icon-floppy-16", isize, this::save).size(swidth * 2f + 10, 60f).colspan(2);
t.row();
t.addImageTextButton("$text.editor.mapinfo", "icon-pencil", isize, () -> {
t.addImageTextButton("$editor.mapinfo", "icon-pencil", isize, () -> {
infoDialog.show();
menu.hide();
});
t.addImageTextButton("$text.editor.resize", "icon-resize", isize, () -> {
t.addImageTextButton("$editor.resize", "icon-resize", isize, () -> {
resizeDialog.show();
menu.hide();
});
t.row();
t.addImageTextButton("$text.editor.import", "icon-load-map", isize, () ->
createDialog("$text.editor.import",
"$text.editor.importmap", "$text.editor.importmap.description", "icon-load-map", (Runnable) loadDialog::show,
"$text.editor.importfile", "$text.editor.importfile.description", "icon-file", (Runnable) () ->
Platform.instance.showFileChooser("$text.loadimage", "Map Files", file -> ui.loadGraphics(() -> {
t.addImageTextButton("$editor.import", "icon-load-map", isize, () ->
createDialog("$editor.import",
"$editor.importmap", "$editor.importmap.description", "icon-load-map", (Runnable) loadDialog::show,
"$editor.importfile", "$editor.importfile.description", "icon-file", (Runnable) () ->
Platform.instance.showFileChooser("$loadimage", "Map Files", file -> ui.loadGraphics(() -> {
try{
DataInputStream stream = new DataInputStream(file.read());
@@ -96,13 +96,13 @@ public class MapEditorDialog extends Dialog implements Disposable{
editor.beginEdit(data, meta.tags, false);
view.clearStack();
}catch(Exception e){
ui.showError(Core.bundle.format("text.editor.errorimageload", Strings.parseException(e, false)));
ui.showError(Core.bundle.format("editor.errorimageload", Strings.parseException(e, false)));
Log.err(e);
}
}), true, mapExtension),
"$text.editor.importimage", "$text.editor.importimage.description", "icon-file-image", (Runnable)() ->
Platform.instance.showFileChooser("$text.loadimage", "Image Files", file ->
"$editor.importimage", "$editor.importimage.description", "icon-file-image", (Runnable)() ->
Platform.instance.showFileChooser("$loadimage", "Image Files", file ->
ui.loadGraphics(() -> {
try{
MapTileData data = MapIO.readLegacyPixmap(new Pixmap(file));
@@ -110,15 +110,15 @@ public class MapEditorDialog extends Dialog implements Disposable{
editor.beginEdit(data, editor.getTags(), false);
view.clearStack();
}catch (Exception e){
ui.showError(Core.bundle.format("text.editor.errorimageload", Strings.parseException(e, false)));
ui.showError(Core.bundle.format("editor.errorimageload", Strings.parseException(e, false)));
Log.err(e);
}
}), true, "png")
));
t.addImageTextButton("$text.editor.export", "icon-save-map", isize, () -> createDialog("$text.editor.export",
"$text.editor.exportfile", "$text.editor.exportfile.description", "icon-file", (Runnable) () ->
Platform.instance.showFileChooser("$text.saveimage", "Map Files", file -> {
t.addImageTextButton("$editor.export", "icon-save-map", isize, () -> createDialog("$editor.export",
"$editor.exportfile", "$editor.exportfile.description", "icon-file", (Runnable) () ->
Platform.instance.showFileChooser("$saveimage", "Map Files", file -> {
file = file.parent().child(file.nameWithoutExtension() + "." + mapExtension);
FileHandle result = file;
ui.loadGraphics(() -> {
@@ -129,7 +129,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
}
MapIO.writeMap(result.write(false), editor.getTags(), editor.getMap());
}catch(Exception e){
ui.showError(Core.bundle.format("text.editor.errorimagesave", Strings.parseException(e, false)));
ui.showError(Core.bundle.format("editor.errorimagesave", Strings.parseException(e, false)));
Log.err(e);
}
});
@@ -142,7 +142,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
menu.content().row();
menu.content().addImageTextButton("$text.quit", "icon-back", isize, () -> {
menu.content().addImageTextButton("$quit", "icon-back", isize, () -> {
tryExit();
menu.hide();
}).padTop(-5).size(swidth * 2f + 10, 60f);
@@ -165,7 +165,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
editor.beginEdit(data, meta.tags, false);
view.clearStack();
}catch(Exception e){
ui.showError(Core.bundle.format("text.editor.errormapload", Strings.parseException(e, false)));
ui.showError(Core.bundle.format("editor.errormapload", Strings.parseException(e, false)));
Log.err(e);
}
}));
@@ -222,14 +222,14 @@ public class MapEditorDialog extends Dialog implements Disposable{
String name = editor.getTags().get("name", "");
if(name.isEmpty()){
ui.showError("$text.editor.save.noname");
ui.showError("$editor.save.noname");
}else{
Map map = world.maps.getByName(name);
if(map != null && !map.custom){
ui.showError("$text.editor.save.overwrite");
ui.showError("$editor.save.overwrite");
}else{
world.maps.saveMap(name, editor.getMap(), editor.getTags());
ui.showInfoFade("$text.editor.saved");
ui.showInfoFade("$editor.saved");
}
}
@@ -301,7 +301,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
show();
}catch(Exception e){
Log.err(e);
ui.showError(Core.bundle.format("text.editor.errorimageload", Strings.parseException(e, false)));
ui.showError(Core.bundle.format("editor.errorimageload", Strings.parseException(e, false)));
}
});
}
@@ -398,7 +398,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
tools.row();
tools.table("underline", t -> t.add("$text.editor.teams"))
tools.table("underline", t -> t.add("$editor.teams"))
.colspan(3).height(40).width(size * 3f + 3f).padBottom(3);
tools.row();
@@ -429,14 +429,14 @@ public class MapEditorDialog extends Dialog implements Disposable{
slider.moved(f -> editor.setBrushSize(MapEditor.brushSizes[(int) (float) f]));
t.top();
t.add("$text.editor.brush");
t.add("$editor.brush");
t.row();
t.add(slider).width(size * 3f - 20).padTop(4f);
}).padTop(5).growX().growY().top();
mid.row();
mid.table("underline", t -> t.add("$text.editor.elevation"))
mid.table("underline", t -> t.add("$editor.elevation"))
.colspan(3).height(40).width(size * 3f + 3f);
mid.row();
@@ -446,7 +446,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
t.addImageButton("icon-arrow-left", "clear-partial", 16 * 2f, () -> editor.setDrawElevation(editor.getDrawElevation() - 1))
.disabled(b -> editor.getDrawElevation() <= -1).size(size);
t.label(() -> editor.getDrawElevation() == -1 ? "$text.editor.slope" : (editor.getDrawElevation() + ""))
t.label(() -> editor.getDrawElevation() == -1 ? "$editor.slope" : (editor.getDrawElevation() + ""))
.size(size).get().setAlignment(Align.center, Align.center);
t.addImageButton("icon-arrow-right", "clear-partial", 16 * 2f, () -> editor.setDrawElevation(editor.getDrawElevation() + 1))
@@ -502,7 +502,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
private void tryExit(){
if(!saved){
ui.showConfirm("$text.confirm", "$text.editor.unsaved", this::hide);
ui.showConfirm("$confirm", "$editor.unsaved", this::hide);
}else{
hide();
}

View File

@@ -15,7 +15,7 @@ public class MapInfoDialog extends FloatingDialog{
private TextField name;
public MapInfoDialog(MapEditor editor){
super("$text.editor.mapinfo");
super("$editor.mapinfo");
this.editor = editor;
addCloseButton();
@@ -32,18 +32,18 @@ public class MapInfoDialog extends FloatingDialog{
ObjectMap<String, String> tags = editor.getTags();
content().add("$text.editor.name").padRight(8).left();
content().add("$editor.name").padRight(8).left();
content().defaults().padTop(15);
name = content().addField(tags.get("name", ""), text -> {
tags.put("name", text);
}).size(400, 55f).get();
name.setMessageText("$text.unknown");
name.setMessageText("$unknown");
content().row();
content().add("$text.editor.description").padRight(8).left();
content().add("$editor.description").padRight(8).left();
description = content().addArea(tags.get("description", ""), "textarea", text -> {
tags.put("description", text);
@@ -51,19 +51,19 @@ public class MapInfoDialog extends FloatingDialog{
content().row();
content().add("$text.editor.author").padRight(8).left();
content().add("$editor.author").padRight(8).left();
author = content().addField(tags.get("author", Core.settings.getString("mapAuthor", "")), text -> {
tags.put("author", text);
Core.settings.put("mapAuthor", text);
Core.settings.save();
}).size(400, 55f).get();
author.setMessageText("$text.unknown");
author.setMessageText("$unknown");
content().row();
content().add().padRight(8).left();
content().addCheck("$text.editor.oregen", enabled -> {
content().addCheck("$editor.oregen", enabled -> {
tags.put("oregen", enabled ? "1" : "0");
}).update(c -> c.setChecked(!tags.get("oregen", "0").equals("0"))).left();

View File

@@ -16,12 +16,12 @@ public class MapLoadDialog extends FloatingDialog{
private Map selected = null;
public MapLoadDialog(Consumer<Map> loader){
super("$text.editor.loadmap");
super("$editor.loadmap");
shown(this::rebuild);
rebuild();
TextButton button = new TextButton("$text.load");
TextButton button = new TextButton("$load");
button.setDisabled(() -> selected == null);
button.clicked(() -> {
if(selected != null){
@@ -31,7 +31,7 @@ public class MapLoadDialog extends FloatingDialog{
});
buttons().defaults().size(200f, 50f);
buttons().addButton("$text.cancel", this::hide);
buttons().addButton("$cancel", this::hide);
buttons().add(button);
}
@@ -67,9 +67,9 @@ public class MapLoadDialog extends FloatingDialog{
}
if(world.maps.all().size == 0){
table.add("$text.maps.none").center();
table.add("$maps.none").center();
}else{
content().add("$text.editor.loadmap");
content().add("$editor.loadmap");
}
content().row();

View File

@@ -13,7 +13,7 @@ public class MapResizeDialog extends FloatingDialog{
int width, height;
public MapResizeDialog(MapEditor editor, BiConsumer<Integer, Integer> cons){
super("$text.editor.resizemap");
super("$editor.resizemap");
shown(() -> {
content().clear();
MapTileData data = editor.getMap();
@@ -29,7 +29,7 @@ public class MapResizeDialog extends FloatingDialog{
if(validMapSizes[i] == curr) idx = i;
}
table.add(w ? "$text.width" : "$text.height").padRight(8f);
table.add(w ? "$width" : "$height").padRight(8f);
ButtonGroup<TextButton> group = new ButtonGroup<>();
for(int i = 0; i < validMapSizes.length; i++){
int size = validMapSizes[i];
@@ -53,8 +53,8 @@ public class MapResizeDialog extends FloatingDialog{
});
buttons().defaults().size(200f, 50f);
buttons().addButton("$text.cancel", this::hide);
buttons().addButton("$text.editor.resize", () -> {
buttons().addButton("$cancel", this::hide);
buttons().addButton("$editor.resize", () -> {
cons.accept(width, height);
hide();
});

View File

@@ -15,7 +15,7 @@ public class MapSaveDialog extends FloatingDialog{
private Consumer<String> listener;
public MapSaveDialog(Consumer<String> cons){
super("$text.editor.savemap");
super("$editor.savemap");
field = new TextField();
listener = cons;
@@ -27,22 +27,22 @@ public class MapSaveDialog extends FloatingDialog{
Map map = world.maps.getByName(field.getText());
if(map != null){
if(map.custom){
return "$text.editor.overwrite";
return "$editor.overwrite";
}else{
return "$text.editor.failoverwrite";
return "$editor.failoverwrite";
}
}
return "";
}).colspan(2);
content().row();
content().add("$text.editor.mapname").padRight(14f);
content().add("$editor.mapname").padRight(14f);
content().add(field).size(220f, 48f);
});
buttons().defaults().size(200f, 50f).pad(2f);
buttons().addButton("$text.cancel", this::hide);
buttons().addButton("$cancel", this::hide);
TextButton button = new TextButton("$text.save");
TextButton button = new TextButton("$save");
button.clicked(() -> {
if(!invalid()){
cons.accept(field.getText());
@@ -57,7 +57,7 @@ public class MapSaveDialog extends FloatingDialog{
if(!invalid()){
listener.accept(field.getText());
}else{
ui.showError("$text.editor.failoverwrite");
ui.showError("$editor.failoverwrite");
}
}

View File

@@ -195,12 +195,12 @@ public class MobileInput extends InputHandler implements GestureListener{
void showGuide(String type){
if(!guides.contains(type) && !Core.settings.getBool(type, false)){
FloatingDialog dialog = new FloatingDialog("$text." + type + ".title");
FloatingDialog dialog = new FloatingDialog("$" + type + ".title");
dialog.addCloseButton();
dialog.content().left();
dialog.content().add("$text." + type).growX().wrap();
dialog.content().add("$" + type).growX().wrap();
dialog.content().row();
dialog.content().addCheck("$text.showagain", false, checked -> {
dialog.content().addCheck("$showagain", false, checked -> {
Core.settings.put(type, checked);
Core.settings.save();
}).growX().left().get().left();

View File

@@ -31,7 +31,7 @@ public class MapMeta{
}
public String tag(String name){
return tags.containsKey(name) && !tags.get(name).trim().isEmpty() ? tags.get(name): Core.bundle.get("text.unknown");
return tags.containsKey(name) && !tags.get(name).trim().isEmpty() ? tags.get(name): Core.bundle.get("unknown");
}
public boolean hasOreGen(){

View File

@@ -61,22 +61,22 @@ public class Net{
String type = t.getClass().toString().toLowerCase();
if(e instanceof BufferUnderflowException || e instanceof BufferOverflowException){
error = Core.bundle.get("text.error.io");
error = Core.bundle.get("error.io");
}else if(error.equals("mismatch")){
error = Core.bundle.get("text.error.mismatch");
error = Core.bundle.get("error.mismatch");
}else if(error.contains("port out of range") || error.contains("invalid argument") || (error.contains("invalid") && error.contains("address"))){
error = Core.bundle.get("text.error.invalidaddress");
error = Core.bundle.get("error.invalidaddress");
}else if(error.contains("connection refused") || error.contains("route to host") || type.contains("unknownhost")){
error = Core.bundle.get("text.error.unreachable");
error = Core.bundle.get("error.unreachable");
}else if(type.contains("timeout")){
error = Core.bundle.get("text.error.timedout");
error = Core.bundle.get("error.timedout");
}else if(error.equals("alreadyconnected")){
error = Core.bundle.get("text.error.alreadyconnected");
error = Core.bundle.get("error.alreadyconnected");
}else if(!error.isEmpty()){
error = Core.bundle.get("text.error.any");
error = Core.bundle.get("error.any");
}
ui.showText("", Core.bundle.format("text.connectfail", error));
ui.showText("", Core.bundle.format("connectfail", error));
ui.loadfrag.hide();
if(Net.client()){

View File

@@ -28,11 +28,11 @@ public class Packets{
@Override
public String toString(){
return Core.bundle.get("text.server.kicked." + name());
return Core.bundle.get("server.kicked." + name());
}
public String extraText(){
return Core.bundle.getOrNull("text.server.kicked." + name() + ".text");
return Core.bundle.getOrNull("server.kicked." + name() + ".text");
}
}

View File

@@ -50,7 +50,7 @@ public class ContentDisplay{
if(map.size == 0) continue;
table.add("$text.category." + cat.name()).color(Palette.accent).fillX();
table.add("$category." + cat.name()).color(Palette.accent).fillX();
table.row();
for(BlockStat stat : map.keys()){
@@ -87,13 +87,13 @@ public class ContentDisplay{
table.left().defaults().fillX();
table.add(Core.bundle.format("text.item.explosiveness", (int) (item.explosiveness * 100 * 2f)));
table.add(Core.bundle.format("item.explosiveness", (int) (item.explosiveness * 100 * 2f)));
table.row();
table.add(Core.bundle.format("text.item.flammability", (int) (item.flammability * 100 * 2f)));
table.add(Core.bundle.format("item.flammability", (int) (item.flammability * 100 * 2f)));
table.row();
table.add(Core.bundle.format("text.item.radioactivity", (int) (item.radioactivity * 100 * 2f)));
table.add(Core.bundle.format("item.radioactivity", (int) (item.radioactivity * 100 * 2f)));
table.row();
table.add(Core.bundle.format("text.item.fluxiness", (int) (item.fluxiness * 100 * 2f)));
table.add(Core.bundle.format("item.fluxiness", (int) (item.fluxiness * 100 * 2f)));
table.row();
}
@@ -120,15 +120,15 @@ public class ContentDisplay{
table.left().defaults().fillX();
table.add(Core.bundle.format("text.item.explosiveness", (int) (liquid.explosiveness * 100 * 2f)));
table.add(Core.bundle.format("item.explosiveness", (int) (liquid.explosiveness * 100 * 2f)));
table.row();
table.add(Core.bundle.format("text.item.flammability", (int) (liquid.flammability * 100 * 2f)));
table.add(Core.bundle.format("item.flammability", (int) (liquid.flammability * 100 * 2f)));
table.row();
table.add(Core.bundle.format("text.liquid.heatcapacity", (int) (liquid.heatCapacity * 100)));
table.add(Core.bundle.format("liquid.heatcapacity", (int) (liquid.heatCapacity * 100)));
table.row();
table.add(Core.bundle.format("text.liquid.temperature", (int) (liquid.temperature * 100)));
table.add(Core.bundle.format("liquid.temperature", (int) (liquid.temperature * 100)));
table.row();
table.add(Core.bundle.format("text.liquid.viscosity", (int) (liquid.viscosity * 100)));
table.add(Core.bundle.format("liquid.viscosity", (int) (liquid.viscosity * 100)));
table.row();
}
@@ -155,22 +155,22 @@ public class ContentDisplay{
table.left().defaults().fillX();
if(Core.bundle.has("mech." + mech.name + ".weapon")){
table.add(Core.bundle.format("text.mech.weapon", Core.bundle.get("mech." + mech.name + ".weapon")));
table.add(Core.bundle.format("mech.weapon", Core.bundle.get("mech." + mech.name + ".weapon")));
table.row();
}
if(Core.bundle.has("mech." + mech.name + ".ability")){
table.add(Core.bundle.format("text.mech.ability", Core.bundle.get("mech." + mech.name + ".ability")));
table.add(Core.bundle.format("mech.ability", Core.bundle.get("mech." + mech.name + ".ability")));
table.row();
}
table.add(Core.bundle.format("text.mech.armor", mech.armor));
table.add(Core.bundle.format("mech.armor", mech.armor));
table.row();
table.add(Core.bundle.format("text.mech.itemcapacity", mech.itemCapacity));
table.add(Core.bundle.format("mech.itemcapacity", mech.itemCapacity));
table.row();
if(mech.drillPower > 0){
table.add(Core.bundle.format("text.mech.minespeed", (int) (mech.mineSpeed * 10)));
table.add(Core.bundle.format("mech.minespeed", (int) (mech.mineSpeed * 10)));
table.row();
table.add(Core.bundle.format("text.mech.minepower", mech.drillPower));
table.add(Core.bundle.format("mech.minepower", mech.drillPower));
table.row();
}
}
@@ -197,9 +197,9 @@ public class ContentDisplay{
table.left().defaults().fillX();
table.add(Core.bundle.format("text.unit.health", unit.health));
table.add(Core.bundle.format("unit.health", unit.health));
table.row();
table.add(Core.bundle.format("text.unit.speed", Strings.toFixed(unit.speed, 1)));
table.add(Core.bundle.format("unit.speed", Strings.toFixed(unit.speed, 1)));
table.row();
table.row();
}

View File

@@ -33,7 +33,7 @@ public class Links{
public LinkEntry(String name, String link, Color color){
this.name = name;
this.color = color;
this.description = Core.bundle.getNotNull("text.link." + name + ".description");
this.description = Core.bundle.getNotNull("link." + name + ".description");
this.link = link;
}
}

View File

@@ -26,7 +26,7 @@ public class AboutDialog extends FloatingDialog{
private static ObjectSet<String> bannedItems = ObjectSet.with("google-play", "itch.io", "dev-builds", "trello");
public AboutDialog(){
super("$text.about.button");
super("$about.button");
Contributors.getContributors(out -> contributors = out, Throwable::printStackTrace);
@@ -70,7 +70,7 @@ public class AboutDialog extends FloatingDialog{
table.addImageButton("icon-link", 14 * 3, () -> {
if(!Core.net.openURI(link.link)){
ui.showError("$text.linkfail");
ui.showError("$linkfail");
Core.app.getClipboard().setContents(link.link);
}
}).size(h - 5, h);
@@ -84,10 +84,10 @@ public class AboutDialog extends FloatingDialog{
addCloseButton();
buttons().addButton("$text.credits", this::showCredits).size(200f, 64f);
buttons().addButton("$credits", this::showCredits).size(200f, 64f);
if(!ios && !OS.isMac){
buttons().addButton("$text.changelog.title", ui.changelog::show).size(200f, 64f);
buttons().addButton("$changelog.title", ui.changelog::show).size(200f, 64f);
}
if(UIUtils.portrait()){
@@ -99,14 +99,14 @@ public class AboutDialog extends FloatingDialog{
}
public void showCredits(){
FloatingDialog dialog = new FloatingDialog("$text.credits");
FloatingDialog dialog = new FloatingDialog("$credits");
dialog.addCloseButton();
dialog.content().add("$text.credits.text");
dialog.content().add("$credits.text");
dialog.content().row();
if(!contributors.isEmpty()){
dialog.content().addImage("blank").color(Palette.accent).fillX().height(3f).pad(3f);
dialog.content().row();
dialog.content().add("$text.contributors");
dialog.content().add("$contributors");
dialog.content().row();
dialog.content().pane(new Table(){{
int i = 0;

View File

@@ -9,7 +9,7 @@ import static io.anuke.mindustry.Vars.*;
public class AdminsDialog extends FloatingDialog{
public AdminsDialog(){
super("$text.server.admins");
super("$server.admins");
addCloseButton();
@@ -28,7 +28,7 @@ public class AdminsDialog extends FloatingDialog{
pane.setFadeScrollBars(false);
if(netServer.admins.getAdmins().size == 0){
table.add("$text.server.admins.none");
table.add("$server.admins.none");
}
for(PlayerInfo info : netServer.admins.getAdmins()){
@@ -38,7 +38,7 @@ public class AdminsDialog extends FloatingDialog{
res.labelWrap("[LIGHT_GRAY]" + info.lastName).width(w - h - 24f);
res.add().growX();
res.addImageButton("icon-cancel", 14 * 3, () -> {
ui.showConfirm("$text.confirm", "$text.confirmunadmin", () -> {
ui.showConfirm("$confirm", "$confirmunadmin", () -> {
netServer.admins.unAdminPlayer(info.id);
playerGroup.forEach(player -> {
if(player != null && player.uuid != null && player.uuid.equals(info.id)){

View File

@@ -9,7 +9,7 @@ import static io.anuke.mindustry.Vars.*;
public class BansDialog extends FloatingDialog{
public BansDialog(){
super("$text.server.bans");
super("$server.bans");
addCloseButton();
@@ -29,7 +29,7 @@ public class BansDialog extends FloatingDialog{
pane.setFadeScrollBars(false);
if(netServer.admins.getBanned().size == 0){
table.add("$text.server.bans.none");
table.add("$server.bans.none");
}
for(PlayerInfo info : netServer.admins.getBanned()){
@@ -39,7 +39,7 @@ public class BansDialog extends FloatingDialog{
res.labelWrap("IP: [LIGHT_GRAY]" + info.lastIP + "\n[]Name: [LIGHT_GRAY]" + info.lastName).width(w - h - 24f);
res.add().growX();
res.addImageButton("icon-cancel", 14 * 3, () -> {
ui.showConfirm("$text.confirm", "$text.confirmunban", () -> {
ui.showConfirm("$confirm", "$confirmunban", () -> {
netServer.admins.unbanPlayerID(info.id);
setup();
});

View File

@@ -18,11 +18,11 @@ public class ChangelogDialog extends FloatingDialog{
private Array<VersionInfo> versions;
public ChangelogDialog(){
super("$text.changelog.title");
super("$changelog.title");
addCloseButton();
content().add("$text.changelog.loading");
content().add("$changelog.loading");
if(!ios && !OS.isMac){
Changelogs.getChangelog(result -> {
@@ -43,15 +43,15 @@ public class ChangelogDialog extends FloatingDialog{
content().add(pane).grow();
if(versions == null){
table.add("$text.changelog.error");
table.add("$changelog.error");
if(Vars.android){
table.row();
table.add("$text.changelog.error.android").padTop(8);
table.add("$changelog.error.android").padTop(8);
}
if(ios){
table.row();
table.add("$text.changelog.error.ios").padTop(8);
table.add("$changelog.error.ios").padTop(8);
}
}else{
for(VersionInfo info : versions){
@@ -65,10 +65,10 @@ public class ChangelogDialog extends FloatingDialog{
in.add("[accent]" + info.name + "[LIGHT_GRAY] | " + info.date);
if(info.build == Version.build){
in.row();
in.add("$text.changelog.current");
in.add("$changelog.current");
}else if(info == versions.first()){
in.row();
in.add("$text.changelog.latest");
in.add("$changelog.latest");
}
in.row();
in.labelWrap("[lightgray]" + desc).width(vw - 20).padTop(12);

View File

@@ -7,7 +7,7 @@ import io.anuke.arc.scene.ui.layout.Table;
public class ContentInfoDialog extends FloatingDialog{
public ContentInfoDialog(){
super("$text.info.title");
super("$info.title");
addCloseButton();
}

View File

@@ -21,7 +21,7 @@ public class ControlsDialog extends KeybindDialog{
@Override
public void addCloseButton(){
buttons().addImageTextButton("$text.back", "icon-arrow-left", 30f, this::hide).size(230f, 64f);
buttons().addImageTextButton("$back", "icon-arrow-left", 30f, this::hide).size(230f, 64f);
keyDown(key -> {
if(key == KeyCode.ESCAPE || key == KeyCode.BACK)

View File

@@ -21,7 +21,7 @@ import static io.anuke.mindustry.Vars.*;
public class CustomGameDialog extends FloatingDialog{
public CustomGameDialog(){
super("$text.customgame");
super("$customgame");
addCloseButton();
shown(this::setup);
@@ -40,7 +40,7 @@ public class CustomGameDialog extends FloatingDialog{
Table selmode = new Table();
ButtonGroup<TextButton> group = new ButtonGroup<>();
selmode.add("$text.level.mode").padRight(15f);
selmode.add("$level.mode").padRight(15f);
int i = 0;
Table modes = new Table();
@@ -102,7 +102,7 @@ public class CustomGameDialog extends FloatingDialog{
image.row();
image.add("[accent]" + map.getDisplayName()).pad(3f).growX().wrap().get().setAlignment(Align.center, Align.center);
image.row();
image.label((() -> Core.bundle.format("text.level.highscore", Core.settings.getInt("hiscore" + map.name, 0)))).pad(3f);
image.label((() -> Core.bundle.format("level.highscore", Core.settings.getInt("hiscore" + map.name, 0)))).pad(3f);
BorderImage border = new BorderImage(map.texture, 3f);
border.setScaling(Scaling.fit);
@@ -123,10 +123,10 @@ public class CustomGameDialog extends FloatingDialog{
world.generator.playRandomMap();
}).growY().get();
gen.row();
gen.add("$text.map.random");
gen.add("$map.random");
if(world.maps.all().size == 0){
maps.add("$text.maps.none").pad(50);
maps.add("$maps.none").pad(50);
}
content().add(pane).uniformX();
@@ -147,7 +147,7 @@ public class CustomGameDialog extends FloatingDialog{
}
d.content().add(pane);
d.buttons().addButton("$text.ok", d::hide).size(110, 50).pad(10f);
d.buttons().addButton("$ok", d::hide).size(110, 50).pad(10f);
d.show();
}

View File

@@ -9,7 +9,7 @@ import io.anuke.mindustry.type.ItemType;
public class DeployDialog extends FloatingDialog{
public DeployDialog(){
super("$text.play");
super("$play");
shown(this::setup);
}

View File

@@ -33,18 +33,18 @@ public class DiscordDialog extends Dialog{
i.addImage("icon-discord").size(14 * 3);
}).size(h).left();
t.add("$text.discord").color(Palette.accent).growX().padLeft(10f);
t.add("$discord").color(Palette.accent).growX().padLeft(10f);
}).size(470f, h).pad(10f);
buttons().defaults().size(170f, 50);
buttons().addButton("$text.back", this::hide);
buttons().addButton("$text.copylink", () -> {
buttons().addButton("$back", this::hide);
buttons().addButton("$copylink", () -> {
Core.app.getClipboard().setContents(discordURL);
});
buttons().addButton("$text.openlink", () -> {
buttons().addButton("$openlink", () -> {
if(!Core.net.openURI(discordURL)){
ui.showError("$text.linkfail");
ui.showError("$linkfail");
Core.app.getClipboard().setContents(discordURL);
}
});

View File

@@ -54,7 +54,7 @@ public class FileChooser extends FloatingDialog{
if(!open) Platform.instance.addDialog(filefield);
filefield.setDisabled(open);
ok = new TextButton(open ? "$text.load" : "$text.save");
ok = new TextButton(open ? "$load" : "$save");
ok.clicked(() -> {
if(ok.isDisabled()) return;
@@ -69,7 +69,7 @@ public class FileChooser extends FloatingDialog{
filefield.change();
TextButton cancel = new TextButton("$text.cancel");
TextButton cancel = new TextButton("$cancel");
cancel.clicked(this::hide);
navigation = new TextField("");
@@ -129,7 +129,7 @@ public class FileChooser extends FloatingDialog{
icontable.add(up);
Table fieldcontent = new Table();
fieldcontent.bottom().left().add(new Label("$text.filename"));
fieldcontent.bottom().left().add(new Label("$filename"));
fieldcontent.add(filefield).height(40f).fillX().expandX().padLeft(10f);
Table buttons = new Table();

View File

@@ -63,7 +63,7 @@ public class FloatingDialog extends Dialog{
@Override
public void addCloseButton(){
buttons().addImageTextButton("$text.back", "icon-arrow-left", 30f, this::hide).size(230f, 64f);
buttons().addImageTextButton("$back", "icon-arrow-left", 30f, this::hide).size(230f, 64f);
keyDown(key -> {
if(key == KeyCode.ESCAPE || key == KeyCode.BACK) {

View File

@@ -18,14 +18,14 @@ public class HostDialog extends FloatingDialog{
float w = 300;
public HostDialog(){
super("$text.hostserver");
super("$hostserver");
Player player = players[0];
addCloseButton();
content().table(t -> {
t.add("$text.name").padRight(10);
t.add("$name").padRight(10);
t.addField(Core.settings.getString("name"), text -> {
player.name = text;
Core.settings.put("name", text);
@@ -47,25 +47,25 @@ public class HostDialog extends FloatingDialog{
content().add().width(65f);
content().addButton("$text.host", () -> {
content().addButton("$host", () -> {
if(Core.settings.getString("name").trim().isEmpty()){
ui.showInfo("$text.noname");
ui.showInfo("$noname");
return;
}
ui.loadfrag.show("$text.hosting");
ui.loadfrag.show("$hosting");
Time.runTask(5f, () -> {
try{
Net.host(Vars.port);
player.isAdmin = true;
}catch(IOException e){
ui.showError(Core.bundle.format("text.server.error", Strings.parseException(e, false)));
ui.showError(Core.bundle.format("server.error", Strings.parseException(e, false)));
}
ui.loadfrag.hide();
hide();
});
}).width(w).height(70f);
content().addButton("?", () -> ui.showInfo("$text.host.info")).size(65f, 70f).padLeft(6f);
content().addButton("?", () -> ui.showInfo("$host.info")).size(65f, 70f).padLeft(6f);
}
}

View File

@@ -31,7 +31,7 @@ public class JoinDialog extends FloatingDialog{
int totalHosts;
public JoinDialog(){
super("$text.joingame");
super("$joingame");
loadServers();
@@ -41,10 +41,10 @@ public class JoinDialog extends FloatingDialog{
addCloseButton();
buttons().add().growX();
buttons().addButton("?", () -> ui.showInfo("$text.join.info")).size(60f, 64f);
buttons().addButton("?", () -> ui.showInfo("$join.info")).size(60f, 64f);
add = new FloatingDialog("$text.joingame.title");
add.content().add("$text.joingame.ip").padRight(5f).left();
add = new FloatingDialog("$joingame.title");
add.content().add("$joingame.ip").padRight(5f).left();
TextField field = add.content().addField(Core.settings.getString("ip"), text -> {
Core.settings.put("ip", text);
@@ -55,8 +55,8 @@ public class JoinDialog extends FloatingDialog{
add.content().row();
add.buttons().defaults().size(140f, 60f).pad(4f);
add.buttons().addButton("$text.cancel", add::hide);
add.buttons().addButton("$text.ok", () -> {
add.buttons().addButton("$cancel", add::hide);
add.buttons().addButton("$ok", () -> {
if(renaming == null){
Server server = new Server();
server.setIP(Core.settings.getString("ip"));
@@ -74,7 +74,7 @@ public class JoinDialog extends FloatingDialog{
}).disabled(b -> Core.settings.getString("ip").isEmpty() || Net.active());
add.shown(() -> {
add.getTitleLabel().setText(renaming != null ? "$text.server.edit" : "$text.server.add");
add.getTitleLabel().setText(renaming != null ? "$server.edit" : "$server.add");
if(renaming != null){
field.setText(renaming.displayIP());
}
@@ -119,7 +119,7 @@ public class JoinDialog extends FloatingDialog{
}).margin(3f).padTop(6f).top().right();
inner.addImageButton("icon-trash-16", "empty", 16 * 2, () -> {
ui.showConfirm("$text.confirm", "$text.server.delete", () -> {
ui.showConfirm("$confirm", "$server.delete", () -> {
servers.removeValue(server, true);
saveServers();
setupRemote();
@@ -144,23 +144,23 @@ public class JoinDialog extends FloatingDialog{
void refreshServer(Server server){
server.content.clear();
server.content.label(() -> Core.bundle.get("text.server.refreshing") + Strings.animated(Time.time(), 4, 11, "."));
server.content.label(() -> Core.bundle.get("server.refreshing") + Strings.animated(Time.time(), 4, 11, "."));
Net.pingHost(server.ip, server.port, host -> {
String versionString;
if(host.version == -1){
versionString = Core.bundle.format("text.server.version", Core.bundle.get("text.server.custombuild"), "");
versionString = Core.bundle.format("server.version", Core.bundle.get("server.custombuild"), "");
}else if(host.version == 0){
versionString = Core.bundle.get("text.server.outdated");
versionString = Core.bundle.get("server.outdated");
}else if(host.version < Version.build && Version.build != -1){
versionString = Core.bundle.get("text.server.outdated") + "\n" +
Core.bundle.format("text.server.version", host.version, "");
versionString = Core.bundle.get("server.outdated") + "\n" +
Core.bundle.format("server.version", host.version, "");
}else if(host.version > Version.build && Version.build != -1){
versionString = Core.bundle.get("text.server.outdated.client") + "\n" +
Core.bundle.format("text.server.version", host.version, "");
versionString = Core.bundle.get("server.outdated.client") + "\n" +
Core.bundle.format("server.version", host.version, "");
}else{
versionString = Core.bundle.format("text.server.version", host.version, host.versionType);
versionString = Core.bundle.format("server.version", host.version, host.versionType);
}
server.content.clear();
@@ -168,17 +168,17 @@ public class JoinDialog extends FloatingDialog{
server.content.table(t -> {
t.add(versionString).left();
t.row();
t.add("[lightgray]" + Core.bundle.format("text.server.hostname", host.name)).left();
t.add("[lightgray]" + Core.bundle.format("server.hostname", host.name)).left();
t.row();
t.add("[lightgray]" + (host.players != 1 ? Core.bundle.format("text.players", host.players) :
Core.bundle.format("text.players.single", host.players))).left();
t.add("[lightgray]" + (host.players != 1 ? Core.bundle.format("players", host.players) :
Core.bundle.format("players.single", host.players))).left();
t.row();
t.add("[lightgray]" + Core.bundle.format("text.save.map", host.mapname) + " / " + Core.bundle.format("text.save.wave", host.wave)).left();
t.add("[lightgray]" + Core.bundle.format("save.map", host.mapname) + " / " + Core.bundle.format("save.wave", host.wave)).left();
}).expand().left().bottom().padLeft(12f).padBottom(8);
}, e -> {
server.content.clear();
server.content.add("$text.host.invalid");
server.content.add("$host.invalid");
});
}
@@ -202,7 +202,7 @@ public class JoinDialog extends FloatingDialog{
content().clear();
content().table(t -> {
t.add("$text.name").padRight(10);
t.add("$name").padRight(10);
t.addField(Core.settings.getString("name"), text -> {
player.name = text;
Core.settings.put("name", text);
@@ -221,7 +221,7 @@ public class JoinDialog extends FloatingDialog{
content().row();
content().add(pane).width(w + 38).pad(0);
content().row();
content().addCenteredImageTextButton("$text.server.add", "icon-add", 14 * 3, () -> {
content().addCenteredImageTextButton("$server.add", "icon-add", 14 * 3, () -> {
renaming = null;
add.show();
}).marginLeft(6).width(w).height(80f).update(button -> {
@@ -247,7 +247,7 @@ public class JoinDialog extends FloatingDialog{
local.clear();
local.background((Drawable)null);
local.table("button", t -> t.label(() -> "[accent]" + Core.bundle.get("text.hosts.discovering") + Strings.animated(Time.time(), 4, 10f, ".")).pad(10f)).growX();
local.table("button", t -> t.label(() -> "[accent]" + Core.bundle.get("hosts.discovering") + Strings.animated(Time.time(), 4, 10f, ".")).pad(10f)).growX();
Net.discoverServers(this::addLocalHost, this::finishLocalHosts);
}
@@ -255,7 +255,7 @@ public class JoinDialog extends FloatingDialog{
if(totalHosts == 0){
local.clear();
local.background("button");
local.add("$text.hosts.none").pad(10f);
local.add("$hosts.none").pad(10f);
local.add().growX();
local.addImageButton("icon-loading", 16 * 2f, this::refreshLocal).pad(-12f).padLeft(0).size(70f);
}else{
@@ -277,17 +277,17 @@ public class JoinDialog extends FloatingDialog{
.width(w).height(80f).pad(4f).get();
button.left();
button.row();
button.add("[lightgray]" + (host.players != 1 ? Core.bundle.format("text.players", host.players) :
Core.bundle.format("text.players.single", host.players))).padBottom(5);
button.add("[lightgray]" + (host.players != 1 ? Core.bundle.format("players", host.players) :
Core.bundle.format("players.single", host.players))).padBottom(5);
}
void connect(String ip, int port){
if(Core.settings.getString("name").trim().isEmpty()){
ui.showInfo("$text.noname");
ui.showInfo("$noname");
return;
}
ui.loadfrag.show("$text.connecting");
ui.loadfrag.show("$connecting");
ui.loadfrag.setButton(() -> {
ui.loadfrag.hide();

View File

@@ -16,7 +16,7 @@ public class LanguageDialog extends FloatingDialog{
private Locale lastLocale;
public LanguageDialog(){
super("$text.settings.language");
super("$settings.language");
addCloseButton();
setup();
}
@@ -36,7 +36,7 @@ public class LanguageDialog extends FloatingDialog{
Core.settings.put("locale", loc.toString());
Core.settings.save();
Log.info("Setting locale: {0}", loc.toString());
ui.showInfo("$text.language.restart");
ui.showInfo("$language.restart");
});
langs.add(button).group(group).update(t -> t.setChecked(loc.equals(getLocale()))).size(400f, 50f).pad(2).row();
}

View File

@@ -24,7 +24,7 @@ public class LoadDialog extends FloatingDialog{
Table slots;
public LoadDialog(){
this("$text.loadgame");
this("$loadgame");
}
public LoadDialog(String title){
@@ -71,14 +71,14 @@ public class LoadDialog extends FloatingDialog{
}).checked(slot.isAutosave()).right();
t.addImageButton("icon-trash", "empty", 14 * 3, () -> {
ui.showConfirm("$text.confirm", "$text.save.delete.confirm", () -> {
ui.showConfirm("$confirm", "$save.delete.confirm", () -> {
slot.delete();
setup();
});
}).size(14 * 3).right();
t.addImageButton("icon-pencil-small", "empty", 14 * 3, () -> {
ui.showTextInput("$text.save.rename", "$text.save.rename.text", slot.getName(), text -> {
ui.showTextInput("$save.rename", "$save.rename.text", slot.getName(), text -> {
slot.setName(text);
setup();
});
@@ -86,12 +86,12 @@ public class LoadDialog extends FloatingDialog{
t.addImageButton("icon-save", "empty", 14 * 3, () -> {
if(!ios){
Platform.instance.showFileChooser(Core.bundle.get("text.save.export"), "Mindustry Save", file -> {
Platform.instance.showFileChooser(Core.bundle.get("save.export"), "Mindustry Save", file -> {
try{
slot.exportFile(file);
setup();
}catch(IOException e){
ui.showError(Core.bundle.format("text.save.export.fail", Strings.parseException(e, false)));
ui.showError(Core.bundle.format("save.export.fail", Strings.parseException(e, false)));
}
}, false, saveExtension);
}else{
@@ -100,7 +100,7 @@ public class LoadDialog extends FloatingDialog{
slot.exportFile(file);
Platform.instance.shareFile(file);
}catch(Exception e){
ui.showError(Core.bundle.format("text.save.export.fail", Strings.parseException(e, false)));
ui.showError(Core.bundle.format("save.export.fail", Strings.parseException(e, false)));
}
}
}).size(14 * 3).right();
@@ -112,19 +112,19 @@ public class LoadDialog extends FloatingDialog{
button.defaults().padBottom(3);
button.row();
button.add(Core.bundle.format("text.save.map", color + (slot.getMap() == null ? "Unknown" : slot.getMap().meta.name())));
button.add(Core.bundle.format("save.map", color + (slot.getMap() == null ? "Unknown" : slot.getMap().meta.name())));
button.row();
button.add(Core.bundle.get("text.level.mode") + " " + color + slot.getMode());
button.add(Core.bundle.get("level.mode") + " " + color + slot.getMode());
button.row();
button.add(Core.bundle.format("text.save.wave", color + slot.getWave()));
button.add(Core.bundle.format("save.wave", color + slot.getWave()));
button.row();
button.add(Core.bundle.format("text.save.difficulty", color + slot.getDifficulty()));
button.add(Core.bundle.format("save.difficulty", color + slot.getDifficulty()));
button.row();
button.label(() -> Core.bundle.format("text.save.autosave", color + Core.bundle.get(slot.isAutosave() ? "text.on" : "text.off")));
button.label(() -> Core.bundle.format("save.autosave", color + Core.bundle.get(slot.isAutosave() ? "on" : "off")));
button.row();
button.label(() -> Core.bundle.format("text.save.playtime", color + slot.getPlayTime()));
button.label(() -> Core.bundle.format("save.playtime", color + slot.getPlayTime()));
button.row();
button.add(Core.bundle.format("text.save.date", color + slot.getDate())).colspan(2).padTop(5).right();
button.add(Core.bundle.format("save.date", color + slot.getDate())).colspan(2).padTop(5).right();
button.row();
modifyButton(button, slot);
@@ -144,7 +144,7 @@ public class LoadDialog extends FloatingDialog{
if(!valids){
slots.row();
slots.addButton("$text.save.none", () -> {
slots.addButton("$save.none", () -> {
}).disabled(true).fillX().margin(20f).minWidth(340f).height(80f).pad(4f);
}
@@ -152,18 +152,18 @@ public class LoadDialog extends FloatingDialog{
if(ios) return;
slots.addImageTextButton("$text.save.import", "icon-add", 14 * 3, () -> {
Platform.instance.showFileChooser(Core.bundle.get("text.save.import"), "Mindustry Save", file -> {
slots.addImageTextButton("$save.import", "icon-add", 14 * 3, () -> {
Platform.instance.showFileChooser(Core.bundle.get("save.import"), "Mindustry Save", file -> {
if(SaveIO.isSaveValid(file)){
try{
control.saves.importSave(file);
setup();
}catch(IOException e){
e.printStackTrace();
ui.showError(Core.bundle.format("text.save.import.fail", Strings.parseException(e, false)));
ui.showError(Core.bundle.format("save.import.fail", Strings.parseException(e, false)));
}
}else{
ui.showError("$text.save.import.invalid");
ui.showError("$save.import.invalid");
}
}, true, saveExtension);
}).fillX().margin(10f).minWidth(300f).height(70f).pad(4f).padRight(-4);
@@ -181,7 +181,7 @@ public class LoadDialog extends FloatingDialog{
Log.err(e);
state.set(State.menu);
logic.reset();
ui.showError("$text.save.corrupted");
ui.showError("$save.corrupted");
}
});
}
@@ -191,7 +191,7 @@ public class LoadDialog extends FloatingDialog{
if(!button.childrenPressed()){
int build = slot.getBuild();
if(SaveIO.breakingVersions.contains(build)){
ui.showInfo("$text.save.old");
ui.showInfo("$save.old");
slot.delete();
}else{
runLoadSave(slot);

View File

@@ -13,7 +13,7 @@ import static io.anuke.mindustry.Vars.players;
public class LocalPlayerDialog extends FloatingDialog{
public LocalPlayerDialog(){
super("$text.addplayers");
super("$addplayers");
addCloseButton();
shown(this::rebuild);

View File

@@ -27,11 +27,11 @@ public class MapsDialog extends FloatingDialog{
private FloatingDialog dialog;
public MapsDialog(){
super("$text.maps");
super("$maps");
addCloseButton();
buttons().addImageTextButton("$text.editor.importmap", "icon-add", 14 * 2, () -> {
Platform.instance.showFileChooser("$text.editor.importmap", "Map File", file -> {
buttons().addImageTextButton("$editor.importmap", "icon-add", 14 * 2, () -> {
Platform.instance.showFileChooser("$editor.importmap", "Map File", file -> {
try{
DataInputStream stream = new DataInputStream(file.read());
MapMeta meta = MapIO.readMapMeta(stream);
@@ -41,9 +41,9 @@ public class MapsDialog extends FloatingDialog{
String name = meta.tags.get("name", file.nameWithoutExtension());
if(world.maps.getByName(name) != null && !world.maps.getByName(name).custom){
ui.showError(Core.bundle.format("text.editor.import.exists", name));
ui.showError(Core.bundle.format("editor.import.exists", name));
}else if(world.maps.getByName(name) != null){
ui.showConfirm("$text.confirm", "$text.editor.overwrite.confirm", () -> {
ui.showConfirm("$confirm", "$editor.overwrite.confirm", () -> {
world.maps.saveMap(name, data, meta.tags);
setup();
});
@@ -53,7 +53,7 @@ public class MapsDialog extends FloatingDialog{
}
}catch(Exception e){
ui.showError(Core.bundle.format("text.editor.errorimageload", Strings.parseException(e, false)));
ui.showError(Core.bundle.format("editor.errorimageload", Strings.parseException(e, false)));
Log.err(e);
}
}, true, mapExtension);
@@ -95,20 +95,20 @@ public class MapsDialog extends FloatingDialog{
button.row();
button.stack(new Image(map.texture).setScaling(Scaling.fit), new BorderImage(map.texture).setScaling(Scaling.fit)).size(mapsize - 20f);
button.row();
button.add(map.custom ? "$text.custom" : "$text.builtin").color(Color.GRAY).padTop(3);
button.add(map.custom ? "$custom" : "$builtin").color(Color.GRAY).padTop(3);
i++;
}
if(world.maps.all().size == 0){
maps.add("$text.maps.none");
maps.add("$maps.none");
}
content().add(pane).uniformX();
}
void showMapInfo(Map map){
dialog = new FloatingDialog("$text.editor.mapinfo");
dialog = new FloatingDialog("$editor.mapinfo");
dialog.addCloseButton();
float mapsize = UIUtils.portrait() ? 160f : 300f;
@@ -127,38 +127,38 @@ public class MapsDialog extends FloatingDialog{
t.top();
t.defaults().padTop(10).left();
t.add("$text.editor.name").padRight(10).color(Color.GRAY).padTop(0);
t.add("$editor.name").padRight(10).color(Color.GRAY).padTop(0);
t.row();
t.add(map.meta.tags.get("name", map.name)).growX().wrap().padTop(2);
t.row();
t.add("$text.editor.author").padRight(10).color(Color.GRAY);
t.add("$editor.author").padRight(10).color(Color.GRAY);
t.row();
t.add(map.meta.author()).growX().wrap().padTop(2);
t.row();
t.add("$text.editor.description").padRight(10).color(Color.GRAY).top();
t.add("$editor.description").padRight(10).color(Color.GRAY).top();
t.row();
t.add(map.meta.description()).growX().wrap().padTop(2);
t.row();
t.add("$text.editor.oregen.info").padRight(10).color(Color.GRAY);
t.add("$editor.oregen.info").padRight(10).color(Color.GRAY);
t.row();
t.add(map.meta.hasOreGen() ? "$text.on" : "$text.off").padTop(2);
t.add(map.meta.hasOreGen() ? "$on" : "$off").padTop(2);
}).height(mapsize).width(mapsize);
table.row();
table.addImageTextButton("$text.editor.openin", "icon-load-map", 16 * 2, () -> {
table.addImageTextButton("$editor.openin", "icon-load-map", 16 * 2, () -> {
try{
Vars.ui.editor.beginEditMap(map.stream.get());
dialog.hide();
hide();
}catch(Exception e){
e.printStackTrace();
ui.showError("$text.error.mapnotfound");
ui.showError("$error.mapnotfound");
}
}).fillX().height(54f).marginLeft(10);
table.addImageTextButton("$text.delete", "icon-trash-16", 16 * 2, () -> {
ui.showConfirm("$text.confirm", Core.bundle.format("text.map.delete", map.name), () -> {
table.addImageTextButton("$delete", "icon-trash-16", 16 * 2, () -> {
ui.showConfirm("$confirm", Core.bundle.format("map.delete", map.name), () -> {
world.maps.removeMap(map);
dialog.hide();
setup();

View File

@@ -15,7 +15,7 @@ public class PausedDialog extends FloatingDialog{
private Table missionTable;
public PausedDialog(){
super("$text.menu");
super("$menu");
shouldPause = true;
setup();
@@ -47,24 +47,24 @@ public class PausedDialog extends FloatingDialog{
float dw = 210f;
content().defaults().width(dw).height(50).pad(5f);
content().addButton("$text.back", this::hide).colspan(2).width(dw*2 + 20f);
content().addButton("$back", this::hide).colspan(2).width(dw*2 + 20f);
content().row();
content().addButton("$text.unlocks", ui.unlocks::show);
content().addButton("$text.settings", ui.settings::show);
content().addButton("$unlocks", ui.unlocks::show);
content().addButton("$settings", ui.settings::show);
content().row();
content().addButton("$text.savegame", save::show);
content().addButton("$text.loadgame", load::show).disabled(b -> Net.active());
content().addButton("$savegame", save::show);
content().addButton("$loadgame", load::show).disabled(b -> Net.active());
content().row();
content().addButton("$text.hostserver", ui.host::show).disabled(b -> Net.active()).colspan(2).width(dw*2 + 20f);
content().addButton("$hostserver", ui.host::show).disabled(b -> Net.active()).colspan(2).width(dw*2 + 20f);
content().row();
content().addButton("$text.quit", () -> {
ui.showConfirm("$text.confirm", "$text.quit.confirm", () -> {
content().addButton("$quit", () -> {
ui.showConfirm("$confirm", "$quit.confirm", () -> {
if(Net.client()) netClient.disconnectQuietly();
runExitSave();
hide();
@@ -75,16 +75,16 @@ public class PausedDialog extends FloatingDialog{
content().defaults().size(120f).pad(5);
float isize = 14f * 4;
content().addRowImageTextButton("$text.back", "icon-play-2", isize, this::hide);
content().addRowImageTextButton("$text.settings", "icon-tools", isize, ui.settings::show);
content().addRowImageTextButton("$text.save", "icon-save", isize, save::show);
content().addRowImageTextButton("$back", "icon-play-2", isize, this::hide);
content().addRowImageTextButton("$settings", "icon-tools", isize, ui.settings::show);
content().addRowImageTextButton("$save", "icon-save", isize, save::show);
content().row();
content().addRowImageTextButton("$text.load", "icon-load", isize, load::show).disabled(b -> Net.active());
content().addRowImageTextButton("$text.hostserver.mobile", "icon-host", isize, ui.host::show).disabled(b -> Net.active());
content().addRowImageTextButton("$text.quit", "icon-quit", isize, () -> {
ui.showConfirm("$text.confirm", "$text.quit.confirm", () -> {
content().addRowImageTextButton("$load", "icon-load", isize, load::show).disabled(b -> Net.active());
content().addRowImageTextButton("$hostserver.mobile", "icon-host", isize, ui.host::show).disabled(b -> Net.active());
content().addRowImageTextButton("$quit", "icon-quit", isize, () -> {
ui.showConfirm("$confirm", "$quit.confirm", () -> {
if(Net.client()) netClient.disconnectQuietly();
runExitSave();
hide();
@@ -100,12 +100,12 @@ public class PausedDialog extends FloatingDialog{
return;
}
ui.loadLogic("$text.saveload", () -> {
ui.loadLogic("$saveload", () -> {
try{
control.saves.getCurrent().save();
}catch(Throwable e){
e.printStackTrace();
ui.showError("[accent]" + Core.bundle.get("text.savefail"));
ui.showError("[accent]" + Core.bundle.get("savefail"));
}
state.set(State.menu);
});

View File

@@ -10,7 +10,7 @@ public class RestartDialog extends FloatingDialog{
private Team winner;
public RestartDialog(){
super("$text.gameover");
super("$gameover");
setFillParent(false);
shown(this::rebuild);
}
@@ -27,20 +27,20 @@ public class RestartDialog extends FloatingDialog{
buttons().margin(10);
if(state.mode.isPvp){
content().add(Core.bundle.format("text.gameover.pvp",winner.localized())).pad(6);
buttons().addButton("$text.menu", () -> {
content().add(Core.bundle.format("gameover.pvp",winner.localized())).pad(6);
buttons().addButton("$menu", () -> {
hide();
state.set(State.menu);
logic.reset();
}).size(130f, 60f);
}else{
if(control.isHighScore()){
content().add("$text.highscore").pad(6);
content().add("$highscore").pad(6);
content().row();
}
content().add(Core.bundle.format("text.wave.lasted", state.wave)).pad(12);
content().add(Core.bundle.format("wave.lasted", state.wave)).pad(12);
buttons().addButton("$text.menu", () -> {
buttons().addButton("$menu", () -> {
hide();
state.set(State.menu);
logic.reset();

View File

@@ -11,7 +11,7 @@ import static io.anuke.mindustry.Vars.*;
public class SaveDialog extends LoadDialog{
public SaveDialog(){
super("$text.savegame");
super("$savegame");
update(() -> {
if(state.is(State.menu) && isShown()){
@@ -22,9 +22,9 @@ public class SaveDialog extends LoadDialog{
public void addSetup(){
slots.row();
slots.addImageTextButton("$text.save.new", "icon-add",14 * 3, () ->
ui.showTextInput("$text.save", "$text.save.newslot", "", text -> {
ui.loadGraphics("$text.saving", () -> {
slots.addImageTextButton("$save.new", "icon-add",14 * 3, () ->
ui.showTextInput("$save", "$save.newslot", "", text -> {
ui.loadGraphics("$saving", () -> {
control.saves.addSave(text);
Core.app.post(() -> Core.app.post(this::setup));
});
@@ -37,13 +37,13 @@ public class SaveDialog extends LoadDialog{
button.clicked(() -> {
if(button.childrenPressed()) return;
ui.showConfirm("$text.overwrite", "$text.save.overwrite", () -> save(slot));
ui.showConfirm("$overwrite", "$save.overwrite", () -> save(slot));
});
}
void save(SaveSlot slot){
ui.loadfrag.show("$text.saveload");
ui.loadfrag.show("$saveload");
Time.runTask(5f, () -> {
hide();
@@ -53,7 +53,7 @@ public class SaveDialog extends LoadDialog{
}catch(Throwable e){
e.printStackTrace();
ui.showError("[accent]" + Core.bundle.get("text.savefail"));
ui.showError("[accent]" + Core.bundle.get("savefail"));
}
});
}

View File

@@ -62,7 +62,7 @@ public class SettingsMenuDialog extends SettingsDialog{
Consumer<SettingsTable> s = table -> {
table.row();
table.addImageTextButton("$text.back", "icon-arrow-left", 10 * 3, this::back).size(240f, 60f).colspan(2).padTop(15f);
table.addImageTextButton("$back", "icon-arrow-left", 10 * 3, this::back).size(240f, 60f).colspan(2).padTop(15f);
};
game = new SettingsTable(s);
@@ -74,17 +74,17 @@ public class SettingsMenuDialog extends SettingsDialog{
prefs.margin(14f);
menu.defaults().size(300f, 60f).pad(3f);
menu.addButton("$text.settings.game", () -> visible(0));
menu.addButton("$settings.game", () -> visible(0));
menu.row();
menu.addButton("$text.settings.graphics", () -> visible(1));
menu.addButton("$settings.graphics", () -> visible(1));
menu.row();
menu.addButton("$text.settings.sound", () -> visible(2));
menu.addButton("$settings.sound", () -> visible(2));
if(!Vars.mobile){
menu.row();
menu.addButton("$text.settings.controls", ui.controls::show);
menu.addButton("$settings.controls", ui.controls::show);
}
menu.row();
menu.addButton("$text.settings.language", ui.language::show);
menu.addButton("$settings.language", ui.language::show);
prefs.clearChildren();
prefs.add(menu);
@@ -138,20 +138,20 @@ public class SettingsMenuDialog extends SettingsDialog{
game.pref(new Setting(){
@Override
public void add(SettingsTable table){
table.addButton("$text.settings.cleardata", () -> {
FloatingDialog dialog = new FloatingDialog("$text.settings.cleardata");
table.addButton("$settings.cleardata", () -> {
FloatingDialog dialog = new FloatingDialog("$settings.cleardata");
dialog.setFillParent(false);
dialog.content().defaults().size(230f, 60f).pad(3);
dialog.addCloseButton();
dialog.content().addButton("$text.settings.clearunlocks", () -> {
ui.showConfirm("$text.confirm", "$text.settings.clear.confirm", () -> {
dialog.content().addButton("$settings.clearunlocks", () -> {
ui.showConfirm("$confirm", "$settings.clear.confirm", () -> {
data.reset();
dialog.hide();
});
});
dialog.content().row();
dialog.content().addButton("$text.settings.clearall", () -> {
ui.showConfirm("$text.confirm", "$text.settings.clearall.confirm", () -> {
dialog.content().addButton("$settings.clearall", () -> {
ui.showConfirm("$confirm", "$settings.clearall.confirm", () -> {
ObjectMap<String, Object> map = new ObjectMap<>();
for(String value : Core.settings.keys()){
if(value.contains("usid") || value.contains("uuid")){
@@ -214,7 +214,7 @@ public class SettingsMenuDialog extends SettingsDialog{
@Override
public void addCloseButton(){
buttons().addImageTextButton("$text.menu", "icon-arrow-left", 30f, this::hide).size(230f, 64f);
buttons().addImageTextButton("$menu", "icon-arrow-left", 30f, this::hide).size(230f, 64f);
keyDown(key -> {
if(key == KeyCode.ESCAPE || key == KeyCode.BACK)

View File

@@ -3,7 +3,7 @@ package io.anuke.mindustry.ui.dialogs;
public class TraceDialog extends FloatingDialog{
public TraceDialog(){
super("$text.trace");
super("$trace");
addCloseButton();
}
@@ -17,15 +17,15 @@ public class TraceDialog extends FloatingDialog{
/*
table.defaults().left();
table.add(Core.bundle.format("text.trace.playername", player.name));
table.add(Core.bundle.format("trace.playername", player.name));
table.row();
table.add(Core.bundle.format("text.trace.ip", info.ip));
table.add(Core.bundle.format("trace.ip", info.ip));
table.row();
table.add(Core.bundle.format("text.trace.id", info.uuid));
table.add(Core.bundle.format("trace.id", info.uuid));
table.row();
table.add(Core.bundle.format("text.trace.modclient", info.modclient));
table.add(Core.bundle.format("trace.modclient", info.modclient));
table.row();
table.add(Core.bundle.format("text.trace.android", info.android));
table.add(Core.bundle.format("trace.android", info.android));
table.row();
table.add().pad(5);
@@ -33,19 +33,19 @@ public class TraceDialog extends FloatingDialog{
//disabled until further notice
/*
table.add(Core.bundle.format("text.trace.totalblocksbroken", info.totalBlocksBroken));
table.add(Core.bundle.format("trace.totalblocksbroken", info.totalBlocksBroken));
table.row();
table.add(Core.bundle.format("text.trace.structureblocksbroken", info.structureBlocksBroken));
table.add(Core.bundle.format("trace.structureblocksbroken", info.structureBlocksBroken));
table.row();
table.add(Core.bundle.format("text.trace.lastblockbroken", info.lastBlockBroken.formalName));
table.add(Core.bundle.format("trace.lastblockbroken", info.lastBlockBroken.formalName));
table.row();
table.add().pad(5);
table.row();
table.add(Core.bundle.format("text.trace.totalblocksplaced", info.totalBlocksPlaced));
table.add(Core.bundle.format("trace.totalblocksplaced", info.totalBlocksPlaced));
table.row();
table.add(Core.bundle.format("text.trace.lastblockplaced", info.lastBlockPlaced.formalName));
table.add(Core.bundle.format("trace.lastblockplaced", info.lastBlockPlaced.formalName));
table.row();
content().add(table);

View File

@@ -18,7 +18,7 @@ import static io.anuke.mindustry.Vars.*;
public class UnlocksDialog extends FloatingDialog{
public UnlocksDialog(){
super("$text.unlocks");
super("$unlocks");
shouldPause = true;
addCloseButton();

View File

@@ -124,7 +124,7 @@ public class ChatFragment extends Table{
TextField to = dialog.content().addField("", t-> {}).pad(15).width(250f).get();
to.setMaxLength(maxTextLength);
to.keyDown(KeyCode.ENTER, () -> dialog.content().find("okb").fireClick());
dialog.content().addButton("$text.ok", () -> {
dialog.content().addButton("$ok", () -> {
chatfield.clearText();
chatfield.appendText(to.getText());
chatfield.change();

View File

@@ -130,9 +130,9 @@ public class HudFragment extends Fragment{
//fps display
infolabel = cont.table(t -> {
IntFormat fps = new IntFormat("text.fps");
IntFormat tps = new IntFormat("text.tps");
IntFormat ping = new IntFormat("text.ping");
IntFormat fps = new IntFormat("fps");
IntFormat tps = new IntFormat("tps");
IntFormat ping = new IntFormat("ping");
t.label(() -> fps.get(Core.graphics.getFramesPerSecond())).padRight(10);
t.row();
if(Net.hasClient()){
@@ -152,12 +152,12 @@ public class HudFragment extends Fragment{
//paused table
parent.fill(t -> {
t.top().visible(() -> state.is(State.paused) && !Net.active());
t.table("button", top -> top.add("$text.paused").pad(6f));
t.table("button", top -> top.add("$paused").pad(6f));
});
parent.fill(t -> {
t.visible(() -> netServer.isWaitingForPlayers() && !state.is(State.menu));
t.table("button", c -> c.add("$text.waiting.players"));
t.table("button", c -> c.add("$waiting.players"));
});
//'core is under attack' table
@@ -195,14 +195,14 @@ public class HudFragment extends Fragment{
return coreAttackOpacity > 0;
});
t.table("button", top -> top.add("$text.coreattack").pad(2)
t.table("button", top -> top.add("$coreattack").pad(2)
.update(label -> label.getColor().set(Color.ORANGE).lerp(Color.SCARLET, Mathf.absin(Time.time(), 2f, 1f))));
});
//'saving' indicator
parent.fill(t -> {
t.bottom().visible(() -> !state.is(State.menu) && control.saves.isSaving());
t.add("$text.saveload");
t.add("$saveload");
});
blockfrag.build(Core.scene.root);
@@ -258,7 +258,7 @@ public class HudFragment extends Fragment{
//add to table
table.add(in).padRight(8);
table.add("$text.unlocked");
table.add("$unlocked");
table.pack();
//create container table which will align and move
@@ -292,7 +292,7 @@ public class HudFragment extends Fragment{
//correct plurals if needed
if(esize == 1){
((Label) lastUnlockLayout.getParent().find(e -> e instanceof Label)).setText("$text.unlocked.plural");
((Label) lastUnlockLayout.getParent().find(e -> e instanceof Label)).setText("$unlocked.plural");
}
lastUnlockLayout.clearChildren();
@@ -326,12 +326,12 @@ public class HudFragment extends Fragment{
}
public void showTextDialog(String str){
new FloatingDialog("$text.mission.info"){{
new FloatingDialog("$mission.info"){{
shouldPause = true;
setFillParent(false);
getCell(content()).growX();
content().margin(15).add(str).width(400f).wrap().get().setAlignment(Align.left, Align.left);
buttons().addButton("$text.continue", this::hide).size(140, 60).pad(4);
buttons().addButton("$continue", this::hide).size(140, 60).pad(4);
}}.show();
}
@@ -361,9 +361,9 @@ public class HudFragment extends Fragment{
private void addWaveTable(TextButton table){
IntFormat wavef = new IntFormat("text.wave");
IntFormat enemyf = new IntFormat("text.wave.enemy");
IntFormat enemiesf = new IntFormat("text.wave.enemies");
IntFormat wavef = new IntFormat("wave");
IntFormat enemyf = new IntFormat("wave.enemy");
IntFormat enemiesf = new IntFormat("wave.enemies");
table.clearChildren();
table.touchable(Touchable.enabled);
@@ -375,8 +375,8 @@ public class HudFragment extends Fragment{
enemiesf.get(state.enemies())) :
wavef.get(state.wave) + "\n" +
(!state.mode.disableWaveTimer ?
Core.bundle.format("text.wave.waiting", (int)(state.wavetime/60)) :
Core.bundle.get("text.waiting")))
Core.bundle.format("wave.waiting", (int)(state.wavetime/60)) :
Core.bundle.get("waiting")))
).growX().pad(8f);
table.setDisabled(true);

View File

@@ -20,12 +20,12 @@ public class LoadingFragment extends Fragment{
t.addImage("white").growX().height(3f).pad(4f).growX().get().setColor(Palette.accent);
t.row();
t.add("$text.loading").name("namelabel").pad(10f);
t.add("$loading").name("namelabel").pad(10f);
t.row();
t.addImage("white").growX().height(3f).pad(4f).growX().get().setColor(Palette.accent);
t.row();
button = t.addButton("$text.cancel", () -> {}).pad(20).size(250f, 70f).visible(false).get();
button = t.addButton("$cancel", () -> {}).pad(20).size(250f, 70f).visible(false).get();
table = t;
});
}
@@ -37,7 +37,7 @@ public class LoadingFragment extends Fragment{
}
public void show(){
show("$text.loading");
show("$loading");
}
public void show(String text){

View File

@@ -56,14 +56,14 @@ public class MenuFragment extends Fragment{
container.defaults().size(size).pad(5).padTop(4f);
MobileButton
play = new MobileButton("icon-play-2", isize, "$text.play", this::showPlaySelect),
maps = new MobileButton("icon-map", isize, "$text.maps", ui.maps::show),
load = new MobileButton("icon-load", isize, "$text.load", ui.load::show),
join = new MobileButton("icon-add", isize, "$text.joingame", ui.join::show),
editor = new MobileButton("icon-editor", isize, "$text.editor", () -> ui.loadGraphics(ui.editor::show)),
tools = new MobileButton("icon-tools", isize, "$text.settings", ui.settings::show),
unlocks = new MobileButton("icon-unlocks", isize, "$text.unlocks", ui.unlocks::show),
donate = new MobileButton("icon-donate", isize, "$text.donate", Platform.instance::openDonations);
play = new MobileButton("icon-play-2", isize, "$play", this::showPlaySelect),
maps = new MobileButton("icon-map", isize, "$maps", ui.maps::show),
load = new MobileButton("icon-load", isize, "$load", ui.load::show),
join = new MobileButton("icon-add", isize, "$joingame", ui.join::show),
editor = new MobileButton("icon-editor", isize, "$editor", () -> ui.loadGraphics(ui.editor::show)),
tools = new MobileButton("icon-tools", isize, "$settings", ui.settings::show),
unlocks = new MobileButton("icon-unlocks", isize, "$unlocks", ui.unlocks::show),
donate = new MobileButton("icon-donate", isize, "$donate", Platform.instance::openDonations);
if(Core.graphics.getWidth() > Core.graphics.getHeight()){
container.add(play);
@@ -111,29 +111,29 @@ public class MenuFragment extends Fragment{
out.margin(16);
out.defaults().size(w, 66f).padTop(5).padRight(5);
out.add(new MenuButton("icon-play-2", "$text.play", MenuFragment.this::showPlaySelect)).width(bw).colspan(2);
out.add(new MenuButton("icon-play-2", "$play", MenuFragment.this::showPlaySelect)).width(bw).colspan(2);
out.row();
out.add(new MenuButton("icon-editor", "$text.editor", () -> ui.loadGraphics(ui.editor::show)));
out.add(new MenuButton("icon-editor", "$editor", () -> ui.loadGraphics(ui.editor::show)));
out.add(new MenuButton("icon-map", "$text.maps", ui.maps::show));
out.add(new MenuButton("icon-map", "$maps", ui.maps::show));
out.row();
out.add(new MenuButton("icon-info", "$text.about.button", ui.about::show));
out.add(new MenuButton("icon-info", "$about.button", ui.about::show));
out.add(new MenuButton("icon-tools", "$text.settings", ui.settings::show));
out.add(new MenuButton("icon-tools", "$settings", ui.settings::show));
out.row();
out.add(new MenuButton("icon-menu", "$text.changelog.title", ui.changelog::show));
out.add(new MenuButton("icon-menu", "$changelog.title", ui.changelog::show));
out.add(new MenuButton("icon-unlocks", "$text.unlocks", ui.unlocks::show));
out.add(new MenuButton("icon-unlocks", "$unlocks", ui.unlocks::show));
out.row();
out.add(new MenuButton("icon-exit", "$text.quit", Core.app::exit)).width(bw).colspan(2);
out.add(new MenuButton("icon-exit", "$quit", Core.app::exit)).width(bw).colspan(2);
});
}
@@ -144,29 +144,29 @@ public class MenuFragment extends Fragment{
float w = 220f;
float bw = w * 2f + 10f;
FloatingDialog dialog = new FloatingDialog("$text.play");
FloatingDialog dialog = new FloatingDialog("$play");
dialog.addCloseButton();
dialog.content().defaults().height(66f).width(w).padRight(5f);
dialog.content().add(new MenuButton("icon-play-2", "$text.map.random", () -> {
dialog.content().add(new MenuButton("icon-play-2", "$map.random", () -> {
dialog.hide();
world.generator.playRandomMap();
})).width(bw).colspan(2);
dialog.content().row();
dialog.content().add(new MenuButton("icon-add", "$text.joingame", () -> {
dialog.content().add(new MenuButton("icon-add", "$joingame", () -> {
ui.join.show();
dialog.hide();
}));
dialog.content().add(new MenuButton("icon-editor", "$text.customgame", () -> {
dialog.content().add(new MenuButton("icon-editor", "$customgame", () -> {
dialog.hide();
ui.levels.show();
}));
dialog.content().row();
dialog.content().add(new MenuButton("icon-load", "$text.loadgame", () -> {
dialog.content().add(new MenuButton("icon-load", "$loadgame", () -> {
ui.load.show();
dialog.hide();
})).width(bw).colspan(2);

View File

@@ -176,7 +176,7 @@ public class PlacementFragment extends Fragment{
header.left();
header.add(new ImageStack(lastDisplay.getCompactIcon())).size(8 * 4);
header.labelWrap(() ->
!data.isUnlocked(Recipe.getByResult(lastDisplay)) ? Core.bundle.get("text.blocks.unknown") : lastDisplay.formalName)
!data.isUnlocked(Recipe.getByResult(lastDisplay)) ? Core.bundle.get("blocks.unknown") : lastDisplay.formalName)
.left().width(190f).padLeft(5);
header.add().growX();
if(data.isUnlocked(Recipe.getByResult(lastDisplay))){

View File

@@ -44,7 +44,7 @@ public class PlayerListFragment extends Fragment{
});
cont.table("button", pane -> {
pane.label(() -> Core.bundle.format(playerGroup.size() == 1 ? "text.players.single" : "text.players", playerGroup.size()));
pane.label(() -> Core.bundle.format(playerGroup.size() == 1 ? "players.single" : "players", playerGroup.size()));
pane.row();
pane.pane(content).grow().get().setScrollingDisabled(true, false);
pane.row();
@@ -52,9 +52,9 @@ public class PlayerListFragment extends Fragment{
pane.table(menu -> {
menu.defaults().growX().height(50f).fillY();
menu.addButton("$text.server.bans", ui.bans::show).disabled(b -> Net.client());
menu.addButton("$text.server.admins", ui.admins::show).disabled(b -> Net.client());
menu.addButton("$text.close", this::toggle);
menu.addButton("$server.bans", ui.bans::show).disabled(b -> Net.client());
menu.addButton("$server.admins", ui.admins::show).disabled(b -> Net.client());
menu.addButton("$close", this::toggle);
}).margin(0f).pad(10f).growX();
}).touchable(Touchable.enabled).margin(14f);
@@ -108,9 +108,9 @@ public class PlayerListFragment extends Fragment{
t.defaults().size(bs);
t.addImageButton("icon-ban", "clear-partial", 14 * 2,
() -> ui.showConfirm("$text.confirm", "$text.confirmban", () -> Call.onAdminRequest(player, AdminAction.ban)));
() -> ui.showConfirm("$confirm", "$confirmban", () -> Call.onAdminRequest(player, AdminAction.ban)));
t.addImageButton("icon-cancel", "clear-partial", 16 * 2,
() -> ui.showConfirm("$text.confirm", "$text.confirmkick", () -> Call.onAdminRequest(player, AdminAction.kick)));
() -> ui.showConfirm("$confirm", "$confirmkick", () -> Call.onAdminRequest(player, AdminAction.kick)));
t.row();
@@ -120,9 +120,9 @@ public class PlayerListFragment extends Fragment{
String id = player.uuid;
if(netServer.admins.isAdmin(id, connection.address)){
ui.showConfirm("$text.confirm", "$text.confirmunadmin", () -> netServer.admins.unAdminPlayer(id));
ui.showConfirm("$confirm", "$confirmunadmin", () -> netServer.admins.unAdminPlayer(id));
}else{
ui.showConfirm("$text.confirm", "$text.confirmadmin", () -> netServer.admins.adminPlayer(id, player.usid));
ui.showConfirm("$confirm", "$confirmadmin", () -> netServer.admins.adminPlayer(id, player.usid));
}
})
.update(b -> b.setChecked(player.isAdmin))

View File

@@ -57,6 +57,6 @@ public enum BlockStat{
}
public String localized(){
return Core.bundle.get("text.blocks." + name().toLowerCase(Locale.ROOT));
return Core.bundle.get("blocks." + name().toLowerCase(Locale.ROOT));
}
}

View File

@@ -56,7 +56,7 @@ public class BlockStats{
/**Adds a stat value.*/
public void add(BlockStat stat, StatValue value){
if(!Core.bundle.has("text.blocks." + stat.name().toLowerCase(Locale.ROOT))){
if(!Core.bundle.has("blocks." + stat.name().toLowerCase(Locale.ROOT))){
if(!errorWhenMissing){
Log.err("Warning: No bundle entry for stat type \"" + stat + "\"!");
}else{
@@ -64,7 +64,7 @@ public class BlockStats{
}
}
if(!Core.bundle.has("text.category." + stat.category.name().toLowerCase(Locale.ROOT))){
if(!Core.bundle.has("category." + stat.category.name().toLowerCase(Locale.ROOT))){
if(!errorWhenMissing){
Log.err("Warning: No bundle entry for stat category \"" + stat.category + "\"!");
}else{

View File

@@ -22,6 +22,6 @@ public enum StatUnit{
public String localized(){
if(this == none) return "";
return Core.bundle.get("text.unit." + name().toLowerCase(Locale.ROOT));
return Core.bundle.get("unit." + name().toLowerCase(Locale.ROOT));
}
}

View File

@@ -12,6 +12,6 @@ public class BooleanValue implements StatValue{
@Override
public void display(Table table){
table.add(!value ? "$text.no" : "$text.yes");
table.add(!value ? "$no" : "$yes");
}
}