Fixed #530 / Better icons / Server list ordering
This commit is contained in:
@@ -57,6 +57,10 @@ public class Vars{
|
||||
public static final float itemSize = 5f;
|
||||
/** extra padding around the world; units outside this bound will begin to self-destruct. */
|
||||
public static final float worldBounds = 100f;
|
||||
/** default size of UI icons.*/
|
||||
public static final int iconsize = 48;
|
||||
/** size of UI icons (small)*/
|
||||
public static final int iconsizesmall = 32;
|
||||
/** units outside of this bound will simply die instantly */
|
||||
public static final float finalWorldBounds = worldBounds + 500;
|
||||
/** ticks spent out of bound until self destruct. */
|
||||
|
||||
@@ -65,7 +65,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
menu = new FloatingDialog("$menu");
|
||||
menu.addCloseButton();
|
||||
|
||||
float isize = 16 * 2f;
|
||||
float isize = iconsize;
|
||||
float swidth = 180f;
|
||||
|
||||
menu.cont.table(t -> {
|
||||
@@ -314,7 +314,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
}).left().margin(0).get();
|
||||
|
||||
button.clearChildren();
|
||||
button.addImage(iconname).size(16 * 3).padLeft(10);
|
||||
button.addImage(iconname).size(iconsize).padLeft(10);
|
||||
button.table(t -> {
|
||||
t.add(name).growX().wrap();
|
||||
t.row();
|
||||
@@ -392,7 +392,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
lastTable[0].remove();
|
||||
}
|
||||
});
|
||||
button.resizeImage(16 * 2f);
|
||||
button.resizeImage(iconsize);
|
||||
button.update(() -> button.setChecked(view.getTool() == tool));
|
||||
group.add(button);
|
||||
|
||||
@@ -462,16 +462,16 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
|
||||
tools.defaults().size(size, size);
|
||||
|
||||
tools.addImageButton("icon-menu-large", "clear", 16 * 2f, menu::show);
|
||||
tools.addImageButton("icon-menu-large", "clear", iconsize, menu::show);
|
||||
|
||||
ImageButton grid = tools.addImageButton("icon-grid", "clear-toggle", 16 * 2f, () -> view.setGrid(!view.isGrid())).get();
|
||||
ImageButton grid = tools.addImageButton("icon-grid", "clear-toggle", iconsize, () -> view.setGrid(!view.isGrid())).get();
|
||||
|
||||
addTool.accept(EditorTool.zoom);
|
||||
|
||||
tools.row();
|
||||
|
||||
ImageButton undo = tools.addImageButton("icon-undo", "clear", 16 * 2f, editor::undo).get();
|
||||
ImageButton redo = tools.addImageButton("icon-redo", "clear", 16 * 2f, editor::redo).get();
|
||||
ImageButton undo = tools.addImageButton("icon-undo", "clear", iconsize, editor::undo).get();
|
||||
ImageButton redo = tools.addImageButton("icon-redo", "clear", iconsize, editor::redo).get();
|
||||
|
||||
addTool.accept(EditorTool.pick);
|
||||
|
||||
@@ -493,7 +493,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
addTool.accept(EditorTool.fill);
|
||||
addTool.accept(EditorTool.spray);
|
||||
|
||||
ImageButton rotate = tools.addImageButton("icon-arrow-16", "clear", 16 * 2f, () -> editor.rotation = (editor.rotation + 1) % 4).get();
|
||||
ImageButton rotate = tools.addImageButton("icon-arrow-16", "clear", iconsize, () -> editor.rotation = (editor.rotation + 1) % 4).get();
|
||||
rotate.getImage().update(() -> {
|
||||
rotate.getImage().setRotation(editor.rotation * 90);
|
||||
rotate.getImage().setOrigin(Align.center);
|
||||
|
||||
@@ -63,7 +63,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
||||
update();
|
||||
}).size(160f, 64f);
|
||||
|
||||
buttons.addImageTextButton("$add", "icon-add", 14 * 2, this::showAdd).height(64f).width(140f);
|
||||
buttons.addImageTextButton("$add", "icon-add", iconsize, this::showAdd).height(64f).width(140f);
|
||||
}
|
||||
|
||||
void setup(){
|
||||
@@ -123,7 +123,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
||||
t.table(b -> {
|
||||
b.left();
|
||||
b.defaults().size(50f);
|
||||
b.addImageButton("icon-refresh", 14 * 2, () -> {
|
||||
b.addImageButton("icon-refresh", iconsize, () -> {
|
||||
filter.randomize();
|
||||
update();
|
||||
});
|
||||
@@ -140,7 +140,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
||||
rebuildFilters();
|
||||
update();
|
||||
});
|
||||
b.addImageButton("icon-trash", 14 * 2, () -> {
|
||||
b.addImageButton("icon-trash", iconsize, () -> {
|
||||
filters.remove(filter);
|
||||
rebuildFilters();
|
||||
update();
|
||||
|
||||
@@ -67,6 +67,8 @@ public class BuilderDrone extends BaseDrone implements BuilderTrait{
|
||||
circle(placeDistance * 0.7f);
|
||||
velocity.scl(0.74f);
|
||||
}else{ //else, building isn't valid, follow a player
|
||||
target = null;
|
||||
|
||||
if(playerTarget == null || playerTarget.getTeam() != team || !playerTarget.isValid()){
|
||||
playerTarget = null;
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
table.row();
|
||||
table.left().margin(0f).defaults().size(48f);
|
||||
|
||||
table.addImageButton("icon-break", "clear-toggle-partial", 16 * 2f, () -> {
|
||||
table.addImageButton("icon-break", "clear-toggle-partial", iconsize, () -> {
|
||||
mode = mode == breaking ? block == null ? none : placing : breaking;
|
||||
lastBlock = block;
|
||||
if(mode == breaking){
|
||||
@@ -274,17 +274,17 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
}).update(l -> l.setChecked(mode == breaking));
|
||||
|
||||
//diagonal swap button
|
||||
table.addImageButton("icon-diagonal", "clear-toggle-partial", 16 * 2f, () -> {
|
||||
table.addImageButton("icon-diagonal", "clear-toggle-partial", iconsize, () -> {
|
||||
Core.settings.put("swapdiagonal", !Core.settings.getBool("swapdiagonal"));
|
||||
Core.settings.save();
|
||||
}).update(l -> l.setChecked(Core.settings.getBool("swapdiagonal")));
|
||||
|
||||
//rotate button
|
||||
table.addImageButton("icon-arrow", "clear-partial", 16 * 2f, () -> rotation = Mathf.mod(rotation + 1, 4))
|
||||
table.addImageButton("icon-arrow", "clear-partial", iconsize, () -> rotation = Mathf.mod(rotation + 1, 4))
|
||||
.update(i -> i.getImage().setRotationOrigin(rotation * 90, Align.center)).visible(() -> block != null && block.rotate);
|
||||
|
||||
//confirm button
|
||||
table.addImageButton("icon-check", "clear-partial", 16 * 2f, () -> {
|
||||
table.addImageButton("icon-check", "clear-partial", iconsize, () -> {
|
||||
for(PlaceRequest request : selection){
|
||||
Tile tile = request.tile();
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public class Item extends UnlockableContent implements Comparable<Item>{
|
||||
|
||||
@Override
|
||||
public TextureRegion getContentIcon(){
|
||||
return icon(Icon.xlarge);
|
||||
return icon(Icon.xxlarge);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -91,7 +91,8 @@ public class Item extends UnlockableContent implements Comparable<Item>{
|
||||
small(8 * 2),
|
||||
medium(8 * 3),
|
||||
large(8 * 4),
|
||||
xlarge(8 * 5);
|
||||
xlarge(8 * 5),
|
||||
xxlarge(8 * 6);
|
||||
|
||||
public final int size;
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.scene.ui.TextButton;
|
||||
import io.anuke.arc.util.Align;
|
||||
|
||||
import static io.anuke.mindustry.Vars.iconsize;
|
||||
|
||||
public class MenuButton extends TextButton{
|
||||
|
||||
public MenuButton(String icon, String text, Runnable clicked){
|
||||
@@ -19,7 +21,7 @@ public class MenuButton extends TextButton{
|
||||
margin(0);
|
||||
|
||||
table(t -> {
|
||||
t.addImage(icon).size(14 * 3).padLeft(6);
|
||||
t.addImage(icon).size(iconsize).padLeft(6);
|
||||
|
||||
t.add(text).wrap().growX().get().setAlignment(Align.center, Align.left);
|
||||
if(description != null){
|
||||
|
||||
@@ -53,7 +53,7 @@ public class AboutDialog extends FloatingDialog{
|
||||
|
||||
table.table(i -> {
|
||||
i.background("button-edge-3");
|
||||
i.addImage("icon-" + link.name).size(14 * 3f);
|
||||
i.addImage("icon-" + link.name).size(iconsize);
|
||||
}).size(h - 5, h);
|
||||
|
||||
table.table(inset -> {
|
||||
@@ -62,7 +62,7 @@ public class AboutDialog extends FloatingDialog{
|
||||
inset.labelWrap(link.description).width(w - 100f).color(Color.LIGHT_GRAY).growX();
|
||||
}).padLeft(8);
|
||||
|
||||
table.addImageButton("icon-link", 14 * 3, () -> {
|
||||
table.addImageButton("icon-link", iconsize, () -> {
|
||||
if(!Core.net.openURI(link.link)){
|
||||
ui.showError("$linkfail");
|
||||
Core.app.getClipboard().setContents(link.link);
|
||||
|
||||
@@ -37,7 +37,7 @@ public class AdminsDialog extends FloatingDialog{
|
||||
|
||||
res.labelWrap("[LIGHT_GRAY]" + info.lastName).width(w - h - 24f);
|
||||
res.add().growX();
|
||||
res.addImageButton("icon-cancel", 14 * 3, () -> {
|
||||
res.addImageButton("icon-cancel", iconsize, () -> {
|
||||
ui.showConfirm("$confirm", "$confirmunadmin", () -> {
|
||||
netServer.admins.unAdminPlayer(info.id);
|
||||
playerGroup.all().each(player -> {
|
||||
|
||||
@@ -4,8 +4,7 @@ import io.anuke.arc.scene.ui.ScrollPane;
|
||||
import io.anuke.arc.scene.ui.layout.Table;
|
||||
import io.anuke.mindustry.net.Administration.PlayerInfo;
|
||||
|
||||
import static io.anuke.mindustry.Vars.netServer;
|
||||
import static io.anuke.mindustry.Vars.ui;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class BansDialog extends FloatingDialog{
|
||||
|
||||
@@ -39,7 +38,7 @@ public class BansDialog extends FloatingDialog{
|
||||
|
||||
res.labelWrap("IP: [LIGHT_GRAY]" + info.lastIP + "\n[]Name: [LIGHT_GRAY]" + info.lastName).width(w - h - 24f);
|
||||
res.add().growX();
|
||||
res.addImageButton("icon-cancel", 14 * 3, () -> {
|
||||
res.addImageButton("icon-cancel", iconsize, () -> {
|
||||
ui.showConfirm("$confirm", "$confirmunban", () -> {
|
||||
netServer.admins.unbanPlayerID(info.id);
|
||||
setup();
|
||||
|
||||
@@ -46,20 +46,20 @@ public class DatabaseDialog extends FloatingDialog{
|
||||
list.left();
|
||||
|
||||
int maxWidth = Core.graphics.isPortrait() ? 7 : 13;
|
||||
int size = 8 * 5;
|
||||
float size = Vars.iconsize;
|
||||
|
||||
int count = 0;
|
||||
|
||||
for(int i = 0; i < array.size; i++){
|
||||
UnlockableContent unlock = (UnlockableContent)array.get(i);
|
||||
|
||||
Image image = unlocked(unlock) ? new Image(unlock.getContentIcon()) : new Image("icon-tree-locked");
|
||||
Image image = unlocked(unlock) ? new Image(unlock.getContentIcon()) : new Image("icon-locked");
|
||||
image.addListener(new HandCursorListener());
|
||||
list.add(image).size(size).pad(3);
|
||||
|
||||
if(unlocked(unlock)){
|
||||
image.clicked(() -> Vars.ui.content.show(unlock));
|
||||
image.addListener(new Tooltip(t -> t.add(unlock.localizedName())));
|
||||
image.addListener(new Tooltip(t -> t.background("button").add(unlock.localizedName())));
|
||||
}
|
||||
|
||||
if((++count) % maxWidth == 0){
|
||||
|
||||
@@ -40,7 +40,7 @@ public class DeployDialog extends FloatingDialog{
|
||||
layout.layout(root);
|
||||
|
||||
addCloseButton();
|
||||
buttons.addImageTextButton("$techtree", "icon-tree", 16 * 2, () -> ui.tech.show()).size(230f, 64f);
|
||||
buttons.addImageTextButton("$techtree", "icon-tree", iconsize, () -> ui.tech.show()).size(230f, 64f);
|
||||
|
||||
shown(this::setup);
|
||||
}
|
||||
@@ -131,10 +131,10 @@ public class DeployDialog extends FloatingDialog{
|
||||
button.clicked(() -> info.show(zone));
|
||||
|
||||
if(zone.unlocked()){
|
||||
button.addImage("icon-zone").padRight(3);
|
||||
button.addImage("icon-terrain").size(iconsize).padRight(3);
|
||||
button.labelWrap(zone.localizedName()).width(140).growX();
|
||||
}else{
|
||||
button.addImage("icon-zone-locked");
|
||||
button.addImage("icon-locked");
|
||||
button.row();
|
||||
button.add("$locked");
|
||||
}
|
||||
|
||||
@@ -5,8 +5,7 @@ import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.scene.ui.Dialog;
|
||||
import io.anuke.mindustry.graphics.Pal;
|
||||
|
||||
import static io.anuke.mindustry.Vars.discordURL;
|
||||
import static io.anuke.mindustry.Vars.ui;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class DiscordDialog extends Dialog{
|
||||
|
||||
@@ -30,7 +29,7 @@ public class DiscordDialog extends Dialog{
|
||||
|
||||
t.table(i -> {
|
||||
i.background("button");
|
||||
i.addImage("icon-discord").size(14 * 3);
|
||||
i.addImage("icon-discord").size(iconsize);
|
||||
}).size(h).left();
|
||||
|
||||
t.add("$discord").color(Pal.accent).growX().padLeft(10f);
|
||||
|
||||
@@ -17,6 +17,8 @@ import io.anuke.mindustry.core.Platform;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import static io.anuke.mindustry.Vars.iconsize;
|
||||
|
||||
public class FileChooser extends FloatingDialog{
|
||||
private static final FileHandle homeDirectory = Core.files.absolute(OS.isMac ? OS.getProperty("user.home") + "/Downloads/" : Core.files.getExternalStoragePath());
|
||||
private static FileHandle lastDirectory = homeDirectory;
|
||||
@@ -99,7 +101,7 @@ public class FileChooser extends FloatingDialog{
|
||||
|
||||
Table icontable = new Table();
|
||||
|
||||
float isize = 14 * 2;
|
||||
float isize = iconsize;
|
||||
|
||||
ImageButton up = new ImageButton("icon-folder-parent");
|
||||
up.resizeImage(isize);
|
||||
@@ -131,7 +133,7 @@ public class FileChooser extends FloatingDialog{
|
||||
updateFiles(true);
|
||||
});
|
||||
|
||||
icontable.defaults().height(50).growX().padTop(5).uniform();
|
||||
icontable.defaults().height(60).growX().padTop(5).uniform();
|
||||
icontable.add(home);
|
||||
icontable.add(back);
|
||||
icontable.add(forward);
|
||||
@@ -142,7 +144,7 @@ public class FileChooser extends FloatingDialog{
|
||||
fieldcontent.add(filefield).height(40f).fillX().expandX().padLeft(10f);
|
||||
|
||||
Table buttons = new Table();
|
||||
buttons.defaults().growX().height(50);
|
||||
buttons.defaults().growX().height(60);
|
||||
buttons.add(cancel);
|
||||
buttons.add(ok);
|
||||
|
||||
@@ -213,7 +215,7 @@ public class FileChooser extends FloatingDialog{
|
||||
updateFiles(true);
|
||||
});
|
||||
|
||||
upbutton.left().add(upimage).padRight(4f).size(14 * 2);
|
||||
upbutton.left().add(upimage).padRight(4f).size(iconsize);
|
||||
upbutton.getLabel().setAlignment(Align.left);
|
||||
upbutton.getCells().reverse();
|
||||
|
||||
@@ -249,7 +251,7 @@ public class FileChooser extends FloatingDialog{
|
||||
|
||||
Image image = new Image(file.isDirectory() ? "icon-folder" : "icon-file-text");
|
||||
|
||||
button.add(image).padRight(4f).size(14 * 2f);
|
||||
button.add(image).padRight(4f).size(iconsize);
|
||||
button.getCells().reverse();
|
||||
files.top().left().add(button).align(Align.topLeft).fillX().expandX()
|
||||
.height(50).pad(2).padTop(0).padBottom(0).colspan(2);
|
||||
|
||||
@@ -11,6 +11,7 @@ import io.anuke.mindustry.game.EventType.ResizeEvent;
|
||||
import io.anuke.mindustry.graphics.Pal;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
|
||||
import static io.anuke.mindustry.Vars.iconsize;
|
||||
import static io.anuke.mindustry.Vars.state;
|
||||
|
||||
public class FloatingDialog extends Dialog{
|
||||
@@ -63,7 +64,7 @@ public class FloatingDialog extends Dialog{
|
||||
|
||||
@Override
|
||||
public void addCloseButton(){
|
||||
buttons.addImageTextButton("$back", "icon-arrow-left", 30f, this::hide).size(210f, 64f);
|
||||
buttons.addImageTextButton("$back", "icon-arrow-left", iconsize, this::hide).size(210f, 64f);
|
||||
|
||||
keyDown(key -> {
|
||||
if(key == KeyCode.ESCAPE || key == KeyCode.BACK){
|
||||
|
||||
@@ -107,16 +107,35 @@ public class JoinDialog extends FloatingDialog{
|
||||
|
||||
inner.add(button.getLabel()).growX();
|
||||
|
||||
inner.addImageButton("icon-loading", "empty", 16 * 2, () -> {
|
||||
inner.addImageButton("icon-arrow-up-small", "empty", iconsizesmall, () -> {
|
||||
int index = servers.indexOf(server);
|
||||
if(index > 0){
|
||||
servers.remove(index);
|
||||
servers.insert(0, server);
|
||||
|
||||
saveServers();
|
||||
setupRemote();
|
||||
for(Server other : servers){
|
||||
if(other.lastHost != null){
|
||||
setupServer(other, other.lastHost);
|
||||
}else{
|
||||
refreshServer(other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}).margin(3f).padTop(6f).top().right();
|
||||
|
||||
inner.addImageButton("icon-loading-small", "empty", iconsizesmall, () -> {
|
||||
refreshServer(server);
|
||||
}).margin(3f).padTop(6f).top().right();
|
||||
|
||||
inner.addImageButton("icon-pencil", "empty", 16 * 2, () -> {
|
||||
inner.addImageButton("icon-pencil-small", "empty", iconsizesmall, () -> {
|
||||
renaming = server;
|
||||
add.show();
|
||||
}).margin(3f).padTop(6f).top().right();
|
||||
|
||||
inner.addImageButton("icon-trash-16", "empty", 16 * 2, () -> {
|
||||
inner.addImageButton("icon-trash-16-small", "empty", iconsizesmall, () -> {
|
||||
ui.showConfirm("$confirm", "$server.delete", () -> {
|
||||
servers.removeValue(server, true);
|
||||
saveServers();
|
||||
@@ -144,42 +163,44 @@ public class JoinDialog extends FloatingDialog{
|
||||
server.content.clear();
|
||||
server.content.label(() -> Core.bundle.get("server.refreshing") + Strings.animated(Time.time(), 4, 11, "."));
|
||||
|
||||
Net.pingHost(server.ip, server.port, host -> {
|
||||
String versionString;
|
||||
|
||||
if(host.version == -1){
|
||||
versionString = Core.bundle.format("server.version", Core.bundle.get("server.custombuild"), "");
|
||||
}else if(host.version == 0){
|
||||
versionString = Core.bundle.get("server.outdated");
|
||||
}else if(host.version < Version.build && Version.build != -1){
|
||||
versionString = Core.bundle.get("server.outdated") + "\n" +
|
||||
Core.bundle.format("server.version", host.version, "");
|
||||
}else if(host.version > Version.build && Version.build != -1){
|
||||
versionString = Core.bundle.get("server.outdated.client") + "\n" +
|
||||
Core.bundle.format("server.version", host.version, "");
|
||||
}else{
|
||||
versionString = Core.bundle.format("server.version", host.version, host.versionType);
|
||||
}
|
||||
|
||||
server.content.clear();
|
||||
|
||||
server.content.table(t -> {
|
||||
t.add("[lightgray]" + host.name).width(targetWidth() - 10f).left().get().setEllipsis(true);
|
||||
t.row();
|
||||
t.add(versionString).left();
|
||||
t.row();
|
||||
t.add("[lightgray]" + (host.players != 1 ? Core.bundle.format("players", host.players) :
|
||||
Core.bundle.format("players.single", host.players))).left();
|
||||
t.row();
|
||||
t.add("[lightgray]" + Core.bundle.format("save.map", host.mapname) + "[] / " + Core.bundle.format("save.wave", host.wave)).width(targetWidth() - 10f).left().get().setEllipsis(true);
|
||||
}).expand().left().bottom().padLeft(12f).padBottom(8);
|
||||
|
||||
}, e -> {
|
||||
Net.pingHost(server.ip, server.port, host -> setupServer(server, host), e -> {
|
||||
server.content.clear();
|
||||
server.content.add("$host.invalid");
|
||||
});
|
||||
}
|
||||
|
||||
void setupServer(Server server, Host host){
|
||||
server.lastHost = host;
|
||||
String versionString;
|
||||
|
||||
if(host.version == -1){
|
||||
versionString = Core.bundle.format("server.version", Core.bundle.get("server.custombuild"), "");
|
||||
}else if(host.version == 0){
|
||||
versionString = Core.bundle.get("server.outdated");
|
||||
}else if(host.version < Version.build && Version.build != -1){
|
||||
versionString = Core.bundle.get("server.outdated") + "\n" +
|
||||
Core.bundle.format("server.version", host.version, "");
|
||||
}else if(host.version > Version.build && Version.build != -1){
|
||||
versionString = Core.bundle.get("server.outdated.client") + "\n" +
|
||||
Core.bundle.format("server.version", host.version, "");
|
||||
}else{
|
||||
versionString = Core.bundle.format("server.version", host.version, host.versionType);
|
||||
}
|
||||
|
||||
server.content.clear();
|
||||
|
||||
server.content.table(t -> {
|
||||
t.add("[lightgray]" + host.name).width(targetWidth() - 10f).left().get().setEllipsis(true);
|
||||
t.row();
|
||||
t.add(versionString).left();
|
||||
t.row();
|
||||
t.add("[lightgray]" + (host.players != 1 ? Core.bundle.format("players", host.players) :
|
||||
Core.bundle.format("players.single", host.players))).left();
|
||||
t.row();
|
||||
t.add("[lightgray]" + Core.bundle.format("save.map", host.mapname) + "[] / " + Core.bundle.format("save.wave", host.wave)).width(targetWidth() - 10f).left().get().setEllipsis(true);
|
||||
}).expand().left().bottom().padLeft(12f).padBottom(8);
|
||||
}
|
||||
|
||||
void setup(){
|
||||
float w = targetWidth();
|
||||
|
||||
@@ -217,7 +238,7 @@ public class JoinDialog extends FloatingDialog{
|
||||
cont.row();
|
||||
cont.add(pane).width(w + 38).pad(0);
|
||||
cont.row();
|
||||
cont.addCenteredImageTextButton("$server.add", "icon-add", 14 * 3, () -> {
|
||||
cont.addCenteredImageTextButton("$server.add", "icon-add", iconsize, () -> {
|
||||
renaming = null;
|
||||
add.show();
|
||||
}).marginLeft(6).width(w).height(80f).update(button -> {
|
||||
@@ -253,7 +274,7 @@ public class JoinDialog extends FloatingDialog{
|
||||
local.background("button");
|
||||
local.add("$hosts.none").pad(10f);
|
||||
local.add().growX();
|
||||
local.addImageButton("icon-loading", 16 * 2f, this::refreshLocal).pad(-12f).padLeft(0).size(70f);
|
||||
local.addImageButton("icon-loading", iconsize, this::refreshLocal).pad(-12f).padLeft(0).size(70f);
|
||||
}else{
|
||||
local.background((Drawable)null);
|
||||
}
|
||||
@@ -320,6 +341,7 @@ public class JoinDialog extends FloatingDialog{
|
||||
public int port;
|
||||
|
||||
transient Table content;
|
||||
transient Host lastHost;
|
||||
|
||||
void setIP(String ip){
|
||||
|
||||
|
||||
@@ -65,25 +65,25 @@ public class LoadDialog extends FloatingDialog{
|
||||
button.table(t -> {
|
||||
t.right();
|
||||
|
||||
t.addImageButton("icon-floppy", "emptytoggle", 14 * 3, () -> {
|
||||
t.addImageButton("icon-floppy", "emptytoggle", iconsize, () -> {
|
||||
slot.setAutosave(!slot.isAutosave());
|
||||
}).checked(slot.isAutosave()).right();
|
||||
|
||||
t.addImageButton("icon-trash", "empty", 14 * 3, () -> {
|
||||
t.addImageButton("icon-trash", "empty", iconsize, () -> {
|
||||
ui.showConfirm("$confirm", "$save.delete.confirm", () -> {
|
||||
slot.delete();
|
||||
setup();
|
||||
});
|
||||
}).size(14 * 3).right();
|
||||
}).size(iconsize).right();
|
||||
|
||||
t.addImageButton("icon-pencil-small", "empty", 14 * 3, () -> {
|
||||
t.addImageButton("icon-pencil", "empty", iconsize, () -> {
|
||||
ui.showTextInput("$save.rename", "$save.rename.text", slot.getName(), text -> {
|
||||
slot.setName(text);
|
||||
setup();
|
||||
});
|
||||
}).size(14 * 3).right();
|
||||
}).size(iconsize).right();
|
||||
|
||||
t.addImageButton("icon-save", "empty", 14 * 3, () -> {
|
||||
t.addImageButton("icon-save", "empty", iconsize, () -> {
|
||||
if(!ios){
|
||||
Platform.instance.showFileChooser(Core.bundle.get("save.export"), "Mindustry Save", file -> {
|
||||
try{
|
||||
@@ -102,7 +102,7 @@ public class LoadDialog extends FloatingDialog{
|
||||
ui.showError(Core.bundle.format("save.export.fail", Strings.parseException(e, true)));
|
||||
}
|
||||
}
|
||||
}).size(14 * 3).right();
|
||||
}).size(iconsize).right();
|
||||
|
||||
|
||||
}).padRight(-10).growX();
|
||||
@@ -147,7 +147,7 @@ public class LoadDialog extends FloatingDialog{
|
||||
|
||||
if(ios) return;
|
||||
|
||||
slots.addImageTextButton("$save.import", "icon-add", 14 * 3, () -> {
|
||||
slots.addImageTextButton("$save.import", "icon-add", iconsize, () -> {
|
||||
Platform.instance.showFileChooser(Core.bundle.get("save.import"), "Mindustry Save", file -> {
|
||||
if(SaveIO.isSaveValid(file)){
|
||||
try{
|
||||
|
||||
@@ -57,7 +57,7 @@ public class MapPlayDialog extends FloatingDialog{
|
||||
|
||||
cont.add(selmode);
|
||||
cont.row();
|
||||
cont.addImageTextButton("$customize", "icon-tools", 14*2, () -> dialog.show(rules, () -> rules = (selectedGamemode == null ? map.rules() : selectedGamemode.apply(map.rules())))).width(230);
|
||||
cont.addImageTextButton("$customize", "icon-tools-small", iconsizesmall, () -> dialog.show(rules, () -> rules = (selectedGamemode == null ? map.rules() : selectedGamemode.apply(map.rules())))).width(230);
|
||||
cont.row();
|
||||
cont.add(new BorderImage(map.texture, 3f)).size(mobile && !Core.graphics.isPortrait() ? 150f : 250f).get().setScaling(Scaling.fit);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public class MapsDialog extends FloatingDialog{
|
||||
super("$maps");
|
||||
|
||||
addCloseButton();
|
||||
buttons.addImageTextButton("$editor.importmap", "icon-add", 14 * 2, () -> {
|
||||
buttons.addImageTextButton("$editor.importmap", "icon-add", iconsize, () -> {
|
||||
Platform.instance.showFileChooser("$editor.importmap", "Map File", file -> {
|
||||
world.maps.tryCatchMapError(() -> {
|
||||
if(MapIO.isImage(file)){
|
||||
@@ -145,7 +145,7 @@ public class MapsDialog extends FloatingDialog{
|
||||
|
||||
table.row();
|
||||
|
||||
table.addImageTextButton("$editor.openin", "icon-load-map", 16 * 2, () -> {
|
||||
table.addImageTextButton("$editor.openin", "icon-load-map", iconsize, () -> {
|
||||
try{
|
||||
Vars.ui.editor.beginEditMap(map.file);
|
||||
dialog.hide();
|
||||
@@ -156,7 +156,7 @@ public class MapsDialog extends FloatingDialog{
|
||||
}
|
||||
}).fillX().height(54f).marginLeft(10);
|
||||
|
||||
table.addImageTextButton("$delete", "icon-trash-16", 16 * 2, () -> {
|
||||
table.addImageTextButton("$delete", "icon-trash-16", iconsize, () -> {
|
||||
ui.showConfirm("$confirm", Core.bundle.format("map.delete", map.name()), () -> {
|
||||
world.maps.removeMap(map);
|
||||
dialog.hide();
|
||||
|
||||
@@ -22,7 +22,7 @@ public class SaveDialog extends LoadDialog{
|
||||
|
||||
public void addSetup(){
|
||||
slots.row();
|
||||
slots.addImageTextButton("$save.new", "icon-add", 14 * 3, () ->
|
||||
slots.addImageTextButton("$save.new", "icon-add", iconsize, () ->
|
||||
ui.showTextInput("$save", "$save.newslot", "", text -> {
|
||||
ui.loadAnd("$saving", () -> {
|
||||
control.saves.addSave(text);
|
||||
|
||||
@@ -59,7 +59,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
|
||||
Consumer<SettingsTable> s = table -> {
|
||||
table.row();
|
||||
table.addImageTextButton("$back", "icon-arrow-left", 10 * 3, this::back).size(240f, 60f).colspan(2).padTop(15f);
|
||||
table.addImageTextButton("$back", "icon-arrow-left", iconsize, this::back).size(240f, 60f).colspan(2).padTop(15f);
|
||||
};
|
||||
|
||||
game = new SettingsTable(s);
|
||||
|
||||
@@ -50,7 +50,7 @@ public class TechTreeDialog extends FloatingDialog{
|
||||
|
||||
addCloseButton();
|
||||
|
||||
buttons.addImageTextButton("$database", "icon-database", 14 * 2, () -> {
|
||||
buttons.addImageTextButton("$database", "icon-database", iconsize, () -> {
|
||||
hide();
|
||||
ui.database.show();
|
||||
}).size(210f, 64f);
|
||||
@@ -194,7 +194,7 @@ public class TechTreeDialog extends FloatingDialog{
|
||||
button.setPosition(node.x + panX + width / 2f, node.y + panY + height / 2f + offset, Align.center);
|
||||
button.getStyle().up = Core.scene.skin.getDrawable(!locked(node.node) ? "content-background" : !data.hasItems(node.node.requirements) ? "content-background-noitems" : "content-background-locked");
|
||||
((TextureRegionDrawable)button.getStyle().imageUp)
|
||||
.setRegion(node.visible ? node.node.block.icon(Icon.medium) : Core.atlas.find("icon-tree-locked"));
|
||||
.setRegion(node.visible ? node.node.block.icon(Icon.medium) : Core.atlas.find("icon-locked"));
|
||||
button.getImage().setColor(!locked(node.node) ? Color.WHITE : Color.GRAY);
|
||||
});
|
||||
addChild(button);
|
||||
@@ -253,7 +253,7 @@ public class TechTreeDialog extends FloatingDialog{
|
||||
infoTable.table("content-background", b -> {
|
||||
b.margin(0).left().defaults().left();
|
||||
|
||||
b.addImageButton("icon-info", "node", 14 * 2, () -> ui.content.show(node.block)).growY().width(50f);
|
||||
b.addImageButton("icon-info", "node", iconsize, () -> ui.content.show(node.block)).growY().width(50f);
|
||||
b.add().grow();
|
||||
b.table(desc -> {
|
||||
desc.left().defaults().left();
|
||||
@@ -280,7 +280,7 @@ public class TechTreeDialog extends FloatingDialog{
|
||||
|
||||
if(mobile && locked(node)){
|
||||
b.row();
|
||||
b.addImageTextButton("$research", "icon-check", "node", 16 * 2, () -> unlock(node))
|
||||
b.addImageTextButton("$research", "icon-check", "node", iconsize, () -> unlock(node))
|
||||
.disabled(i -> !data.hasItems(node.requirements)).growX().height(44f).colspan(3);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ZoneInfoDialog extends FloatingDialog{
|
||||
|
||||
cont.table(cont -> {
|
||||
if(zone.locked()){
|
||||
cont.addImage("icon-zone-locked");
|
||||
cont.addImage("icon-locked");
|
||||
cont.row();
|
||||
cont.add("$locked").padBottom(6);
|
||||
cont.row();
|
||||
@@ -71,9 +71,9 @@ public class ZoneInfoDialog extends FloatingDialog{
|
||||
r.add("$complete").colspan(2).left();
|
||||
r.row();
|
||||
for(ZoneRequirement other : zone.zoneRequirements){
|
||||
r.addImage("icon-zone").padRight(4);
|
||||
r.addImage("icon-terrain").padRight(4);
|
||||
r.add(Core.bundle.format("zone.requirement", other.wave, other.zone.localizedName())).color(Color.LIGHT_GRAY);
|
||||
r.addImage(other.zone.bestWave() >= other.wave ? "icon-check-2" : "icon-cancel-2")
|
||||
r.addImage(other.zone.bestWave() >= other.wave ? "icon-check" : "icon-cancel")
|
||||
.color(other.zone.bestWave() >= other.wave ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
|
||||
r.row();
|
||||
}
|
||||
@@ -89,7 +89,7 @@ public class ZoneInfoDialog extends FloatingDialog{
|
||||
for(Block block : zone.blockRequirements){
|
||||
r.addImage(block.icon(Icon.small)).size(8 * 3).padRight(4);
|
||||
r.add(block.localizedName).color(Color.LIGHT_GRAY);
|
||||
r.addImage(data.isUnlocked(block) ? "icon-check-2" : "icon-cancel-2")
|
||||
r.addImage(data.isUnlocked(block) ? "icon-check" : "icon-cancel")
|
||||
.color(data.isUnlocked(block) ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
|
||||
r.row();
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ public class HudFragment extends Fragment{
|
||||
private Table lastUnlockLayout;
|
||||
private boolean shown = true;
|
||||
private float dsize = 59;
|
||||
private float isize = 40;
|
||||
|
||||
private float coreAttackTime;
|
||||
private float lastCoreHP;
|
||||
@@ -70,10 +69,10 @@ public class HudFragment extends Fragment{
|
||||
select.left();
|
||||
select.defaults().size(dsize).left();
|
||||
|
||||
select.addImageButton("icon-menu", "clear", isize, ui.paused::show);
|
||||
flip = select.addImageButton("icon-arrow-up", "clear", isize, this::toggleMenus).get();
|
||||
select.addImageButton("icon-menu-large", "clear", iconsize, ui.paused::show);
|
||||
flip = select.addImageButton("icon-arrow-up", "clear", iconsize, this::toggleMenus).get();
|
||||
|
||||
select.addImageButton("icon-pause", "clear", isize, () -> {
|
||||
select.addImageButton("icon-pause", "clear", iconsize, () -> {
|
||||
if(Net.active()){
|
||||
ui.listfrag.toggle();
|
||||
}else{
|
||||
@@ -88,7 +87,7 @@ public class HudFragment extends Fragment{
|
||||
}
|
||||
}).get();
|
||||
|
||||
select.addImageButton("icon-settings", "clear", isize, () -> {
|
||||
select.addImageButton("icon-settings", "clear", iconsize, () -> {
|
||||
if(Net.active() && mobile){
|
||||
if(ui.chatfrag.chatOpen()){
|
||||
ui.chatfrag.hide();
|
||||
@@ -104,7 +103,7 @@ public class HudFragment extends Fragment{
|
||||
if(Net.active() && mobile){
|
||||
i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-chat");
|
||||
}else{
|
||||
i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-database-small");
|
||||
i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-database");
|
||||
}
|
||||
}).get();
|
||||
|
||||
@@ -197,7 +196,7 @@ public class HudFragment extends Fragment{
|
||||
if(enableUnitEditing){
|
||||
|
||||
t.row();
|
||||
t.addImageTextButton("$editor.spawn", "icon-add", 8 * 3, () -> {
|
||||
t.addImageTextButton("$editor.spawn", "icon-add", iconsize, () -> {
|
||||
FloatingDialog dialog = new FloatingDialog("$editor.spawn");
|
||||
int i = 0;
|
||||
for(UnitType type : content.<UnitType>getBy(ContentType.unit)){
|
||||
@@ -216,7 +215,7 @@ public class HudFragment extends Fragment{
|
||||
float[] position = {0, 0};
|
||||
|
||||
t.row();
|
||||
t.addImageTextButton("$editor.removeunit", "icon-quit", "toggle", 8 * 3, () -> {
|
||||
t.addImageTextButton("$editor.removeunit", "icon-quit", "toggle", iconsize, () -> {
|
||||
|
||||
}).fillX().update(b -> {
|
||||
boolean[] found = {false};
|
||||
@@ -430,7 +429,7 @@ public class HudFragment extends Fragment{
|
||||
}
|
||||
});
|
||||
table.margin(12);
|
||||
table.addImage("icon-check").size(16 * 2).pad(3);
|
||||
table.addImage("icon-check").size(iconsize).pad(3);
|
||||
table.add(text).wrap().width(280f).get().setAlignment(Align.center, Align.center);
|
||||
table.pack();
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class MenuFragment extends Fragment{
|
||||
container.setSize(Core.graphics.getWidth(), Core.graphics.getHeight());
|
||||
|
||||
float size = 120f;
|
||||
float isize = 14f * 4;
|
||||
float isize = iconsize;
|
||||
container.defaults().size(size).pad(5).padTop(4f);
|
||||
|
||||
MobileButton
|
||||
|
||||
@@ -274,7 +274,7 @@ public class PlacementFragment extends Fragment{
|
||||
continue;
|
||||
}
|
||||
|
||||
categories.addImageButton("icon-" + cat.name(), "clear-toggle", 16 * 2, () -> {
|
||||
categories.addImageButton("icon-" + cat.name(), "clear-toggle", iconsize, () -> {
|
||||
currentCategory = cat;
|
||||
rebuildCategory.run();
|
||||
}).group(group).update(i -> i.setChecked(currentCategory == cat));
|
||||
|
||||
@@ -95,7 +95,7 @@ public class PlayerListFragment extends Fragment{
|
||||
button.labelWrap("[#" + user.color.toString().toUpperCase() + "]" + user.name).width(170f).pad(10);
|
||||
button.add().grow();
|
||||
|
||||
button.addImage("icon-admin").size(14 * 2).visible(() -> user.isAdmin && !(!user.isLocal && Net.server())).padRight(5).get().updateVisibility();
|
||||
button.addImage("icon-admin").size(iconsize).visible(() -> user.isAdmin && !(!user.isLocal && Net.server())).padRight(5).get().updateVisibility();
|
||||
|
||||
if((Net.server() || player.isAdmin) && !user.isLocal && (!user.isAdmin || Net.server())){
|
||||
button.add().growY();
|
||||
@@ -105,14 +105,14 @@ public class PlayerListFragment extends Fragment{
|
||||
button.table(t -> {
|
||||
t.defaults().size(bs);
|
||||
|
||||
t.addImageButton("icon-ban", "clear-partial", 14 * 2,
|
||||
t.addImageButton("icon-ban", "clear-partial", iconsize,
|
||||
() -> ui.showConfirm("$confirm", "$confirmban", () -> Call.onAdminRequest(user, AdminAction.ban)));
|
||||
t.addImageButton("icon-cancel", "clear-partial", 16 * 2,
|
||||
t.addImageButton("icon-cancel", "clear-partial", iconsize,
|
||||
() -> ui.showConfirm("$confirm", "$confirmkick", () -> Call.onAdminRequest(user, AdminAction.kick)));
|
||||
|
||||
t.row();
|
||||
|
||||
t.addImageButton("icon-admin", "clear-toggle-partial", 14 * 2, () -> {
|
||||
t.addImageButton("icon-admin", "clear-toggle-partial", iconsize, () -> {
|
||||
if(Net.client()) return;
|
||||
|
||||
String id = user.uuid;
|
||||
@@ -128,7 +128,7 @@ public class PlayerListFragment extends Fragment{
|
||||
.touchable(() -> Net.client() ? Touchable.disabled : Touchable.enabled)
|
||||
.checked(user.isAdmin);
|
||||
|
||||
t.addImageButton("icon-zoom-small", "clear-partial", 14 * 2, () -> Call.onAdminRequest(user, AdminAction.trace));
|
||||
t.addImageButton("icon-zoom", "clear-partial", iconsize, () -> Call.onAdminRequest(user, AdminAction.trace));
|
||||
|
||||
}).padRight(12).size(bs + 10f, bs);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class ConsumeLiquid extends ConsumeLiquidBase{
|
||||
|
||||
@Override
|
||||
public String getIcon(){
|
||||
return "icon-liquid-small";
|
||||
return "icon-liquid-consume";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ConsumeLiquidFilter extends ConsumeLiquidBase{
|
||||
|
||||
@Override
|
||||
public String getIcon(){
|
||||
return "icon-liquid-small";
|
||||
return "icon-liquid-consume";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ConsumePower extends Consume{
|
||||
|
||||
@Override
|
||||
public String getIcon(){
|
||||
return "icon-power-small";
|
||||
return "icon-power";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user