Transcribed all ingame text to a bundle
This commit is contained in:
@@ -373,7 +373,7 @@ public class UI extends SceneModule{
|
||||
new Dialog("$text.error.title", "dialog"){{
|
||||
content().margin(15);
|
||||
content().add(text);
|
||||
getButtonTable().addButton("OK", this::hide).size(90, 50).pad(4);
|
||||
getButtonTable().addButton("$text.ok", this::hide).size(90, 50).pad(4);
|
||||
}}.show();
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ public class UI extends SceneModule{
|
||||
new Dialog("$text.error.title", "dialog"){{
|
||||
content().margin(15);
|
||||
content().add(text);
|
||||
getButtonTable().addButton("Exit", Gdx.app::exit).size(90, 50).pad(4);
|
||||
getButtonTable().addButton("$text.quit", Gdx.app::exit).size(90, 50).pad(4);
|
||||
}}.show();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package io.anuke.mindustry.io;
|
||||
|
||||
import com.badlogic.gdx.Game;
|
||||
import com.badlogic.gdx.files.FileHandle;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.core.Tutorial;
|
||||
import io.anuke.mindustry.core.Tutorial.Stage;
|
||||
@@ -15,6 +16,7 @@ import io.anuke.ucore.core.Inputs.DeviceType;
|
||||
import io.anuke.ucore.core.KeyBinds;
|
||||
import io.anuke.ucore.core.KeyBinds.Keybind;
|
||||
import io.anuke.ucore.scene.ui.SettingsDialog.SettingsTable.Setting;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
import java.io.File;
|
||||
@@ -61,6 +63,17 @@ public class BundleUtil {
|
||||
write("block." + block.name + ".name=" + block.formalName);
|
||||
if(block.fullDescription != null) write("block." + block.name + ".fulldescription=" + block.fullDescription);
|
||||
if(block.description != null) write("block." + block.name + ".description=" + block.description);
|
||||
|
||||
Array<String> a = new Array<>();
|
||||
block.getStats(a);
|
||||
for(String s : a){
|
||||
if(s.contains(":")) {
|
||||
String color = s.substring(0, s.indexOf("]")+1);
|
||||
String first = s.substring(color.length(), s.indexOf(":")).replace("/", "").replace(" ", "").toLowerCase();
|
||||
String last = s.substring(s.indexOf(":"), s.length());
|
||||
s = color + Bundles.getNotNull("text.blocks." + first) + last;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import io.anuke.ucore.graphics.Pixmaps;
|
||||
import io.anuke.ucore.scene.builders.*;
|
||||
import io.anuke.ucore.scene.ui.*;
|
||||
import io.anuke.ucore.scene.ui.layout.Table;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
import io.anuke.ucore.util.Strings;
|
||||
|
||||
public class MapEditorDialog extends Dialog{
|
||||
@@ -37,12 +38,12 @@ public class MapEditorDialog extends Dialog{
|
||||
private ButtonGroup<ImageButton> blockgroup;
|
||||
|
||||
public MapEditorDialog(MapEditor editor){
|
||||
super("Map Editor", "dialog");
|
||||
super("$text.mapeditor", "dialog");
|
||||
this.editor = editor;
|
||||
dialog = new MapGenerateDialog(editor);
|
||||
view = new MapView(editor);
|
||||
|
||||
openFile = new FileChooser("Load Image", FileChooser.pngFilter, true, file -> {
|
||||
openFile = new FileChooser("$text.loadimage", FileChooser.pngFilter, true, file -> {
|
||||
Vars.ui.showLoading();
|
||||
Timers.run(3f, () -> {
|
||||
try{
|
||||
@@ -51,17 +52,17 @@ public class MapEditorDialog extends Dialog{
|
||||
editor.setPixmap(pixmap);
|
||||
view.clearStack();
|
||||
}else{
|
||||
Vars.ui.showError("[orange]Invalid image dimensions![]\nValid map dimensions: " + Arrays.toString(MapEditor.validMapSizes));
|
||||
Vars.ui.showError(Bundles.format("text.editor.badsize", Arrays.toString(MapEditor.validMapSizes)));
|
||||
}
|
||||
}catch (Exception e){
|
||||
Vars.ui.showError("Error loading image file:\n[orange]" + Strings.parseException(e, false));
|
||||
Vars.ui.showError(Bundles.format("text.editor.errorimageload", Strings.parseException(e, false)));
|
||||
e.printStackTrace();
|
||||
}
|
||||
Vars.ui.hideLoading();
|
||||
});
|
||||
});
|
||||
|
||||
saveFile = new FileChooser("Save Image", false, file -> {
|
||||
saveFile = new FileChooser("$saveimage", false, file -> {
|
||||
if(!file.extension().toLowerCase().equals(".png")){
|
||||
file = file.parent().child(file.nameWithoutExtension() + ".png");
|
||||
}
|
||||
@@ -71,7 +72,7 @@ public class MapEditorDialog extends Dialog{
|
||||
try{
|
||||
Pixmaps.write(editor.pixmap(), result);
|
||||
}catch (Exception e){
|
||||
Vars.ui.showError("Error saving image file:\n[orange]" + Strings.parseException(e, false));
|
||||
Vars.ui.showError(Bundles.format("text.editor.errorimagesave", Strings.parseException(e, false)));
|
||||
if(!Vars.android) e.printStackTrace();
|
||||
}
|
||||
Vars.ui.hideLoading();
|
||||
@@ -171,48 +172,48 @@ public class MapEditorDialog extends Dialog{
|
||||
|
||||
new imagebutton("icon-terrain", isize, () ->
|
||||
dialog.show()
|
||||
).text("generate");
|
||||
).text("$text.editor.generate");
|
||||
|
||||
row();
|
||||
|
||||
new imagebutton("icon-resize", isize, () ->
|
||||
resizeDialog.show()
|
||||
).text("resize").padTop(4f);
|
||||
).text("$text.editor.resize").padTop(4f);
|
||||
|
||||
row();
|
||||
|
||||
new imagebutton("icon-load-map", isize, () ->
|
||||
loadDialog.show()
|
||||
).text("load map");
|
||||
).text("$text.editor.loadmap");
|
||||
|
||||
row();
|
||||
|
||||
new imagebutton("icon-save-map", isize, ()->
|
||||
saveDialog.show()
|
||||
).text("save map");
|
||||
).text("$text.editor.savemap");
|
||||
|
||||
row();
|
||||
|
||||
new imagebutton("icon-load-image", isize, () ->
|
||||
openFile.show()
|
||||
).text("load image");
|
||||
).text("$text.editor.loadimage");
|
||||
|
||||
row();
|
||||
|
||||
new imagebutton("icon-save-image", isize, () ->
|
||||
saveFile.show()
|
||||
).text("save image");
|
||||
).text("$text.editor.saveimage");
|
||||
|
||||
row();
|
||||
|
||||
new imagebutton("icon-back", isize, () -> {
|
||||
if(!saved){
|
||||
Vars.ui.showConfirm("Confirm Exit", "[scarlet]You have unsaved changes![]\nAre you sure you want to exit?",
|
||||
Vars.ui.showConfirm("$text.confirm", "$text.editor.unsaved",
|
||||
MapEditorDialog.this::hide);
|
||||
}else{
|
||||
hide();
|
||||
}
|
||||
}).padBottom(0).text("back");
|
||||
}).padBottom(0).text("$text.back");
|
||||
|
||||
}}.left().growY().end();
|
||||
|
||||
@@ -260,7 +261,7 @@ public class MapEditorDialog extends Dialog{
|
||||
margin(10f);
|
||||
Slider slider = new Slider(0, MapEditor.brushSizes.length-1, 1, false);
|
||||
slider.moved(f -> editor.setBrushSize(MapEditor.brushSizes[(int)(float)f]));
|
||||
new label(() -> "Brush size: " + MapEditor.brushSizes[(int)slider.getValue()]).left();
|
||||
new label(() -> Bundles.format("text.editor.brushsize", MapEditor.brushSizes[(int)slider.getValue()])).left();
|
||||
row();
|
||||
add(slider).growX().padTop(4f);
|
||||
}}.growX().end();
|
||||
@@ -304,15 +305,15 @@ public class MapEditorDialog extends Dialog{
|
||||
}
|
||||
|
||||
if(playerSpawns == 0){
|
||||
Vars.ui.showError("This map has no player spawnpoint!");
|
||||
Vars.ui.showError("$text.editor.noplayerspawn");
|
||||
return false;
|
||||
}else if(playerSpawns > 1){
|
||||
Vars.ui.showError("Maps cannot have more than one\nplayer spawnpoint!");
|
||||
Vars.ui.showError("$text.editor.manyplayerspawns");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(enemySpawns > MapEditor.maxSpawnpoints){
|
||||
Vars.ui.showError("Cannot have more than\n" + MapEditor.maxSpawnpoints + " enemy spawnpoints!");
|
||||
Vars.ui.showError(Bundles.format("text.editor.manyenemyspawns", MapEditor.maxSpawnpoints));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -347,7 +348,7 @@ public class MapEditorDialog extends Dialog{
|
||||
group.getButtons().get(2).setChecked(true);
|
||||
|
||||
Table extra = new Table("button");
|
||||
extra.labelWrap(() -> editor.getDrawBlock().name).width(180f).center();
|
||||
extra.labelWrap(() -> editor.getDrawBlock().formalName).width(180f).center();
|
||||
table.add(extra).growX();
|
||||
table.row();
|
||||
table.add(pane).growY().fillX();
|
||||
|
||||
@@ -24,7 +24,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
||||
private boolean loading;
|
||||
|
||||
public MapGenerateDialog(MapEditor editor) {
|
||||
super("generate");
|
||||
super("$text.generate");
|
||||
this.editor = editor;
|
||||
|
||||
Stack stack = new Stack();
|
||||
@@ -64,13 +64,13 @@ public class MapGenerateDialog extends FloatingDialog{
|
||||
content().add(pane).fillY();
|
||||
|
||||
buttons().defaults().size(170f, 50f).pad(4f);
|
||||
buttons().addButton("Back", this::hide);
|
||||
buttons().addButton("Randomize", () ->{
|
||||
buttons().addButton("$text.back", this::hide);
|
||||
buttons().addButton("$text.randomize", () ->{
|
||||
editor.getFilter().randomize();
|
||||
apply();
|
||||
});
|
||||
buttons().addButton("Update", this::apply);
|
||||
buttons().addButton("Apply", () ->{
|
||||
buttons().addButton("$text.update", this::apply);
|
||||
buttons().addButton("$text.apply", () ->{
|
||||
Vars.ui.showLoading();
|
||||
|
||||
Timers.run(3f, () ->{
|
||||
|
||||
@@ -14,11 +14,11 @@ public class MapLoadDialog extends FloatingDialog{
|
||||
private Map selected = Vars.world.maps().getMap(0);
|
||||
|
||||
public MapLoadDialog(Consumer<Map> loader) {
|
||||
super("load map");
|
||||
super("$text.editor.loadmap");
|
||||
|
||||
rebuild();
|
||||
|
||||
TextButton button = new TextButton("Load");
|
||||
TextButton button = new TextButton("$text.load");
|
||||
button.setDisabled(() -> selected == null);
|
||||
button.clicked(() -> {
|
||||
if (selected != null) {
|
||||
@@ -28,7 +28,7 @@ public class MapLoadDialog extends FloatingDialog{
|
||||
});
|
||||
|
||||
buttons().defaults().size(200f, 50f);
|
||||
buttons().addButton("Cancel", this::hide);
|
||||
buttons().addButton("$text.cancel", this::hide);
|
||||
buttons().add(button);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class MapLoadDialog extends FloatingDialog{
|
||||
for (Map map : Vars.world.maps().list()) {
|
||||
if (!map.visible) continue;
|
||||
|
||||
TextButton button = new TextButton(map.name, "toggle");
|
||||
TextButton button = new TextButton(map.localized(), "toggle");
|
||||
button.add(new BorderImage(map.texture, 2f)).size(16 * 4f);
|
||||
button.getCells().reverse();
|
||||
button.clicked(() -> selected = map);
|
||||
@@ -63,7 +63,7 @@ public class MapLoadDialog extends FloatingDialog{
|
||||
if (++i % maxcol == 0) table.row();
|
||||
}
|
||||
|
||||
content().add("Select a map to load:");
|
||||
content().add("$text.editor.loadmap");
|
||||
content().row();
|
||||
content().add(pane);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MapResizeDialog extends FloatingDialog{
|
||||
int width, height;
|
||||
|
||||
public MapResizeDialog(MapEditor editor, BiConsumer<Integer, Integer> cons){
|
||||
super("resize map");
|
||||
super("$text.editor.resizemap");
|
||||
shown(() -> {
|
||||
content().clear();
|
||||
Pixmap pix = editor.pixmap();
|
||||
@@ -29,7 +29,7 @@ public class MapResizeDialog extends FloatingDialog{
|
||||
for(int i = 0; i < MapEditor.validMapSizes.length; i ++)
|
||||
if(MapEditor.validMapSizes[i] == curr) idx = i;
|
||||
|
||||
table.add(d == 0 ? "Width: ": "Height: ");
|
||||
table.add(d == 0 ? "$text.width": "$text.height").padRight(8f);
|
||||
ButtonGroup<TextButton> group = new ButtonGroup<>();
|
||||
for(int i = 0; i < MapEditor.validMapSizes.length; i ++){
|
||||
int size = MapEditor.validMapSizes[i];
|
||||
@@ -49,7 +49,7 @@ public class MapResizeDialog extends FloatingDialog{
|
||||
}
|
||||
|
||||
content().label(() ->
|
||||
width + height > 512 ? "[scarlet]Warning!\n[]Maps larger than 256 units may be laggy and unstable." : ""
|
||||
width + height > 512 ? "$text.editor.resizebig" : ""
|
||||
).get().setAlignment(Align.center, Align.center);
|
||||
content().row();
|
||||
content().add(table);
|
||||
@@ -57,8 +57,8 @@ public class MapResizeDialog extends FloatingDialog{
|
||||
});
|
||||
|
||||
buttons().defaults().size(200f, 50f);
|
||||
buttons().addButton("Cancel", this::hide);
|
||||
buttons().addButton("Resize", () -> {
|
||||
buttons().addButton("$text.cancel", this::hide);
|
||||
buttons().addButton("$text.editor.resize", () -> {
|
||||
cons.accept(width, height);
|
||||
hide();
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@ public class MapSaveDialog extends FloatingDialog{
|
||||
private TextField field;
|
||||
|
||||
public MapSaveDialog(Consumer<String> cons){
|
||||
super("Save Map");
|
||||
super("$text.editor.savemap");
|
||||
field = new TextField();
|
||||
|
||||
Mindustry.platforms.addDialog(field);
|
||||
@@ -23,22 +23,22 @@ public class MapSaveDialog extends FloatingDialog{
|
||||
Map map = Vars.world.maps().getMap(field.getText());
|
||||
if(map != null){
|
||||
if(map.custom){
|
||||
return "[accent]Warning!\nThis overwrites an existing map.";
|
||||
return "$text.editor.overwrite";
|
||||
}else{
|
||||
return "[crimson]Cannot overwrite default map!";
|
||||
return "$text.editor.failoverwrite";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}).colspan(2);
|
||||
content().row();
|
||||
content().add("Map Name: ");
|
||||
content().add("$text.editor.mapname").padRight(14f);
|
||||
content().add(field).size(220f, 48f);
|
||||
});
|
||||
|
||||
buttons().defaults().size(200f, 50f).pad(2f);
|
||||
buttons().addButton("Cancel", this::hide);
|
||||
buttons().addButton("$text.cancel", this::hide);
|
||||
|
||||
TextButton button = new TextButton("Save");
|
||||
TextButton button = new TextButton("$text.save");
|
||||
button.clicked(() -> {
|
||||
if(!invalid()){
|
||||
cons.accept(field.getText());
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
package io.anuke.mindustry.resource;
|
||||
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
|
||||
public enum Item{
|
||||
stone, iron, coal, steel, titanium, dirium, uranium;
|
||||
|
||||
public String localized(){
|
||||
return Bundles.get("item."+name() + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return localized();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package io.anuke.mindustry.resource;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
|
||||
public enum Liquid{
|
||||
water(Color.ROYAL),
|
||||
@@ -13,4 +14,13 @@ public enum Liquid{
|
||||
private Liquid(Color color){
|
||||
this.color = new Color(color);
|
||||
}
|
||||
|
||||
public String localized(){
|
||||
return Bundles.get("liquid."+name() + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return localized();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,6 +104,10 @@ public enum Weapon{
|
||||
public final String description;
|
||||
|
||||
Vector2 vector = new Vector2();
|
||||
|
||||
public String localized(){
|
||||
return Bundles.get("weapon."+name() + ".name");
|
||||
}
|
||||
|
||||
private Weapon(float reload, BulletType type, ItemStack... requirements){
|
||||
this.reload = reload;
|
||||
|
||||
@@ -20,7 +20,7 @@ public class FloatingDialog extends Dialog{
|
||||
|
||||
@Override
|
||||
public void addCloseButton(){
|
||||
buttons().addImageTextButton("Back", "icon-arrow-left", 30f, this::hide).size(230f, 64f);
|
||||
buttons().addImageTextButton("$text.back", "icon-arrow-left", 30f, this::hide).size(230f, 64f);
|
||||
|
||||
keyDown(key->{
|
||||
if(key == Keys.ESCAPE || key == Keys.BACK)
|
||||
|
||||
@@ -54,7 +54,7 @@ public class LoadDialog extends FloatingDialog{
|
||||
button.row();
|
||||
|
||||
Label info = new Label("[gray]" + (!SaveIO.isSaveValid(i) ? Bundles.get("text.empty") : SaveIO.getMode(i) + ", "
|
||||
+ SaveIO.getMap(i).name + ", " + Bundles.format("text.save.wave", SaveIO.getWave(i)) + "\n"
|
||||
+ Bundles.get("map."+SaveIO.getMap(i).name+".name", SaveIO.getMap(i).name) + ", " + Bundles.format("text.save.wave", SaveIO.getWave(i)) + "\n"
|
||||
+ Bundles.format("text.save.date", SaveIO.getTimeString(i))));
|
||||
info.setAlignment(Align.center, Align.center);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class SaveDialog extends LoadDialog{
|
||||
}
|
||||
|
||||
void save(int slot){
|
||||
Vars.ui.showLoading("text.saveload");
|
||||
Vars.ui.showLoading("$text.saveload");
|
||||
|
||||
Timers.runTask(5f, () -> {
|
||||
hide();
|
||||
|
||||
@@ -42,7 +42,7 @@ public class UpgradeDialog extends FloatingDialog{
|
||||
|
||||
int i = 0;
|
||||
for(Weapon weapon : Weapon.values()){
|
||||
TextButton button = new TextButton(weapon.name());
|
||||
TextButton button = new TextButton("$weapon."+weapon.name()+".name");
|
||||
|
||||
Image img = new Image(Draw.region(weapon.name()));
|
||||
button.add(img).size(8*5);
|
||||
@@ -81,7 +81,7 @@ public class UpgradeDialog extends FloatingDialog{
|
||||
String description = weapon.description;
|
||||
|
||||
tiptable.background("pane");
|
||||
tiptable.add("[orange]" + weapon.name(), 0.5f).left().padBottom(4f);
|
||||
tiptable.add("[orange]" + weapon.localized(), 0.5f).left().padBottom(4f);
|
||||
|
||||
Table reqtable = new Table();
|
||||
|
||||
|
||||
@@ -233,6 +233,12 @@ public class BlocksFragment implements Fragment{
|
||||
}
|
||||
|
||||
for(String s : statlist){
|
||||
if(s.contains(":")) {
|
||||
String color = s.substring(0, s.indexOf("]")+1);
|
||||
String first = s.substring(color.length(), s.indexOf(":")).replace("/", "").replace(" ", "").toLowerCase();
|
||||
String last = s.substring(s.indexOf(":"), s.length());
|
||||
s = color + Bundles.get("text.blocks." + first) + last;
|
||||
}
|
||||
table.add(s).left();
|
||||
table.row();
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ public class HudFragment implements Fragment{
|
||||
|
||||
private String getEnemiesRemaining() {
|
||||
if(control.getEnemiesRemaining() == 1) {
|
||||
return Bundles.format("text.single", control.getEnemiesRemaining());
|
||||
return Bundles.format("text.enemies.single", control.getEnemiesRemaining());
|
||||
} else return Bundles.format("text.enemies", control.getEnemiesRemaining());
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ public class HudFragment implements Fragment{
|
||||
if(amount > 99999999){
|
||||
formatted = "inf";
|
||||
}
|
||||
Image image = new Image(Draw.region("icon-" + items[i]));
|
||||
Image image = new Image(Draw.region("icon-" + items[i].name()));
|
||||
Label label = new Label(formatted);
|
||||
label.setFontScale(fontscale*1.5f);
|
||||
itemtable.add(image).size(8*3);
|
||||
|
||||
@@ -87,12 +87,10 @@ public class PlacementFragment implements Fragment{
|
||||
|
||||
defaults().size(54, 58).pad(0);
|
||||
|
||||
int d = 0;
|
||||
|
||||
for(PlaceMode mode : PlaceMode.values()){
|
||||
if(!mode.shown || !mode.delete) continue;
|
||||
|
||||
defaults().padBottom(d < 2 ? -5.5f : 0);
|
||||
defaults().padBottom(-5.5f);
|
||||
|
||||
new imagebutton("icon-" + mode.name(), "toggle", 10*3, ()->{
|
||||
control.getInput().resetCursor();
|
||||
|
||||
@@ -85,8 +85,8 @@ public class Block{
|
||||
|
||||
this.name = name;
|
||||
this.formalName = Bundles.get("block." + name + ".name", name);
|
||||
this.description = Bundles.get("block." + name + ".description");
|
||||
this.fullDescription = Bundles.get("block." + name + ".fulldescription");
|
||||
this.description = Bundles.getOrNull("block." + name + ".description");
|
||||
this.fullDescription = Bundles.getOrNull("block." + name + ".fulldescription");
|
||||
this.solid = false;
|
||||
this.id = lastid++;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package io.anuke.mindustry.world;
|
||||
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
|
||||
public enum GameMode{
|
||||
waves,
|
||||
sandbox{
|
||||
@@ -15,4 +17,10 @@ public enum GameMode{
|
||||
};
|
||||
public boolean infiniteResources;
|
||||
public boolean toggleWaves;
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return Bundles.get("mode."+name()+".name");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.world;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Pixmap;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
|
||||
public class Map{
|
||||
public int id = -1;
|
||||
@@ -16,6 +17,10 @@ public class Map{
|
||||
public transient Texture texture;
|
||||
|
||||
public Map(){}
|
||||
|
||||
public String localized(){
|
||||
return Bundles.get("map."+name+".name", name);
|
||||
}
|
||||
|
||||
public int getWidth(){
|
||||
return pixmap.getWidth();
|
||||
|
||||
@@ -14,6 +14,7 @@ import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.types.PowerAcceptor;
|
||||
import io.anuke.ucore.core.Draw;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
import io.anuke.ucore.util.Strings;
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ public class ShieldBlock extends PowerBlock{
|
||||
@Override
|
||||
public void getStats(Array<String> list){
|
||||
super.getStats(list);
|
||||
list.add("[powerinfo]Power used: " + Strings.toFixed(powerDrain*60, 2) + "power/s");
|
||||
list.add("[powerinfo]Power Drain: " + Strings.toFixed(powerPerDamage, 2) + "power/damage");
|
||||
list.add("[powerinfo]Shield Radius: " + (int)shieldRadius + " units");
|
||||
list.add("[powerinfo]Power/second: " + Strings.toFixed(powerDrain*60, 2));
|
||||
list.add("[powerinfo]Power Drain/damage: " + Strings.toFixed(powerPerDamage, 2));
|
||||
list.add("[powerinfo]Shield Radius: " + (int)shieldRadius);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,7 +40,7 @@ public class Conveyor extends Block{
|
||||
@Override
|
||||
public void getStats(Array<String> list){
|
||||
super.getStats(list);
|
||||
list.add("[iteminfo]Move Speed: " + Strings.toFixed(speed * 60, 1) + " units/s");
|
||||
list.add("[iteminfo]Item Speed/second: " + Strings.toFixed(speed * 60, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,12 +19,6 @@ public class PowerLaser extends Generator{
|
||||
health = 50;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getStats(Array<String> list){
|
||||
super.getStats(list);
|
||||
list.add("[powerinfo]Laser Range: " + laserRange + " tiles");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Tile tile){
|
||||
distributeLaserPower(tile);
|
||||
|
||||
@@ -42,12 +42,12 @@ public class Generator extends PowerBlock{
|
||||
super.getStats(list);
|
||||
|
||||
if(hasLasers){
|
||||
list.add("[powerinfo]Laser range: " + laserRange + " blocks");
|
||||
list.add("[powerinfo]Laser tile range: " + laserRange);
|
||||
list.add("[powerinfo]Max power transfer/second: " + Strings.toFixed(powerSpeed * 2, 2));
|
||||
}
|
||||
|
||||
if(explosive){
|
||||
list.add("[orange]Highly explosive!");
|
||||
list.add("[orange]" + Bundles.get("text.blocks.explosive"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ public class ItemPowerGenerator extends Generator{
|
||||
public void getStats(Array<String> list){
|
||||
super.getStats(list);
|
||||
list.add("[powerinfo]Item Capacity: " + itemCapacity);
|
||||
list.add("[powerinfo]Generation: " + Strings.toFixed(powerOutput*60f, 2) + " power/s");
|
||||
list.add("[powerinfo]Generation Time: " + Strings.toFixed(itemDuration/60f, 2) + " s/item");
|
||||
list.add("[powerinfo]Power Generation/second: " + Strings.toFixed(powerOutput*60f, 2));
|
||||
list.add("[powerinfo]Generation Seconds/item: " + Strings.toFixed(itemDuration/60f, 2));
|
||||
list.add("[powerinfo]Input: " + generateItem);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ public class LiquidPowerGenerator extends Generator implements LiquidAcceptor{
|
||||
public void getStats(Array<String> list){
|
||||
super.getStats(list);
|
||||
list.add("[liquidinfo]Liquid Capacity: " + (int)liquidCapacity);
|
||||
list.add("[liquidinfo]Generation: " + Strings.toFixed(powerPerLiquid, 2) + " power/liquid");
|
||||
list.add("[liquidinfo]Max liquid: " + Strings.toFixed(maxLiquidGenerate*60f, 2) + " liquid/s");
|
||||
list.add("[liquidinfo]Power/Liquid: " + Strings.toFixed(powerPerLiquid, 2) + " power/liquid");
|
||||
list.add("[liquidinfo]Max liquid/second: " + Strings.toFixed(maxLiquidGenerate*60f, 2) + " liquid/s");
|
||||
list.add("[liquidinfo]Input: " + generateLiquid);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public class Pump extends LiquidBlock{
|
||||
@Override
|
||||
public void getStats(Array<String> list){
|
||||
super.getStats(list);
|
||||
list.add("[liquidinfo]Pump Speed: " + Strings.toFixed(60f*pumpAmount, 1) + "/s");
|
||||
list.add("[liquidinfo]Liquid/second: " + Strings.toFixed(60f*pumpAmount, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user