mirror of
https://github.com/Anuken/Mindustry.git
synced 2024-11-13 07:15:28 +03:00
Replaced '$' formatting with '@'
This commit is contained in:
parent
8dd4839f53
commit
f60afc39f1
@ -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);
|
||||
|
@ -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();
|
||||
});
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -111,7 +111,7 @@ public interface Platform{
|
||||
* @param extension File extension to filter
|
||||
*/
|
||||
default void showFileChooser(boolean open, String extension, Cons<Fi> 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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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<String> 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();
|
||||
});
|
||||
|
@ -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{
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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<String, String> 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();
|
||||
|
@ -14,11 +14,11 @@ public class MapLoadDialog extends BaseDialog{
|
||||
private Map selected = null;
|
||||
|
||||
public MapLoadDialog(Cons<Map> 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();
|
||||
|
@ -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();
|
||||
});
|
||||
|
@ -137,7 +137,7 @@ public class WaveGraph extends Table{
|
||||
ButtonGroup<Button> group = new ButtonGroup<>();
|
||||
|
||||
for(Mode m : Mode.all){
|
||||
t.button("$wavemode." + m.name(), Styles.fullTogglet, () -> {
|
||||
t.button("@wavemode." + m.name(), Styles.fullTogglet, () -> {
|
||||
mode = m;
|
||||
}).group(group).height(35f).update(b -> b.setChecked(m == mode)).width(130f);
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ public class WaveInfoDialog extends BaseDialog{
|
||||
private WaveGraph graph = new WaveGraph();
|
||||
|
||||
public WaveInfoDialog(MapEditor editor){
|
||||
super("$waves.title");
|
||||
super("@waves.title");
|
||||
|
||||
shown(this::setup);
|
||||
hidden(() -> {
|
||||
@ -48,29 +48,29 @@ public class WaveInfoDialog extends BaseDialog{
|
||||
onResize(this::setup);
|
||||
addCloseButton();
|
||||
|
||||
buttons.button("$waves.edit", () -> {
|
||||
BaseDialog dialog = new BaseDialog("$waves.edit");
|
||||
buttons.button("@waves.edit", () -> {
|
||||
BaseDialog dialog = new BaseDialog("@waves.edit");
|
||||
dialog.addCloseButton();
|
||||
dialog.setFillParent(false);
|
||||
dialog.cont.defaults().size(210f, 64f);
|
||||
dialog.cont.button("$waves.copy", () -> {
|
||||
ui.showInfoFade("$waves.copied");
|
||||
dialog.cont.button("@waves.copy", () -> {
|
||||
ui.showInfoFade("@waves.copied");
|
||||
Core.app.setClipboardText(maps.writeWaves(groups));
|
||||
dialog.hide();
|
||||
}).disabled(b -> groups == null);
|
||||
dialog.cont.row();
|
||||
dialog.cont.button("$waves.load", () -> {
|
||||
dialog.cont.button("@waves.load", () -> {
|
||||
try{
|
||||
groups = maps.readWaves(Core.app.getClipboardText());
|
||||
buildGroups();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
ui.showErrorMessage("$waves.invalid");
|
||||
ui.showErrorMessage("@waves.invalid");
|
||||
}
|
||||
dialog.hide();
|
||||
}).disabled(b -> Core.app.getClipboardText() == null || Core.app.getClipboardText().isEmpty());
|
||||
dialog.cont.row();
|
||||
dialog.cont.button("$settings.reset", () -> ui.showConfirm("$confirm", "$settings.clear.confirm", () -> {
|
||||
dialog.cont.button("@settings.reset", () -> ui.showConfirm("@confirm", "@settings.clear.confirm", () -> {
|
||||
groups = JsonIO.copy(defaultWaves.get());
|
||||
buildGroups();
|
||||
dialog.hide();
|
||||
@ -130,12 +130,12 @@ public class WaveInfoDialog extends BaseDialog{
|
||||
cont.stack(new Table(Tex.clear, main -> {
|
||||
main.pane(t -> table = t).growX().growY().padRight(8f).get().setScrollingDisabled(true, false);
|
||||
main.row();
|
||||
main.button("$add", () -> {
|
||||
main.button("@add", () -> {
|
||||
if(groups == null) groups = new Seq<>();
|
||||
groups.add(new SpawnGroup(lastType));
|
||||
buildGroups();
|
||||
}).growX().height(70f);
|
||||
}), new Label("$waves.none"){{
|
||||
}), new Label("@waves.none"){{
|
||||
visible(() -> groups.isEmpty());
|
||||
this.touchable = Touchable.disabled;
|
||||
setWrap(true);
|
||||
@ -180,7 +180,7 @@ public class WaveInfoDialog extends BaseDialog{
|
||||
updateWaves();
|
||||
}
|
||||
}).width(100f);
|
||||
spawns.add("$waves.to").padLeft(4).padRight(4);
|
||||
spawns.add("@waves.to").padLeft(4).padRight(4);
|
||||
spawns.field(group.end == never ? "" : (group.end + 1) + "", TextFieldFilter.digitsOnly, text -> {
|
||||
if(Strings.canParsePositiveInt(text)){
|
||||
group.end = Strings.parseInt(text) - 1;
|
||||
@ -193,14 +193,14 @@ public class WaveInfoDialog extends BaseDialog{
|
||||
});
|
||||
t.row();
|
||||
t.table(p -> {
|
||||
p.add("$waves.every").padRight(4);
|
||||
p.add("@waves.every").padRight(4);
|
||||
p.field(group.spacing + "", TextFieldFilter.digitsOnly, text -> {
|
||||
if(Strings.canParsePositiveInt(text) && Strings.parseInt(text) > 0){
|
||||
group.spacing = Strings.parseInt(text);
|
||||
updateWaves();
|
||||
}
|
||||
}).width(100f);
|
||||
p.add("$waves.waves").padLeft(4);
|
||||
p.add("@waves.waves").padLeft(4);
|
||||
});
|
||||
|
||||
t.row();
|
||||
@ -219,7 +219,7 @@ public class WaveInfoDialog extends BaseDialog{
|
||||
updateWaves();
|
||||
}
|
||||
}).width(80f);
|
||||
a.add("$waves.perspawn").padLeft(4);
|
||||
a.add("@waves.perspawn").padLeft(4);
|
||||
});
|
||||
t.row();
|
||||
t.table(a -> {
|
||||
@ -237,17 +237,17 @@ public class WaveInfoDialog extends BaseDialog{
|
||||
updateWaves();
|
||||
}
|
||||
}).width(80f);
|
||||
a.add("$waves.shields").padLeft(4);
|
||||
a.add("@waves.shields").padLeft(4);
|
||||
});
|
||||
|
||||
t.row();
|
||||
t.check("$waves.guardian", b -> group.effect = (b ? StatusEffects.boss : null)).padTop(4).update(b -> b.setChecked(group.effect == StatusEffects.boss)).padBottom(8f);
|
||||
t.check("@waves.guardian", b -> group.effect = (b ? StatusEffects.boss : null)).padTop(4).update(b -> b.setChecked(group.effect == StatusEffects.boss)).padBottom(8f);
|
||||
}).width(340f).pad(8);
|
||||
|
||||
table.row();
|
||||
}
|
||||
}else{
|
||||
table.add("$editor.default");
|
||||
table.add("@editor.default");
|
||||
}
|
||||
|
||||
updateWaves();
|
||||
|
@ -270,7 +270,7 @@ public class Saves{
|
||||
mods.removeAll(Vars.mods.getModStrings());
|
||||
|
||||
if(!mods.isEmpty()){
|
||||
ui.showConfirm("$warning", Core.bundle.format("mod.missing", mods.toString("\n")), run);
|
||||
ui.showConfirm("@warning", Core.bundle.format("mod.missing", mods.toString("\n")), run);
|
||||
}else{
|
||||
run.run();
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public class DesktopInput extends InputHandler{
|
||||
Core.keybinds.get(Binding.schematic_flip_y).key.toString())).style(Styles.outlineLabel);
|
||||
b.row();
|
||||
b.table(a -> {
|
||||
a.button("$schematic.add", Icon.save, this::showSchematicSave).colspan(2).size(250f, 50f).disabled(f -> lastSchematic == null || lastSchematic.file != null);
|
||||
a.button("@schematic.add", Icon.save, this::showSchematicSave).colspan(2).size(250f, 50f).disabled(f -> lastSchematic == null || lastSchematic.file != null);
|
||||
});
|
||||
}).margin(6f);
|
||||
});
|
||||
|
@ -396,18 +396,18 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
protected void showSchematicSave(){
|
||||
if(lastSchematic == null) return;
|
||||
|
||||
ui.showTextInput("$schematic.add", "$name", "", text -> {
|
||||
ui.showTextInput("@schematic.add", "@name", "", text -> {
|
||||
Schematic replacement = schematics.all().find(s -> s.name().equals(text));
|
||||
if(replacement != null){
|
||||
ui.showConfirm("$confirm", "$schematic.replace", () -> {
|
||||
ui.showConfirm("@confirm", "@schematic.replace", () -> {
|
||||
schematics.overwrite(replacement, lastSchematic);
|
||||
ui.showInfoFade("$schematic.saved");
|
||||
ui.showInfoFade("@schematic.saved");
|
||||
ui.schematics.showInfo(replacement);
|
||||
});
|
||||
}else{
|
||||
lastSchematic.tags.put("name", text);
|
||||
schematics.add(lastSchematic);
|
||||
ui.showInfoFade("$schematic.saved");
|
||||
ui.showInfoFade("@schematic.saved");
|
||||
ui.schematics.showInfo(lastSchematic);
|
||||
}
|
||||
});
|
||||
|
@ -243,7 +243,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
group.fill(t -> {
|
||||
t.visible(() -> (player.builder().isBuilding() || block != null || mode == breaking || !selectRequests.isEmpty()) && !schem.get());
|
||||
t.bottom().left();
|
||||
t.button("$cancel", Icon.cancel, () -> {
|
||||
t.button("@cancel", Icon.cancel, () -> {
|
||||
player.builder().clearBuilding();
|
||||
selectRequests.clear();
|
||||
mode = none;
|
||||
|
@ -266,11 +266,11 @@ public class Maps{
|
||||
Log.err(e);
|
||||
|
||||
if("Outdated legacy map format".equals(e.getMessage())){
|
||||
ui.showErrorMessage("$editor.errornot");
|
||||
ui.showErrorMessage("@editor.errornot");
|
||||
}else if(e.getMessage() != null && e.getMessage().contains("Incorrect header!")){
|
||||
ui.showErrorMessage("$editor.errorheader");
|
||||
ui.showErrorMessage("@editor.errorheader");
|
||||
}else{
|
||||
ui.showException("$editor.errorload", e);
|
||||
ui.showException("@editor.errorload", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public abstract class FilterOption{
|
||||
@Override
|
||||
public void build(Table table){
|
||||
if(!display){
|
||||
table.add("$filter.option." + name);
|
||||
table.add("@filter.option." + name);
|
||||
}else{
|
||||
table.label(() -> Core.bundle.get("filter.option." + name) + ": " + (int)getter.get());
|
||||
}
|
||||
@ -107,7 +107,7 @@ public abstract class FilterOption{
|
||||
dialog.show();
|
||||
}).pad(4).margin(12f);
|
||||
|
||||
table.add("$filter.option." + name);
|
||||
table.add("@filter.option." + name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ public class Mods implements Loadable{
|
||||
boolean deleted = mod.file.isDirectory() ? mod.file.deleteDirectory() : mod.file.delete();
|
||||
|
||||
if(!deleted){
|
||||
ui.showErrorMessage("$mod.delete.error");
|
||||
ui.showErrorMessage("@mod.delete.error");
|
||||
return;
|
||||
}
|
||||
mods.remove(mod);
|
||||
@ -371,7 +371,7 @@ public class Mods implements Loadable{
|
||||
private void checkWarnings(){
|
||||
//show 'scripts have errored' info
|
||||
if(scripts != null && scripts.hasErrored()){
|
||||
ui.showErrorMessage("$mod.scripts.disable");
|
||||
ui.showErrorMessage("@mod.scripts.disable");
|
||||
}
|
||||
|
||||
//show list of errored content
|
||||
@ -381,11 +381,11 @@ public class Mods implements Loadable{
|
||||
|
||||
setFillParent(true);
|
||||
cont.margin(15);
|
||||
cont.add("$error.title");
|
||||
cont.add("@error.title");
|
||||
cont.row();
|
||||
cont.image().width(300f).pad(2).colspan(2).height(4f).color(Color.scarlet);
|
||||
cont.row();
|
||||
cont.add("$mod.errors").wrap().growX().center().get().setAlignment(Align.center);
|
||||
cont.add("@mod.errors").wrap().growX().center().get().setAlignment(Align.center);
|
||||
cont.row();
|
||||
cont.pane(p -> {
|
||||
mods.each(m -> m.enabled() && m.hasContentErrors(), m -> {
|
||||
@ -397,12 +397,12 @@ public class Mods implements Loadable{
|
||||
d.left().marginLeft(15f);
|
||||
for(Content c : m.erroredContent){
|
||||
d.add(c.minfo.sourceFile.nameWithoutExtension()).left().padRight(10);
|
||||
d.button("$details", Icon.downOpen, Styles.transt, () -> {
|
||||
d.button("@details", Icon.downOpen, Styles.transt, () -> {
|
||||
new Dialog(""){{
|
||||
setFillParent(true);
|
||||
cont.pane(e -> e.add(c.minfo.error).wrap().grow()).grow();
|
||||
cont.row();
|
||||
cont.button("$ok", Icon.left, this::hide).size(240f, 60f);
|
||||
cont.button("@ok", Icon.left, this::hide).size(240f, 60f);
|
||||
}}.show();
|
||||
}).size(190f, 50f).left().marginLeft(6);
|
||||
d.row();
|
||||
@ -413,7 +413,7 @@ public class Mods implements Loadable{
|
||||
});
|
||||
|
||||
cont.row();
|
||||
cont.button("$ok", this::hide).size(300, 50);
|
||||
cont.button("@ok", this::hide).size(300, 50);
|
||||
}}.show();
|
||||
}
|
||||
}
|
||||
@ -752,12 +752,12 @@ public class Mods implements Loadable{
|
||||
@Override
|
||||
public boolean prePublish(){
|
||||
if(!file.isDirectory()){
|
||||
ui.showErrorMessage("$mod.folder.missing");
|
||||
ui.showErrorMessage("@mod.folder.missing");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!file.child("preview.png").exists()){
|
||||
ui.showErrorMessage("$mod.preview.missing");
|
||||
ui.showErrorMessage("@mod.preview.missing");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -85,13 +85,13 @@ public class BeControl{
|
||||
|
||||
if(!headless){
|
||||
checkUpdates = false;
|
||||
ui.showCustomConfirm(Core.bundle.format("be.update", "") + " " + updateBuild, "$be.update.confirm", "$ok", "$be.ignore", () -> {
|
||||
ui.showCustomConfirm(Core.bundle.format("be.update", "") + " " + updateBuild, "@be.update.confirm", "@ok", "@be.ignore", () -> {
|
||||
boolean[] cancel = {false};
|
||||
float[] progress = {0};
|
||||
int[] length = {0};
|
||||
Fi file = bebuildDirectory.child("client-be-" + updateBuild + ".jar");
|
||||
|
||||
BaseDialog dialog = new BaseDialog("$be.updating");
|
||||
BaseDialog dialog = new BaseDialog("@be.updating");
|
||||
download(updateUrl, file, i -> length[0] = i, v -> progress[0] = v, () -> cancel[0], () -> {
|
||||
try{
|
||||
Runtime.getRuntime().exec(new String[]{"java", "-DlastBuild=" + Version.build, "-Dberestart", "-jar", file.absolutePath()});
|
||||
@ -105,7 +105,7 @@ public class BeControl{
|
||||
});
|
||||
|
||||
dialog.cont.add(new Bar(() -> length[0] == 0 ? Core.bundle.get("be.updating") : (int)(progress[0] * length[0]) / 1024/ 1024 + "/" + length[0]/1024/1024 + " MB", () -> Pal.accent, () -> progress[0])).width(400f).height(70f);
|
||||
dialog.buttons.button("$cancel", Icon.cancel, () -> {
|
||||
dialog.buttons.button("@cancel", Icon.cancel, () -> {
|
||||
cancel[0] = true;
|
||||
dialog.hide();
|
||||
}).size(210f, 64f);
|
||||
|
@ -70,7 +70,7 @@ public class Net{
|
||||
}
|
||||
|
||||
if(isError){
|
||||
ui.showException("$error.any", e);
|
||||
ui.showException("@error.any", e);
|
||||
}else{
|
||||
ui.showText("", Core.bundle.format("connectfail", error));
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public class ContentDisplay{
|
||||
|
||||
if(map.size == 0) continue;
|
||||
|
||||
table.add("$category." + cat.name()).color(Pal.accent).fillX();
|
||||
table.add("@category." + cat.name()).color(Pal.accent).fillX();
|
||||
table.row();
|
||||
|
||||
for(BlockStat stat : map.keys()){
|
||||
|
@ -52,7 +52,7 @@ public class ItemsDisplay extends Table{
|
||||
}
|
||||
}).get().setScrollingDisabled(true, false), false).setDuration(0.3f);
|
||||
|
||||
c.button("$globalitems", Icon.downOpen, Styles.clearTogglet, col::toggle).update(t -> {
|
||||
c.button("@globalitems", Icon.downOpen, Styles.clearTogglet, col::toggle).update(t -> {
|
||||
t.setChecked(col.isCollapsed());
|
||||
((Image)t.getChildren().get(1)).setDrawable(col.isCollapsed() ? Icon.upOpen : Icon.downOpen);
|
||||
}).padBottom(4).left().fillX().margin(12f).minWidth(200f);
|
||||
|
@ -19,7 +19,7 @@ public class AboutDialog extends BaseDialog{
|
||||
private static ObjectSet<String> bannedItems = ObjectSet.with("google-play", "itch.io", "dev-builds", "f-droid");
|
||||
|
||||
public AboutDialog(){
|
||||
super("$about.button");
|
||||
super("@about.button");
|
||||
|
||||
shown(() -> {
|
||||
contributors = Seq.with(Core.files.internal("contributors").readString("UTF-8").split("\n"));
|
||||
@ -68,7 +68,7 @@ public class AboutDialog extends BaseDialog{
|
||||
if(link.name.equals("wiki")) Events.fire(Trigger.openWiki);
|
||||
|
||||
if(!Core.app.openURI(link.link)){
|
||||
ui.showErrorMessage("$linkfail");
|
||||
ui.showErrorMessage("@linkfail");
|
||||
Core.app.setClipboardText(link.link);
|
||||
}
|
||||
}).size(h - 5, h);
|
||||
@ -82,7 +82,7 @@ public class AboutDialog extends BaseDialog{
|
||||
|
||||
addCloseButton();
|
||||
|
||||
buttons.button("$credits", this::showCredits).size(200f, 64f);
|
||||
buttons.button("@credits", this::showCredits).size(200f, 64f);
|
||||
|
||||
if(Core.graphics.isPortrait()){
|
||||
for(Cell<?> cell : buttons.getCells()){
|
||||
@ -93,14 +93,14 @@ public class AboutDialog extends BaseDialog{
|
||||
}
|
||||
|
||||
public void showCredits(){
|
||||
BaseDialog dialog = new BaseDialog("$credits");
|
||||
BaseDialog dialog = new BaseDialog("@credits");
|
||||
dialog.addCloseButton();
|
||||
dialog.cont.add("$credits.text").fillX().wrap().get().setAlignment(Align.center);
|
||||
dialog.cont.add("@credits.text").fillX().wrap().get().setAlignment(Align.center);
|
||||
dialog.cont.row();
|
||||
if(!contributors.isEmpty()){
|
||||
dialog.cont.image().color(Pal.accent).fillX().height(3f).pad(3f);
|
||||
dialog.cont.row();
|
||||
dialog.cont.add("$contributors");
|
||||
dialog.cont.add("@contributors");
|
||||
dialog.cont.row();
|
||||
dialog.cont.pane(new Table(){{
|
||||
int i = 0;
|
||||
|
@ -10,7 +10,7 @@ import static mindustry.Vars.*;
|
||||
public class AdminsDialog extends BaseDialog{
|
||||
|
||||
public AdminsDialog(){
|
||||
super("$server.admins");
|
||||
super("@server.admins");
|
||||
|
||||
addCloseButton();
|
||||
|
||||
@ -29,7 +29,7 @@ public class AdminsDialog extends BaseDialog{
|
||||
pane.setFadeScrollBars(false);
|
||||
|
||||
if(netServer.admins.getAdmins().size == 0){
|
||||
table.add("$server.admins.none");
|
||||
table.add("@server.admins.none");
|
||||
}
|
||||
|
||||
for(PlayerInfo info : netServer.admins.getAdmins()){
|
||||
@ -39,7 +39,7 @@ public class AdminsDialog extends BaseDialog{
|
||||
res.labelWrap("[lightgray]" + info.lastName).width(w - h - 24f);
|
||||
res.add().growX();
|
||||
res.button(Icon.cancel, () -> {
|
||||
ui.showConfirm("$confirm", "$confirmunadmin", () -> {
|
||||
ui.showConfirm("@confirm", "@confirmunadmin", () -> {
|
||||
netServer.admins.unAdminPlayer(info.id);
|
||||
Groups.player.each(player -> {
|
||||
if(player != null && !player.isLocal() && player.uuid().equals(info.id)){
|
||||
|
@ -10,7 +10,7 @@ import static mindustry.Vars.*;
|
||||
public class BansDialog extends BaseDialog{
|
||||
|
||||
public BansDialog(){
|
||||
super("$server.bans");
|
||||
super("@server.bans");
|
||||
|
||||
addCloseButton();
|
||||
|
||||
@ -30,7 +30,7 @@ public class BansDialog extends BaseDialog{
|
||||
pane.setFadeScrollBars(false);
|
||||
|
||||
if(netServer.admins.getBanned().size == 0){
|
||||
table.add("$server.bans.none");
|
||||
table.add("@server.bans.none");
|
||||
}
|
||||
|
||||
for(PlayerInfo info : netServer.admins.getBanned()){
|
||||
@ -40,7 +40,7 @@ public class BansDialog extends BaseDialog{
|
||||
res.labelWrap("IP: [lightgray]" + info.lastIP + "\n[]Name: [lightgray]" + info.lastName).width(w - h - 24f);
|
||||
res.add().growX();
|
||||
res.button(Icon.cancel, () -> {
|
||||
ui.showConfirm("$confirm", "$confirmunban", () -> {
|
||||
ui.showConfirm("@confirm", "@confirmunban", () -> {
|
||||
netServer.admins.unbanPlayerID(info.id);
|
||||
setup();
|
||||
});
|
||||
|
@ -56,7 +56,7 @@ public class BaseDialog extends Dialog{
|
||||
@Override
|
||||
public void addCloseButton(){
|
||||
buttons.defaults().size(210f, 64f);
|
||||
buttons.button("$back", Icon.left, this::hide).size(210f, 64f);
|
||||
buttons.button("@back", Icon.left, this::hide).size(210f, 64f);
|
||||
|
||||
keyDown(key -> {
|
||||
if(key == KeyCode.escape || key == KeyCode.back){
|
||||
|
@ -11,7 +11,7 @@ public class ColorPicker extends BaseDialog{
|
||||
private Color current = new Color();
|
||||
|
||||
public ColorPicker(){
|
||||
super("$pickcolor");
|
||||
super("@pickcolor");
|
||||
}
|
||||
|
||||
public void show(Color color, Cons<Color> consumer){
|
||||
@ -55,7 +55,7 @@ public class ColorPicker extends BaseDialog{
|
||||
|
||||
buttons.clear();
|
||||
addCloseButton();
|
||||
buttons.button("$ok", Icon.ok, () -> {
|
||||
buttons.button("@ok", Icon.ok, () -> {
|
||||
cons.get(current);
|
||||
hide();
|
||||
});
|
||||
|
@ -7,7 +7,7 @@ import mindustry.ctype.UnlockableContent;
|
||||
public class ContentInfoDialog extends BaseDialog{
|
||||
|
||||
public ContentInfoDialog(){
|
||||
super("$info.title");
|
||||
super("@info.title");
|
||||
|
||||
addCloseButton();
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ public class ControlsDialog extends KeybindDialog{
|
||||
|
||||
@Override
|
||||
public void addCloseButton(){
|
||||
buttons.button("$back", Icon.left, this::hide).size(230f, 64f);
|
||||
buttons.button("@back", Icon.left, this::hide).size(230f, 64f);
|
||||
|
||||
keyDown(key -> {
|
||||
if(key == KeyCode.escape || key == KeyCode.back) hide();
|
||||
|
@ -17,7 +17,7 @@ public class CustomGameDialog extends BaseDialog{
|
||||
private MapPlayDialog dialog = new MapPlayDialog();
|
||||
|
||||
public CustomGameDialog(){
|
||||
super("$customgame");
|
||||
super("@customgame");
|
||||
addCloseButton();
|
||||
shown(this::setup);
|
||||
onResize(this::setup);
|
||||
@ -84,7 +84,7 @@ public class CustomGameDialog extends BaseDialog{
|
||||
}
|
||||
|
||||
if(Vars.maps.all().size == 0){
|
||||
maps.add("$maps.none").pad(50);
|
||||
maps.add("@maps.none").pad(50);
|
||||
}
|
||||
|
||||
cont.add(pane).uniformX();
|
||||
|
@ -26,19 +26,19 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
private BaseDialog banDialog;
|
||||
|
||||
public CustomRulesDialog(){
|
||||
super("$mode.custom");
|
||||
super("@mode.custom");
|
||||
|
||||
loadoutDialog = new LoadoutDialog();
|
||||
banDialog = new BaseDialog("$bannedblocks");
|
||||
banDialog = new BaseDialog("@bannedblocks");
|
||||
banDialog.addCloseButton();
|
||||
|
||||
banDialog.shown(this::rebuildBanned);
|
||||
banDialog.buttons.button("$addall", Icon.add, () -> {
|
||||
banDialog.buttons.button("@addall", Icon.add, () -> {
|
||||
rules.bannedBlocks.addAll(content.blocks().select(Block::canBeBuilt));
|
||||
rebuildBanned();
|
||||
}).size(180, 64f);
|
||||
|
||||
banDialog.buttons.button("$clear", Icon.trash, () -> {
|
||||
banDialog.buttons.button("@clear", Icon.trash, () -> {
|
||||
rules.bannedBlocks.clear();
|
||||
rebuildBanned();
|
||||
}).size(180, 64f);
|
||||
@ -55,7 +55,7 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
t.margin(10f);
|
||||
|
||||
if(rules.bannedBlocks.isEmpty()){
|
||||
t.add("$empty");
|
||||
t.add("@empty");
|
||||
}
|
||||
|
||||
Seq<Block> array = Seq.with(rules.bannedBlocks);
|
||||
@ -82,8 +82,8 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
}
|
||||
}).get().setScrollYForce(previousScroll);
|
||||
banDialog.cont.row();
|
||||
banDialog.cont.button("$add", Icon.add, () -> {
|
||||
BaseDialog dialog = new BaseDialog("$add");
|
||||
banDialog.cont.button("@add", Icon.add, () -> {
|
||||
BaseDialog dialog = new BaseDialog("@add");
|
||||
dialog.cont.pane(t -> {
|
||||
t.left().margin(14f);
|
||||
int[] i = {0};
|
||||
@ -116,7 +116,7 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
cont.clear();
|
||||
cont.pane(m -> main = m).get().setScrollingDisabled(true, false);
|
||||
main.margin(10f);
|
||||
main.button("$settings.reset", () -> {
|
||||
main.button("@settings.reset", () -> {
|
||||
rules = resetter.get();
|
||||
setup();
|
||||
requestKeyboard();
|
||||
@ -125,45 +125,45 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
main.left().defaults().fillX().left().pad(5);
|
||||
main.row();
|
||||
|
||||
title("$rules.title.waves");
|
||||
check("$rules.waves", b -> rules.waves = b, () -> rules.waves);
|
||||
check("$rules.wavetimer", b -> rules.waveTimer = b, () -> rules.waveTimer);
|
||||
check("$rules.waitForWaveToEnd", b -> rules.waitEnemies = b, () -> rules.waitEnemies);
|
||||
number("$rules.wavespacing", false, f -> rules.waveSpacing = f * 60f, () -> rules.waveSpacing / 60f, () -> true);
|
||||
number("$rules.dropzoneradius", false, f -> rules.dropZoneRadius = f * tilesize, () -> rules.dropZoneRadius / tilesize, () -> true);
|
||||
title("@rules.title.waves");
|
||||
check("@rules.waves", b -> rules.waves = b, () -> rules.waves);
|
||||
check("@rules.wavetimer", b -> rules.waveTimer = b, () -> rules.waveTimer);
|
||||
check("@rules.waitForWaveToEnd", b -> rules.waitEnemies = b, () -> rules.waitEnemies);
|
||||
number("@rules.wavespacing", false, f -> rules.waveSpacing = f * 60f, () -> rules.waveSpacing / 60f, () -> true);
|
||||
number("@rules.dropzoneradius", false, f -> rules.dropZoneRadius = f * tilesize, () -> rules.dropZoneRadius / tilesize, () -> true);
|
||||
|
||||
title("$rules.title.resourcesbuilding");
|
||||
check("$rules.infiniteresources", b -> rules.infiniteResources = b, () -> rules.infiniteResources);
|
||||
check("$rules.reactorexplosions", b -> rules.reactorExplosions = b, () -> rules.reactorExplosions);
|
||||
number("$rules.buildcostmultiplier", false, f -> rules.buildCostMultiplier = f, () -> rules.buildCostMultiplier, () -> !rules.infiniteResources);
|
||||
number("$rules.buildspeedmultiplier", f -> rules.buildSpeedMultiplier = f, () -> rules.buildSpeedMultiplier);
|
||||
number("$rules.deconstructrefundmultiplier", false, f -> rules.deconstructRefundMultiplier = f, () -> rules.deconstructRefundMultiplier, () -> !rules.infiniteResources);
|
||||
number("$rules.blockhealthmultiplier", f -> rules.blockHealthMultiplier = f, () -> rules.blockHealthMultiplier);
|
||||
number("$rules.blockdamagemultiplier", f -> rules.blockDamageMultiplier = f, () -> rules.blockDamageMultiplier);
|
||||
title("@rules.title.resourcesbuilding");
|
||||
check("@rules.infiniteresources", b -> rules.infiniteResources = b, () -> rules.infiniteResources);
|
||||
check("@rules.reactorexplosions", b -> rules.reactorExplosions = b, () -> rules.reactorExplosions);
|
||||
number("@rules.buildcostmultiplier", false, f -> rules.buildCostMultiplier = f, () -> rules.buildCostMultiplier, () -> !rules.infiniteResources);
|
||||
number("@rules.buildspeedmultiplier", f -> rules.buildSpeedMultiplier = f, () -> rules.buildSpeedMultiplier);
|
||||
number("@rules.deconstructrefundmultiplier", false, f -> rules.deconstructRefundMultiplier = f, () -> rules.deconstructRefundMultiplier, () -> !rules.infiniteResources);
|
||||
number("@rules.blockhealthmultiplier", f -> rules.blockHealthMultiplier = f, () -> rules.blockHealthMultiplier);
|
||||
number("@rules.blockdamagemultiplier", f -> rules.blockDamageMultiplier = f, () -> rules.blockDamageMultiplier);
|
||||
|
||||
main.button("$configure",
|
||||
main.button("@configure",
|
||||
() -> loadoutDialog.show(Blocks.coreShard.itemCapacity, rules.loadout,
|
||||
() -> rules.loadout.clear().add(new ItemStack(Items.copper, 100)),
|
||||
() -> {}, () -> {}
|
||||
)).left().width(300f);
|
||||
main.row();
|
||||
|
||||
main.button("$bannedblocks", banDialog::show).left().width(300f);
|
||||
main.button("@bannedblocks", banDialog::show).left().width(300f);
|
||||
main.row();
|
||||
|
||||
title("$rules.title.unit");
|
||||
check("$rules.unitammo", b -> rules.unitAmmo = b, () -> rules.unitAmmo);
|
||||
number("$rules.unithealthmultiplier", f -> rules.unitHealthMultiplier = f, () -> rules.unitHealthMultiplier);
|
||||
number("$rules.unitdamagemultiplier", f -> rules.unitDamageMultiplier = f, () -> rules.unitDamageMultiplier);
|
||||
number("$rules.unitbuildspeedmultiplier", f -> rules.unitBuildSpeedMultiplier = f, () -> rules.unitBuildSpeedMultiplier);
|
||||
title("@rules.title.unit");
|
||||
check("@rules.unitammo", b -> rules.unitAmmo = b, () -> rules.unitAmmo);
|
||||
number("@rules.unithealthmultiplier", f -> rules.unitHealthMultiplier = f, () -> rules.unitHealthMultiplier);
|
||||
number("@rules.unitdamagemultiplier", f -> rules.unitDamageMultiplier = f, () -> rules.unitDamageMultiplier);
|
||||
number("@rules.unitbuildspeedmultiplier", f -> rules.unitBuildSpeedMultiplier = f, () -> rules.unitBuildSpeedMultiplier);
|
||||
|
||||
title("$rules.title.enemy");
|
||||
check("$rules.attack", b -> rules.attackMode = b, () -> rules.attackMode);
|
||||
number("$rules.enemycorebuildradius", f -> rules.enemyCoreBuildRadius = f * tilesize, () -> Math.min(rules.enemyCoreBuildRadius / tilesize, 200));
|
||||
title("@rules.title.enemy");
|
||||
check("@rules.attack", b -> rules.attackMode = b, () -> rules.attackMode);
|
||||
number("@rules.enemycorebuildradius", f -> rules.enemyCoreBuildRadius = f * tilesize, () -> Math.min(rules.enemyCoreBuildRadius / tilesize, 200));
|
||||
|
||||
title("$rules.title.environment");
|
||||
number("$rules.solarpowermultiplier", f -> rules.solarPowerMultiplier = f, () -> rules.solarPowerMultiplier);
|
||||
check("$rules.lighting", b -> rules.lighting = b, () -> rules.lighting);
|
||||
title("@rules.title.environment");
|
||||
number("@rules.solarpowermultiplier", f -> rules.solarPowerMultiplier = f, () -> rules.solarPowerMultiplier);
|
||||
check("@rules.lighting", b -> rules.lighting = b, () -> rules.lighting);
|
||||
|
||||
main.button(b -> {
|
||||
b.left();
|
||||
@ -172,7 +172,7 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
update(() -> setColor(rules.ambientLight));
|
||||
}}).grow();
|
||||
}).margin(4).size(50f).padRight(10);
|
||||
b.add("$rules.ambientlight");
|
||||
b.add("@rules.ambientlight");
|
||||
}, () -> ui.picker.show(rules.ambientLight, rules.ambientLight::set)).left().width(250f);
|
||||
main.row();
|
||||
|
||||
|
@ -19,7 +19,7 @@ import static mindustry.Vars.ui;
|
||||
public class DatabaseDialog extends BaseDialog{
|
||||
|
||||
public DatabaseDialog(){
|
||||
super("$database");
|
||||
super("@database");
|
||||
|
||||
shouldPause = true;
|
||||
addCloseButton();
|
||||
@ -42,7 +42,7 @@ public class DatabaseDialog extends BaseDialog{
|
||||
Seq<Content> array = allContent[j].select(c -> c instanceof UnlockableContent && !((UnlockableContent)c).isHidden());
|
||||
if(array.size == 0) continue;
|
||||
|
||||
table.add("$content." + type.name() + ".name").growX().left().color(Pal.accent);
|
||||
table.add("@content." + type.name() + ".name").growX().left().color(Pal.accent);
|
||||
table.row();
|
||||
table.image().growX().pad(5).padLeft(0).padRight(0).height(3).color(Pal.accent);
|
||||
table.row();
|
||||
@ -69,7 +69,7 @@ public class DatabaseDialog extends BaseDialog{
|
||||
image.clicked(() -> {
|
||||
if(Core.input.keyDown(KeyCode.shiftLeft) && Fonts.getUnicode(unlock.name) != 0){
|
||||
Core.app.setClipboardText((char)Fonts.getUnicode(unlock.name) + "");
|
||||
ui.showInfoFade("$copied");
|
||||
ui.showInfoFade("@copied");
|
||||
}else{
|
||||
Vars.ui.content.show(unlock);
|
||||
}
|
||||
|
@ -33,18 +33,18 @@ public class DiscordDialog extends Dialog{
|
||||
i.image(Icon.discord);
|
||||
}).size(h).left();
|
||||
|
||||
t.add("$discord").color(Pal.accent).growX().padLeft(10f);
|
||||
t.add("@discord").color(Pal.accent).growX().padLeft(10f);
|
||||
}).size(440f, h).pad(10f);
|
||||
|
||||
buttons.defaults().size(150f, 50);
|
||||
|
||||
buttons.button("$back", this::hide);
|
||||
buttons.button("$copylink", () -> {
|
||||
buttons.button("@back", this::hide);
|
||||
buttons.button("@copylink", () -> {
|
||||
Core.app.setClipboardText(discordURL);
|
||||
});
|
||||
buttons.button("$openlink", () -> {
|
||||
buttons.button("@openlink", () -> {
|
||||
if(!Core.app.openURI(discordURL)){
|
||||
ui.showErrorMessage("$linkfail");
|
||||
ui.showErrorMessage("@linkfail");
|
||||
Core.app.setClipboardText(discordURL);
|
||||
}
|
||||
});
|
||||
|
@ -57,7 +57,7 @@ public class FileChooser extends BaseDialog{
|
||||
if(!open) filefield.addInputDialog();
|
||||
filefield.setDisabled(open);
|
||||
|
||||
ok = new TextButton(open ? "$load" : "$save");
|
||||
ok = new TextButton(open ? "@load" : "@save");
|
||||
|
||||
ok.clicked(() -> {
|
||||
if(ok.isDisabled()) return;
|
||||
@ -72,7 +72,7 @@ public class FileChooser extends BaseDialog{
|
||||
|
||||
filefield.change();
|
||||
|
||||
TextButton cancel = new TextButton("$cancel");
|
||||
TextButton cancel = new TextButton("@cancel");
|
||||
cancel.clicked(this::hide);
|
||||
|
||||
navigation = new TextField("");
|
||||
@ -119,7 +119,7 @@ public class FileChooser extends BaseDialog{
|
||||
icontable.add(up);
|
||||
|
||||
Table fieldcontent = new Table();
|
||||
fieldcontent.bottom().left().add(new Label("$filename"));
|
||||
fieldcontent.bottom().left().add(new Label("@filename"));
|
||||
fieldcontent.add(filefield).height(40f).fillX().expandX().padLeft(10f);
|
||||
|
||||
Table buttons = new Table();
|
||||
|
@ -13,7 +13,7 @@ public class GameOverDialog extends BaseDialog{
|
||||
private Team winner;
|
||||
|
||||
public GameOverDialog(){
|
||||
super("$gameover");
|
||||
super("@gameover");
|
||||
setFillParent(true);
|
||||
shown(this::rebuild);
|
||||
}
|
||||
@ -29,7 +29,7 @@ public class GameOverDialog extends BaseDialog{
|
||||
}
|
||||
|
||||
void rebuild(){
|
||||
title.setText(state.launched ? "$launch.title" : "$gameover");
|
||||
title.setText(state.launched ? "@launch.title" : "@gameover");
|
||||
buttons.clear();
|
||||
cont.clear();
|
||||
|
||||
@ -37,13 +37,13 @@ public class GameOverDialog extends BaseDialog{
|
||||
|
||||
if(state.rules.pvp){
|
||||
cont.add(Core.bundle.format("gameover.pvp", winner.localized())).pad(6);
|
||||
buttons.button("$menu", () -> {
|
||||
buttons.button("@menu", () -> {
|
||||
hide();
|
||||
logic.reset();
|
||||
}).size(130f, 60f);
|
||||
}else{
|
||||
if(control.isHighScore()){
|
||||
cont.add("$highscore").pad(6);
|
||||
cont.add("@highscore").pad(6);
|
||||
cont.row();
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ public class GameOverDialog extends BaseDialog{
|
||||
t.row();
|
||||
}
|
||||
if(state.isCampaign() && !state.stats.itemsDelivered.isEmpty()){
|
||||
t.add("$stat.delivered");
|
||||
t.add("@stat.delivered");
|
||||
t.row();
|
||||
for(Item item : content.items()){
|
||||
if(state.stats.itemsDelivered.get(item, 0) > 0){
|
||||
@ -86,13 +86,13 @@ public class GameOverDialog extends BaseDialog{
|
||||
}).pad(12);
|
||||
|
||||
if(state.isCampaign()){
|
||||
buttons.button("$continue", () -> {
|
||||
buttons.button("@continue", () -> {
|
||||
hide();
|
||||
logic.reset();
|
||||
ui.planet.show();
|
||||
}).size(130f, 60f);
|
||||
}else{
|
||||
buttons.button("$menu", () -> {
|
||||
buttons.button("@menu", () -> {
|
||||
hide();
|
||||
logic.reset();
|
||||
}).size(130f, 60f);
|
||||
|
@ -16,12 +16,12 @@ public class HostDialog extends BaseDialog{
|
||||
float w = 300;
|
||||
|
||||
public HostDialog(){
|
||||
super("$hostserver");
|
||||
super("@hostserver");
|
||||
|
||||
addCloseButton();
|
||||
|
||||
cont.table(t -> {
|
||||
t.add("$name").padRight(10);
|
||||
t.add("@name").padRight(10);
|
||||
t.field(Core.settings.getString("name"), text -> {
|
||||
player.name(text);
|
||||
Core.settings.put("name", text);
|
||||
@ -41,26 +41,26 @@ public class HostDialog extends BaseDialog{
|
||||
|
||||
cont.add().width(65f);
|
||||
|
||||
cont.button("$host", () -> {
|
||||
cont.button("@host", () -> {
|
||||
if(Core.settings.getString("name").trim().isEmpty()){
|
||||
ui.showInfo("$noname");
|
||||
ui.showInfo("@noname");
|
||||
return;
|
||||
}
|
||||
|
||||
runHost();
|
||||
}).width(w).height(70f);
|
||||
|
||||
cont.button("?", () -> ui.showInfo("$host.info")).size(65f, 70f).padLeft(6f);
|
||||
cont.button("?", () -> ui.showInfo("@host.info")).size(65f, 70f).padLeft(6f);
|
||||
|
||||
shown(() -> {
|
||||
if(!steam){
|
||||
Core.app.post(() -> Core.settings.getBoolOnce("hostinfo", () -> ui.showInfo("$host.info")));
|
||||
Core.app.post(() -> Core.settings.getBoolOnce("hostinfo", () -> ui.showInfo("@host.info")));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void runHost(){
|
||||
ui.loadfrag.show("$hosting");
|
||||
ui.loadfrag.show("@hosting");
|
||||
Time.runTask(5f, () -> {
|
||||
try{
|
||||
net.host(Vars.port);
|
||||
@ -68,7 +68,7 @@ public class HostDialog extends BaseDialog{
|
||||
|
||||
if(steam){
|
||||
Core.app.post(() -> Core.settings.getBoolOnce("steampublic2", () -> {
|
||||
ui.showCustomConfirm("$setting.publichost.name", "$public.confirm", "$yes", "$no", () -> {
|
||||
ui.showCustomConfirm("@setting.publichost.name", "@public.confirm", "@yes", "@no", () -> {
|
||||
Core.settings.put("publichost", true);
|
||||
platform.updateLobby();
|
||||
}, () -> {
|
||||
@ -81,10 +81,10 @@ public class HostDialog extends BaseDialog{
|
||||
if(Version.modifier.contains("beta")){
|
||||
Core.settings.put("publichost", false);
|
||||
platform.updateLobby();
|
||||
Core.settings.getBoolOnce("betapublic", () -> ui.showInfo("$public.beta"));
|
||||
Core.settings.getBoolOnce("betapublic", () -> ui.showInfo("@public.beta"));
|
||||
}
|
||||
}catch(IOException e){
|
||||
ui.showException("$server.error", e);
|
||||
ui.showException("@server.error", e);
|
||||
}
|
||||
ui.loadfrag.hide();
|
||||
hide();
|
||||
|
@ -30,7 +30,7 @@ public class JoinDialog extends BaseDialog{
|
||||
int totalHosts;
|
||||
|
||||
public JoinDialog(){
|
||||
super("$joingame");
|
||||
super("@joingame");
|
||||
|
||||
loadServers();
|
||||
|
||||
@ -41,11 +41,11 @@ public class JoinDialog extends BaseDialog{
|
||||
|
||||
buttons.add().growX().width(-1);
|
||||
if(!steam){
|
||||
buttons.button("?", () -> ui.showInfo("$join.info")).size(60f, 64f).width(-1);
|
||||
buttons.button("?", () -> ui.showInfo("@join.info")).size(60f, 64f).width(-1);
|
||||
}
|
||||
|
||||
add = new BaseDialog("$joingame.title");
|
||||
add.cont.add("$joingame.ip").padRight(5f).left();
|
||||
add = new BaseDialog("@joingame.title");
|
||||
add.cont.add("@joingame.ip").padRight(5f).left();
|
||||
|
||||
TextField field = add.cont.field(Core.settings.getString("ip"), text -> {
|
||||
Core.settings.put("ip", text);
|
||||
@ -53,8 +53,8 @@ public class JoinDialog extends BaseDialog{
|
||||
|
||||
add.cont.row();
|
||||
add.buttons.defaults().size(140f, 60f).pad(4f);
|
||||
add.buttons.button("$cancel", add::hide);
|
||||
add.buttons.button("$ok", () -> {
|
||||
add.buttons.button("@cancel", add::hide);
|
||||
add.buttons.button("@ok", () -> {
|
||||
if(renaming == null){
|
||||
Server server = new Server();
|
||||
server.setIP(Core.settings.getString("ip"));
|
||||
@ -69,7 +69,7 @@ public class JoinDialog extends BaseDialog{
|
||||
}).disabled(b -> Core.settings.getString("ip").isEmpty() || net.active());
|
||||
|
||||
add.shown(() -> {
|
||||
add.title.setText(renaming != null ? "$server.edit" : "$server.add");
|
||||
add.title.setText(renaming != null ? "@server.edit" : "@server.add");
|
||||
if(renaming != null){
|
||||
field.setText(renaming.displayIP());
|
||||
}
|
||||
@ -82,7 +82,7 @@ public class JoinDialog extends BaseDialog{
|
||||
refreshAll();
|
||||
|
||||
if(!steam){
|
||||
Core.app.post(() -> Core.settings.getBoolOnce("joininfo", () -> ui.showInfo("$join.info")));
|
||||
Core.app.post(() -> Core.settings.getBoolOnce("joininfo", () -> ui.showInfo("@join.info")));
|
||||
}
|
||||
});
|
||||
|
||||
@ -143,7 +143,7 @@ public class JoinDialog extends BaseDialog{
|
||||
}).margin(3f).pad(2).padTop(6f).top().right();
|
||||
|
||||
inner.button(Icon.trash, Styles.emptyi, () -> {
|
||||
ui.showConfirm("$confirm", "$server.delete", () -> {
|
||||
ui.showConfirm("@confirm", "@server.delete", () -> {
|
||||
servers.remove(server, true);
|
||||
saveServers();
|
||||
setupRemote();
|
||||
@ -191,7 +191,7 @@ public class JoinDialog extends BaseDialog{
|
||||
|
||||
net.pingHost(server.ip, server.port, host -> setupServer(server, host), e -> {
|
||||
server.content.clear();
|
||||
server.content.add("$host.invalid").padBottom(4);
|
||||
server.content.add("@host.invalid").padBottom(4);
|
||||
});
|
||||
}
|
||||
|
||||
@ -242,9 +242,9 @@ public class JoinDialog extends BaseDialog{
|
||||
|
||||
hosts.clear();
|
||||
|
||||
section("$servers.local", local);
|
||||
section("$servers.remote", remote);
|
||||
section("$servers.global", global);
|
||||
section("@servers.local", local);
|
||||
section("@servers.remote", remote);
|
||||
section("@servers.global", global);
|
||||
|
||||
ScrollPane pane = new ScrollPane(hosts);
|
||||
pane.setFadeScrollBars(false);
|
||||
@ -254,7 +254,7 @@ public class JoinDialog extends BaseDialog{
|
||||
|
||||
cont.clear();
|
||||
cont.table(t -> {
|
||||
t.add("$name").padRight(10);
|
||||
t.add("@name").padRight(10);
|
||||
if(!steam){
|
||||
t.field(Core.settings.getString("name"), text -> {
|
||||
player.name(text);
|
||||
@ -275,7 +275,7 @@ public class JoinDialog extends BaseDialog{
|
||||
cont.row();
|
||||
cont.add(pane).width(w + 38).pad(0);
|
||||
cont.row();
|
||||
cont.buttonCenter("$server.add", Icon.add, () -> {
|
||||
cont.buttonCenter("@server.add", Icon.add, () -> {
|
||||
renaming = null;
|
||||
add.show();
|
||||
}).marginLeft(10).width(w).height(80f).update(button -> {
|
||||
@ -340,7 +340,7 @@ public class JoinDialog extends BaseDialog{
|
||||
if(totalHosts == 0){
|
||||
local.clear();
|
||||
local.background(Tex.button);
|
||||
local.add("$hosts.none").pad(10f);
|
||||
local.add("@hosts.none").pad(10f);
|
||||
local.add().growX();
|
||||
local.button(Icon.refresh, this::refreshLocal).pad(-12f).padLeft(0).size(70f);
|
||||
}else{
|
||||
@ -378,11 +378,11 @@ public class JoinDialog extends BaseDialog{
|
||||
|
||||
public void connect(String ip, int port){
|
||||
if(player.name.trim().isEmpty()){
|
||||
ui.showInfo("$noname");
|
||||
ui.showInfo("@noname");
|
||||
return;
|
||||
}
|
||||
|
||||
ui.loadfrag.show("$connecting");
|
||||
ui.loadfrag.show("@connecting");
|
||||
|
||||
ui.loadfrag.setButton(() -> {
|
||||
ui.loadfrag.hide();
|
||||
|
@ -21,7 +21,7 @@ public class LanguageDialog extends BaseDialog{
|
||||
);
|
||||
|
||||
public LanguageDialog(){
|
||||
super("$settings.language");
|
||||
super("@settings.language");
|
||||
addCloseButton();
|
||||
setup();
|
||||
}
|
||||
@ -40,7 +40,7 @@ public class LanguageDialog extends BaseDialog{
|
||||
if(getLocale().equals(loc)) return;
|
||||
Core.settings.put("locale", loc.toString());
|
||||
Log.info("Setting locale: @", loc.toString());
|
||||
ui.showInfo("$language.restart");
|
||||
ui.showInfo("@language.restart");
|
||||
});
|
||||
langs.add(button).group(group).update(t -> t.setChecked(loc.equals(getLocale()))).size(400f, 50f).row();
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class LaunchLoadoutDialog extends BaseDialog{
|
||||
boolean valid;
|
||||
|
||||
public LaunchLoadoutDialog(){
|
||||
super("$configure");
|
||||
super("@configure");
|
||||
}
|
||||
|
||||
public void show(CoreBlock core, Building build, Runnable confirm){
|
||||
@ -70,7 +70,7 @@ public class LaunchLoadoutDialog extends BaseDialog{
|
||||
|
||||
Runnable rebuildItems = () -> rebuild.get(items);
|
||||
|
||||
buttons.button("$resources", Icon.terrain, () -> {
|
||||
buttons.button("@resources", Icon.terrain, () -> {
|
||||
loadout.show(core.itemCapacity, stacks, stacks::clear, () -> {}, () -> {
|
||||
universe.updateLaunchResources(stacks);
|
||||
update.run();
|
||||
@ -78,7 +78,7 @@ public class LaunchLoadoutDialog extends BaseDialog{
|
||||
});
|
||||
});
|
||||
|
||||
buttons.button("$launch.text", Icon.ok, () -> {
|
||||
buttons.button("@launch.text", Icon.ok, () -> {
|
||||
universe.updateLoadout(core, selected);
|
||||
confirm.run();
|
||||
hide();
|
||||
|
@ -24,7 +24,7 @@ public class LoadDialog extends BaseDialog{
|
||||
Table slots;
|
||||
|
||||
public LoadDialog(){
|
||||
this("$loadgame");
|
||||
this("@loadgame");
|
||||
}
|
||||
|
||||
public LoadDialog(String title){
|
||||
@ -80,14 +80,14 @@ public class LoadDialog extends BaseDialog{
|
||||
}).checked(slot.isAutosave()).right();
|
||||
|
||||
t.button(Icon.trash, Styles.emptyi, () -> {
|
||||
ui.showConfirm("$confirm", "$save.delete.confirm", () -> {
|
||||
ui.showConfirm("@confirm", "@save.delete.confirm", () -> {
|
||||
slot.delete();
|
||||
setup();
|
||||
});
|
||||
}).right();
|
||||
|
||||
t.button(Icon.pencil, Styles.emptyi, () -> {
|
||||
ui.showTextInput("$save.rename", "$save.rename.text", slot.getName(), text -> {
|
||||
ui.showTextInput("@save.rename", "@save.rename.text", slot.getName(), text -> {
|
||||
slot.setName(text);
|
||||
setup();
|
||||
});
|
||||
@ -141,7 +141,7 @@ public class LoadDialog extends BaseDialog{
|
||||
}
|
||||
|
||||
if(!any){
|
||||
slots.button("$save.none", () -> {}).disabled(true).fillX().margin(20f).minWidth(340f).height(80f).pad(4f);
|
||||
slots.button("@save.none", () -> {}).disabled(true).fillX().margin(20f).minWidth(340f).height(80f).pad(4f);
|
||||
}
|
||||
|
||||
cont.add(pane);
|
||||
@ -149,7 +149,7 @@ public class LoadDialog extends BaseDialog{
|
||||
|
||||
public void addSetup(){
|
||||
|
||||
buttons.button("$save.import", Icon.add, () -> {
|
||||
buttons.button("@save.import", Icon.add, () -> {
|
||||
platform.showFileChooser(true, saveExtension, file -> {
|
||||
if(SaveIO.isSaveValid(file)){
|
||||
try{
|
||||
@ -157,10 +157,10 @@ public class LoadDialog extends BaseDialog{
|
||||
setup();
|
||||
}catch(IOException e){
|
||||
e.printStackTrace();
|
||||
ui.showException("$save.import.fail", e);
|
||||
ui.showException("@save.import.fail", e);
|
||||
}
|
||||
}else{
|
||||
ui.showErrorMessage("$save.import.invalid");
|
||||
ui.showErrorMessage("@save.import.invalid");
|
||||
}
|
||||
});
|
||||
}).fillX().margin(10f);
|
||||
@ -180,7 +180,7 @@ public class LoadDialog extends BaseDialog{
|
||||
}catch(SaveException e){
|
||||
Log.err(e);
|
||||
logic.reset();
|
||||
ui.showErrorMessage("$save.corrupted");
|
||||
ui.showErrorMessage("@save.corrupted");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -21,7 +21,7 @@ public class LoadoutDialog extends BaseDialog{
|
||||
private int capacity;
|
||||
|
||||
public LoadoutDialog(){
|
||||
super("$configure");
|
||||
super("@configure");
|
||||
setFillParent(true);
|
||||
|
||||
keyDown(key -> {
|
||||
@ -41,9 +41,9 @@ public class LoadoutDialog extends BaseDialog{
|
||||
}
|
||||
});
|
||||
|
||||
buttons.button("$back", Icon.left, this::hide).size(210f, 64f);
|
||||
buttons.button("@back", Icon.left, this::hide).size(210f, 64f);
|
||||
|
||||
buttons.button("$settings.reset", Icon.refresh, () -> {
|
||||
buttons.button("@settings.reset", Icon.refresh, () -> {
|
||||
resetter.run();
|
||||
reseed();
|
||||
updater.run();
|
||||
@ -81,7 +81,7 @@ public class LoadoutDialog extends BaseDialog{
|
||||
updater.run();
|
||||
}).size(bsize);
|
||||
|
||||
t.button(Icon.pencil, Styles.cleari, () -> ui.showTextInput("$configure", stack.item.localizedName, 10, stack.amount + "", true, str -> {
|
||||
t.button(Icon.pencil, Styles.cleari, () -> ui.showTextInput("@configure", stack.item.localizedName, 10, stack.amount + "", true, str -> {
|
||||
if(Strings.canParsePositiveInt(str)){
|
||||
int amount = Strings.parseInt(str);
|
||||
if(amount >= 0 && amount <= capacity){
|
||||
|
@ -47,7 +47,7 @@ public class MapPlayDialog extends BaseDialog{
|
||||
rules = map.applyRules(selectedGamemode);
|
||||
|
||||
Table selmode = new Table();
|
||||
selmode.add("$level.mode").colspan(4);
|
||||
selmode.add("@level.mode").colspan(4);
|
||||
selmode.row();
|
||||
int i = 0;
|
||||
|
||||
@ -67,7 +67,7 @@ public class MapPlayDialog extends BaseDialog{
|
||||
|
||||
cont.add(selmode);
|
||||
cont.row();
|
||||
cont.button("$customize", Icon.settings, () -> dialog.show(rules, () -> rules = map.applyRules(selectedGamemode))).width(230);
|
||||
cont.button("@customize", Icon.settings, () -> dialog.show(rules, () -> rules = map.applyRules(selectedGamemode))).width(230);
|
||||
cont.row();
|
||||
cont.add(new BorderImage(map.safeTexture(), 3f)).size(mobile && !Core.graphics.isPortrait() ? 150f : 250f).get().setScaling(Scaling.fit);
|
||||
//only maps with survival are valid for high scores
|
||||
@ -79,7 +79,7 @@ public class MapPlayDialog extends BaseDialog{
|
||||
buttons.clearChildren();
|
||||
addCloseButton();
|
||||
|
||||
buttons.button("$play", Icon.play, () -> {
|
||||
buttons.button("@play", Icon.play, () -> {
|
||||
control.playMap(map, rules);
|
||||
hide();
|
||||
ui.custom.hide();
|
||||
@ -103,7 +103,7 @@ public class MapPlayDialog extends BaseDialog{
|
||||
}
|
||||
|
||||
d.cont.add(pane);
|
||||
d.buttons.button("$ok", d::hide).size(110, 50).pad(10f);
|
||||
d.buttons.button("@ok", d::hide).size(110, 50).pad(10f);
|
||||
d.show();
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ public class MapsDialog extends BaseDialog{
|
||||
private BaseDialog dialog;
|
||||
|
||||
public MapsDialog(){
|
||||
super("$maps");
|
||||
super("@maps");
|
||||
|
||||
buttons.remove();
|
||||
|
||||
@ -43,14 +43,14 @@ public class MapsDialog extends BaseDialog{
|
||||
buttons.clearChildren();
|
||||
|
||||
if(Core.graphics.isPortrait()){
|
||||
buttons.button("$back", Icon.left, this::hide).size(210f*2f, 64f).colspan(2);
|
||||
buttons.button("@back", Icon.left, this::hide).size(210f*2f, 64f).colspan(2);
|
||||
buttons.row();
|
||||
}else{
|
||||
buttons.button("$back", Icon.left, this::hide).size(210f, 64f);
|
||||
buttons.button("@back", Icon.left, this::hide).size(210f, 64f);
|
||||
}
|
||||
|
||||
buttons.button("$editor.newmap", Icon.add, () -> {
|
||||
ui.showTextInput("$editor.newmap", "$editor.mapname", "", text -> {
|
||||
buttons.button("@editor.newmap", Icon.add, () -> {
|
||||
ui.showTextInput("@editor.newmap", "@editor.mapname", "", text -> {
|
||||
Runnable show = () -> ui.loadAnd(() -> {
|
||||
hide();
|
||||
ui.editor.show();
|
||||
@ -59,19 +59,19 @@ public class MapsDialog extends BaseDialog{
|
||||
});
|
||||
|
||||
if(maps.byName(text) != null){
|
||||
ui.showErrorMessage("$editor.exists");
|
||||
ui.showErrorMessage("@editor.exists");
|
||||
}else{
|
||||
show.run();
|
||||
}
|
||||
});
|
||||
}).size(210f, 64f);
|
||||
|
||||
buttons.button("$editor.importmap", Icon.upload, () -> {
|
||||
buttons.button("@editor.importmap", Icon.upload, () -> {
|
||||
platform.showFileChooser(true, mapExtension, file -> {
|
||||
ui.loadAnd(() -> {
|
||||
maps.tryCatchMapError(() -> {
|
||||
if(MapIO.isImage(file)){
|
||||
ui.showErrorMessage("$editor.errorimage");
|
||||
ui.showErrorMessage("@editor.errorimage");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ public class MapsDialog extends BaseDialog{
|
||||
|
||||
//this will never actually get called, but it remains just in case
|
||||
if(name == null){
|
||||
ui.showErrorMessage("$editor.errorname");
|
||||
ui.showErrorMessage("@editor.errorname");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ public class MapsDialog extends BaseDialog{
|
||||
if(conflict != null && !conflict.custom){
|
||||
ui.showInfo(Core.bundle.format("editor.import.exists", name));
|
||||
}else if(conflict != null){
|
||||
ui.showConfirm("$confirm", Core.bundle.format("editor.overwrite.confirm", map.name()), () -> {
|
||||
ui.showConfirm("@confirm", Core.bundle.format("editor.overwrite.confirm", map.name()), () -> {
|
||||
maps.tryCatchMapError(() -> {
|
||||
maps.removeMap(conflict);
|
||||
maps.importMap(map.file);
|
||||
@ -142,13 +142,13 @@ public class MapsDialog extends BaseDialog{
|
||||
button.row();
|
||||
button.stack(new Image(map.safeTexture()).setScaling(Scaling.fit), new BorderImage(map.safeTexture()).setScaling(Scaling.fit)).size(mapsize - 20f);
|
||||
button.row();
|
||||
button.add(map.custom ? "$custom" : map.workshop ? "$workshop" : map.mod != null ? "[lightgray]" + map.mod.meta.displayName() : "$builtin").color(Color.gray).padTop(3);
|
||||
button.add(map.custom ? "@custom" : map.workshop ? "@workshop" : map.mod != null ? "[lightgray]" + map.mod.meta.displayName() : "@builtin").color(Color.gray).padTop(3);
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
if(Vars.maps.all().size == 0){
|
||||
maps.add("$maps.none");
|
||||
maps.add("@maps.none");
|
||||
}
|
||||
|
||||
cont.add(buttons).growX();
|
||||
@ -157,7 +157,7 @@ public class MapsDialog extends BaseDialog{
|
||||
}
|
||||
|
||||
void showMapInfo(Map map){
|
||||
dialog = new BaseDialog("$editor.mapinfo");
|
||||
dialog = new BaseDialog("@editor.mapinfo");
|
||||
dialog.addCloseButton();
|
||||
|
||||
float mapsize = Core.graphics.isPortrait() ? 160f : 300f;
|
||||
@ -176,37 +176,37 @@ public class MapsDialog extends BaseDialog{
|
||||
t.top();
|
||||
t.defaults().padTop(10).left();
|
||||
|
||||
t.add("$editor.mapname").padRight(10).color(Color.gray).padTop(0);
|
||||
t.add("@editor.mapname").padRight(10).color(Color.gray).padTop(0);
|
||||
t.row();
|
||||
t.add(map.name()).growX().wrap().padTop(2);
|
||||
t.row();
|
||||
t.add("$editor.author").padRight(10).color(Color.gray);
|
||||
t.add("@editor.author").padRight(10).color(Color.gray);
|
||||
t.row();
|
||||
t.add(!map.custom && map.author().isEmpty() ? "Anuke" : map.author()).growX().wrap().padTop(2);
|
||||
t.row();
|
||||
t.add("$editor.description").padRight(10).color(Color.gray).top();
|
||||
t.add("@editor.description").padRight(10).color(Color.gray).top();
|
||||
t.row();
|
||||
t.add(map.description()).growX().wrap().padTop(2);
|
||||
}).height(mapsize).width(mapsize);
|
||||
|
||||
table.row();
|
||||
|
||||
table.button("$editor.openin", Icon.export, () -> {
|
||||
table.button("@editor.openin", Icon.export, () -> {
|
||||
try{
|
||||
Vars.ui.editor.beginEditMap(map.file);
|
||||
dialog.hide();
|
||||
hide();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
ui.showErrorMessage("$error.mapnotfound");
|
||||
ui.showErrorMessage("@error.mapnotfound");
|
||||
}
|
||||
}).fillX().height(54f).marginLeft(10);
|
||||
|
||||
table.button(map.workshop && steam ? "$view.workshop" : "$delete", map.workshop && steam ? Icon.link : Icon.trash, () -> {
|
||||
table.button(map.workshop && steam ? "@view.workshop" : "@delete", map.workshop && steam ? Icon.link : Icon.trash, () -> {
|
||||
if(map.workshop && steam){
|
||||
platform.viewListing(map);
|
||||
}else{
|
||||
ui.showConfirm("$confirm", Core.bundle.format("map.delete", map.name()), () -> {
|
||||
ui.showConfirm("@confirm", Core.bundle.format("map.delete", map.name()), () -> {
|
||||
maps.removeMap(map);
|
||||
dialog.hide();
|
||||
setup();
|
||||
|
@ -13,7 +13,7 @@ import static mindustry.Vars.renderer;
|
||||
public class MinimapDialog extends BaseDialog{
|
||||
|
||||
public MinimapDialog(){
|
||||
super("$minimap");
|
||||
super("@minimap");
|
||||
setFillParent(true);
|
||||
|
||||
shown(this::setup);
|
||||
|
@ -20,10 +20,10 @@ import static mindustry.Vars.*;
|
||||
public class ModsDialog extends BaseDialog{
|
||||
|
||||
public ModsDialog(){
|
||||
super("$mods");
|
||||
super("@mods");
|
||||
addCloseButton();
|
||||
|
||||
buttons.button("$mods.guide", Icon.link, () -> Core.app.openURI(modGuideURL)).size(210, 64f);
|
||||
buttons.button("@mods.guide", Icon.link, () -> Core.app.openURI(modGuideURL)).size(210, 64f);
|
||||
|
||||
shown(this::setup);
|
||||
|
||||
@ -35,7 +35,7 @@ public class ModsDialog extends BaseDialog{
|
||||
|
||||
shown(() -> Core.app.post(() -> {
|
||||
Core.settings.getBoolOnce("modsalpha", () -> {
|
||||
ui.showText("$mods", "$mods.alphainfo");
|
||||
ui.showText("@mods", "@mods.alphainfo");
|
||||
});
|
||||
}));
|
||||
}
|
||||
@ -44,7 +44,7 @@ public class ModsDialog extends BaseDialog{
|
||||
ui.loadfrag.hide();
|
||||
|
||||
if(Strings.getCauses(error).contains(t -> t.getMessage() != null && (t.getMessage().contains("trust anchor") || t.getMessage().contains("SSL") || t.getMessage().contains("protocol")))){
|
||||
ui.showErrorMessage("$feature.unsupported");
|
||||
ui.showErrorMessage("@feature.unsupported");
|
||||
}else{
|
||||
ui.showException(error);
|
||||
}
|
||||
@ -56,7 +56,7 @@ public class ModsDialog extends BaseDialog{
|
||||
|
||||
cont.clear();
|
||||
cont.defaults().width(mobile ? 500 : 560f).pad(4);
|
||||
cont.add("$mod.reloadrequired").visible(mods::requiresReload).center().get().setAlignment(Align.center);
|
||||
cont.add("@mod.reloadrequired").visible(mods::requiresReload).center().get().setAlignment(Align.center);
|
||||
cont.row();
|
||||
|
||||
cont.table(buttons -> {
|
||||
@ -65,8 +65,8 @@ public class ModsDialog extends BaseDialog{
|
||||
TextButtonStyle style = Styles.clearPartialt;
|
||||
float margin = 12f;
|
||||
|
||||
buttons.button("$mod.import", Icon.add, style, () -> {
|
||||
BaseDialog dialog = new BaseDialog("$mod.import");
|
||||
buttons.button("@mod.import", Icon.add, style, () -> {
|
||||
BaseDialog dialog = new BaseDialog("@mod.import");
|
||||
|
||||
TextButtonStyle bstyle = Styles.cleart;
|
||||
|
||||
@ -74,7 +74,7 @@ public class ModsDialog extends BaseDialog{
|
||||
t.defaults().size(300f, 70f);
|
||||
t.margin(12f);
|
||||
|
||||
t.button("$mod.import.file", Icon.file, bstyle, () -> {
|
||||
t.button("@mod.import.file", Icon.file, bstyle, () -> {
|
||||
dialog.hide();
|
||||
|
||||
platform.showMultiFileChooser(file -> {
|
||||
@ -90,7 +90,7 @@ public class ModsDialog extends BaseDialog{
|
||||
|
||||
//show unsafe jar file warning
|
||||
if(file.extEquals("jar")){
|
||||
ui.showConfirm("$warning", "$mod.jarwarn", go);
|
||||
ui.showConfirm("@warning", "@mod.jarwarn", go);
|
||||
}else{
|
||||
go.run();
|
||||
}
|
||||
@ -99,10 +99,10 @@ public class ModsDialog extends BaseDialog{
|
||||
|
||||
t.row();
|
||||
|
||||
t.button("$mod.import.github", Icon.github, bstyle, () -> {
|
||||
t.button("@mod.import.github", Icon.github, bstyle, () -> {
|
||||
dialog.hide();
|
||||
|
||||
ui.showTextInput("$mod.import.github", "", 64, Core.settings.getString("lastmod", "Anuken/ExampleMod"), text -> {
|
||||
ui.showTextInput("@mod.import.github", "", 64, Core.settings.getString("lastmod", "Anuken/ExampleMod"), text -> {
|
||||
Core.settings.put("lastmod", text);
|
||||
|
||||
ui.loadfrag.show();
|
||||
@ -141,7 +141,7 @@ public class ModsDialog extends BaseDialog{
|
||||
}).margin(margin);
|
||||
|
||||
if(!mobile){
|
||||
buttons.button("$mods.openfolder", Icon.link, style, () -> Core.app.openFolder(modDirectory.absolutePath())).margin(margin);
|
||||
buttons.button("@mods.openfolder", Icon.link, style, () -> Core.app.openFolder(modDirectory.absolutePath())).margin(margin);
|
||||
}
|
||||
}).width(w);
|
||||
|
||||
@ -196,14 +196,14 @@ public class ModsDialog extends BaseDialog{
|
||||
|
||||
t.table(right -> {
|
||||
right.right();
|
||||
right.button(mod.enabled() ? "$mod.disable" : "$mod.enable", mod.enabled() ? Icon.downOpen : Icon.upOpen, Styles.transt, () -> {
|
||||
right.button(mod.enabled() ? "@mod.disable" : "@mod.enable", mod.enabled() ? Icon.downOpen : Icon.upOpen, Styles.transt, () -> {
|
||||
mods.setEnabled(mod, !mod.enabled());
|
||||
setup();
|
||||
}).height(50f).margin(8f).width(130f).disabled(!mod.isSupported());
|
||||
|
||||
right.button(mod.hasSteamID() ? Icon.link : Icon.trash, Styles.clearPartiali, () -> {
|
||||
if(!mod.hasSteamID()){
|
||||
ui.showConfirm("$confirm", "$mod.remove.confirm", () -> {
|
||||
ui.showConfirm("@confirm", "@mod.remove.confirm", () -> {
|
||||
mods.removeMod(mod);
|
||||
setup();
|
||||
});
|
||||
@ -228,7 +228,7 @@ public class ModsDialog extends BaseDialog{
|
||||
t.labelWrap(Core.bundle.format("mod.missingdependencies", mod.missingDependencies.toString(", "))).growX();
|
||||
t.row();
|
||||
}else if(mod.hasContentErrors()){
|
||||
t.labelWrap("$mod.erroredcontent").growX();
|
||||
t.labelWrap("@mod.erroredcontent").growX();
|
||||
t.row();
|
||||
}
|
||||
}, Styles.clearPartialt, () -> showMod(mod)).size(w, h).growX().pad(4f);
|
||||
@ -237,7 +237,7 @@ public class ModsDialog extends BaseDialog{
|
||||
});
|
||||
|
||||
}else{
|
||||
cont.table(Styles.black6, t -> t.add("$mods.none")).height(80f);
|
||||
cont.table(Styles.black6, t -> t.add("@mods.none")).height(80f);
|
||||
}
|
||||
|
||||
cont.row();
|
||||
@ -246,7 +246,7 @@ public class ModsDialog extends BaseDialog{
|
||||
}
|
||||
|
||||
private void reload(){
|
||||
ui.showInfo("$mods.reloadexit", () -> Core.app.exit());
|
||||
ui.showInfo("@mods.reloadexit", () -> Core.app.exit());
|
||||
}
|
||||
|
||||
private void showMod(LoadedMod mod){
|
||||
@ -255,7 +255,7 @@ public class ModsDialog extends BaseDialog{
|
||||
dialog.addCloseButton();
|
||||
|
||||
if(!mobile){
|
||||
dialog.buttons.button("$mods.openfolder", Icon.link, () -> Core.app.openFolder(mod.file.absolutePath()));
|
||||
dialog.buttons.button("@mods.openfolder", Icon.link, () -> Core.app.openFolder(mod.file.absolutePath()));
|
||||
}
|
||||
|
||||
//TODO improve this menu later
|
||||
@ -263,18 +263,18 @@ public class ModsDialog extends BaseDialog{
|
||||
desc.center();
|
||||
desc.defaults().padTop(10).left();
|
||||
|
||||
desc.add("$editor.name").padRight(10).color(Color.gray).padTop(0);
|
||||
desc.add("@editor.name").padRight(10).color(Color.gray).padTop(0);
|
||||
desc.row();
|
||||
desc.add(mod.meta.displayName()).growX().wrap().padTop(2);
|
||||
desc.row();
|
||||
if(mod.meta.author != null){
|
||||
desc.add("$editor.author").padRight(10).color(Color.gray);
|
||||
desc.add("@editor.author").padRight(10).color(Color.gray);
|
||||
desc.row();
|
||||
desc.add(mod.meta.author).growX().wrap().padTop(2);
|
||||
desc.row();
|
||||
}
|
||||
if(mod.meta.description != null){
|
||||
desc.add("$editor.description").padRight(10).color(Color.gray).top();
|
||||
desc.add("@editor.description").padRight(10).color(Color.gray).top();
|
||||
desc.row();
|
||||
desc.add(mod.meta.description).growX().wrap().padTop(2);
|
||||
}
|
||||
@ -283,7 +283,7 @@ public class ModsDialog extends BaseDialog{
|
||||
/*
|
||||
Array<UnlockableContent> all = Array.with(content.getContentMap()).<Content>flatten().select(c -> c.minfo.mod == mod && c instanceof UnlockableContent).as(UnlockableContent.class);
|
||||
if(all.any()){
|
||||
desc.add("$mod.content").padRight(10).color(Color.gray).top();
|
||||
desc.add("@mod.content").padRight(10).color(Color.gray).top();
|
||||
desc.row();
|
||||
desc.pane(cs -> {
|
||||
int i = 0;
|
||||
|
@ -12,7 +12,7 @@ public class PausedDialog extends BaseDialog{
|
||||
private boolean wasClient = false;
|
||||
|
||||
public PausedDialog(){
|
||||
super("$menu");
|
||||
super("@menu");
|
||||
shouldPause = true;
|
||||
|
||||
shown(this::rebuild);
|
||||
@ -44,28 +44,28 @@ public class PausedDialog extends BaseDialog{
|
||||
float dw = 220f;
|
||||
cont.defaults().width(dw).height(55).pad(5f);
|
||||
|
||||
cont.button("$back", Icon.left, this::hide).colspan(2).width(dw * 2 + 20f);
|
||||
cont.button("@back", Icon.left, this::hide).colspan(2).width(dw * 2 + 20f);
|
||||
|
||||
cont.row();
|
||||
//if(state.isCampaign()){
|
||||
// cont.button("$techtree", Icon.tree, ui.tech::show);
|
||||
// cont.button("@techtree", Icon.tree, ui.tech::show);
|
||||
//}else{
|
||||
// cont.button("$database", Icon.book, ui.database::show);
|
||||
// cont.button("@database", Icon.book, ui.database::show);
|
||||
//}
|
||||
//TODO remove
|
||||
cont.button("nothing", Icon.warning, () -> ui.showInfo("no"));
|
||||
cont.button("$settings", Icon.settings, ui.settings::show);
|
||||
cont.button("@settings", Icon.settings, ui.settings::show);
|
||||
|
||||
if(!state.rules.tutorial){
|
||||
if(!state.isCampaign() && !state.isEditor()){
|
||||
cont.row();
|
||||
cont.button("$savegame", Icon.save, save::show);
|
||||
cont.button("$loadgame", Icon.upload, load::show).disabled(b -> net.active());
|
||||
cont.button("@savegame", Icon.save, save::show);
|
||||
cont.button("@loadgame", Icon.upload, load::show).disabled(b -> net.active());
|
||||
}
|
||||
|
||||
cont.row();
|
||||
|
||||
cont.button("$hostserver", Icon.host, () -> {
|
||||
cont.button("@hostserver", Icon.host, () -> {
|
||||
if(net.server() && steam){
|
||||
platform.inviteFriends();
|
||||
}else{
|
||||
@ -75,39 +75,39 @@ public class PausedDialog extends BaseDialog{
|
||||
ui.host.show();
|
||||
}
|
||||
}
|
||||
}).disabled(b -> !((steam && net.server()) || !net.active())).colspan(2).width(dw * 2 + 20f).update(e -> e.setText(net.server() && steam ? "$invitefriends" : "$hostserver"));
|
||||
}).disabled(b -> !((steam && net.server()) || !net.active())).colspan(2).width(dw * 2 + 20f).update(e -> e.setText(net.server() && steam ? "@invitefriends" : "@hostserver"));
|
||||
}
|
||||
|
||||
cont.row();
|
||||
|
||||
cont.button("$quit", Icon.exit, this::showQuitConfirm).colspan(2).width(dw + 20f).update(s -> s.setText(control.saves.getCurrent() != null && control.saves.getCurrent().isAutosave() ? "$save.quit" : "$quit"));
|
||||
cont.button("@quit", Icon.exit, this::showQuitConfirm).colspan(2).width(dw + 20f).update(s -> s.setText(control.saves.getCurrent() != null && control.saves.getCurrent().isAutosave() ? "@save.quit" : "@quit"));
|
||||
|
||||
}else{
|
||||
cont.defaults().size(130f).pad(5);
|
||||
cont.buttonRow("$back", Icon.play, this::hide);
|
||||
cont.buttonRow("$settings", Icon.settings, ui.settings::show);
|
||||
cont.buttonRow("@back", Icon.play, this::hide);
|
||||
cont.buttonRow("@settings", Icon.settings, ui.settings::show);
|
||||
|
||||
if(!state.isCampaign() && !state.isEditor()){
|
||||
cont.buttonRow("$save", Icon.save, save::show);
|
||||
cont.buttonRow("@save", Icon.save, save::show);
|
||||
|
||||
cont.row();
|
||||
|
||||
cont.buttonRow("$load", Icon.download, load::show).disabled(b -> net.active());
|
||||
cont.buttonRow("@load", Icon.download, load::show).disabled(b -> net.active());
|
||||
}else{
|
||||
cont.row();
|
||||
}
|
||||
|
||||
cont.buttonRow("$hostserver.mobile", Icon.host, ui.host::show).disabled(b -> net.active());
|
||||
cont.buttonRow("@hostserver.mobile", Icon.host, ui.host::show).disabled(b -> net.active());
|
||||
|
||||
cont.buttonRow("$quit", Icon.exit, this::showQuitConfirm).update(s -> {
|
||||
s.setText(control.saves.getCurrent() != null && control.saves.getCurrent().isAutosave() ? "$save.quit" : "$quit");
|
||||
cont.buttonRow("@quit", Icon.exit, this::showQuitConfirm).update(s -> {
|
||||
s.setText(control.saves.getCurrent() != null && control.saves.getCurrent().isAutosave() ? "@save.quit" : "@quit");
|
||||
s.getLabelCell().growX().wrap();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void showQuitConfirm(){
|
||||
ui.showConfirm("$confirm", state.rules.tutorial ? "$quit.confirm.tutorial" : "$quit.confirm", () -> {
|
||||
ui.showConfirm("@confirm", state.rules.tutorial ? "@quit.confirm.tutorial" : "@quit.confirm", () -> {
|
||||
if(state.rules.tutorial){
|
||||
Core.settings.put("playedtutorial", true);
|
||||
}
|
||||
@ -129,7 +129,7 @@ public class PausedDialog extends BaseDialog{
|
||||
return;
|
||||
}
|
||||
|
||||
ui.loadAnd("$saving", () -> {
|
||||
ui.loadAnd("@saving", () -> {
|
||||
try{
|
||||
control.saves.getCurrent().save();
|
||||
}catch(Throwable e){
|
||||
|
@ -112,7 +112,7 @@ public class ResearchDialog extends BaseDialog{
|
||||
|
||||
addCloseButton();
|
||||
|
||||
buttons.button("$database", Icon.book, () -> {
|
||||
buttons.button("@database", Icon.book, () -> {
|
||||
hide();
|
||||
ui.database.show();
|
||||
}).size(210f, 64f);
|
||||
@ -531,7 +531,7 @@ public class ResearchDialog extends BaseDialog{
|
||||
}
|
||||
}else if(node.objectives.size > 0){
|
||||
t.table(r -> {
|
||||
r.add("$complete").colspan(2).left();
|
||||
r.add("@complete").colspan(2).left();
|
||||
r.row();
|
||||
for(Objective o : node.objectives){
|
||||
if(o.complete()) continue;
|
||||
@ -545,13 +545,13 @@ public class ResearchDialog extends BaseDialog{
|
||||
}
|
||||
});
|
||||
}else{
|
||||
desc.add("$completed");
|
||||
desc.add("@completed");
|
||||
}
|
||||
}).pad(9);
|
||||
|
||||
if(mobile && locked(node)){
|
||||
b.row();
|
||||
b.button("$research", Icon.ok, Styles.nodet, () -> spend(node))
|
||||
b.button("@research", Icon.ok, Styles.nodet, () -> spend(node))
|
||||
.disabled(i -> !canSpend(node)).growX().height(44f).colspan(3);
|
||||
}
|
||||
});
|
||||
|
@ -11,7 +11,7 @@ import static mindustry.Vars.*;
|
||||
public class SaveDialog extends LoadDialog{
|
||||
|
||||
public SaveDialog(){
|
||||
super("$savegame");
|
||||
super("@savegame");
|
||||
|
||||
update(() -> {
|
||||
if(state.isMenu() && isShown()){
|
||||
@ -23,9 +23,9 @@ public class SaveDialog extends LoadDialog{
|
||||
@Override
|
||||
public void addSetup(){
|
||||
|
||||
buttons.button("$save.new", Icon.add, () ->
|
||||
ui.showTextInput("$save", "$save.newslot", 30, "",
|
||||
text -> ui.loadAnd("$saving", () -> {
|
||||
buttons.button("@save.new", Icon.add, () ->
|
||||
ui.showTextInput("@save", "@save.newslot", 30, "",
|
||||
text -> ui.loadAnd("@saving", () -> {
|
||||
control.saves.addSave(text);
|
||||
Core.app.post(() -> Core.app.post(this::setup));
|
||||
}))).fillX().margin(10f);
|
||||
@ -36,13 +36,13 @@ public class SaveDialog extends LoadDialog{
|
||||
button.clicked(() -> {
|
||||
if(button.childrenPressed()) return;
|
||||
|
||||
ui.showConfirm("$overwrite", "$save.overwrite", () -> save(slot));
|
||||
ui.showConfirm("@overwrite", "@save.overwrite", () -> save(slot));
|
||||
});
|
||||
}
|
||||
|
||||
void save(SaveSlot slot){
|
||||
|
||||
ui.loadfrag.show("$saving");
|
||||
ui.loadfrag.show("@saving");
|
||||
|
||||
Time.runTask(5f, () -> {
|
||||
hide();
|
||||
|
@ -28,14 +28,14 @@ public class SchematicsDialog extends BaseDialog{
|
||||
private TextField searchField;
|
||||
|
||||
public SchematicsDialog(){
|
||||
super("$schematics");
|
||||
super("@schematics");
|
||||
Core.assets.load("sprites/schematic-background.png", Texture.class).loaded = t -> {
|
||||
((Texture)t).setWrap(TextureWrap.repeat);
|
||||
};
|
||||
|
||||
shouldPause = true;
|
||||
addCloseButton();
|
||||
buttons.button("$schematic.import", Icon.download, this::showImport);
|
||||
buttons.button("@schematic.import", Icon.download, this::showImport);
|
||||
shown(this::setup);
|
||||
onResize(this::setup);
|
||||
}
|
||||
@ -102,11 +102,11 @@ public class SchematicsDialog extends BaseDialog{
|
||||
});
|
||||
|
||||
buttons.button(Icon.pencil, style, () -> {
|
||||
ui.showTextInput("$schematic.rename", "$name", s.name(), res -> {
|
||||
ui.showTextInput("@schematic.rename", "@name", s.name(), res -> {
|
||||
Schematic replacement = schematics.all().find(other -> other.name().equals(res) && other != s);
|
||||
if(replacement != null){
|
||||
//renaming to an existing schematic is not allowed, as it is not clear how the tags would be merged, and which one should be removed
|
||||
ui.showErrorMessage("$schematic.exists");
|
||||
ui.showErrorMessage("@schematic.exists");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ public class SchematicsDialog extends BaseDialog{
|
||||
if(s.mod != null){
|
||||
ui.showInfo(Core.bundle.format("mod.item.remove", s.mod.meta.displayName()));
|
||||
}else{
|
||||
ui.showConfirm("$confirm", "$schematic.delete.confirm", () -> {
|
||||
ui.showConfirm("@confirm", "@schematic.delete.confirm", () -> {
|
||||
schematics.remove(s);
|
||||
rebuildPane[0].run();
|
||||
});
|
||||
@ -159,7 +159,7 @@ public class SchematicsDialog extends BaseDialog{
|
||||
}
|
||||
|
||||
if(firstSchematic == null){
|
||||
t.add("$none");
|
||||
t.add("@none");
|
||||
}
|
||||
};
|
||||
|
||||
@ -172,28 +172,28 @@ public class SchematicsDialog extends BaseDialog{
|
||||
}
|
||||
|
||||
public void showImport(){
|
||||
BaseDialog dialog = new BaseDialog("$editor.export");
|
||||
BaseDialog dialog = new BaseDialog("@editor.export");
|
||||
dialog.cont.pane(p -> {
|
||||
p.margin(10f);
|
||||
p.table(Tex.button, t -> {
|
||||
TextButtonStyle style = Styles.cleart;
|
||||
t.defaults().size(280f, 60f).left();
|
||||
t.row();
|
||||
t.button("$schematic.copy.import", Icon.copy, style, () -> {
|
||||
t.button("@schematic.copy.import", Icon.copy, style, () -> {
|
||||
dialog.hide();
|
||||
try{
|
||||
Schematic s = Schematics.readBase64(Core.app.getClipboardText());
|
||||
s.removeSteamID();
|
||||
schematics.add(s);
|
||||
setup();
|
||||
ui.showInfoFade("$schematic.saved");
|
||||
ui.showInfoFade("@schematic.saved");
|
||||
showInfo(s);
|
||||
}catch(Throwable e){
|
||||
ui.showException(e);
|
||||
}
|
||||
}).marginLeft(12f).disabled(b -> Core.app.getClipboardText() == null || !Core.app.getClipboardText().startsWith(schematicBaseStart));
|
||||
t.row();
|
||||
t.button("$schematic.importfile", Icon.download, style, () -> platform.showFileChooser(true, schematicExtension, file -> {
|
||||
t.button("@schematic.importfile", Icon.download, style, () -> platform.showFileChooser(true, schematicExtension, file -> {
|
||||
dialog.hide();
|
||||
|
||||
try{
|
||||
@ -208,7 +208,7 @@ public class SchematicsDialog extends BaseDialog{
|
||||
})).marginLeft(12f);
|
||||
t.row();
|
||||
if(steam){
|
||||
t.button("$schematic.browseworkshop", Icon.book, style, () -> {
|
||||
t.button("@schematic.browseworkshop", Icon.book, style, () -> {
|
||||
dialog.hide();
|
||||
platform.openWorkshop();
|
||||
}).marginLeft(12f);
|
||||
@ -221,25 +221,25 @@ public class SchematicsDialog extends BaseDialog{
|
||||
}
|
||||
|
||||
public void showExport(Schematic s){
|
||||
BaseDialog dialog = new BaseDialog("$editor.export");
|
||||
BaseDialog dialog = new BaseDialog("@editor.export");
|
||||
dialog.cont.pane(p -> {
|
||||
p.margin(10f);
|
||||
p.table(Tex.button, t -> {
|
||||
TextButtonStyle style = Styles.cleart;
|
||||
t.defaults().size(280f, 60f).left();
|
||||
if(steam && !s.hasSteamID()){
|
||||
t.button("$schematic.shareworkshop", Icon.book, style,
|
||||
t.button("@schematic.shareworkshop", Icon.book, style,
|
||||
() -> platform.publish(s)).marginLeft(12f);
|
||||
t.row();
|
||||
dialog.hide();
|
||||
}
|
||||
t.button("$schematic.copy", Icon.copy, style, () -> {
|
||||
t.button("@schematic.copy", Icon.copy, style, () -> {
|
||||
dialog.hide();
|
||||
ui.showInfoFade("$copied");
|
||||
ui.showInfoFade("@copied");
|
||||
Core.app.setClipboardText(schematics.writeBase64(s));
|
||||
}).marginLeft(12f);
|
||||
t.row();
|
||||
t.button("$schematic.exportfile", Icon.export, style, () -> {
|
||||
t.button("@schematic.exportfile", Icon.export, style, () -> {
|
||||
dialog.hide();
|
||||
platform.export(s.name(), schematicExtension, file -> Schematics.write(s, file));
|
||||
}).marginLeft(12f);
|
||||
|
@ -82,14 +82,14 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
prefs.clearChildren();
|
||||
prefs.add(menu);
|
||||
|
||||
dataDialog = new BaseDialog("$settings.data");
|
||||
dataDialog = new BaseDialog("@settings.data");
|
||||
dataDialog.addCloseButton();
|
||||
|
||||
dataDialog.cont.table(Tex.button, t -> {
|
||||
t.defaults().size(270f, 60f).left();
|
||||
TextButtonStyle style = Styles.cleart;
|
||||
|
||||
t.button("$settings.cleardata", Icon.trash, style, () -> ui.showConfirm("$confirm", "$settings.clearall.confirm", () -> {
|
||||
t.button("@settings.cleardata", Icon.trash, style, () -> 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")){
|
||||
@ -108,15 +108,15 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
|
||||
t.row();
|
||||
|
||||
t.button("$settings.clearsaves", Icon.trash, style, () -> {
|
||||
ui.showConfirm("$confirm", "$settings.clearsaves.confirm", () -> {
|
||||
t.button("@settings.clearsaves", Icon.trash, style, () -> {
|
||||
ui.showConfirm("@confirm", "@settings.clearsaves.confirm", () -> {
|
||||
control.saves.deleteAll();
|
||||
});
|
||||
}).marginLeft(4);
|
||||
|
||||
t.row();
|
||||
|
||||
t.button("$data.export", Icon.upload, style, () -> {
|
||||
t.button("@data.export", Icon.upload, style, () -> {
|
||||
if(ios){
|
||||
Fi file = Core.files.local("mindustry-data-export.zip");
|
||||
try{
|
||||
@ -129,7 +129,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
platform.showFileChooser(false, "zip", file -> {
|
||||
try{
|
||||
exportData(file);
|
||||
ui.showInfo("$data.exported");
|
||||
ui.showInfo("@data.exported");
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
ui.showException(e);
|
||||
@ -140,25 +140,25 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
|
||||
t.row();
|
||||
|
||||
t.button("$data.import", Icon.download, style, () -> ui.showConfirm("$confirm", "$data.import.confirm", () -> platform.showFileChooser(true, "zip", file -> {
|
||||
t.button("@data.import", Icon.download, style, () -> ui.showConfirm("@confirm", "@data.import.confirm", () -> platform.showFileChooser(true, "zip", file -> {
|
||||
try{
|
||||
importData(file);
|
||||
Core.app.exit();
|
||||
}catch(IllegalArgumentException e){
|
||||
ui.showErrorMessage("$data.invalid");
|
||||
ui.showErrorMessage("@data.invalid");
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
if(e.getMessage() == null || !e.getMessage().contains("too short")){
|
||||
ui.showException(e);
|
||||
}else{
|
||||
ui.showErrorMessage("$data.invalid");
|
||||
ui.showErrorMessage("@data.invalid");
|
||||
}
|
||||
}
|
||||
}))).marginLeft(4);
|
||||
|
||||
if(!mobile){
|
||||
t.row();
|
||||
t.button("$data.openfolder", Icon.folder, style, () -> Core.app.openFolder(Core.settings.getDataDirectory().absolutePath())).marginLeft(4);
|
||||
t.button("@data.openfolder", Icon.folder, style, () -> Core.app.openFolder(Core.settings.getDataDirectory().absolutePath())).marginLeft(4);
|
||||
}
|
||||
});
|
||||
|
||||
@ -197,20 +197,20 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
TextButtonStyle style = Styles.cleart;
|
||||
|
||||
menu.defaults().size(300f, 60f);
|
||||
menu.button("$settings.game", style, () -> visible(0));
|
||||
menu.button("@settings.game", style, () -> visible(0));
|
||||
menu.row();
|
||||
menu.button("$settings.graphics", style, () -> visible(1));
|
||||
menu.button("@settings.graphics", style, () -> visible(1));
|
||||
menu.row();
|
||||
menu.button("$settings.sound", style, () -> visible(2));
|
||||
menu.button("@settings.sound", style, () -> visible(2));
|
||||
menu.row();
|
||||
menu.button("$settings.language", style, ui.language::show);
|
||||
menu.button("@settings.language", style, ui.language::show);
|
||||
if(!mobile || Core.settings.getBool("keyboard")){
|
||||
menu.row();
|
||||
menu.button("$settings.controls", style, ui.controls::show);
|
||||
menu.button("@settings.controls", style, ui.controls::show);
|
||||
}
|
||||
|
||||
menu.row();
|
||||
menu.button("$settings.data", style, () -> dataDialog.show());
|
||||
menu.button("@settings.data", style, () -> dataDialog.show());
|
||||
}
|
||||
|
||||
void addSettings(){
|
||||
@ -268,7 +268,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
game.pref(new Setting(){
|
||||
@Override
|
||||
public void add(SettingsTable table){
|
||||
table.button("$tutorial.retake", () -> {
|
||||
table.button("@tutorial.retake", () -> {
|
||||
hide();
|
||||
control.playTutorial();
|
||||
}).size(220f, 60f).pad(6).left();
|
||||
@ -434,7 +434,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
|
||||
@Override
|
||||
public void addCloseButton(){
|
||||
buttons.button("$back", Icon.leftOpen, () -> {
|
||||
buttons.button("@back", Icon.leftOpen, () -> {
|
||||
if(prefs.getChildren().first() != menu){
|
||||
back();
|
||||
}else{
|
||||
|
@ -8,7 +8,7 @@ import mindustry.net.Administration.TraceInfo;
|
||||
public class TraceDialog extends BaseDialog{
|
||||
|
||||
public TraceDialog(){
|
||||
super("$trace");
|
||||
super("@trace");
|
||||
|
||||
addCloseButton();
|
||||
setFillParent(false);
|
||||
|
@ -71,7 +71,7 @@ public class HudFragment extends Fragment{
|
||||
//paused table
|
||||
parent.fill(t -> {
|
||||
t.top().visible(() -> state.isPaused() && !state.isOutOfTime()).touchable = Touchable.disabled;
|
||||
t.table(Styles.black5, top -> top.add("$paused").style(Styles.outlineLabel).pad(8f)).growX();
|
||||
t.table(Styles.black5, top -> top.add("@paused").style(Styles.outlineLabel).pad(8f)).growX();
|
||||
});
|
||||
|
||||
//TODO tear this all down
|
||||
@ -167,7 +167,7 @@ public class HudFragment extends Fragment{
|
||||
{
|
||||
editorMain.table(Tex.buttonEdge4, t -> {
|
||||
//t.margin(0f);
|
||||
t.add("$editor.teams").growX().left();
|
||||
t.add("@editor.teams").growX().left();
|
||||
t.row();
|
||||
t.table(teams -> {
|
||||
teams.left();
|
||||
@ -223,7 +223,7 @@ public class HudFragment extends Fragment{
|
||||
//spawner warning
|
||||
parent.fill(t -> {
|
||||
t.touchable = Touchable.disabled;
|
||||
t.table(Styles.black, c -> c.add("$nearpoint")
|
||||
t.table(Styles.black, c -> c.add("@nearpoint")
|
||||
.update(l -> l.setColor(Tmp.c1.set(Color.white).lerp(Color.scarlet, Mathf.absin(Time.time(), 10f, 1f))))
|
||||
.get().setAlignment(Align.center, Align.center))
|
||||
.margin(6).update(u -> u.color.a = Mathf.lerpDelta(u.color.a, Mathf.num(spawner.playerNear()), 0.1f)).get().color.a = 0f;
|
||||
@ -231,7 +231,7 @@ public class HudFragment extends Fragment{
|
||||
|
||||
parent.fill(t -> {
|
||||
t.visible(() -> netServer.isWaitingForPlayers());
|
||||
t.table(Tex.button, c -> c.add("$waiting.players"));
|
||||
t.table(Tex.button, c -> c.add("@waiting.players"));
|
||||
});
|
||||
|
||||
//'core is under attack' table
|
||||
@ -262,7 +262,7 @@ public class HudFragment extends Fragment{
|
||||
|
||||
return coreAttackOpacity[0] > 0;
|
||||
});
|
||||
t.table(Tex.button, top -> top.add("$coreattack").pad(2)
|
||||
t.table(Tex.button, top -> top.add("@coreattack").pad(2)
|
||||
.update(label -> label.color.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time(), 2f, 1f)))).touchable(Touchable.disabled);
|
||||
});
|
||||
|
||||
@ -312,7 +312,7 @@ public class HudFragment extends Fragment{
|
||||
//'saving' indicator
|
||||
parent.fill(t -> {
|
||||
t.bottom().visible(() -> control.saves.isSaving());
|
||||
t.add("$saving").style(Styles.outlineLabel);
|
||||
t.add("@saving").style(Styles.outlineLabel);
|
||||
});
|
||||
|
||||
parent.fill(p -> {
|
||||
@ -459,7 +459,7 @@ public class HudFragment extends Fragment{
|
||||
|
||||
//add to table
|
||||
table.add(in).padRight(8);
|
||||
table.add("$unlocked");
|
||||
table.add("@unlocked");
|
||||
table.pack();
|
||||
|
||||
//create container table which will align and move
|
||||
@ -555,17 +555,17 @@ public class HudFragment extends Fragment{
|
||||
}
|
||||
|
||||
private void showLaunchConfirm(){
|
||||
BaseDialog dialog = new BaseDialog("$launch");
|
||||
BaseDialog dialog = new BaseDialog("@launch");
|
||||
dialog.update(() -> {
|
||||
if(!inLaunchWave()){
|
||||
dialog.hide();
|
||||
}
|
||||
});
|
||||
dialog.cont.add("$launch.confirm").width(500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center);
|
||||
dialog.cont.add("@launch.confirm").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("$cancel", dialog::hide);
|
||||
dialog.buttons.button("$ok", () -> {
|
||||
dialog.buttons.button("@cancel", dialog::hide);
|
||||
dialog.buttons.button("@ok", () -> {
|
||||
dialog.hide();
|
||||
Call.launchZone();
|
||||
});
|
||||
@ -680,7 +680,7 @@ public class HudFragment extends Fragment{
|
||||
if(net.client() && player.admin){
|
||||
Call.adminRequest(player, AdminAction.wave);
|
||||
}else if(inLaunchWave()){
|
||||
ui.showConfirm("$confirm", "$launch.skip.confirm", () -> !canSkipWave(), () -> logic.skipWave());
|
||||
ui.showConfirm("@confirm", "@launch.skip.confirm", () -> !canSkipWave(), () -> logic.skipWave());
|
||||
}else{
|
||||
logic.skipWave();
|
||||
}
|
||||
|
@ -24,16 +24,16 @@ public class LoadingFragment extends Fragment{
|
||||
t.add().height(133f).row();
|
||||
t.add(new WarningBar()).growX().height(24f);
|
||||
t.row();
|
||||
nameLabel = t.add("$loading").pad(10f).style(Styles.techLabel).get();
|
||||
nameLabel = t.add("@loading").pad(10f).style(Styles.techLabel).get();
|
||||
t.row();
|
||||
t.add(new WarningBar()).growX().height(24f);
|
||||
t.row();
|
||||
|
||||
text("$loading");
|
||||
text("@loading");
|
||||
|
||||
bar = t.add(new Bar()).pad(3).size(500f, 40f).visible(false).get();
|
||||
t.row();
|
||||
button = t.button("$cancel", () -> {}).pad(20).size(250f, 70f).visible(false).get();
|
||||
button = t.button("@cancel", () -> {}).pad(20).size(250f, 70f).visible(false).get();
|
||||
table = t;
|
||||
});
|
||||
}
|
||||
@ -56,7 +56,7 @@ public class LoadingFragment extends Fragment{
|
||||
}
|
||||
|
||||
public void show(){
|
||||
show("$loading");
|
||||
show("@loading");
|
||||
}
|
||||
|
||||
public void show(String text){
|
||||
|
@ -60,12 +60,12 @@ public class MenuFragment extends Fragment{
|
||||
parent.fill(c -> c.bottom().left().button("", Styles.infot, ui.about::show).size(84, 45));
|
||||
parent.fill(c -> c.bottom().right().button("", Styles.discordt, ui.discord::show).size(84, 45));
|
||||
}else if(becontrol.active()){
|
||||
parent.fill(c -> c.bottom().right().button("$be.check", Icon.refresh, () -> {
|
||||
parent.fill(c -> c.bottom().right().button("@be.check", Icon.refresh, () -> {
|
||||
ui.loadfrag.show();
|
||||
becontrol.checkUpdate(result -> {
|
||||
ui.loadfrag.hide();
|
||||
if(!result){
|
||||
ui.showInfo("$be.noupdates");
|
||||
ui.showInfo("@be.noupdates");
|
||||
}
|
||||
});
|
||||
}).size(200, 60).update(t -> {
|
||||
@ -100,15 +100,15 @@ public class MenuFragment extends Fragment{
|
||||
container.defaults().size(size).pad(5).padTop(4f);
|
||||
|
||||
MobileButton
|
||||
play = new MobileButton(Icon.play, "$campaign", () -> checkPlay(ui.planet::show)),
|
||||
custom = new MobileButton(Icon.rightOpenOut, "$customgame", () -> checkPlay(ui.custom::show)),
|
||||
maps = new MobileButton(Icon.download, "$loadgame", () -> checkPlay(ui.load::show)),
|
||||
join = new MobileButton(Icon.add, "$joingame", () -> checkPlay(ui.join::show)),
|
||||
editor = new MobileButton(Icon.terrain, "$editor", () -> checkPlay(ui.maps::show)),
|
||||
tools = new MobileButton(Icon.settings, "$settings", ui.settings::show),
|
||||
mods = new MobileButton(Icon.book, "$mods", ui.mods::show),
|
||||
donate = new MobileButton(Icon.link, "$website", () -> Core.app.openURI("https://anuke.itch.io/mindustry")),
|
||||
exit = new MobileButton(Icon.exit, "$quit", () -> Core.app.exit());
|
||||
play = new MobileButton(Icon.play, "@campaign", () -> checkPlay(ui.planet::show)),
|
||||
custom = new MobileButton(Icon.rightOpenOut, "@customgame", () -> checkPlay(ui.custom::show)),
|
||||
maps = new MobileButton(Icon.download, "@loadgame", () -> checkPlay(ui.load::show)),
|
||||
join = new MobileButton(Icon.add, "@joingame", () -> checkPlay(ui.join::show)),
|
||||
editor = new MobileButton(Icon.terrain, "@editor", () -> checkPlay(ui.maps::show)),
|
||||
tools = new MobileButton(Icon.settings, "@settings", ui.settings::show),
|
||||
mods = new MobileButton(Icon.book, "@mods", ui.mods::show),
|
||||
donate = new MobileButton(Icon.link, "@website", () -> Core.app.openURI("https://anuke.itch.io/mindustry")),
|
||||
exit = new MobileButton(Icon.exit, "@quit", () -> Core.app.exit());
|
||||
|
||||
if(!Core.graphics.isPortrait()){
|
||||
container.marginTop(60f);
|
||||
@ -164,20 +164,20 @@ public class MenuFragment extends Fragment{
|
||||
t.defaults().width(width).height(70f);
|
||||
|
||||
buttons(t,
|
||||
new Buttoni("$play", Icon.play,
|
||||
new Buttoni("$campaign", Icon.play, () -> checkPlay(ui.planet::show)),
|
||||
new Buttoni("$joingame", Icon.add, () -> checkPlay(ui.join::show)),
|
||||
new Buttoni("$customgame", Icon.terrain, () -> checkPlay(ui.custom::show)),
|
||||
new Buttoni("$loadgame", Icon.download, () -> checkPlay(ui.load::show)),
|
||||
new Buttoni("$tutorial", Icon.info, () -> checkPlay(control::playTutorial))
|
||||
new Buttoni("@play", Icon.play,
|
||||
new Buttoni("@campaign", Icon.play, () -> checkPlay(ui.planet::show)),
|
||||
new Buttoni("@joingame", Icon.add, () -> checkPlay(ui.join::show)),
|
||||
new Buttoni("@customgame", Icon.terrain, () -> checkPlay(ui.custom::show)),
|
||||
new Buttoni("@loadgame", Icon.download, () -> checkPlay(ui.load::show)),
|
||||
new Buttoni("@tutorial", Icon.info, () -> checkPlay(control::playTutorial))
|
||||
),
|
||||
new Buttoni("$editor", Icon.terrain, () -> checkPlay(ui.maps::show)), steam ? new Buttoni("$workshop", Icon.book, platform::openWorkshop) : null,
|
||||
new Buttoni("@editor", Icon.terrain, () -> checkPlay(ui.maps::show)), steam ? new Buttoni("@workshop", Icon.book, platform::openWorkshop) : null,
|
||||
new Buttoni(Core.bundle.get("mods"), Icon.bookOpen, ui.mods::show),
|
||||
//not enough space for this button
|
||||
//new Buttoni("$schematics", Icon.paste, ui.schematics::show),
|
||||
new Buttoni("$settings", Icon.settings, ui.settings::show),
|
||||
new Buttoni("$about.button", Icon.info, ui.about::show),
|
||||
new Buttoni("$quit", Icon.exit, Core.app::exit)
|
||||
//new Buttoni("@schematics", Icon.paste, ui.schematics::show),
|
||||
new Buttoni("@settings", Icon.settings, ui.settings::show),
|
||||
new Buttoni("@about.button", Icon.info, ui.about::show),
|
||||
new Buttoni("@quit", Icon.exit, Core.app::exit)
|
||||
);
|
||||
|
||||
}).width(width).growY();
|
||||
@ -196,7 +196,7 @@ public class MenuFragment extends Fragment{
|
||||
if(!mods.hasContentErrors()){
|
||||
run.run();
|
||||
}else{
|
||||
ui.showInfo("$mod.noerrorplay");
|
||||
ui.showInfo("@mod.noerrorplay");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,11 +98,11 @@ public class MinimapFragment extends Fragment{
|
||||
t.visible(() -> shown);
|
||||
t.update(() -> t.setBounds(0, 0, Core.graphics.getWidth(), Core.graphics.getHeight()));
|
||||
|
||||
t.add("$minimap").style(Styles.outlineLabel).pad(10f);
|
||||
t.add("@minimap").style(Styles.outlineLabel).pad(10f);
|
||||
t.row();
|
||||
t.add().growY();
|
||||
t.row();
|
||||
t.button("$back", Icon.leftOpen, () -> shown = false).size(220f, 60f).pad(10f);
|
||||
t.button("@back", Icon.leftOpen, () -> shown = false).size(220f, 60f).pad(10f);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -216,7 +216,7 @@ public class PlacementFragment extends Fragment{
|
||||
if(unlocked(block)){
|
||||
if(Core.input.keyDown(KeyCode.shiftLeft) && Fonts.getUnicode(block.name) != 0){
|
||||
Core.app.setClipboardText((char)Fonts.getUnicode(block.name) + "");
|
||||
ui.showInfoFade("$copied");
|
||||
ui.showInfoFade("@copied");
|
||||
}else{
|
||||
control.input.block = control.input.block == block ? null : block;
|
||||
selectedBlocks.put(currentCategory, control.input.block);
|
||||
@ -337,7 +337,7 @@ public class PlacementFragment extends Fragment{
|
||||
topTable.row();
|
||||
topTable.table(b -> {
|
||||
b.image(Icon.cancel).padRight(2).color(Color.scarlet);
|
||||
b.add(!player.isBuilder() ? "$unit.nobuild" : displayBlock.unplaceableMessage()).width(190f).wrap();
|
||||
b.add(!player.isBuilder() ? "@unit.nobuild" : displayBlock.unplaceableMessage()).width(190f).wrap();
|
||||
b.left();
|
||||
}).padTop(2).left();
|
||||
}
|
||||
|
@ -57,9 +57,9 @@ public class PlayerListFragment extends Fragment{
|
||||
pane.table(menu -> {
|
||||
menu.defaults().growX().height(50f).fillY();
|
||||
|
||||
menu.button("$server.bans", ui.bans::show).disabled(b -> net.client());
|
||||
menu.button("$server.admins", ui.admins::show).disabled(b -> net.client());
|
||||
menu.button("$close", this::toggle);
|
||||
menu.button("@server.bans", ui.bans::show).disabled(b -> net.client());
|
||||
menu.button("@server.admins", ui.admins::show).disabled(b -> net.client());
|
||||
menu.button("@close", this::toggle);
|
||||
}).margin(0f).pad(10f).growX();
|
||||
|
||||
}).touchable(Touchable.enabled).margin(14f);
|
||||
@ -116,11 +116,11 @@ public class PlayerListFragment extends Fragment{
|
||||
|
||||
t.button(Icon.hammer, Styles.clearPartiali,
|
||||
() -> {
|
||||
ui.showConfirm("$confirm", Core.bundle.format("confirmban", user.name()), () -> Call.adminRequest(user, AdminAction.ban));
|
||||
ui.showConfirm("@confirm", Core.bundle.format("confirmban", user.name()), () -> Call.adminRequest(user, AdminAction.ban));
|
||||
});
|
||||
t.button(Icon.cancel, Styles.clearPartiali,
|
||||
() -> {
|
||||
ui.showConfirm("$confirm", Core.bundle.format("confirmkick", user.name()), () -> Call.adminRequest(user, AdminAction.kick));
|
||||
ui.showConfirm("@confirm", Core.bundle.format("confirmkick", user.name()), () -> Call.adminRequest(user, AdminAction.kick));
|
||||
});
|
||||
|
||||
t.row();
|
||||
@ -131,9 +131,9 @@ public class PlayerListFragment extends Fragment{
|
||||
String id = user.uuid();
|
||||
|
||||
if(netServer.admins.isAdmin(id, connection.address)){
|
||||
ui.showConfirm("$confirm", Core.bundle.format("confirmunadmin", user.name()), () -> netServer.admins.unAdminPlayer(id));
|
||||
ui.showConfirm("@confirm", Core.bundle.format("confirmunadmin", user.name()), () -> netServer.admins.unAdminPlayer(id));
|
||||
}else{
|
||||
ui.showConfirm("$confirm", Core.bundle.format("confirmadmin", user.name()), () -> netServer.admins.adminPlayer(id, user.usid()));
|
||||
ui.showConfirm("@confirm", Core.bundle.format("confirmadmin", user.name()), () -> netServer.admins.adminPlayer(id, user.usid()));
|
||||
}
|
||||
}).update(b -> b.setChecked(user.admin))
|
||||
.disabled(b -> net.client())
|
||||
@ -148,7 +148,7 @@ public class PlayerListFragment extends Fragment{
|
||||
|
||||
button.button(Icon.hammer, Styles.clearPartiali,
|
||||
() -> {
|
||||
ui.showConfirm("$confirm", Core.bundle.format("confirmvotekick", user.name()), () -> {
|
||||
ui.showConfirm("@confirm", Core.bundle.format("confirmvotekick", user.name()), () -> {
|
||||
Call.sendChatMessage("/votekick " + user.name());
|
||||
});
|
||||
}).size(h);
|
||||
|
@ -143,7 +143,7 @@ public class ResearchBlock extends Block{
|
||||
i.setScaling(Scaling.fit);
|
||||
i.setColor(researching == null ? Color.lightGray : Color.white);
|
||||
}).size(32).pad(3);
|
||||
t.label(() -> researching == null ? "$none" : researching.content.localizedName).color(Color.lightGray);
|
||||
t.label(() -> researching == null ? "@none" : researching.content.localizedName).color(Color.lightGray);
|
||||
}).left().padTop(4);
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ public class MessageBlock extends Block{
|
||||
accepted = str -> configure(str);
|
||||
}});
|
||||
}else{
|
||||
BaseDialog dialog = new BaseDialog("$editmessage");
|
||||
BaseDialog dialog = new BaseDialog("@editmessage");
|
||||
dialog.setFillParent(false);
|
||||
TextArea a = dialog.cont.add(new TextArea(message.replace("\n", "\r"))).size(380f, 160f).get();
|
||||
a.setFilter((textField, c) -> {
|
||||
@ -112,7 +112,7 @@ public class MessageBlock extends Block{
|
||||
return true;
|
||||
});
|
||||
a.setMaxLength(maxTextLength);
|
||||
dialog.buttons.button("$ok", () -> {
|
||||
dialog.buttons.button("@ok", () -> {
|
||||
configure(a.getText());
|
||||
dialog.hide();
|
||||
}).size(130f, 60f);
|
||||
|
@ -132,7 +132,7 @@ public class UnitFactory extends UnitBlock{
|
||||
if(units.any()){
|
||||
ItemSelection.buildTable(table, units, () -> currentPlan == -1 ? null : plans[currentPlan].unit, unit -> configure(units.indexOf(unit)));
|
||||
}else{
|
||||
table.table(Styles.black3, t -> t.add("$none").color(Color.lightGray));
|
||||
table.table(Styles.black3, t -> t.add("@none").color(Color.lightGray));
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ public class UnitFactory extends UnitBlock{
|
||||
i.setScaling(Scaling.fit);
|
||||
i.setColor(currentPlan == -1 ? Color.lightGray : Color.white);
|
||||
}).size(32).padBottom(-4).padRight(2);
|
||||
t.label(() -> currentPlan == -1 ? "$none" : plans[currentPlan].unit.localizedName).color(Color.lightGray);
|
||||
t.label(() -> currentPlan == -1 ? "@none" : plans[currentPlan].unit.localizedName).color(Color.lightGray);
|
||||
}).left();
|
||||
}
|
||||
|
||||
|
@ -51,27 +51,27 @@ public class AmmoListValue<T extends UnlockableContent> implements StatValue{
|
||||
}
|
||||
|
||||
if((type.status == StatusEffects.burning || type.status == StatusEffects.melting) || type.incendAmount > 0){
|
||||
sep(bt, "$bullet.incendiary");
|
||||
sep(bt, "@bullet.incendiary");
|
||||
}
|
||||
|
||||
if(type.status == StatusEffects.freezing){
|
||||
sep(bt, "$bullet.freezing");
|
||||
sep(bt, "@bullet.freezing");
|
||||
}
|
||||
|
||||
if(type.status == StatusEffects.tarred){
|
||||
sep(bt, "$bullet.tarred");
|
||||
sep(bt, "@bullet.tarred");
|
||||
}
|
||||
|
||||
if(type.homingPower > 0.01f){
|
||||
sep(bt, "$bullet.homing");
|
||||
sep(bt, "@bullet.homing");
|
||||
}
|
||||
|
||||
if(type.lightning > 0){
|
||||
sep(bt, "$bullet.shock");
|
||||
sep(bt, "@bullet.shock");
|
||||
}
|
||||
|
||||
if(type.fragBullet != null){
|
||||
sep(bt, "$bullet.frag");
|
||||
sep(bt, "@bullet.frag");
|
||||
}
|
||||
}).left().padTop(-9);
|
||||
table.row();
|
||||
|
@ -12,6 +12,6 @@ public class BooleanValue implements StatValue{
|
||||
|
||||
@Override
|
||||
public void display(Table table){
|
||||
table.add(!value ? "$no" : "$yes");
|
||||
table.add(!value ? "@no" : "@yes");
|
||||
}
|
||||
}
|
||||
|
@ -96,36 +96,36 @@ public class SWorkshop implements SteamUGCCallback{
|
||||
if(details.getResult() == SteamResult.OK){
|
||||
if(details.getOwnerID().equals(SVars.user.user.getSteamID())){
|
||||
|
||||
BaseDialog dialog = new BaseDialog("$workshop.info");
|
||||
BaseDialog dialog = new BaseDialog("@workshop.info");
|
||||
dialog.setFillParent(false);
|
||||
dialog.cont.add("$workshop.menu").pad(20f);
|
||||
dialog.cont.add("@workshop.menu").pad(20f);
|
||||
dialog.addCloseButton();
|
||||
|
||||
dialog.buttons.button("$view.workshop", Icon.link, () -> {
|
||||
dialog.buttons.button("@view.workshop", Icon.link, () -> {
|
||||
viewListingID(id);
|
||||
dialog.hide();
|
||||
}).size(210f, 64f);
|
||||
|
||||
dialog.buttons.button("$workshop.update", Icon.up, () -> {
|
||||
new BaseDialog("$workshop.update"){{
|
||||
dialog.buttons.button("@workshop.update", Icon.up, () -> {
|
||||
new BaseDialog("@workshop.update"){{
|
||||
setFillParent(false);
|
||||
cont.margin(10).add("$changelog").padRight(6f);
|
||||
cont.margin(10).add("@changelog").padRight(6f);
|
||||
cont.row();
|
||||
TextArea field = cont.area("", t -> {}).size(500f, 160f).get();
|
||||
field.setMaxLength(400);
|
||||
buttons.defaults().size(120, 54).pad(4);
|
||||
buttons.button("$ok", () -> {
|
||||
buttons.button("@ok", () -> {
|
||||
if(!p.prePublish()){
|
||||
Log.info("Rejecting due to pre-publish.");
|
||||
return;
|
||||
}
|
||||
|
||||
ui.loadfrag.show("$publishing");
|
||||
ui.loadfrag.show("@publishing");
|
||||
updateItem(p, field.getText().replace("\r", "\n"));
|
||||
dialog.hide();
|
||||
hide();
|
||||
});
|
||||
buttons.button("$cancel", this::hide);
|
||||
buttons.button("@cancel", this::hide);
|
||||
}}.show();
|
||||
|
||||
}).size(210f, 64f);
|
||||
@ -135,7 +135,7 @@ public class SWorkshop implements SteamUGCCallback{
|
||||
}
|
||||
}else if(details.getResult() == SteamResult.FileNotFound){
|
||||
p.removeSteamID();
|
||||
ui.showErrorMessage("$missing");
|
||||
ui.showErrorMessage("@missing");
|
||||
}else{
|
||||
ui.showErrorMessage(Core.bundle.format("workshop.error", details.getResult().name()));
|
||||
}
|
||||
@ -177,19 +177,19 @@ public class SWorkshop implements SteamUGCCallback{
|
||||
}
|
||||
|
||||
void showPublish(Cons<SteamPublishedFileID> published){
|
||||
BaseDialog dialog = new BaseDialog("$confirm");
|
||||
BaseDialog dialog = new BaseDialog("@confirm");
|
||||
dialog.setFillParent(false);
|
||||
dialog.cont.add("$publish.confirm").width(600f).wrap();
|
||||
dialog.cont.add("@publish.confirm").width(600f).wrap();
|
||||
dialog.addCloseButton();
|
||||
dialog.buttons.button("$eula", Icon.link,
|
||||
dialog.buttons.button("@eula", Icon.link,
|
||||
() -> SVars.net.friends.activateGameOverlayToWebPage("https://steamcommunity.com/sharedfiles/workshoplegalagreement"))
|
||||
.size(210f, 64f);
|
||||
|
||||
dialog.buttons.button("$ok", Icon.ok, () -> {
|
||||
dialog.buttons.button("@ok", Icon.ok, () -> {
|
||||
Log.info("Accepted, publishing item...");
|
||||
itemHandlers.add(published);
|
||||
ugc.createItem(SVars.steamID, WorkshopFileType.Community);
|
||||
ui.loadfrag.show("$publishing");
|
||||
ui.loadfrag.show("@publishing");
|
||||
dialog.hide();
|
||||
}).size(170f, 64f);
|
||||
dialog.show();
|
||||
@ -213,9 +213,9 @@ public class SWorkshop implements SteamUGCCallback{
|
||||
|
||||
ui.loadfrag.setProgress(() -> {
|
||||
ItemUpdateStatus status = ugc.getItemUpdateProgress(h, info);
|
||||
ui.loadfrag.setText("$" + status.name().toLowerCase());
|
||||
ui.loadfrag.setText("@" + status.name().toLowerCase());
|
||||
if(status == ItemUpdateStatus.Invalid){
|
||||
ui.loadfrag.setText("$done");
|
||||
ui.loadfrag.setText("@done");
|
||||
return 1f;
|
||||
}
|
||||
return (float)status.ordinal() / (float)ItemUpdateStatus.values().length;
|
||||
|
@ -236,10 +236,10 @@ public class IOSLauncher extends IOSApplication.Delegate{
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user