Merge branch 'master' into schematic
This commit is contained in:
@@ -91,7 +91,7 @@ public class Bar extends Element{
|
||||
|
||||
Draw.color();
|
||||
|
||||
BitmapFont font = Fonts.outline;
|
||||
Font font = Fonts.outline;
|
||||
GlyphLayout lay = Pools.obtain(GlyphLayout.class, GlyphLayout::new);
|
||||
lay.setText(font, name);
|
||||
|
||||
|
||||
@@ -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()){
|
||||
|
||||
@@ -26,7 +26,7 @@ public class CoreItemsDisplay extends Table{
|
||||
margin(4);
|
||||
|
||||
update(() -> {
|
||||
CoreEntity core = Vars.player.team().core();
|
||||
CoreBuild core = Vars.player.team().core();
|
||||
|
||||
for(Item item : content.items()){
|
||||
if(core != null && core.items.get(item) > 0 && usedItems.add(item)){
|
||||
@@ -38,7 +38,7 @@ public class CoreItemsDisplay extends Table{
|
||||
|
||||
int i = 0;
|
||||
|
||||
CoreEntity core = Vars.player.team().core();
|
||||
CoreBuild core = Vars.player.team().core();
|
||||
for(Item item : content.items()){
|
||||
if(usedItems.contains(item)){
|
||||
image(item.icon(Cicon.small)).padRight(3);
|
||||
|
||||
@@ -13,7 +13,7 @@ import arc.graphics.*;
|
||||
import arc.graphics.Pixmap.*;
|
||||
import arc.graphics.Texture.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.graphics.g2d.BitmapFont.*;
|
||||
import arc.graphics.g2d.Font.*;
|
||||
import arc.graphics.g2d.PixmapPacker.*;
|
||||
import arc.graphics.g2d.TextureAtlas.*;
|
||||
import arc.math.*;
|
||||
@@ -27,14 +27,15 @@ import mindustry.core.*;
|
||||
import java.util.*;
|
||||
|
||||
public class Fonts{
|
||||
private static final String mainFont = "fonts/font.woff";
|
||||
private static ObjectIntMap<String> unicodeIcons = new ObjectIntMap<>();
|
||||
private static ObjectMap<String, String> stringIcons = new ObjectMap<>();
|
||||
|
||||
public static BitmapFont def;
|
||||
public static BitmapFont outline;
|
||||
public static BitmapFont chat;
|
||||
public static BitmapFont icon;
|
||||
public static BitmapFont tech;
|
||||
public static Font def;
|
||||
public static Font outline;
|
||||
public static Font chat;
|
||||
public static Font icon;
|
||||
public static Font tech;
|
||||
|
||||
public static int getUnicode(String content){
|
||||
return unicodeIcons.get(content, 0);
|
||||
@@ -58,21 +59,19 @@ public class Fonts{
|
||||
}
|
||||
|
||||
public static void loadFonts(){
|
||||
String fontName = "fonts/font.ttf";
|
||||
|
||||
FreeTypeFontParameter param = fontParameter();
|
||||
|
||||
Core.assets.load("default", BitmapFont.class, new FreeTypeFontLoaderParameter(fontName, param)).loaded = f -> Fonts.def = (BitmapFont)f;
|
||||
Core.assets.load("chat", BitmapFont.class, new FreeTypeFontLoaderParameter(fontName, param)).loaded = f -> Fonts.chat = (BitmapFont)f;
|
||||
Core.assets.load("icon", BitmapFont.class, new FreeTypeFontLoaderParameter("fonts/icon.ttf", new FreeTypeFontParameter(){{
|
||||
Core.assets.load("default", Font.class, new FreeTypeFontLoaderParameter(mainFont, param)).loaded = f -> Fonts.def = (Font)f;
|
||||
Core.assets.load("chat", Font.class, new FreeTypeFontLoaderParameter(mainFont, param)).loaded = f -> Fonts.chat = (Font)f;
|
||||
Core.assets.load("icon", Font.class, new FreeTypeFontLoaderParameter("fonts/icon.ttf", new FreeTypeFontParameter(){{
|
||||
size = 30;
|
||||
incremental = true;
|
||||
characters = "\0";
|
||||
}})).loaded = f -> Fonts.icon = (BitmapFont)f;
|
||||
}})).loaded = f -> Fonts.icon = (Font)f;
|
||||
}
|
||||
|
||||
public static void loadContentIcons(){
|
||||
Seq<BitmapFont> fonts = Seq.with(Fonts.chat, Fonts.def, Fonts.outline);
|
||||
Seq<Font> fonts = Seq.with(Fonts.chat, Fonts.def, Fonts.outline);
|
||||
Texture uitex = Core.atlas.find("logo").getTexture();
|
||||
int size = (int)(Fonts.def.getData().lineHeight/Fonts.def.getData().scaleY);
|
||||
|
||||
@@ -119,11 +118,11 @@ public class Fonts{
|
||||
UI.packer = new PixmapPacker(2048, 2048, Format.rgba8888, 2, true);
|
||||
FileHandleResolver resolver = new InternalFileHandleResolver();
|
||||
Core.assets.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
|
||||
Core.assets.setLoader(BitmapFont.class, null, new FreetypeFontLoader(resolver){
|
||||
Core.assets.setLoader(Font.class, null, new FreetypeFontLoader(resolver){
|
||||
ObjectSet<FreeTypeFontParameter> scaled = new ObjectSet<>();
|
||||
|
||||
@Override
|
||||
public BitmapFont loadSync(AssetManager manager, String fileName, Fi file, FreeTypeFontLoaderParameter parameter){
|
||||
public Font loadSync(AssetManager manager, String fileName, Fi file, FreeTypeFontLoaderParameter parameter){
|
||||
if(fileName.equals("outline")){
|
||||
parameter.fontParameters.borderWidth = Scl.scl(2f);
|
||||
parameter.fontParameters.spaceX -= parameter.fontParameters.borderWidth;
|
||||
@@ -146,11 +145,14 @@ public class Fonts{
|
||||
size = 18;
|
||||
}};
|
||||
|
||||
Core.assets.load("outline", BitmapFont.class, new FreeTypeFontLoaderParameter("fonts/font.ttf", param)).loaded = t -> Fonts.outline = (BitmapFont)t;
|
||||
Core.assets.load("outline", Font.class, new FreeTypeFontLoaderParameter(mainFont, param)).loaded = t -> Fonts.outline = (Font)t;
|
||||
|
||||
Core.assets.load("tech", BitmapFont.class, new FreeTypeFontLoaderParameter("fonts/tech.ttf", new FreeTypeFontParameter(){{
|
||||
Core.assets.load("tech", Font.class, new FreeTypeFontLoaderParameter("fonts/tech.ttf", new FreeTypeFontParameter(){{
|
||||
size = 18;
|
||||
}})).loaded = f -> Fonts.tech = (BitmapFont)f;
|
||||
}})).loaded = f -> {
|
||||
Fonts.tech = (Font)f;
|
||||
((Font)f).getData().down *= 1.5f;
|
||||
};
|
||||
}
|
||||
|
||||
/** Merges the UI and font atlas together for better performance. */
|
||||
@@ -184,7 +186,7 @@ public class Fonts{
|
||||
page.updateTexture(TextureFilter.linear, TextureFilter.linear, false);
|
||||
}
|
||||
|
||||
public static TextureRegionDrawable getGlyph(BitmapFont font, char glyph){
|
||||
public static TextureRegionDrawable getGlyph(Font font, char glyph){
|
||||
Glyph g = font.getData().getGlyph(glyph);
|
||||
if(g == null) throw new IllegalArgumentException("No glyph: " + glyph + " (" + (int)glyph + ")");
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ public class GridImage extends Element{
|
||||
int jumpy = (int)(Math.max(minspace, yspace) / yspace);
|
||||
|
||||
for(int x = 0; x <= imageWidth; x += jumpx){
|
||||
Fill.crect((int)(getX() + xspace * x - s), getY() - s, 2, getHeight() + (x == imageWidth ? 1 : 0));
|
||||
Fill.crect((int)(this.x + xspace * x - s), y - s, 2, getHeight() + (x == imageWidth ? 1 : 0));
|
||||
}
|
||||
|
||||
for(int y = 0; y <= imageHeight; y += jumpy){
|
||||
Fill.crect(getX() - s, (int)(getY() + y * yspace - s), getWidth(), 2);
|
||||
Fill.crect(x - s, (int)(this.y + y * yspace - s), getWidth(), 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -25,13 +25,13 @@ import static mindustry.gen.Tex.*;
|
||||
public class Styles{
|
||||
public static Drawable black, black9, black8, black6, black3, black5, none, flatDown, flatOver;
|
||||
public static ButtonStyle defaultb, waveb;
|
||||
public static TextButtonStyle defaultt, squaret, nodet, cleart, discordt, infot, clearPartialt, clearTogglet, clearToggleMenut, togglet, transt, fullTogglet;
|
||||
public static ImageButtonStyle defaulti, nodei, righti, emptyi, emptytogglei, selecti, cleari, clearFulli, clearPartiali, clearPartial2i, clearTogglei, clearTransi, clearToggleTransi, clearTogglePartiali;
|
||||
public static TextButtonStyle defaultt, squaret, nodet, cleart, discordt, infot, clearPartialt, clearTogglet, clearToggleMenut, togglet, transt, fullTogglet, logict;
|
||||
public static ImageButtonStyle defaulti, nodei, righti, emptyi, emptytogglei, selecti, logici, geni, colori, cleari, clearFulli, clearPartiali, clearPartial2i, clearTogglei, clearTransi, clearToggleTransi, clearTogglePartiali;
|
||||
public static ScrollPaneStyle defaultPane, horizontalPane, smallPane;
|
||||
public static KeybindDialogStyle defaultKeybindDialog;
|
||||
public static SliderStyle defaultSlider, vSlider;
|
||||
public static LabelStyle defaultLabel, outlineLabel, techLabel;
|
||||
public static TextFieldStyle defaultField, areaField;
|
||||
public static TextFieldStyle defaultField, nodeField, areaField, nodeArea;
|
||||
public static CheckBoxStyle defaultCheck;
|
||||
public static DialogStyle defaultDialog, fullDialog;
|
||||
|
||||
@@ -93,6 +93,14 @@ public class Styles{
|
||||
down = flatOver;
|
||||
up = black;
|
||||
}};
|
||||
logict = new TextButtonStyle(){{
|
||||
over = flatOver;
|
||||
font = Fonts.def;
|
||||
fontColor = Color.white;
|
||||
disabledFontColor = Color.gray;
|
||||
down = flatOver;
|
||||
up = underlineWhite;
|
||||
}};
|
||||
discordt = new TextButtonStyle(){{
|
||||
font = Fonts.def;
|
||||
fontColor = Color.white;
|
||||
@@ -189,6 +197,18 @@ public class Styles{
|
||||
checked = buttonSelect;
|
||||
up = none;
|
||||
}};
|
||||
logici = new ImageButtonStyle(){{
|
||||
//imageDownColor = Pal.accent;
|
||||
imageUpColor = Color.black;
|
||||
}};
|
||||
geni = new ImageButtonStyle(){{
|
||||
imageDownColor = Pal.accent;
|
||||
imageUpColor = Color.black;
|
||||
}};
|
||||
colori = new ImageButtonStyle(){{
|
||||
//imageDownColor = Pal.accent;
|
||||
imageUpColor = Color.white;
|
||||
}};
|
||||
cleari = new ImageButtonStyle(){{
|
||||
down = flatOver;
|
||||
up = black;
|
||||
@@ -298,6 +318,20 @@ public class Styles{
|
||||
messageFont = Fonts.def;
|
||||
messageFontColor = Color.gray;
|
||||
}};
|
||||
|
||||
nodeField = new TextFieldStyle(){{
|
||||
font = Fonts.chat;
|
||||
fontColor = Color.white;
|
||||
disabledFontColor = Color.gray;
|
||||
disabledBackground = underlineDisabled;
|
||||
selection = Tex.selection;
|
||||
background = underlineWhite;
|
||||
invalidBackground = underlineRed;
|
||||
cursor = Tex.cursor;
|
||||
messageFont = Fonts.def;
|
||||
messageFontColor = Color.gray;
|
||||
}};
|
||||
|
||||
areaField = new TextFieldStyle(){{
|
||||
font = Fonts.chat;
|
||||
fontColor = Color.white;
|
||||
@@ -309,6 +343,17 @@ public class Styles{
|
||||
messageFontColor = Color.gray;
|
||||
}};
|
||||
|
||||
nodeArea = new TextFieldStyle(){{
|
||||
font = Fonts.chat;
|
||||
fontColor = Color.white;
|
||||
disabledFontColor = Color.gray;
|
||||
selection = Tex.selection;
|
||||
background = underlineWhite;
|
||||
cursor = Tex.cursor;
|
||||
messageFont = Fonts.def;
|
||||
messageFontColor = Color.gray;
|
||||
}};
|
||||
|
||||
defaultCheck = new CheckBoxStyle(){{
|
||||
checkboxOn = checkOn;
|
||||
checkboxOff = checkOff;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -10,6 +10,7 @@ import arc.util.*;
|
||||
import arc.util.serialization.*;
|
||||
import mindustry.*;
|
||||
import mindustry.core.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.io.legacy.*;
|
||||
@@ -30,7 +31,7 @@ public class JoinDialog extends BaseDialog{
|
||||
int totalHosts;
|
||||
|
||||
public JoinDialog(){
|
||||
super("$joingame");
|
||||
super("@joingame");
|
||||
|
||||
loadServers();
|
||||
|
||||
@@ -41,11 +42,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 +54,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 +70,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 +83,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")));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -108,6 +109,7 @@ public class JoinDialog extends BaseDialog{
|
||||
TextButton button = buttons[0] = remote.button("[accent]" + server.displayIP(), Styles.cleart, () -> {
|
||||
if(!buttons[0].childrenPressed()){
|
||||
if(server.lastHost != null){
|
||||
Events.fire(new ClientPreConnectEvent(server.lastHost));
|
||||
safeConnect(server.ip, server.port, server.lastHost.version);
|
||||
}else{
|
||||
connect(server.ip, server.port);
|
||||
@@ -143,7 +145,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 +193,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);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -230,7 +232,7 @@ public class JoinDialog extends BaseDialog{
|
||||
}
|
||||
t.add("[lightgray]" + (Core.bundle.format("players" + (host.players == 1 && host.playerLimit <= 0 ? ".single" : ""), (host.players == 0 ? "[lightgray]" : "[accent]") + host.players + (host.playerLimit > 0 ? "[lightgray]/[accent]" + host.playerLimit : "")+ "[lightgray]"))).left();
|
||||
t.row();
|
||||
t.add("[lightgray]" + Core.bundle.format("save.map", host.mapname) + "[lightgray] / " + host.mode.toString()).width(targetWidth() - 10f).left().get().setEllipsis(true);
|
||||
t.add("[lightgray]" + Core.bundle.format("save.map", host.mapname) + "[lightgray] / " + (host.modeName == null ? host.mode.toString() : host.modeName)).width(targetWidth() - 10f).left().get().setEllipsis(true);
|
||||
}).expand().left().bottom().padLeft(12f).padBottom(8);
|
||||
}
|
||||
|
||||
@@ -242,9 +244,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 +256,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 +277,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 +342,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 +380,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);
|
||||
}
|
||||
@@ -52,11 +52,11 @@ public class ModsDialog extends BaseDialog{
|
||||
|
||||
void setup(){
|
||||
float h = 110f;
|
||||
float w = mobile ? 430f : 524f;
|
||||
float w = mobile ? 440f : 524f;
|
||||
|
||||
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);
|
||||
|
||||
@@ -153,7 +153,6 @@ public class ModsDialog extends BaseDialog{
|
||||
|
||||
boolean anyDisabled = false;
|
||||
for(LoadedMod mod : mods.list()){
|
||||
String letter = (Strings.stripColors(mod.name).charAt(0) + "").toUpperCase();
|
||||
|
||||
if(!mod.enabled() && !anyDisabled && mods.list().size > 0){
|
||||
anyDisabled = true;
|
||||
@@ -166,45 +165,35 @@ public class ModsDialog extends BaseDialog{
|
||||
t.top().left();
|
||||
t.margin(12f);
|
||||
|
||||
t.add(new BorderImage(){
|
||||
{
|
||||
if(mod.iconTexture != null){
|
||||
setDrawable(new TextureRegion(mod.iconTexture));
|
||||
}else{
|
||||
setDrawable(Tex.clear);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
super.draw();
|
||||
|
||||
if(mod.iconTexture == null){
|
||||
Fonts.def.draw(letter, x + width/2f, y + height/2f, Align.center);
|
||||
}
|
||||
}
|
||||
}.border(Pal.accent)).size(h - 8f).padTop(-8f).padLeft(-8f).padRight(2f);
|
||||
|
||||
t.defaults().left().top();
|
||||
t.table(title -> {
|
||||
title.left();
|
||||
title.add("" + mod.meta.displayName() + "\n[lightgray]v" + mod.meta.version + (mod.enabled() ? "" : "\n" + Core.bundle.get("mod.disabled") + "")).wrap().width(170f).growX();
|
||||
title.add().growX();
|
||||
|
||||
title.button(mod.enabled() ? "$mod.disable" : "$mod.enable", mod.enabled() ? Icon.downOpen : Icon.upOpen, Styles.transt, () -> {
|
||||
title.add(new BorderImage(){{
|
||||
if(mod.iconTexture != null){
|
||||
setDrawable(new TextureRegion(mod.iconTexture));
|
||||
}else{
|
||||
setDrawable(Tex.nomap);
|
||||
}
|
||||
border(Pal.accent);
|
||||
}}).size(h - 8f).padTop(-8f).padLeft(-8f).padRight(8f);
|
||||
|
||||
title.add("" + mod.meta.displayName() + "\n[lightgray]v" + mod.meta.version + (mod.enabled() ? "" : "\n" + Core.bundle.get("mod.disabled") + ""))
|
||||
.wrap().top().width(170f).growX().left();
|
||||
|
||||
title.add().growX();
|
||||
}).growX().growY().left();
|
||||
|
||||
t.table(right -> {
|
||||
right.right();
|
||||
right.button(mod.enabled() ? Icon.downOpen : Icon.upOpen, Styles.clearPartiali, () -> {
|
||||
mods.setEnabled(mod, !mod.enabled());
|
||||
setup();
|
||||
}).height(50f).margin(8f).width(130f).disabled(!mod.isSupported());
|
||||
}).size(50f).disabled(!mod.isSupported());
|
||||
|
||||
if(steam && !mod.hasSteamID()){
|
||||
title.button(Icon.download, Styles.clearTransi, () -> {
|
||||
platform.publish(mod);
|
||||
}).size(50f);
|
||||
}
|
||||
|
||||
title.button(mod.hasSteamID() ? Icon.link : Icon.trash, Styles.clearPartiali, () -> {
|
||||
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();
|
||||
});
|
||||
@@ -212,7 +201,14 @@ public class ModsDialog extends BaseDialog{
|
||||
platform.viewListing(mod);
|
||||
}
|
||||
}).size(50f);
|
||||
}).growX().left();
|
||||
|
||||
if(steam && !mod.hasSteamID()){
|
||||
right.row();
|
||||
right.button(Icon.download, Styles.clearTransi, () -> {
|
||||
platform.publish(mod);
|
||||
}).size(50f);
|
||||
}
|
||||
}).growX().right().padRight(-8f).padTop(-8f);
|
||||
|
||||
t.row();
|
||||
if(!mod.isSupported()){
|
||||
@@ -222,16 +218,16 @@ 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);
|
||||
}, Styles.clearPartialt, () -> showMod(mod)).size(w, h).growX().pad(4f);
|
||||
table.row();
|
||||
}
|
||||
});
|
||||
|
||||
}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();
|
||||
@@ -240,7 +236,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){
|
||||
@@ -249,7 +245,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
|
||||
@@ -257,18 +253,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);
|
||||
}
|
||||
@@ -277,7 +273,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);
|
||||
@@ -36,35 +36,36 @@ public class PausedDialog extends BaseDialog{
|
||||
if(!mobile){
|
||||
//TODO localize
|
||||
cont.label(() -> state.getSector() == null ? "" :
|
||||
"[lightgray]Next turn in [accent]" + state.getSector().displayTimeRemaining())
|
||||
("[lightgray]Next turn in [accent]" + state.getSector().displayTimeRemaining() +
|
||||
(state.rules.winWave > 0 && !state.getSector().isCaptured() ? "\n[lightgray]Reach wave[accent] " + state.rules.winWave + "[] to capture" : "")))
|
||||
.visible(() -> state.getSector() != null).colspan(2);
|
||||
cont.row();
|
||||
|
||||
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{
|
||||
@@ -74,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);
|
||||
}
|
||||
@@ -128,7 +129,7 @@ public class PausedDialog extends BaseDialog{
|
||||
return;
|
||||
}
|
||||
|
||||
ui.loadAnd("$saving", () -> {
|
||||
ui.loadAnd("@saving", () -> {
|
||||
try{
|
||||
control.saves.getCurrent().save();
|
||||
}catch(Throwable e){
|
||||
|
||||
@@ -37,13 +37,15 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
private int launchRange;
|
||||
private float zoom = 1f, selectAlpha = 1f;
|
||||
private @Nullable Sector selected, hovered, launchSector;
|
||||
private CoreEntity launcher;
|
||||
private CoreBuild launcher;
|
||||
private Mode mode = look;
|
||||
private boolean launching;
|
||||
|
||||
public PlanetDialog(){
|
||||
super("", Styles.fullDialog);
|
||||
|
||||
shouldPause = true;
|
||||
|
||||
getCell(buttons).padBottom(-4);
|
||||
buttons.background(Styles.black).defaults().growX().height(64f).pad(0);
|
||||
|
||||
@@ -91,7 +93,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
return super.show();
|
||||
}
|
||||
|
||||
public void show(Sector sector, CoreEntity launcher){
|
||||
public void show(Sector sector, CoreBuild launcher){
|
||||
this.launcher = launcher;
|
||||
selected = null;
|
||||
hovered = null;
|
||||
@@ -117,8 +119,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
boolean canLaunch(Sector sector){
|
||||
return mode == launch &&
|
||||
(sector.tile.v.within(launchSector.tile.v, (launchRange + 0.5f) * planets.planet.sectorApproxRadius*2) //within range
|
||||
//TODO completely untested
|
||||
|| (sector.preset != null && sector.preset.unlocked() && sector.preset.requirements.contains(r -> r.zone() != null && r.zone() == sector.preset))); //is an unlocked preset
|
||||
|| (sector.preset != null && sector.preset.unlocked())); //is an unlocked preset
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -363,15 +364,6 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
}).row();
|
||||
}
|
||||
|
||||
//display how many turns this sector has been attacked
|
||||
//TODO implement properly
|
||||
/*
|
||||
if(sector.getTurnsPassed() > 0 && sector.hasBase()){
|
||||
stable.row();
|
||||
|
||||
stable.add("[scarlet]" + Iconc.warning + " " + sector.getTurnsPassed() + "x attacks");
|
||||
}*/
|
||||
|
||||
stable.row();
|
||||
|
||||
if((sector.hasBase() && mode == look) || canLaunch(sector) || (sector.preset != null && sector.preset.alwaysUnlocked)){
|
||||
|
||||
@@ -76,7 +76,7 @@ public class ResearchDialog extends BaseDialog{
|
||||
if(amount < 0){
|
||||
//remove items from each sector's storage, one by one
|
||||
|
||||
//negate amount since it's being *removed*
|
||||
//negate amount since it's being *removed* - this makes it positive
|
||||
amount = -amount;
|
||||
|
||||
//% that gets removed from each sector
|
||||
@@ -91,6 +91,7 @@ public class ResearchDialog extends BaseDialog{
|
||||
//actually remove it from the sector
|
||||
sector.removeItem(item, toRemove);
|
||||
seq.remove(item, toRemove);
|
||||
|
||||
counter[0] -= toRemove;
|
||||
});
|
||||
|
||||
@@ -111,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);
|
||||
@@ -341,6 +342,7 @@ public class ResearchDialog extends BaseDialog{
|
||||
|
||||
((TextureRegionDrawable)button.getStyle().imageUp).setRegion(node.selectable ? node.node.content.icon(Cicon.medium) : Icon.lock.getRegion());
|
||||
button.getImage().setColor(!locked(node.node) ? Color.white : node.selectable ? Color.gray : Pal.gray);
|
||||
button.getImage().setScaling(Scaling.bounded);
|
||||
});
|
||||
addChild(button);
|
||||
}
|
||||
@@ -450,7 +452,7 @@ public class ResearchDialog extends BaseDialog{
|
||||
}
|
||||
});
|
||||
|
||||
infoTable.update(() -> infoTable.setPosition(button.getX() + button.getWidth(), button.getY() + button.getHeight(), Align.topLeft));
|
||||
infoTable.update(() -> infoTable.setPosition(button.x + button.getWidth(), button.y + button.getHeight(), Align.topLeft));
|
||||
|
||||
infoTable.left();
|
||||
infoTable.background(Tex.button).margin(8f);
|
||||
@@ -513,9 +515,7 @@ public class ResearchDialog extends BaseDialog{
|
||||
list.image(req.item.icon(Cicon.small)).size(8 * 3).padRight(3);
|
||||
list.add(req.item.localizedName).color(Color.lightGray);
|
||||
Label label = list.label(() -> " " +
|
||||
(player.team().core() != null ?
|
||||
UI.formatAmount(Math.min(player.team().core().items.get(req.item), reqAmount)) + " / " :
|
||||
"")
|
||||
UI.formatAmount(Math.min(items.get(req.item), reqAmount)) + " / "
|
||||
+ UI.formatAmount(reqAmount)).get();
|
||||
|
||||
Color targetColor = items.has(req.item) ? Color.lightGray : Color.scarlet;
|
||||
@@ -532,7 +532,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;
|
||||
@@ -546,13 +546,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")){
|
||||
@@ -104,19 +104,19 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
}
|
||||
|
||||
Core.app.exit();
|
||||
}));
|
||||
})).marginLeft(4);
|
||||
|
||||
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,36 +129,36 @@ 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}).marginLeft(4);
|
||||
|
||||
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()));
|
||||
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();
|
||||
@@ -363,7 +363,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
}
|
||||
});
|
||||
|
||||
graphics.checkPref("linear", true, b -> {
|
||||
graphics.checkPref("linear", !mobile, b -> {
|
||||
for(Texture tex : Core.atlas.getTextures()){
|
||||
TextureFilter filter = b ? TextureFilter.linear : TextureFilter.nearest;
|
||||
tex.setFilter(filter, filter);
|
||||
@@ -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);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ChatFragment extends Table{
|
||||
private boolean shown = false;
|
||||
private TextField chatfield;
|
||||
private Label fieldlabel = new Label(">");
|
||||
private BitmapFont font;
|
||||
private Font font;
|
||||
private GlyphLayout layout = new GlyphLayout();
|
||||
private float offsetx = Scl.scl(4), offsety = Scl.scl(4), fontoffsetx = Scl.scl(2), chatspace = Scl.scl(50);
|
||||
private Color shadowColor = new Color(0, 0, 0, 0.4f);
|
||||
@@ -124,7 +124,7 @@ public class ChatFragment extends Table{
|
||||
Draw.color(shadowColor);
|
||||
|
||||
if(shown){
|
||||
Fill.crect(offsetx, chatfield.getY(), chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
|
||||
Fill.crect(offsetx, chatfield.y, chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
|
||||
}
|
||||
|
||||
super.draw();
|
||||
@@ -171,7 +171,7 @@ public class ChatFragment extends Table{
|
||||
String message = chatfield.getText();
|
||||
clearChatInput();
|
||||
|
||||
if(message.replaceAll(" ", "").isEmpty()) return;
|
||||
if(message.replace(" ", "").isEmpty()) return;
|
||||
|
||||
history.insert(1, message);
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ public class HudFragment extends Fragment{
|
||||
//TODO full implementation
|
||||
Events.on(ResetEvent.class, e -> {
|
||||
coreItems.resetUsed();
|
||||
coreItems.clear();
|
||||
});
|
||||
|
||||
Events.on(TurnEvent.class, e -> {
|
||||
@@ -70,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
|
||||
@@ -166,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();
|
||||
@@ -216,13 +217,13 @@ public class HudFragment extends Fragment{
|
||||
//core items
|
||||
parent.fill(t -> {
|
||||
t.top().add(coreItems);
|
||||
t.visible(() -> Core.settings.getBool("coreitems") && !mobile);
|
||||
t.visible(() -> Core.settings.getBool("coreitems") && !mobile && !state.isPaused());
|
||||
});
|
||||
|
||||
//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;
|
||||
@@ -230,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
|
||||
@@ -240,7 +241,7 @@ public class HudFragment extends Fragment{
|
||||
float[] coreAttackTime = {0};
|
||||
float[] coreAttackOpacity = {0};
|
||||
|
||||
Events.on(Trigger.teamCoreDamage, () -> {
|
||||
Events.run(Trigger.teamCoreDamage, () -> {
|
||||
coreAttackTime[0] = notifDuration;
|
||||
});
|
||||
|
||||
@@ -261,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);
|
||||
});
|
||||
|
||||
@@ -311,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 -> {
|
||||
@@ -458,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
|
||||
@@ -554,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();
|
||||
});
|
||||
@@ -679,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();
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ public class LoadingFragment extends Fragment{
|
||||
private Table table;
|
||||
private TextButton button;
|
||||
private Bar bar;
|
||||
private Label nameLabel;
|
||||
|
||||
@Override
|
||||
public void build(Group parent){
|
||||
@@ -23,14 +24,16 @@ public class LoadingFragment extends Fragment{
|
||||
t.add().height(133f).row();
|
||||
t.add(new WarningBar()).growX().height(24f);
|
||||
t.row();
|
||||
t.add("$loading").name("namelabel").pad(10f).style(Styles.techLabel);
|
||||
nameLabel = t.add("@loading").pad(10f).style(Styles.techLabel).get();
|
||||
t.row();
|
||||
t.add(new WarningBar()).growX().height(24f);
|
||||
t.row();
|
||||
|
||||
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;
|
||||
});
|
||||
}
|
||||
@@ -48,20 +51,20 @@ public class LoadingFragment extends Fragment{
|
||||
}
|
||||
|
||||
public void setText(String text){
|
||||
table.<Label>find("namelabel").setText(text);
|
||||
table.<Label>find("namelabel").setColor(Pal.accent);
|
||||
text(text);
|
||||
nameLabel.setColor(Pal.accent);
|
||||
}
|
||||
|
||||
public void show(){
|
||||
show("$loading");
|
||||
show("@loading");
|
||||
}
|
||||
|
||||
public void show(String text){
|
||||
table.<Label>find("namelabel").setColor(Color.white);
|
||||
nameLabel.setColor(Color.white);
|
||||
bar.visible = false;
|
||||
table.clearActions();
|
||||
table.touchable = Touchable.enabled;
|
||||
table.<Label>find("namelabel").setText(text);
|
||||
text(text);
|
||||
table.visible = true;
|
||||
table.color.a = 1f;
|
||||
table.toFront();
|
||||
@@ -73,4 +76,20 @@ public class LoadingFragment extends Fragment{
|
||||
table.touchable = Touchable.disabled;
|
||||
table.actions(Actions.fadeOut(0.5f), Actions.visible(false));
|
||||
}
|
||||
|
||||
private void text(String text){
|
||||
nameLabel.setText(text);
|
||||
|
||||
CharSequence realText = nameLabel.getText();
|
||||
|
||||
//fallback to the default font if characters are missing
|
||||
//TODO this should happen everywhere
|
||||
for(int i = 0; i < realText.length(); i++){
|
||||
if(Fonts.tech.getData().getGlyph(realText.charAt(i)) == null){
|
||||
nameLabel.setStyle(Styles.defaultLabel);
|
||||
return;
|
||||
}
|
||||
}
|
||||
nameLabel.setStyle(Styles.techLabel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ import mindustry.input.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.*;
|
||||
import mindustry.world.blocks.BuildBlock.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@@ -93,7 +95,7 @@ public class PlacementFragment extends Fragment{
|
||||
|
||||
if(Core.input.keyDown(Binding.pick) && player.isBuilder()){ //mouse eyedropper select
|
||||
Building tile = world.buildWorld(Core.input.mouseWorld().x, Core.input.mouseWorld().y);
|
||||
Block tryRecipe = tile == null ? null : tile.block();
|
||||
Block tryRecipe = tile == null ? null : tile.block() instanceof BuildBlock ? ((BuildEntity)tile).cblock : tile.block;
|
||||
Object tryConfig = tile == null ? null : tile.config();
|
||||
|
||||
for(BuildPlan req : player.builder().plans()){
|
||||
@@ -160,7 +162,7 @@ public class PlacementFragment extends Fragment{
|
||||
blockSelectEnd = true;
|
||||
}
|
||||
Seq<Block> blocks = getByCategory(currentCategory);
|
||||
if(!unlocked(blocks.get(i))) return true;
|
||||
if(i >= blocks.size || !unlocked(blocks.get(i))) return true;
|
||||
input.block = (i < blocks.size) ? blocks.get(i) : null;
|
||||
selectedBlocks.put(currentCategory, input.block);
|
||||
blockSelectSeqMillis = Time.millis();
|
||||
@@ -216,7 +218,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 +339,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();
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ import mindustry.ui.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class PlayerListFragment extends Fragment{
|
||||
public Table content = new Table().marginRight(13f).marginLeft(13f);
|
||||
private boolean visible = false;
|
||||
private Table content = new Table().marginRight(13f).marginLeft(13f);
|
||||
private Interval timer = new Interval();
|
||||
private TextField sField;
|
||||
private boolean found = false;
|
||||
@@ -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);
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ScriptConsoleFragment extends Table{
|
||||
private boolean open = false, shown;
|
||||
private TextField chatfield;
|
||||
private Label fieldlabel = new Label(">");
|
||||
private BitmapFont font;
|
||||
private Font font;
|
||||
private GlyphLayout layout = new GlyphLayout();
|
||||
private float offsetx = Scl.scl(4), offsety = Scl.scl(4), fontoffsetx = Scl.scl(2), chatspace = Scl.scl(50);
|
||||
private Color shadowColor = new Color(0, 0, 0, 0.4f);
|
||||
@@ -53,7 +53,7 @@ public class ScriptConsoleFragment extends Table{
|
||||
clearChatInput();
|
||||
}
|
||||
|
||||
return shown && !Vars.net.active();
|
||||
return shown;
|
||||
});
|
||||
|
||||
update(() -> {
|
||||
@@ -115,7 +115,7 @@ public class ScriptConsoleFragment extends Table{
|
||||
Draw.color(shadowColor);
|
||||
|
||||
if(open){
|
||||
Fill.crect(offsetx, chatfield.getY(), chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
|
||||
Fill.crect(offsetx, chatfield.y, chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
|
||||
}
|
||||
|
||||
super.draw();
|
||||
@@ -159,7 +159,7 @@ public class ScriptConsoleFragment extends Table{
|
||||
String message = chatfield.getText();
|
||||
clearChatInput();
|
||||
|
||||
if(message.replaceAll(" ", "").isEmpty()) return;
|
||||
if(message.replace(" ", "").isEmpty()) return;
|
||||
|
||||
//special case for 'clear' command
|
||||
if(message.equals("clear")){
|
||||
|
||||
Reference in New Issue
Block a user