Fixed #530 / Better icons / Server list ordering
|
Before Width: | Height: | Size: 167 B |
|
Before Width: | Height: | Size: 114 B |
|
Before Width: | Height: | Size: 160 B |
|
Before Width: | Height: | Size: 141 B |
|
Before Width: | Height: | Size: 151 B |
|
Before Width: | Height: | Size: 156 B |
|
Before Width: | Height: | Size: 139 B |
|
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 114 B |
|
Before Width: | Height: | Size: 191 B |
|
Before Width: | Height: | Size: 181 B |
|
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 129 B After Width: | Height: | Size: 129 B |
|
Before Width: | Height: | Size: 107 B |
|
Before Width: | Height: | Size: 141 B After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 120 B |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 172 B |
|
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 133 B After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 113 B |
|
Before Width: | Height: | Size: 118 B After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 91 B |
|
Before Width: | Height: | Size: 110 B After Width: | Height: | Size: 110 B |
|
Before Width: | Height: | Size: 161 B After Width: | Height: | Size: 161 B |
|
Before Width: | Height: | Size: 139 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 120 B |
|
Before Width: | Height: | Size: 119 B After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 115 B |
|
Before Width: | Height: | Size: 95 B |
|
Before Width: | Height: | Size: 103 B |
|
Before Width: | Height: | Size: 104 B |
|
Before Width: | Height: | Size: 125 B |
|
Before Width: | Height: | Size: 107 B |
|
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 231 B |
|
Before Width: | Height: | Size: 98 B |
|
After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 152 B |
|
Before Width: | Height: | Size: 127 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 120 B After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 118 B |
|
Before Width: | Height: | Size: 117 B |
|
Before Width: | Height: | Size: 250 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 99 B |
|
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 148 B |
|
Before Width: | Height: | Size: 111 B After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 236 B |
|
Before Width: | Height: | Size: 224 B |
|
Before Width: | Height: | Size: 112 B |
|
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 158 KiB After Width: | Height: | Size: 143 KiB |
|
Before Width: | Height: | Size: 235 KiB After Width: | Height: | Size: 242 KiB |
|
Before Width: | Height: | Size: 402 KiB After Width: | Height: | Size: 346 KiB |
|
Before Width: | Height: | Size: 295 KiB After Width: | Height: | Size: 272 KiB |
@@ -57,6 +57,10 @@ public class Vars{
|
|||||||
public static final float itemSize = 5f;
|
public static final float itemSize = 5f;
|
||||||
/** extra padding around the world; units outside this bound will begin to self-destruct. */
|
/** extra padding around the world; units outside this bound will begin to self-destruct. */
|
||||||
public static final float worldBounds = 100f;
|
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 */
|
/** units outside of this bound will simply die instantly */
|
||||||
public static final float finalWorldBounds = worldBounds + 500;
|
public static final float finalWorldBounds = worldBounds + 500;
|
||||||
/** ticks spent out of bound until self destruct. */
|
/** ticks spent out of bound until self destruct. */
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
menu = new FloatingDialog("$menu");
|
menu = new FloatingDialog("$menu");
|
||||||
menu.addCloseButton();
|
menu.addCloseButton();
|
||||||
|
|
||||||
float isize = 16 * 2f;
|
float isize = iconsize;
|
||||||
float swidth = 180f;
|
float swidth = 180f;
|
||||||
|
|
||||||
menu.cont.table(t -> {
|
menu.cont.table(t -> {
|
||||||
@@ -314,7 +314,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
}).left().margin(0).get();
|
}).left().margin(0).get();
|
||||||
|
|
||||||
button.clearChildren();
|
button.clearChildren();
|
||||||
button.addImage(iconname).size(16 * 3).padLeft(10);
|
button.addImage(iconname).size(iconsize).padLeft(10);
|
||||||
button.table(t -> {
|
button.table(t -> {
|
||||||
t.add(name).growX().wrap();
|
t.add(name).growX().wrap();
|
||||||
t.row();
|
t.row();
|
||||||
@@ -392,7 +392,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
lastTable[0].remove();
|
lastTable[0].remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
button.resizeImage(16 * 2f);
|
button.resizeImage(iconsize);
|
||||||
button.update(() -> button.setChecked(view.getTool() == tool));
|
button.update(() -> button.setChecked(view.getTool() == tool));
|
||||||
group.add(button);
|
group.add(button);
|
||||||
|
|
||||||
@@ -462,16 +462,16 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
|
|
||||||
tools.defaults().size(size, size);
|
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);
|
addTool.accept(EditorTool.zoom);
|
||||||
|
|
||||||
tools.row();
|
tools.row();
|
||||||
|
|
||||||
ImageButton undo = tools.addImageButton("icon-undo", "clear", 16 * 2f, editor::undo).get();
|
ImageButton undo = tools.addImageButton("icon-undo", "clear", iconsize, editor::undo).get();
|
||||||
ImageButton redo = tools.addImageButton("icon-redo", "clear", 16 * 2f, editor::redo).get();
|
ImageButton redo = tools.addImageButton("icon-redo", "clear", iconsize, editor::redo).get();
|
||||||
|
|
||||||
addTool.accept(EditorTool.pick);
|
addTool.accept(EditorTool.pick);
|
||||||
|
|
||||||
@@ -493,7 +493,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
addTool.accept(EditorTool.fill);
|
addTool.accept(EditorTool.fill);
|
||||||
addTool.accept(EditorTool.spray);
|
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().update(() -> {
|
||||||
rotate.getImage().setRotation(editor.rotation * 90);
|
rotate.getImage().setRotation(editor.rotation * 90);
|
||||||
rotate.getImage().setOrigin(Align.center);
|
rotate.getImage().setOrigin(Align.center);
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
|||||||
update();
|
update();
|
||||||
}).size(160f, 64f);
|
}).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(){
|
void setup(){
|
||||||
@@ -123,7 +123,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
|||||||
t.table(b -> {
|
t.table(b -> {
|
||||||
b.left();
|
b.left();
|
||||||
b.defaults().size(50f);
|
b.defaults().size(50f);
|
||||||
b.addImageButton("icon-refresh", 14 * 2, () -> {
|
b.addImageButton("icon-refresh", iconsize, () -> {
|
||||||
filter.randomize();
|
filter.randomize();
|
||||||
update();
|
update();
|
||||||
});
|
});
|
||||||
@@ -140,7 +140,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
|||||||
rebuildFilters();
|
rebuildFilters();
|
||||||
update();
|
update();
|
||||||
});
|
});
|
||||||
b.addImageButton("icon-trash", 14 * 2, () -> {
|
b.addImageButton("icon-trash", iconsize, () -> {
|
||||||
filters.remove(filter);
|
filters.remove(filter);
|
||||||
rebuildFilters();
|
rebuildFilters();
|
||||||
update();
|
update();
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ public class BuilderDrone extends BaseDrone implements BuilderTrait{
|
|||||||
circle(placeDistance * 0.7f);
|
circle(placeDistance * 0.7f);
|
||||||
velocity.scl(0.74f);
|
velocity.scl(0.74f);
|
||||||
}else{ //else, building isn't valid, follow a player
|
}else{ //else, building isn't valid, follow a player
|
||||||
|
target = null;
|
||||||
|
|
||||||
if(playerTarget == null || playerTarget.getTeam() != team || !playerTarget.isValid()){
|
if(playerTarget == null || playerTarget.getTeam() != team || !playerTarget.isValid()){
|
||||||
playerTarget = null;
|
playerTarget = null;
|
||||||
|
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
table.row();
|
table.row();
|
||||||
table.left().margin(0f).defaults().size(48f);
|
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;
|
mode = mode == breaking ? block == null ? none : placing : breaking;
|
||||||
lastBlock = block;
|
lastBlock = block;
|
||||||
if(mode == breaking){
|
if(mode == breaking){
|
||||||
@@ -274,17 +274,17 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
}).update(l -> l.setChecked(mode == breaking));
|
}).update(l -> l.setChecked(mode == breaking));
|
||||||
|
|
||||||
//diagonal swap button
|
//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.put("swapdiagonal", !Core.settings.getBool("swapdiagonal"));
|
||||||
Core.settings.save();
|
Core.settings.save();
|
||||||
}).update(l -> l.setChecked(Core.settings.getBool("swapdiagonal")));
|
}).update(l -> l.setChecked(Core.settings.getBool("swapdiagonal")));
|
||||||
|
|
||||||
//rotate button
|
//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);
|
.update(i -> i.getImage().setRotationOrigin(rotation * 90, Align.center)).visible(() -> block != null && block.rotate);
|
||||||
|
|
||||||
//confirm button
|
//confirm button
|
||||||
table.addImageButton("icon-check", "clear-partial", 16 * 2f, () -> {
|
table.addImageButton("icon-check", "clear-partial", iconsize, () -> {
|
||||||
for(PlaceRequest request : selection){
|
for(PlaceRequest request : selection){
|
||||||
Tile tile = request.tile();
|
Tile tile = request.tile();
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class Item extends UnlockableContent implements Comparable<Item>{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TextureRegion getContentIcon(){
|
public TextureRegion getContentIcon(){
|
||||||
return icon(Icon.xlarge);
|
return icon(Icon.xxlarge);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -91,7 +91,8 @@ public class Item extends UnlockableContent implements Comparable<Item>{
|
|||||||
small(8 * 2),
|
small(8 * 2),
|
||||||
medium(8 * 3),
|
medium(8 * 3),
|
||||||
large(8 * 4),
|
large(8 * 4),
|
||||||
xlarge(8 * 5);
|
xlarge(8 * 5),
|
||||||
|
xxlarge(8 * 6);
|
||||||
|
|
||||||
public final int size;
|
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.scene.ui.TextButton;
|
||||||
import io.anuke.arc.util.Align;
|
import io.anuke.arc.util.Align;
|
||||||
|
|
||||||
|
import static io.anuke.mindustry.Vars.iconsize;
|
||||||
|
|
||||||
public class MenuButton extends TextButton{
|
public class MenuButton extends TextButton{
|
||||||
|
|
||||||
public MenuButton(String icon, String text, Runnable clicked){
|
public MenuButton(String icon, String text, Runnable clicked){
|
||||||
@@ -19,7 +21,7 @@ public class MenuButton extends TextButton{
|
|||||||
margin(0);
|
margin(0);
|
||||||
|
|
||||||
table(t -> {
|
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);
|
t.add(text).wrap().growX().get().setAlignment(Align.center, Align.left);
|
||||||
if(description != null){
|
if(description != null){
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class AboutDialog extends FloatingDialog{
|
|||||||
|
|
||||||
table.table(i -> {
|
table.table(i -> {
|
||||||
i.background("button-edge-3");
|
i.background("button-edge-3");
|
||||||
i.addImage("icon-" + link.name).size(14 * 3f);
|
i.addImage("icon-" + link.name).size(iconsize);
|
||||||
}).size(h - 5, h);
|
}).size(h - 5, h);
|
||||||
|
|
||||||
table.table(inset -> {
|
table.table(inset -> {
|
||||||
@@ -62,7 +62,7 @@ public class AboutDialog extends FloatingDialog{
|
|||||||
inset.labelWrap(link.description).width(w - 100f).color(Color.LIGHT_GRAY).growX();
|
inset.labelWrap(link.description).width(w - 100f).color(Color.LIGHT_GRAY).growX();
|
||||||
}).padLeft(8);
|
}).padLeft(8);
|
||||||
|
|
||||||
table.addImageButton("icon-link", 14 * 3, () -> {
|
table.addImageButton("icon-link", iconsize, () -> {
|
||||||
if(!Core.net.openURI(link.link)){
|
if(!Core.net.openURI(link.link)){
|
||||||
ui.showError("$linkfail");
|
ui.showError("$linkfail");
|
||||||
Core.app.getClipboard().setContents(link.link);
|
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.labelWrap("[LIGHT_GRAY]" + info.lastName).width(w - h - 24f);
|
||||||
res.add().growX();
|
res.add().growX();
|
||||||
res.addImageButton("icon-cancel", 14 * 3, () -> {
|
res.addImageButton("icon-cancel", iconsize, () -> {
|
||||||
ui.showConfirm("$confirm", "$confirmunadmin", () -> {
|
ui.showConfirm("$confirm", "$confirmunadmin", () -> {
|
||||||
netServer.admins.unAdminPlayer(info.id);
|
netServer.admins.unAdminPlayer(info.id);
|
||||||
playerGroup.all().each(player -> {
|
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.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.mindustry.net.Administration.PlayerInfo;
|
import io.anuke.mindustry.net.Administration.PlayerInfo;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.netServer;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
import static io.anuke.mindustry.Vars.ui;
|
|
||||||
|
|
||||||
public class BansDialog extends FloatingDialog{
|
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.labelWrap("IP: [LIGHT_GRAY]" + info.lastIP + "\n[]Name: [LIGHT_GRAY]" + info.lastName).width(w - h - 24f);
|
||||||
res.add().growX();
|
res.add().growX();
|
||||||
res.addImageButton("icon-cancel", 14 * 3, () -> {
|
res.addImageButton("icon-cancel", iconsize, () -> {
|
||||||
ui.showConfirm("$confirm", "$confirmunban", () -> {
|
ui.showConfirm("$confirm", "$confirmunban", () -> {
|
||||||
netServer.admins.unbanPlayerID(info.id);
|
netServer.admins.unbanPlayerID(info.id);
|
||||||
setup();
|
setup();
|
||||||
|
|||||||
@@ -46,20 +46,20 @@ public class DatabaseDialog extends FloatingDialog{
|
|||||||
list.left();
|
list.left();
|
||||||
|
|
||||||
int maxWidth = Core.graphics.isPortrait() ? 7 : 13;
|
int maxWidth = Core.graphics.isPortrait() ? 7 : 13;
|
||||||
int size = 8 * 5;
|
float size = Vars.iconsize;
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
for(int i = 0; i < array.size; i++){
|
for(int i = 0; i < array.size; i++){
|
||||||
UnlockableContent unlock = (UnlockableContent)array.get(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());
|
image.addListener(new HandCursorListener());
|
||||||
list.add(image).size(size).pad(3);
|
list.add(image).size(size).pad(3);
|
||||||
|
|
||||||
if(unlocked(unlock)){
|
if(unlocked(unlock)){
|
||||||
image.clicked(() -> Vars.ui.content.show(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){
|
if((++count) % maxWidth == 0){
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class DeployDialog extends FloatingDialog{
|
|||||||
layout.layout(root);
|
layout.layout(root);
|
||||||
|
|
||||||
addCloseButton();
|
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);
|
shown(this::setup);
|
||||||
}
|
}
|
||||||
@@ -131,10 +131,10 @@ public class DeployDialog extends FloatingDialog{
|
|||||||
button.clicked(() -> info.show(zone));
|
button.clicked(() -> info.show(zone));
|
||||||
|
|
||||||
if(zone.unlocked()){
|
if(zone.unlocked()){
|
||||||
button.addImage("icon-zone").padRight(3);
|
button.addImage("icon-terrain").size(iconsize).padRight(3);
|
||||||
button.labelWrap(zone.localizedName()).width(140).growX();
|
button.labelWrap(zone.localizedName()).width(140).growX();
|
||||||
}else{
|
}else{
|
||||||
button.addImage("icon-zone-locked");
|
button.addImage("icon-locked");
|
||||||
button.row();
|
button.row();
|
||||||
button.add("$locked");
|
button.add("$locked");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ import io.anuke.arc.graphics.Color;
|
|||||||
import io.anuke.arc.scene.ui.Dialog;
|
import io.anuke.arc.scene.ui.Dialog;
|
||||||
import io.anuke.mindustry.graphics.Pal;
|
import io.anuke.mindustry.graphics.Pal;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.discordURL;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
import static io.anuke.mindustry.Vars.ui;
|
|
||||||
|
|
||||||
public class DiscordDialog extends Dialog{
|
public class DiscordDialog extends Dialog{
|
||||||
|
|
||||||
@@ -30,7 +29,7 @@ public class DiscordDialog extends Dialog{
|
|||||||
|
|
||||||
t.table(i -> {
|
t.table(i -> {
|
||||||
i.background("button");
|
i.background("button");
|
||||||
i.addImage("icon-discord").size(14 * 3);
|
i.addImage("icon-discord").size(iconsize);
|
||||||
}).size(h).left();
|
}).size(h).left();
|
||||||
|
|
||||||
t.add("$discord").color(Pal.accent).growX().padLeft(10f);
|
t.add("$discord").color(Pal.accent).growX().padLeft(10f);
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import io.anuke.mindustry.core.Platform;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import static io.anuke.mindustry.Vars.iconsize;
|
||||||
|
|
||||||
public class FileChooser extends FloatingDialog{
|
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 final FileHandle homeDirectory = Core.files.absolute(OS.isMac ? OS.getProperty("user.home") + "/Downloads/" : Core.files.getExternalStoragePath());
|
||||||
private static FileHandle lastDirectory = homeDirectory;
|
private static FileHandle lastDirectory = homeDirectory;
|
||||||
@@ -99,7 +101,7 @@ public class FileChooser extends FloatingDialog{
|
|||||||
|
|
||||||
Table icontable = new Table();
|
Table icontable = new Table();
|
||||||
|
|
||||||
float isize = 14 * 2;
|
float isize = iconsize;
|
||||||
|
|
||||||
ImageButton up = new ImageButton("icon-folder-parent");
|
ImageButton up = new ImageButton("icon-folder-parent");
|
||||||
up.resizeImage(isize);
|
up.resizeImage(isize);
|
||||||
@@ -131,7 +133,7 @@ public class FileChooser extends FloatingDialog{
|
|||||||
updateFiles(true);
|
updateFiles(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
icontable.defaults().height(50).growX().padTop(5).uniform();
|
icontable.defaults().height(60).growX().padTop(5).uniform();
|
||||||
icontable.add(home);
|
icontable.add(home);
|
||||||
icontable.add(back);
|
icontable.add(back);
|
||||||
icontable.add(forward);
|
icontable.add(forward);
|
||||||
@@ -142,7 +144,7 @@ public class FileChooser extends FloatingDialog{
|
|||||||
fieldcontent.add(filefield).height(40f).fillX().expandX().padLeft(10f);
|
fieldcontent.add(filefield).height(40f).fillX().expandX().padLeft(10f);
|
||||||
|
|
||||||
Table buttons = new Table();
|
Table buttons = new Table();
|
||||||
buttons.defaults().growX().height(50);
|
buttons.defaults().growX().height(60);
|
||||||
buttons.add(cancel);
|
buttons.add(cancel);
|
||||||
buttons.add(ok);
|
buttons.add(ok);
|
||||||
|
|
||||||
@@ -213,7 +215,7 @@ public class FileChooser extends FloatingDialog{
|
|||||||
updateFiles(true);
|
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.getLabel().setAlignment(Align.left);
|
||||||
upbutton.getCells().reverse();
|
upbutton.getCells().reverse();
|
||||||
|
|
||||||
@@ -249,7 +251,7 @@ public class FileChooser extends FloatingDialog{
|
|||||||
|
|
||||||
Image image = new Image(file.isDirectory() ? "icon-folder" : "icon-file-text");
|
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();
|
button.getCells().reverse();
|
||||||
files.top().left().add(button).align(Align.topLeft).fillX().expandX()
|
files.top().left().add(button).align(Align.topLeft).fillX().expandX()
|
||||||
.height(50).pad(2).padTop(0).padBottom(0).colspan(2);
|
.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.graphics.Pal;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
|
|
||||||
|
import static io.anuke.mindustry.Vars.iconsize;
|
||||||
import static io.anuke.mindustry.Vars.state;
|
import static io.anuke.mindustry.Vars.state;
|
||||||
|
|
||||||
public class FloatingDialog extends Dialog{
|
public class FloatingDialog extends Dialog{
|
||||||
@@ -63,7 +64,7 @@ public class FloatingDialog extends Dialog{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addCloseButton(){
|
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 -> {
|
keyDown(key -> {
|
||||||
if(key == KeyCode.ESCAPE || key == KeyCode.BACK){
|
if(key == KeyCode.ESCAPE || key == KeyCode.BACK){
|
||||||
|
|||||||
@@ -107,16 +107,35 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
|
|
||||||
inner.add(button.getLabel()).growX();
|
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);
|
refreshServer(server);
|
||||||
}).margin(3f).padTop(6f).top().right();
|
}).margin(3f).padTop(6f).top().right();
|
||||||
|
|
||||||
inner.addImageButton("icon-pencil", "empty", 16 * 2, () -> {
|
inner.addImageButton("icon-pencil-small", "empty", iconsizesmall, () -> {
|
||||||
renaming = server;
|
renaming = server;
|
||||||
add.show();
|
add.show();
|
||||||
}).margin(3f).padTop(6f).top().right();
|
}).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", () -> {
|
ui.showConfirm("$confirm", "$server.delete", () -> {
|
||||||
servers.removeValue(server, true);
|
servers.removeValue(server, true);
|
||||||
saveServers();
|
saveServers();
|
||||||
@@ -144,7 +163,14 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
server.content.clear();
|
server.content.clear();
|
||||||
server.content.label(() -> Core.bundle.get("server.refreshing") + Strings.animated(Time.time(), 4, 11, "."));
|
server.content.label(() -> Core.bundle.get("server.refreshing") + Strings.animated(Time.time(), 4, 11, "."));
|
||||||
|
|
||||||
Net.pingHost(server.ip, server.port, host -> {
|
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;
|
String versionString;
|
||||||
|
|
||||||
if(host.version == -1){
|
if(host.version == -1){
|
||||||
@@ -173,11 +199,6 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
t.row();
|
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);
|
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);
|
}).expand().left().bottom().padLeft(12f).padBottom(8);
|
||||||
|
|
||||||
}, e -> {
|
|
||||||
server.content.clear();
|
|
||||||
server.content.add("$host.invalid");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
@@ -217,7 +238,7 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
cont.row();
|
cont.row();
|
||||||
cont.add(pane).width(w + 38).pad(0);
|
cont.add(pane).width(w + 38).pad(0);
|
||||||
cont.row();
|
cont.row();
|
||||||
cont.addCenteredImageTextButton("$server.add", "icon-add", 14 * 3, () -> {
|
cont.addCenteredImageTextButton("$server.add", "icon-add", iconsize, () -> {
|
||||||
renaming = null;
|
renaming = null;
|
||||||
add.show();
|
add.show();
|
||||||
}).marginLeft(6).width(w).height(80f).update(button -> {
|
}).marginLeft(6).width(w).height(80f).update(button -> {
|
||||||
@@ -253,7 +274,7 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
local.background("button");
|
local.background("button");
|
||||||
local.add("$hosts.none").pad(10f);
|
local.add("$hosts.none").pad(10f);
|
||||||
local.add().growX();
|
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{
|
}else{
|
||||||
local.background((Drawable)null);
|
local.background((Drawable)null);
|
||||||
}
|
}
|
||||||
@@ -320,6 +341,7 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
public int port;
|
public int port;
|
||||||
|
|
||||||
transient Table content;
|
transient Table content;
|
||||||
|
transient Host lastHost;
|
||||||
|
|
||||||
void setIP(String ip){
|
void setIP(String ip){
|
||||||
|
|
||||||
|
|||||||
@@ -65,25 +65,25 @@ public class LoadDialog extends FloatingDialog{
|
|||||||
button.table(t -> {
|
button.table(t -> {
|
||||||
t.right();
|
t.right();
|
||||||
|
|
||||||
t.addImageButton("icon-floppy", "emptytoggle", 14 * 3, () -> {
|
t.addImageButton("icon-floppy", "emptytoggle", iconsize, () -> {
|
||||||
slot.setAutosave(!slot.isAutosave());
|
slot.setAutosave(!slot.isAutosave());
|
||||||
}).checked(slot.isAutosave()).right();
|
}).checked(slot.isAutosave()).right();
|
||||||
|
|
||||||
t.addImageButton("icon-trash", "empty", 14 * 3, () -> {
|
t.addImageButton("icon-trash", "empty", iconsize, () -> {
|
||||||
ui.showConfirm("$confirm", "$save.delete.confirm", () -> {
|
ui.showConfirm("$confirm", "$save.delete.confirm", () -> {
|
||||||
slot.delete();
|
slot.delete();
|
||||||
setup();
|
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 -> {
|
ui.showTextInput("$save.rename", "$save.rename.text", slot.getName(), text -> {
|
||||||
slot.setName(text);
|
slot.setName(text);
|
||||||
setup();
|
setup();
|
||||||
});
|
});
|
||||||
}).size(14 * 3).right();
|
}).size(iconsize).right();
|
||||||
|
|
||||||
t.addImageButton("icon-save", "empty", 14 * 3, () -> {
|
t.addImageButton("icon-save", "empty", iconsize, () -> {
|
||||||
if(!ios){
|
if(!ios){
|
||||||
Platform.instance.showFileChooser(Core.bundle.get("save.export"), "Mindustry Save", file -> {
|
Platform.instance.showFileChooser(Core.bundle.get("save.export"), "Mindustry Save", file -> {
|
||||||
try{
|
try{
|
||||||
@@ -102,7 +102,7 @@ public class LoadDialog extends FloatingDialog{
|
|||||||
ui.showError(Core.bundle.format("save.export.fail", Strings.parseException(e, true)));
|
ui.showError(Core.bundle.format("save.export.fail", Strings.parseException(e, true)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).size(14 * 3).right();
|
}).size(iconsize).right();
|
||||||
|
|
||||||
|
|
||||||
}).padRight(-10).growX();
|
}).padRight(-10).growX();
|
||||||
@@ -147,7 +147,7 @@ public class LoadDialog extends FloatingDialog{
|
|||||||
|
|
||||||
if(ios) return;
|
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 -> {
|
Platform.instance.showFileChooser(Core.bundle.get("save.import"), "Mindustry Save", file -> {
|
||||||
if(SaveIO.isSaveValid(file)){
|
if(SaveIO.isSaveValid(file)){
|
||||||
try{
|
try{
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class MapPlayDialog extends FloatingDialog{
|
|||||||
|
|
||||||
cont.add(selmode);
|
cont.add(selmode);
|
||||||
cont.row();
|
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.row();
|
||||||
cont.add(new BorderImage(map.texture, 3f)).size(mobile && !Core.graphics.isPortrait() ? 150f : 250f).get().setScaling(Scaling.fit);
|
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");
|
super("$maps");
|
||||||
|
|
||||||
addCloseButton();
|
addCloseButton();
|
||||||
buttons.addImageTextButton("$editor.importmap", "icon-add", 14 * 2, () -> {
|
buttons.addImageTextButton("$editor.importmap", "icon-add", iconsize, () -> {
|
||||||
Platform.instance.showFileChooser("$editor.importmap", "Map File", file -> {
|
Platform.instance.showFileChooser("$editor.importmap", "Map File", file -> {
|
||||||
world.maps.tryCatchMapError(() -> {
|
world.maps.tryCatchMapError(() -> {
|
||||||
if(MapIO.isImage(file)){
|
if(MapIO.isImage(file)){
|
||||||
@@ -145,7 +145,7 @@ public class MapsDialog extends FloatingDialog{
|
|||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
table.addImageTextButton("$editor.openin", "icon-load-map", 16 * 2, () -> {
|
table.addImageTextButton("$editor.openin", "icon-load-map", iconsize, () -> {
|
||||||
try{
|
try{
|
||||||
Vars.ui.editor.beginEditMap(map.file);
|
Vars.ui.editor.beginEditMap(map.file);
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
@@ -156,7 +156,7 @@ public class MapsDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
}).fillX().height(54f).marginLeft(10);
|
}).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()), () -> {
|
ui.showConfirm("$confirm", Core.bundle.format("map.delete", map.name()), () -> {
|
||||||
world.maps.removeMap(map);
|
world.maps.removeMap(map);
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class SaveDialog extends LoadDialog{
|
|||||||
|
|
||||||
public void addSetup(){
|
public void addSetup(){
|
||||||
slots.row();
|
slots.row();
|
||||||
slots.addImageTextButton("$save.new", "icon-add", 14 * 3, () ->
|
slots.addImageTextButton("$save.new", "icon-add", iconsize, () ->
|
||||||
ui.showTextInput("$save", "$save.newslot", "", text -> {
|
ui.showTextInput("$save", "$save.newslot", "", text -> {
|
||||||
ui.loadAnd("$saving", () -> {
|
ui.loadAnd("$saving", () -> {
|
||||||
control.saves.addSave(text);
|
control.saves.addSave(text);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
|
|
||||||
Consumer<SettingsTable> s = table -> {
|
Consumer<SettingsTable> s = table -> {
|
||||||
table.row();
|
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);
|
game = new SettingsTable(s);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
|
|
||||||
addCloseButton();
|
addCloseButton();
|
||||||
|
|
||||||
buttons.addImageTextButton("$database", "icon-database", 14 * 2, () -> {
|
buttons.addImageTextButton("$database", "icon-database", iconsize, () -> {
|
||||||
hide();
|
hide();
|
||||||
ui.database.show();
|
ui.database.show();
|
||||||
}).size(210f, 64f);
|
}).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.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");
|
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)
|
((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);
|
button.getImage().setColor(!locked(node.node) ? Color.WHITE : Color.GRAY);
|
||||||
});
|
});
|
||||||
addChild(button);
|
addChild(button);
|
||||||
@@ -253,7 +253,7 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
infoTable.table("content-background", b -> {
|
infoTable.table("content-background", b -> {
|
||||||
b.margin(0).left().defaults().left();
|
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.add().grow();
|
||||||
b.table(desc -> {
|
b.table(desc -> {
|
||||||
desc.left().defaults().left();
|
desc.left().defaults().left();
|
||||||
@@ -280,7 +280,7 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
|
|
||||||
if(mobile && locked(node)){
|
if(mobile && locked(node)){
|
||||||
b.row();
|
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);
|
.disabled(i -> !data.hasItems(node.requirements)).growX().height(44f).colspan(3);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class ZoneInfoDialog extends FloatingDialog{
|
|||||||
|
|
||||||
cont.table(cont -> {
|
cont.table(cont -> {
|
||||||
if(zone.locked()){
|
if(zone.locked()){
|
||||||
cont.addImage("icon-zone-locked");
|
cont.addImage("icon-locked");
|
||||||
cont.row();
|
cont.row();
|
||||||
cont.add("$locked").padBottom(6);
|
cont.add("$locked").padBottom(6);
|
||||||
cont.row();
|
cont.row();
|
||||||
@@ -71,9 +71,9 @@ public class ZoneInfoDialog extends FloatingDialog{
|
|||||||
r.add("$complete").colspan(2).left();
|
r.add("$complete").colspan(2).left();
|
||||||
r.row();
|
r.row();
|
||||||
for(ZoneRequirement other : zone.zoneRequirements){
|
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.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);
|
.color(other.zone.bestWave() >= other.wave ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
|
||||||
r.row();
|
r.row();
|
||||||
}
|
}
|
||||||
@@ -89,7 +89,7 @@ public class ZoneInfoDialog extends FloatingDialog{
|
|||||||
for(Block block : zone.blockRequirements){
|
for(Block block : zone.blockRequirements){
|
||||||
r.addImage(block.icon(Icon.small)).size(8 * 3).padRight(4);
|
r.addImage(block.icon(Icon.small)).size(8 * 3).padRight(4);
|
||||||
r.add(block.localizedName).color(Color.LIGHT_GRAY);
|
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);
|
.color(data.isUnlocked(block) ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
|
||||||
r.row();
|
r.row();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ public class HudFragment extends Fragment{
|
|||||||
private Table lastUnlockLayout;
|
private Table lastUnlockLayout;
|
||||||
private boolean shown = true;
|
private boolean shown = true;
|
||||||
private float dsize = 59;
|
private float dsize = 59;
|
||||||
private float isize = 40;
|
|
||||||
|
|
||||||
private float coreAttackTime;
|
private float coreAttackTime;
|
||||||
private float lastCoreHP;
|
private float lastCoreHP;
|
||||||
@@ -70,10 +69,10 @@ public class HudFragment extends Fragment{
|
|||||||
select.left();
|
select.left();
|
||||||
select.defaults().size(dsize).left();
|
select.defaults().size(dsize).left();
|
||||||
|
|
||||||
select.addImageButton("icon-menu", "clear", isize, ui.paused::show);
|
select.addImageButton("icon-menu-large", "clear", iconsize, ui.paused::show);
|
||||||
flip = select.addImageButton("icon-arrow-up", "clear", isize, this::toggleMenus).get();
|
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()){
|
if(Net.active()){
|
||||||
ui.listfrag.toggle();
|
ui.listfrag.toggle();
|
||||||
}else{
|
}else{
|
||||||
@@ -88,7 +87,7 @@ public class HudFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
}).get();
|
}).get();
|
||||||
|
|
||||||
select.addImageButton("icon-settings", "clear", isize, () -> {
|
select.addImageButton("icon-settings", "clear", iconsize, () -> {
|
||||||
if(Net.active() && mobile){
|
if(Net.active() && mobile){
|
||||||
if(ui.chatfrag.chatOpen()){
|
if(ui.chatfrag.chatOpen()){
|
||||||
ui.chatfrag.hide();
|
ui.chatfrag.hide();
|
||||||
@@ -104,7 +103,7 @@ public class HudFragment extends Fragment{
|
|||||||
if(Net.active() && mobile){
|
if(Net.active() && mobile){
|
||||||
i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-chat");
|
i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-chat");
|
||||||
}else{
|
}else{
|
||||||
i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-database-small");
|
i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-database");
|
||||||
}
|
}
|
||||||
}).get();
|
}).get();
|
||||||
|
|
||||||
@@ -197,7 +196,7 @@ public class HudFragment extends Fragment{
|
|||||||
if(enableUnitEditing){
|
if(enableUnitEditing){
|
||||||
|
|
||||||
t.row();
|
t.row();
|
||||||
t.addImageTextButton("$editor.spawn", "icon-add", 8 * 3, () -> {
|
t.addImageTextButton("$editor.spawn", "icon-add", iconsize, () -> {
|
||||||
FloatingDialog dialog = new FloatingDialog("$editor.spawn");
|
FloatingDialog dialog = new FloatingDialog("$editor.spawn");
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(UnitType type : content.<UnitType>getBy(ContentType.unit)){
|
for(UnitType type : content.<UnitType>getBy(ContentType.unit)){
|
||||||
@@ -216,7 +215,7 @@ public class HudFragment extends Fragment{
|
|||||||
float[] position = {0, 0};
|
float[] position = {0, 0};
|
||||||
|
|
||||||
t.row();
|
t.row();
|
||||||
t.addImageTextButton("$editor.removeunit", "icon-quit", "toggle", 8 * 3, () -> {
|
t.addImageTextButton("$editor.removeunit", "icon-quit", "toggle", iconsize, () -> {
|
||||||
|
|
||||||
}).fillX().update(b -> {
|
}).fillX().update(b -> {
|
||||||
boolean[] found = {false};
|
boolean[] found = {false};
|
||||||
@@ -430,7 +429,7 @@ public class HudFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
table.margin(12);
|
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.add(text).wrap().width(280f).get().setAlignment(Align.center, Align.center);
|
||||||
table.pack();
|
table.pack();
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class MenuFragment extends Fragment{
|
|||||||
container.setSize(Core.graphics.getWidth(), Core.graphics.getHeight());
|
container.setSize(Core.graphics.getWidth(), Core.graphics.getHeight());
|
||||||
|
|
||||||
float size = 120f;
|
float size = 120f;
|
||||||
float isize = 14f * 4;
|
float isize = iconsize;
|
||||||
container.defaults().size(size).pad(5).padTop(4f);
|
container.defaults().size(size).pad(5).padTop(4f);
|
||||||
|
|
||||||
MobileButton
|
MobileButton
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ public class PlacementFragment extends Fragment{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
categories.addImageButton("icon-" + cat.name(), "clear-toggle", 16 * 2, () -> {
|
categories.addImageButton("icon-" + cat.name(), "clear-toggle", iconsize, () -> {
|
||||||
currentCategory = cat;
|
currentCategory = cat;
|
||||||
rebuildCategory.run();
|
rebuildCategory.run();
|
||||||
}).group(group).update(i -> i.setChecked(currentCategory == cat));
|
}).group(group).update(i -> i.setChecked(currentCategory == cat));
|
||||||
|
|||||||