diff --git a/android/src/mindustry/android/AndroidLauncher.java b/android/src/mindustry/android/AndroidLauncher.java index 2a5e9aba4b..e2c484e50d 100644 --- a/android/src/mindustry/android/AndroidLauncher.java +++ b/android/src/mindustry/android/AndroidLauncher.java @@ -108,7 +108,7 @@ public class AndroidLauncher extends AndroidApplication{ }); }else if(VERSION.SDK_INT >= VERSION_CODES.M && !(checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED && checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED)){ - chooser = new FileChooser(open ? "$open" : "$save", file -> file.extension().equalsIgnoreCase(extension), open, file -> { + chooser = new FileChooser(open ? "@open" : "@save", file -> file.extension().equalsIgnoreCase(extension), open, file -> { if(!open){ cons.get(file.parent().child(file.nameWithoutExtension() + "." + extension)); }else{ @@ -216,10 +216,10 @@ public class AndroidLauncher extends AndroidApplication{ SaveSlot slot = control.saves.importSave(file); ui.load.runLoadSave(slot); }catch(IOException e){ - ui.showException("$save.import.fail", e); + ui.showException("@save.import.fail", e); } }else{ - ui.showErrorMessage("$save.import.invalid"); + ui.showErrorMessage("@save.import.invalid"); } }else if(map){ //open map Fi file = Core.files.local("temp-map." + mapExtension); diff --git a/core/src/mindustry/core/Control.java b/core/src/mindustry/core/Control.java index 0c327c3643..83ac42defa 100644 --- a/core/src/mindustry/core/Control.java +++ b/core/src/mindustry/core/Control.java @@ -122,7 +122,7 @@ public class Control implements ApplicationListener, Loadable{ net.host(port); player.admin(true); }catch(IOException e){ - ui.showException("$server.error", e); + ui.showException("@server.error", e); state.set(State.menu); } } @@ -312,7 +312,7 @@ public class Control implements ApplicationListener, Loadable{ }catch(SaveException e){ Log.err(e); sector.save = null; - Time.runTask(10f, () -> ui.showErrorMessage("$save.corrupted")); + Time.runTask(10f, () -> ui.showErrorMessage("@save.corrupted")); slot.delete(); playSector(origin, sector); } @@ -451,7 +451,7 @@ public class Control implements ApplicationListener, Loadable{ //display UI scale changed dialog if(Core.settings.getBool("uiscalechanged", false)){ Core.app.post(() -> Core.app.post(() -> { - BaseDialog dialog = new BaseDialog("$confirm"); + BaseDialog dialog = new BaseDialog("@confirm"); dialog.setFillParent(true); float[] countdown = {60 * 11}; @@ -470,9 +470,9 @@ public class Control implements ApplicationListener, Loadable{ }).pad(10f).expand().center(); dialog.buttons.defaults().size(200f, 60f); - dialog.buttons.button("$uiscale.cancel", exit); + dialog.buttons.button("@uiscale.cancel", exit); - dialog.buttons.button("$ok", () -> { + dialog.buttons.button("@ok", () -> { Core.settings.put("uiscalechanged", false); dialog.hide(); }); diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index 01f663f8ab..19f1ec454e 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -63,7 +63,7 @@ public class NetClient implements ApplicationListener{ reset(); ui.loadfrag.hide(); - ui.loadfrag.show("$connecting.data"); + ui.loadfrag.show("@connecting.data"); ui.loadfrag.setButton(() -> { ui.loadfrag.hide(); @@ -80,7 +80,7 @@ public class NetClient implements ApplicationListener{ c.uuid = platform.getUUID(); if(c.uuid == null){ - ui.showErrorMessage("$invalidid"); + ui.showErrorMessage("@invalidid"); ui.loadfrag.hide(); disconnectQuietly(); return; @@ -104,14 +104,14 @@ public class NetClient implements ApplicationListener{ if(packet.reason != null){ if(packet.reason.equals("closed")){ - ui.showSmall("$disconnect", "$disconnect.closed"); + ui.showSmall("@disconnect", "@disconnect.closed"); }else if(packet.reason.equals("timeout")){ - ui.showSmall("$disconnect", "$disconnect.timeout"); + ui.showSmall("@disconnect", "@disconnect.timeout"); }else if(packet.reason.equals("error")){ - ui.showSmall("$disconnect", "$disconnect.error"); + ui.showSmall("@disconnect", "@disconnect.error"); } }else{ - ui.showErrorMessage("$disconnect"); + ui.showErrorMessage("@disconnect"); } }); @@ -261,7 +261,7 @@ public class NetClient implements ApplicationListener{ if(reason.extraText() != null){ ui.showText(reason.toString(), reason.extraText()); }else{ - ui.showText("$disconnect", reason.toString()); + ui.showText("@disconnect", reason.toString()); } } ui.loadfrag.hide(); @@ -271,7 +271,7 @@ public class NetClient implements ApplicationListener{ public static void kick(String reason){ netClient.disconnectQuietly(); logic.reset(); - ui.showText("$disconnect", reason, Align.left); + ui.showText("@disconnect", reason, Align.left); ui.loadfrag.hide(); } @@ -347,7 +347,7 @@ public class NetClient implements ApplicationListener{ net.setClientLoaded(false); - ui.loadfrag.show("$connecting.data"); + ui.loadfrag.show("@connecting.data"); ui.loadfrag.setButton(() -> { ui.loadfrag.hide(); @@ -481,7 +481,7 @@ public class NetClient implements ApplicationListener{ Log.err("Failed to load data!"); ui.loadfrag.hide(); quiet = true; - ui.showErrorMessage("$disconnect.data"); + ui.showErrorMessage("@disconnect.data"); net.disconnect(); timeoutTime = 0f; } diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index 5708a470c7..30aad59fe4 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -740,7 +740,7 @@ public class NetServer implements ApplicationListener{ if(!headless && !closing && net.server() && state.isMenu()){ closing = true; - ui.loadfrag.show("$server.closing"); + ui.loadfrag.show("@server.closing"); Time.runTask(5f, () -> { net.closeServer(); ui.loadfrag.hide(); diff --git a/core/src/mindustry/core/Platform.java b/core/src/mindustry/core/Platform.java index 83c0c46c5a..ff7d44ec88 100644 --- a/core/src/mindustry/core/Platform.java +++ b/core/src/mindustry/core/Platform.java @@ -111,7 +111,7 @@ public interface Platform{ * @param extension File extension to filter */ default void showFileChooser(boolean open, String extension, Cons cons){ - new FileChooser(open ? "$open" : "$save", file -> file.extEquals(extension), open, file -> { + new FileChooser(open ? "@open" : "@save", file -> file.extEquals(extension), open, file -> { if(!open){ cons.get(file.parent().child(file.nameWithoutExtension() + "." + extension)); }else{ @@ -129,7 +129,7 @@ public interface Platform{ if(mobile){ showFileChooser(true, extensions[0], cons); }else{ - new FileChooser("$open", file -> Structs.contains(extensions, file.extension().toLowerCase()), true, cons).show(); + new FileChooser("@open", file -> Structs.contains(extensions, file.extension().toLowerCase()), true, cons).show(); } } diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index d335a3bbae..dc5d350a0f 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -138,7 +138,7 @@ public class Renderer implements ApplicationListener{ }catch(Throwable e){ e.printStackTrace(); settings.put("bloom", false); - ui.showErrorMessage("$error.bloom"); + ui.showErrorMessage("@error.bloom"); } } @@ -318,7 +318,7 @@ public class Renderer implements ApplicationListener{ int memory = w * h * 4 / 1024 / 1024; if(memory >= 65){ - ui.showInfo("$screenshot.invalid"); + ui.showInfo("@screenshot.invalid"); return; } diff --git a/core/src/mindustry/core/UI.java b/core/src/mindustry/core/UI.java index d068d7d23e..66ff092959 100644 --- a/core/src/mindustry/core/UI.java +++ b/core/src/mindustry/core/UI.java @@ -225,7 +225,7 @@ public class UI implements ApplicationListener, Loadable{ } public void loadAnd(Runnable call){ - loadAnd("$loading", call); + loadAnd("@loading", call); } public void loadAnd(String text, Runnable call){ @@ -239,7 +239,7 @@ public class UI implements ApplicationListener, Loadable{ public void showTextInput(String titleText, String dtext, int textLength, String def, boolean inumeric, Cons confirmed){ if(mobile){ Core.input.getTextInput(new TextInput(){{ - this.title = (titleText.startsWith("$") ? Core.bundle.get(titleText.substring(1)) : titleText); + this.title = (titleText.startsWith("@") ? Core.bundle.get(titleText.substring(1)) : titleText); this.text = def; this.numeric = inumeric; this.maxLength = textLength; @@ -252,11 +252,11 @@ public class UI implements ApplicationListener, Loadable{ TextField field = cont.field(def, t -> {}).size(330f, 50f).get(); field.setFilter((f, c) -> field.getText().length() < textLength && filter.acceptChar(f, c)); buttons.defaults().size(120, 54).pad(4); - buttons.button("$ok", () -> { + buttons.button("@ok", () -> { confirmed.get(field.getText()); hide(); }).disabled(b -> field.getText().isEmpty()); - buttons.button("$cancel", this::hide); + buttons.button("@cancel", this::hide); keyDown(KeyCode.enter, () -> { String text = field.getText(); if(!text.isEmpty()){ @@ -341,7 +341,7 @@ public class UI implements ApplicationListener, Loadable{ new Dialog(""){{ getCell(cont).growX(); cont.margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center); - buttons.button("$ok", () -> { + buttons.button("@ok", () -> { hide(); listener.run(); }).size(110, 50).pad(4); @@ -352,7 +352,7 @@ public class UI implements ApplicationListener, Loadable{ new Dialog(""){{ getCell(cont).growX(); cont.margin(15).add(info).width(400f).wrap().get().setAlignment(Align.left); - buttons.button("$ok", this::hide).size(110, 50).pad(4); + buttons.button("@ok", this::hide).size(110, 50).pad(4); }}.show(); } @@ -360,13 +360,13 @@ public class UI implements ApplicationListener, Loadable{ new Dialog(""){{ setFillParent(true); cont.margin(15f); - cont.add("$error.title"); + cont.add("@error.title"); cont.row(); cont.image().width(300f).pad(2).height(4f).color(Color.scarlet); cont.row(); cont.add(text).pad(2f).growX().wrap().get().setAlignment(Align.center); cont.row(); - cont.button("$ok", this::hide).size(120, 50).pad(4); + cont.button("@ok", this::hide).size(120, 50).pad(4); }}.show(); } @@ -381,17 +381,17 @@ public class UI implements ApplicationListener, Loadable{ setFillParent(true); cont.margin(15); - cont.add("$error.title").colspan(2); + cont.add("@error.title").colspan(2); cont.row(); cont.image().width(300f).pad(2).colspan(2).height(4f).color(Color.scarlet); cont.row(); - cont.add((text.startsWith("$") ? Core.bundle.get(text.substring(1)) : text) + (message == null ? "" : "\n[lightgray](" + message + ")")).colspan(2).wrap().growX().center().get().setAlignment(Align.center); + cont.add((text.startsWith("@") ? Core.bundle.get(text.substring(1)) : text) + (message == null ? "" : "\n[lightgray](" + message + ")")).colspan(2).wrap().growX().center().get().setAlignment(Align.center); cont.row(); Collapser col = new Collapser(base -> base.pane(t -> t.margin(14f).add(Strings.neatError(exc)).color(Color.lightGray).left()), true); - cont.button("$details", Styles.togglet, col::toggle).size(180f, 50f).checked(b -> !col.isCollapsed()).fillX().right(); - cont.button("$ok", this::hide).size(110, 50).fillX().left(); + cont.button("@details", Styles.togglet, col::toggle).size(180f, 50f).checked(b -> !col.isCollapsed()).fillX().right(); + cont.button("@ok", this::hide).size(110, 50).fillX().left(); cont.row(); cont.add(col).colspan(2).pad(2); }}.show(); @@ -408,14 +408,14 @@ public class UI implements ApplicationListener, Loadable{ cont.row(); cont.add(text).width(400f).wrap().get().setAlignment(align, align); cont.row(); - buttons.button("$ok", this::hide).size(110, 50).pad(4); + buttons.button("@ok", this::hide).size(110, 50).pad(4); }}.show(); } public void showInfoText(String titleText, String text){ new Dialog(titleText){{ cont.margin(15).add(text).width(400f).wrap().left().get().setAlignment(Align.left, Align.left); - buttons.button("$ok", this::hide).size(110, 50).pad(4); + buttons.button("@ok", this::hide).size(110, 50).pad(4); }}.show(); } @@ -424,7 +424,7 @@ public class UI implements ApplicationListener, Loadable{ cont.margin(10).add(text); titleTable.row(); titleTable.image().color(Pal.accent).height(3f).growX().pad(2f); - buttons.button("$ok", this::hide).size(110, 50).pad(4); + buttons.button("@ok", this::hide).size(110, 50).pad(4); }}.show(); } @@ -437,8 +437,8 @@ public class UI implements ApplicationListener, Loadable{ dialog.cont.add(text).width(mobile ? 400f : 500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center); dialog.buttons.defaults().size(200f, 54f).pad(2f); dialog.setFillParent(false); - dialog.buttons.button("$cancel", dialog::hide); - dialog.buttons.button("$ok", () -> { + dialog.buttons.button("@cancel", dialog::hide); + dialog.buttons.button("@ok", () -> { dialog.hide(); confirmed.run(); }); @@ -490,7 +490,7 @@ public class UI implements ApplicationListener, Loadable{ dialog.cont.add(text).width(500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center); dialog.buttons.defaults().size(200f, 54f).pad(2f); dialog.setFillParent(false); - dialog.buttons.button("$ok", () -> { + dialog.buttons.button("@ok", () -> { dialog.hide(); confirmed.run(); }); diff --git a/core/src/mindustry/core/World.java b/core/src/mindustry/core/World.java index 830db31d9d..f9c7e97e15 100644 --- a/core/src/mindustry/core/World.java +++ b/core/src/mindustry/core/World.java @@ -277,7 +277,7 @@ public class World{ }catch(Throwable e){ Log.err(e); if(!headless){ - ui.showErrorMessage("$map.invalid"); + ui.showErrorMessage("@map.invalid"); Core.app.post(() -> state.set(State.menu)); invalidMap = true; } @@ -291,17 +291,17 @@ public class World{ if(!headless){ if(state.teams.playerCores().size == 0 && !checkRules.pvp){ - ui.showErrorMessage("$map.nospawn"); + ui.showErrorMessage("@map.nospawn"); invalidMap = true; }else if(checkRules.pvp){ //pvp maps need two cores to be valid if(state.teams.getActive().count(TeamData::hasCore) < 2){ invalidMap = true; - ui.showErrorMessage("$map.nospawn.pvp"); + ui.showErrorMessage("@map.nospawn.pvp"); } }else if(checkRules.attackMode){ //attack maps need two cores to be valid invalidMap = state.teams.get(state.rules.waveTeam).noCores(); if(invalidMap){ - ui.showErrorMessage("$map.nospawn.attack"); + ui.showErrorMessage("@map.nospawn.attack"); } } }else{ diff --git a/core/src/mindustry/editor/MapEditorDialog.java b/core/src/mindustry/editor/MapEditorDialog.java index 8fcd9f8d44..045d0b724e 100644 --- a/core/src/mindustry/editor/MapEditorDialog.java +++ b/core/src/mindustry/editor/MapEditorDialog.java @@ -58,7 +58,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ infoDialog = new MapInfoDialog(editor); generateDialog = new MapGenerateDialog(editor, true); - menu = new BaseDialog("$menu"); + menu = new BaseDialog("@menu"); menu.addCloseButton(); float swidth = 180f; @@ -66,41 +66,41 @@ public class MapEditorDialog extends Dialog implements Disposable{ menu.cont.table(t -> { t.defaults().size(swidth, 60f).padBottom(5).padRight(5).padLeft(5); - t.button("$editor.savemap", Icon.save, this::save); + t.button("@editor.savemap", Icon.save, this::save); - t.button("$editor.mapinfo", Icon.pencil, () -> { + t.button("@editor.mapinfo", Icon.pencil, () -> { infoDialog.show(); menu.hide(); }); t.row(); - t.button("$editor.generate", Icon.terrain, () -> { + t.button("@editor.generate", Icon.terrain, () -> { generateDialog.show(generateDialog::applyToEditor); menu.hide(); }); - t.button("$editor.resize", Icon.resize, () -> { + t.button("@editor.resize", Icon.resize, () -> { resizeDialog.show(); menu.hide(); }); t.row(); - t.button("$editor.import", Icon.download, () -> createDialog("$editor.import", - "$editor.importmap", "$editor.importmap.description", Icon.download, (Runnable)loadDialog::show, - "$editor.importfile", "$editor.importfile.description", Icon.file, (Runnable)() -> + t.button("@editor.import", Icon.download, () -> createDialog("@editor.import", + "@editor.importmap", "@editor.importmap.description", Icon.download, (Runnable)loadDialog::show, + "@editor.importfile", "@editor.importfile.description", Icon.file, (Runnable)() -> platform.showFileChooser(true, mapExtension, file -> ui.loadAnd(() -> { maps.tryCatchMapError(() -> { if(MapIO.isImage(file)){ - ui.showInfo("$editor.errorimage"); + ui.showInfo("@editor.errorimage"); }else{ editor.beginEdit(MapIO.createMap(file, true)); } }); })), - "$editor.importimage", "$editor.importimage.description", Icon.fileImage, (Runnable)() -> + "@editor.importimage", "@editor.importimage.description", Icon.fileImage, (Runnable)() -> platform.showFileChooser(true, "png", file -> ui.loadAnd(() -> { try{ @@ -108,16 +108,16 @@ public class MapEditorDialog extends Dialog implements Disposable{ editor.beginEdit(pixmap); pixmap.dispose(); }catch(Exception e){ - ui.showException("$editor.errorload", e); + ui.showException("@editor.errorload", e); Log.err(e); } }))) ); - t.button("$editor.export", Icon.upload, () -> createDialog("$editor.export", - "$editor.exportfile", "$editor.exportfile.description", Icon.file, + t.button("@editor.export", Icon.upload, () -> createDialog("@editor.export", + "@editor.exportfile", "@editor.exportfile.description", Icon.file, (Runnable)() -> platform.export(editor.getTags().get("name", "unknown"), mapExtension, file -> MapIO.writeMap(file, editor.createMap(file))), - "$editor.exportimage", "$editor.exportimage.description", Icon.fileImage, + "@editor.exportimage", "@editor.exportimage.description", Icon.fileImage, (Runnable)() -> platform.export(editor.getTags().get("name", "unknown"), "png", file -> { Pixmap out = MapIO.writeImage(editor.tiles()); file.writePNG(out); @@ -128,7 +128,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ menu.cont.row(); if(steam){ - menu.cont.button("$editor.publish.workshop", Icon.link, () -> { + menu.cont.button("@editor.publish.workshop", Icon.link, () -> { Map builtin = maps.all().find(m -> m.name().equals(editor.getTags().get("name", "").trim())); if(editor.getTags().containsKey("steamid") && builtin != null && !builtin.custom){ @@ -146,26 +146,26 @@ public class MapEditorDialog extends Dialog implements Disposable{ if(map == null) return; if(map.tags.get("description", "").length() < 4){ - ui.showErrorMessage("$editor.nodescription"); + ui.showErrorMessage("@editor.nodescription"); return; } if(!Structs.contains(Gamemode.all, g -> g.valid(map))){ - ui.showErrorMessage("$map.nospawn"); + ui.showErrorMessage("@map.nospawn"); return; } platform.publish(map); - }).padTop(-3).size(swidth * 2f + 10, 60f).update(b -> b.setText(editor.getTags().containsKey("steamid") ? editor.getTags().get("author").equals(player.name) ? "$workshop.listing" : "$view.workshop" : "$editor.publish.workshop")); + }).padTop(-3).size(swidth * 2f + 10, 60f).update(b -> b.setText(editor.getTags().containsKey("steamid") ? editor.getTags().get("author").equals(player.name) ? "@workshop.listing" : "@view.workshop" : "@editor.publish.workshop")); menu.cont.row(); } - menu.cont.button("$editor.ingame", Icon.right, this::playtest).padTop(!steam ? -3 : 1).size(swidth * 2f + 10, 60f); + menu.cont.button("@editor.ingame", Icon.right, this::playtest).padTop(!steam ? -3 : 1).size(swidth * 2f + 10, 60f); menu.cont.row(); - menu.cont.button("$quit", Icon.exit, () -> { + menu.cont.button("@quit", Icon.exit, () -> { tryExit(); menu.hide(); }).size(swidth * 2f + 10, 60f); @@ -182,7 +182,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ try{ editor.beginEdit(map); }catch(Exception e){ - ui.showException("$editor.errorload", e); + ui.showException("@editor.errorload", e); Log.err(e); } })); @@ -280,14 +280,14 @@ public class MapEditorDialog extends Dialog implements Disposable{ if(name.isEmpty()){ infoDialog.show(); - Core.app.post(() -> ui.showErrorMessage("$editor.save.noname")); + Core.app.post(() -> ui.showErrorMessage("@editor.save.noname")); }else{ Map map = maps.all().find(m -> m.name().equals(name)); if(map != null && !map.custom){ handleSaveBuiltin(map); }else{ returned = maps.saveMap(editor.getTags()); - ui.showInfoFade("$editor.saved"); + ui.showInfoFade("@editor.saved"); } } @@ -299,7 +299,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ /** Called when a built-in map save is attempted.*/ protected void handleSaveBuiltin(Map map){ - ui.showErrorMessage("$editor.save.overwrite"); + ui.showErrorMessage("@editor.save.overwrite"); } /** @@ -368,7 +368,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ show(); }catch(Exception e){ Log.err(e); - ui.showException("$editor.errorload", e); + ui.showException("@editor.errorload", e); } }); } @@ -521,7 +521,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ tools.row(); - tools.table(Tex.underline, t -> t.add("$editor.teams")) + tools.table(Tex.underline, t -> t.add("@editor.teams")) .colspan(3).height(40).width(size * 3f + 3f).padBottom(3); tools.row(); @@ -557,7 +557,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ } t.top(); - t.add("$editor.brush"); + t.add("@editor.brush"); t.row(); t.add(slider).width(size * 3f - 20).padTop(4f); }).padTop(5).growX().top(); @@ -650,7 +650,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ private void tryExit(){ if(!saved){ - ui.showConfirm("$confirm", "$editor.unsaved", this::hide); + ui.showConfirm("@confirm", "@editor.unsaved", this::hide); }else{ hide(); } diff --git a/core/src/mindustry/editor/MapGenerateDialog.java b/core/src/mindustry/editor/MapGenerateDialog.java index b9f0962cea..09262a9d74 100644 --- a/core/src/mindustry/editor/MapGenerateDialog.java +++ b/core/src/mindustry/editor/MapGenerateDialog.java @@ -58,34 +58,34 @@ public class MapGenerateDialog extends BaseDialog{ /** @param applied whether or not to use the applied in-game mode. */ public MapGenerateDialog(MapEditor editor, boolean applied){ - super("$editor.generate"); + super("@editor.generate"); this.editor = editor; this.applied = applied; shown(this::setup); addCloseButton(); if(applied){ - buttons.button("$editor.apply", () -> { + buttons.button("@editor.apply", () -> { ui.loadAnd(() -> { apply(); hide(); }); }).size(160f, 64f); }else{ - buttons.button("$settings.reset", () -> { + buttons.button("@settings.reset", () -> { filters.set(maps.readFilters("")); rebuildFilters(); update(); }).size(160f, 64f); } - buttons.button("$editor.randomize", () -> { + buttons.button("@editor.randomize", () -> { for(GenerateFilter filter : filters){ filter.randomize(); } update(); }).size(160f, 64f); - buttons.button("$add", Icon.add, this::showAdd).height(64f).width(140f); + buttons.button("@add", Icon.add, this::showAdd).height(64f).width(140f); if(!applied){ hidden(this::apply); @@ -277,12 +277,12 @@ public class MapGenerateDialog extends BaseDialog{ } if(filters.isEmpty()){ - filterTable.add("$filters.empty").wrap().width(200f); + filterTable.add("@filters.empty").wrap().width(200f); } } void showAdd(){ - BaseDialog selection = new BaseDialog("$add"); + BaseDialog selection = new BaseDialog("@add"); selection.setFillParent(false); selection.cont.defaults().size(210f, 60f); int i = 0; @@ -300,7 +300,7 @@ public class MapGenerateDialog extends BaseDialog{ if(++i % 2 == 0) selection.cont.row(); } - selection.cont.button("$filter.defaultores", () -> { + selection.cont.button("@filter.defaultores", () -> { maps.addDefaultOres(filters); rebuildFilters(); update(); diff --git a/core/src/mindustry/editor/MapInfoDialog.java b/core/src/mindustry/editor/MapInfoDialog.java index b5a7e435ea..9e217c335f 100644 --- a/core/src/mindustry/editor/MapInfoDialog.java +++ b/core/src/mindustry/editor/MapInfoDialog.java @@ -16,7 +16,7 @@ public class MapInfoDialog extends BaseDialog{ private final CustomRulesDialog ruleInfo = new CustomRulesDialog(); public MapInfoDialog(MapEditor editor){ - super("$editor.mapinfo"); + super("@editor.mapinfo"); this.editor = editor; this.waveInfo = new WaveInfoDialog(editor); this.generate = new MapGenerateDialog(editor, false); @@ -32,47 +32,47 @@ public class MapInfoDialog extends BaseDialog{ ObjectMap tags = editor.getTags(); cont.pane(t -> { - t.add("$editor.mapname").padRight(8).left(); + t.add("@editor.mapname").padRight(8).left(); t.defaults().padTop(15); TextField name = t.field(tags.get("name", ""), text -> { tags.put("name", text); }).size(400, 55f).addInputDialog(50).get(); - name.setMessageText("$unknown"); + name.setMessageText("@unknown"); t.row(); - t.add("$editor.description").padRight(8).left(); + t.add("@editor.description").padRight(8).left(); TextArea description = t.area(tags.get("description", ""), Styles.areaField, text -> { tags.put("description", text); }).size(400f, 140f).addInputDialog(1000).get(); t.row(); - t.add("$editor.author").padRight(8).left(); + t.add("@editor.author").padRight(8).left(); TextField author = t.field(tags.get("author", Core.settings.getString("mapAuthor", "")), text -> { tags.put("author", text); Core.settings.put("mapAuthor", text); }).size(400, 55f).addInputDialog(50).get(); - author.setMessageText("$unknown"); + author.setMessageText("@unknown"); t.row(); - t.add("$editor.rules").padRight(8).left(); - t.button("$edit", () -> { + t.add("@editor.rules").padRight(8).left(); + t.button("@edit", () -> { ruleInfo.show(Vars.state.rules, () -> Vars.state.rules = new Rules()); hide(); }).left().width(200f); t.row(); - t.add("$editor.waves").padRight(8).left(); - t.button("$edit", () -> { + t.add("@editor.waves").padRight(8).left(); + t.button("@edit", () -> { waveInfo.show(); hide(); }).left().width(200f); t.row(); - t.add("$editor.generation").padRight(8).left(); - t.button("$edit", () -> { + t.add("@editor.generation").padRight(8).left(); + t.button("@edit", () -> { generate.show(Vars.maps.readFilters(editor.getTags().get("genfilters", "")), filters -> editor.getTags().put("genfilters", JsonIO.write(filters))); hide(); diff --git a/core/src/mindustry/editor/MapLoadDialog.java b/core/src/mindustry/editor/MapLoadDialog.java index 540ed754a2..53673ae9d2 100644 --- a/core/src/mindustry/editor/MapLoadDialog.java +++ b/core/src/mindustry/editor/MapLoadDialog.java @@ -14,11 +14,11 @@ public class MapLoadDialog extends BaseDialog{ private Map selected = null; public MapLoadDialog(Cons loader){ - super("$editor.loadmap"); + super("@editor.loadmap"); shown(this::rebuild); - TextButton button = new TextButton("$load"); + TextButton button = new TextButton("@load"); button.setDisabled(() -> selected == null); button.clicked(() -> { if(selected != null){ @@ -28,7 +28,7 @@ public class MapLoadDialog extends BaseDialog{ }); buttons.defaults().size(200f, 50f); - buttons.button("$cancel", this::hide); + buttons.button("@cancel", this::hide); buttons.add(button); } @@ -64,9 +64,9 @@ public class MapLoadDialog extends BaseDialog{ } if(maps.all().size == 0){ - table.add("$maps.none").center(); + table.add("@maps.none").center(); }else{ - cont.add("$editor.loadmap"); + cont.add("@editor.loadmap"); } cont.row(); diff --git a/core/src/mindustry/editor/MapResizeDialog.java b/core/src/mindustry/editor/MapResizeDialog.java index 29178f3976..b3e190b020 100644 --- a/core/src/mindustry/editor/MapResizeDialog.java +++ b/core/src/mindustry/editor/MapResizeDialog.java @@ -12,7 +12,7 @@ public class MapResizeDialog extends BaseDialog{ int width, height; public MapResizeDialog(MapEditor editor, Intc2 cons){ - super("$editor.resizemap"); + super("@editor.resizemap"); shown(() -> { cont.clear(); width = editor.width(); @@ -21,7 +21,7 @@ public class MapResizeDialog extends BaseDialog{ Table table = new Table(); for(boolean w : Mathf.booleans){ - table.add(w ? "$width" : "$height").padRight(8f); + table.add(w ? "@width" : "@height").padRight(8f); table.defaults().height(60f).padTop(8); table.field((w ? width : height) + "", TextFieldFilter.digitsOnly, value -> { @@ -37,8 +37,8 @@ public class MapResizeDialog extends BaseDialog{ }); buttons.defaults().size(200f, 50f); - buttons.button("$cancel", this::hide); - buttons.button("$ok", () -> { + buttons.button("@cancel", this::hide); + buttons.button("@ok", () -> { cons.get(width, height); hide(); }); diff --git a/core/src/mindustry/editor/WaveGraph.java b/core/src/mindustry/editor/WaveGraph.java index 7245a96b1a..f71a5e6f7d 100644 --- a/core/src/mindustry/editor/WaveGraph.java +++ b/core/src/mindustry/editor/WaveGraph.java @@ -137,7 +137,7 @@ public class WaveGraph extends Table{ ButtonGroup