Various icon changes

This commit is contained in:
Anuken
2020-01-17 13:57:04 -05:00
parent 4f29c80814
commit c3d2351b2d
173 changed files with 1665 additions and 217 deletions

View File

@@ -105,7 +105,6 @@ public class UI implements ApplicationListener, Loadable{
Tex.load();
Icon.load();
Icon_.load();
Styles.load();
Tex.loadStyles();
@@ -156,7 +155,6 @@ public class UI implements ApplicationListener, Loadable{
}
parameter.fontParameters.magFilter = TextureFilter.Linear;
parameter.fontParameters.minFilter = TextureFilter.Linear;
parameter.fontParameters.size = fontParameter().size;
parameter.fontParameters.packer = packer;
return super.loadSync(manager, fileName, file, parameter);
}
@@ -164,6 +162,7 @@ public class UI implements ApplicationListener, Loadable{
FreeTypeFontParameter param = new FreeTypeFontParameter(){{
borderColor = Color.darkGray;
size = (int)(Scl.scl(18f));
incremental = true;
}};
@@ -208,16 +207,18 @@ public class UI implements ApplicationListener, Loadable{
public TextureRegionDrawable getGlyph(BitmapFont font, char glyph){
Glyph g = font.getData().getGlyph(glyph);
if(g == null) throw new IllegalArgumentException("No glyph: " + glyph + " (" + (int)glyph + ")");
float size = Math.max(g.width, g.height);
float aspect = (float)g.height / g.width;
TextureRegionDrawable draw = new TextureRegionDrawable(new TextureRegion(font.getRegion().getTexture(), g.u, g.v2, g.u2, g.v)){
@Override
public void draw(float x, float y, float width, float height){
//enforce even aspect ratio, which will always be incorrect for complicate reasons
super.draw(x, y, width, width * aspect);
super.draw(x + Math.max(g.height-g.width, 0)/2, y, g.width, g.height);
}
};
draw.setMinWidth(draw.getRegion().getWidth());
draw.setMinHeight(draw.getRegion().getHeight());
draw.setMinWidth(size);
draw.setMinHeight(size);
return draw;
}
@@ -228,6 +229,17 @@ public class UI implements ApplicationListener, Loadable{
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(){{
size = (int)(Scl.scl(28f));
incremental = true;
}})).loaded = f -> Fonts.icon = (BitmapFont)f;
}
public TextureRegionDrawable getIcon(String name){
if(Icon.icons.containsKey(name)){
return Icon.icons.get(name);
}
return Core.atlas.getDrawable("error");
}
static FreeTypeFontParameter fontParameter(){

View File

@@ -66,30 +66,30 @@ public class MapEditorDialog extends Dialog implements Disposable{
menu.cont.table(t -> {
t.defaults().size(swidth, 60f).padBottom(5).padRight(5).padLeft(5);
t.addImageTextButton("$editor.savemap", Icon.floppy16Small, this::save);
t.addImageTextButton("$editor.savemap", Icon.save, this::save);
t.addImageTextButton("$editor.mapinfo", Icon.pencilSmall, () -> {
t.addImageTextButton("$editor.mapinfo", Icon.pencil, () -> {
infoDialog.show();
menu.hide();
});
t.row();
t.addImageTextButton("$editor.generate", Icon.editorSmall, () -> {
t.addImageTextButton("$editor.generate", Icon.terrain, () -> {
generateDialog.show(generateDialog::applyToEditor);
menu.hide();
});
t.addImageTextButton("$editor.resize", Icon.resizeSmall, () -> {
t.addImageTextButton("$editor.resize", Icon.resize, () -> {
resizeDialog.show();
menu.hide();
});
t.row();
t.addImageTextButton("$editor.import", Icon.loadMapSmall, () ->
t.addImageTextButton("$editor.import", Icon.download, () ->
createDialog("$editor.import",
"$editor.importmap", "$editor.importmap.description", Icon.loadMap, (Runnable)loadDialog::show,
"$editor.importmap", "$editor.importmap.description", Icon.download, (Runnable)loadDialog::show,
"$editor.importfile", "$editor.importfile.description", Icon.file, (Runnable)() ->
platform.showFileChooser(true, mapExtension, file -> ui.loadAnd(() -> {
maps.tryCatchMapError(() -> {
@@ -115,7 +115,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
})))
);
t.addImageTextButton("$editor.export", Icon.saveMapSmall, () -> {
t.addImageTextButton("$editor.export", Icon.upload, () -> {
if(!ios){
platform.showFileChooser(false, mapExtension, file -> {
ui.loadAnd(() -> {
@@ -148,7 +148,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
menu.cont.row();
if(steam){
menu.cont.addImageTextButton("$editor.publish.workshop", Icon.linkSmall, () -> {
menu.cont.addImageTextButton("$editor.publish.workshop", Icon.link, () -> {
Map builtin = maps.all().find(m -> m.name().equals(editor.getTags().get("name", "").trim()));
if(editor.getTags().containsKey("steamid") && builtin != null && !builtin.custom){
@@ -181,11 +181,11 @@ public class MapEditorDialog extends Dialog implements Disposable{
menu.cont.row();
}
menu.cont.addImageTextButton("$editor.ingame", Icon.arrowSmall, this::playtest).padTop(!steam ? -3 : 1).size(swidth * 2f + 10, 60f);
menu.cont.addImageTextButton("$editor.ingame", Icon.right, this::playtest).padTop(!steam ? -3 : 1).size(swidth * 2f + 10, 60f);
menu.cont.row();
menu.cont.addImageTextButton("$quit", Icon.backSmall, () -> {
menu.cont.addImageTextButton("$quit", Icon.exit, () -> {
tryExit();
menu.hide();
}).size(swidth * 2f + 10, 60f);
@@ -427,7 +427,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
Cons<EditorTool> addTool = tool -> {
ImageButton button = new ImageButton(Core.atlas.drawable("icon-" + tool.name() + "-small"), Styles.clearTogglei);
ImageButton button = new ImageButton(Core.atlas.drawable("Icon." + tool.name() + "-"), Styles.clearTogglei);
button.clicked(() -> {
view.setTool(tool);
if(lastTable[0] != null){
@@ -503,16 +503,16 @@ public class MapEditorDialog extends Dialog implements Disposable{
tools.defaults().size(size, size);
tools.addImageButton(Icon.menuLargeSmall, Styles.cleari, menu::show);
tools.addImageButton(Icon.menu, Styles.cleari, menu::show);
ImageButton grid = tools.addImageButton(Icon.gridSmall, Styles.clearTogglei, () -> view.setGrid(!view.isGrid())).get();
ImageButton grid = tools.addImageButton(Icon.grid, Styles.clearTogglei, () -> view.setGrid(!view.isGrid())).get();
addTool.get(EditorTool.zoom);
tools.row();
ImageButton undo = tools.addImageButton(Icon.undoSmall, Styles.cleari, editor::undo).get();
ImageButton redo = tools.addImageButton(Icon.redoSmall, Styles.cleari, editor::redo).get();
ImageButton undo = tools.addImageButton(Icon.undo, Styles.cleari, editor::undo).get();
ImageButton redo = tools.addImageButton(Icon.redo, Styles.cleari, editor::redo).get();
addTool.get(EditorTool.pick);
@@ -534,7 +534,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
addTool.get(EditorTool.fill);
addTool.get(EditorTool.spray);
ImageButton rotate = tools.addImageButton(Icon.arrow16Small, Styles.cleari, () -> editor.rotation = (editor.rotation + 1) % 4).get();
ImageButton rotate = tools.addImageButton(Icon.right, Styles.cleari, () -> editor.rotation = (editor.rotation + 1) % 4).get();
rotate.getImage().update(() -> {
rotate.getImage().setRotation(editor.rotation * 90);
rotate.getImage().setOrigin(Align.center);

View File

@@ -235,24 +235,24 @@ public class MapGenerateDialog extends FloatingDialog{
t.table(b -> {
ImageButtonStyle style = Styles.cleari;
b.defaults().size(50f);
b.addImageButton(Icon.refreshSmall, style, () -> {
b.addImageButton(Icon.refresh, style, () -> {
filter.randomize();
update();
});
b.addImageButton(Icon.arrowUpSmall, style, () -> {
b.addImageButton(Icon.upOpen, style, () -> {
int idx = filters.indexOf(filter);
filters.swap(idx, Math.max(0, idx - 1));
rebuildFilters();
update();
});
b.addImageButton(Icon.arrowDownSmall, style, () -> {
b.addImageButton(Icon.downOpen, style, () -> {
int idx = filters.indexOf(filter);
filters.swap(idx, Math.min(filters.size - 1, idx + 1));
rebuildFilters();
update();
});
b.addImageButton(Icon.trashSmall, style, () -> {
b.addImageButton(Icon.trash, style, () -> {
filters.remove(filter);
rebuildFilters();
update();

View File

@@ -67,7 +67,7 @@ public class DesktopInput extends InputHandler{
Core.keybinds.get(Binding.schematic_flip_y).key.toString())).style(Styles.outlineLabel);
b.row();
b.table(a -> {
a.addImageTextButton("$schematic.add", Icon.saveSmall, this::showSchematicSave).colspan(2).size(250f, 50f).disabled(f -> lastSchematic == null || lastSchematic.file != null);
a.addImageTextButton("$schematic.add", Icon.save, this::showSchematicSave).colspan(2).size(250f, 50f).disabled(f -> lastSchematic == null || lastSchematic.file != null);
});
}).margin(6f);
});
@@ -256,7 +256,7 @@ public class DesktopInput extends InputHandler{
table.row();
table.left().margin(0f).defaults().size(48f).left();
table.addImageButton(Icon.pasteSmall, Styles.clearPartiali, () -> {
table.addImageButton(Icon.paste, Styles.clearPartiali, () -> {
ui.schematics.show();
});
}

View File

@@ -179,19 +179,19 @@ public class MobileInput extends InputHandler implements GestureListener{
table.row();
table.left().margin(0f).defaults().size(48f);
table.addImageButton(Icon.breakSmall, Styles.clearTogglePartiali, () -> {
table.addImageButton(Icon.hammer, Styles.clearTogglePartiali, () -> {
mode = mode == breaking ? block == null ? none : placing : breaking;
lastBlock = block;
}).update(l -> l.setChecked(mode == breaking)).name("breakmode");
//diagonal swap button
table.addImageButton(Icon.diagonalSmall, Styles.clearTogglePartiali, () -> {
table.addImageButton(Icon.diagonal, Styles.clearTogglePartiali, () -> {
Core.settings.put("swapdiagonal", !Core.settings.getBool("swapdiagonal"));
Core.settings.save();
}).update(l -> l.setChecked(Core.settings.getBool("swapdiagonal")));
//rotate button
table.addImageButton(Icon.arrowSmall, Styles.clearTogglePartiali, () -> {
table.addImageButton(Icon.right, Styles.clearTogglePartiali, () -> {
if(block != null && block.rotate){
rotation = Mathf.mod(rotation + 1, 4);
}else{
@@ -205,12 +205,12 @@ public class MobileInput extends InputHandler implements GestureListener{
boolean arrow = block != null && block.rotate;
i.getImage().setRotationOrigin(!arrow ? 0 : rotation * 90, Align.center);
i.getStyle().imageUp = arrow ? Icon.arrowSmall : Icon.pasteSmall;
i.getStyle().imageUp = arrow ? Icon.right : Icon.paste;
i.setChecked(!arrow && schematicMode);
});
//confirm button
table.addImageButton(Icon.checkSmall, Styles.clearPartiali, () -> {
table.addImageButton(Icon.ok, Styles.clearPartiali, () -> {
for(BuildRequest request : selectRequests){
Tile tile = request.tile();
@@ -253,7 +253,7 @@ public class MobileInput extends InputHandler implements GestureListener{
group.fill(t -> {
t.bottom().left().visible(() -> (player.isBuilding() || block != null || mode == breaking || !selectRequests.isEmpty()) && !schem.get());
t.addImageTextButton("$cancel", Icon.cancelSmall, () -> {
t.addImageTextButton("$cancel", Icon.cancel, () -> {
player.clearBuilding();
selectRequests.clear();
mode = none;
@@ -269,15 +269,15 @@ public class MobileInput extends InputHandler implements GestureListener{
ImageButtonStyle style = Styles.clearPartiali;
b.addImageButton(Icon.floppySmall, style, this::showSchematicSave).disabled(f -> lastSchematic == null || lastSchematic.file != null);
b.addImageButton(Icon.cancelSmall, style, () -> {
b.addImageButton(Icon.save, style, this::showSchematicSave).disabled(f -> lastSchematic == null || lastSchematic.file != null);
b.addImageButton(Icon.cancel, style, () -> {
selectRequests.clear();
});
b.row();
b.addImageButton(Icon.flipSmall, style, () -> flipRequests(selectRequests, true));
b.addImageButton(Icon.flipSmall, style, () -> flipRequests(selectRequests, false)).update(i -> i.getImage().setRotationOrigin(90f, Align.center));
b.addImageButton(Icon.flipX, style, () -> flipRequests(selectRequests, true));
b.addImageButton(Icon.flipY, style, () -> flipRequests(selectRequests, false));
b.row();
b.addImageButton(Icon.rotateSmall, style, () -> rotateRequests(selectRequests, 1));
b.addImageButton(Icon.rotate, style, () -> rotateRequests(selectRequests, 1));
}).margin(4f);
});

View File

@@ -76,15 +76,15 @@ public abstract class FilterOption{
@Override
public void build(Table table){
table.addButton(b -> b.addImage(supplier.get().icon(mindustry.ui.Cicon.small)).update(i -> ((TextureRegionDrawable)i.getDrawable())
.setRegion(supplier.get() == Blocks.air ? Core.atlas.find("icon-none") : supplier.get().icon(mindustry.ui.Cicon.small))).size(8 * 3), () -> {
table.addButton(b -> b.addImage(supplier.get().icon(Cicon.small)).update(i -> ((TextureRegionDrawable)i.getDrawable())
.setRegion(supplier.get() == Blocks.air ? Core.atlas.find("Icon.none") : supplier.get().icon(Cicon.small))).size(8 * 3), () -> {
FloatingDialog dialog = new FloatingDialog("");
dialog.setFillParent(false);
int i = 0;
for(Block block : Vars.content.blocks()){
if(!filter.get(block)) continue;
dialog.cont.addImage(block == Blocks.air ? Core.atlas.find("icon-none-small") : block.icon(Cicon.medium)).size(8 * 4).pad(3).get().clicked(() -> {
dialog.cont.addImage(block == Blocks.air ? Core.atlas.find("Icon.none-") : block.icon(Cicon.medium)).size(8 * 4).pad(3).get().clicked(() -> {
consumer.get(block);
dialog.hide();
changed.run();

View File

@@ -174,6 +174,7 @@ public class Mods implements Loadable{
});
}
//TODO !!!! fix the UI page here
Core.atlas = packer.flush(filter, new TextureAtlas());
Core.atlas.setErrorRegion("error");
Log.debug("Total pages: {0}", Core.atlas.getTextures().size);
@@ -389,12 +390,12 @@ public class Mods implements Loadable{
d.left().marginLeft(15f);
for(Content c : m.erroredContent){
d.add(c.minfo.sourceFile.nameWithoutExtension()).left().padRight(10);
d.addImageTextButton("$details", Icon.arrowDownSmall, Styles.transt, () -> {
d.addImageTextButton("$details", Icon.downOpen, Styles.transt, () -> {
new Dialog(""){{
setFillParent(true);
cont.pane(e -> e.add(c.minfo.error)).grow();
cont.row();
cont.addImageTextButton("$ok", Icon.backSmall, this::hide).size(240f, 60f);
cont.addImageTextButton("$ok", Icon.left, this::hide).size(240f, 60f);
}}.show();
}).size(190f, 50f).left().marginLeft(6);
d.row();

View File

@@ -20,7 +20,7 @@ public class Scripts implements Disposable{
Time.mark();
context = Vars.platform.getScriptContext();
context.setClassShutter(type -> !blacklist.contains(type.toLowerCase()::contains));
context.setClassShutter(type -> !blacklist.contains(type.toLowerCase()::contains) || type.contains("mindustry.net"));
context.getWrapFactory().setJavaPrimitiveWrap(false);
scope = new ImporterTopLevel(context);

View File

@@ -105,7 +105,7 @@ public class BeControl{
});
dialog.cont.add(new Bar(() -> length[0] == 0 ? Core.bundle.get("be.updating") : (int)(progress[0] * length[0]) / 1024/ 1024 + "/" + length[0]/1024/1024 + " MB", () -> Pal.accent, () -> progress[0])).width(400f).height(70f);
dialog.buttons.addImageTextButton("$cancel", Icon.cancelSmall, () -> {
dialog.buttons.addImageTextButton("$cancel", Icon.cancel, () -> {
cancel[0] = true;
dialog.hide();
}).size(210f, 64f);

View File

@@ -6,5 +6,6 @@ public class Fonts{
public static BitmapFont def;
public static BitmapFont outline;
public static BitmapFont chat;
public static BitmapFont icon;
}

View File

@@ -55,7 +55,7 @@ public class ColorPicker extends FloatingDialog{
buttons.clear();
addCloseButton();
buttons.addImageTextButton("$ok", Icon.checkSmall, () -> {
buttons.addImageTextButton("$ok", Icon.ok, () -> {
cons.get(current);
hide();
});

View File

@@ -17,7 +17,7 @@ public class ControlsDialog extends KeybindDialog{
@Override
public void addCloseButton(){
buttons.addImageTextButton("$back", Icon.arrowLeftSmall, this::hide).size(230f, 64f);
buttons.addImageTextButton("$back", Icon.left, this::hide).size(230f, 64f);
keyDown(key -> {
if(key == KeyCode.ESCAPE || key == KeyCode.BACK)

View File

@@ -35,12 +35,12 @@ public class CustomRulesDialog extends FloatingDialog{
banDialog.addCloseButton();
banDialog.shown(this::rebuildBanned);
banDialog.buttons.addImageTextButton("$addall", Icon.arrow16Small, () -> {
banDialog.buttons.addImageTextButton("$addall", Icon.add, () -> {
rules.bannedBlocks.addAll(content.blocks().select(Block::isBuildable));
rebuildBanned();
}).size(180, 64f);
banDialog.buttons.addImageTextButton("$clear", Icon.trash16Small, () -> {
banDialog.buttons.addImageTextButton("$clear", Icon.trash, () -> {
rules.bannedBlocks.clear();
rebuildBanned();
}).size(180, 64f);
@@ -72,7 +72,7 @@ public class CustomRulesDialog extends FloatingDialog{
b.addImage(block.icon(Cicon.medium)).size(Cicon.medium.size).padRight(3);
b.add(block.localizedName).color(Color.lightGray).padLeft(3).growX().left().wrap();
b.addImageButton(Icon.cancelSmall, Styles.clearPartiali, () -> {
b.addImageButton(Icon.cancel, Styles.clearPartiali, () -> {
rules.bannedBlocks.remove(block);
rebuildBanned();
}).size(70f).pad(-4f).padLeft(0f);
@@ -84,7 +84,7 @@ public class CustomRulesDialog extends FloatingDialog{
}
}).get().setScrollYForce(previousScroll);
banDialog.cont.row();
banDialog.cont.addImageTextButton("$add", Icon.addSmall, () -> {
banDialog.cont.addImageTextButton("$add", Icon.add, () -> {
FloatingDialog dialog = new FloatingDialog("$add");
dialog.cont.pane(t -> {
t.left().margin(14f);

View File

@@ -55,7 +55,7 @@ public class DatabaseDialog extends FloatingDialog{
for(int i = 0; i < array.size; i++){
UnlockableContent unlock = (UnlockableContent)array.get(i);
Image image = unlocked(unlock) ? new Image(unlock.icon(Cicon.medium)) : new Image(Icon.lockedSmall, Pal.gray);
Image image = unlocked(unlock) ? new Image(unlock.icon(Cicon.medium)) : new Image(Icon.lockOpen, Pal.gray);
list.add(image).size(8*4).pad(3);
ClickListener listener = new ClickListener();
image.addListener(listener);

View File

@@ -235,7 +235,7 @@ public class DeployDialog extends FloatingDialog{
button.labelWrap(zone.localizedName).style(Styles.outlineLabel).width(140).growX().get().setAlignment(Align.center);
}else{
Cons<Element> flasher = zone.canUnlock() && !hidden(zone) ? e -> e.update(() -> e.getColor().set(Color.white).lerp(Pal.accent, Mathf.absin(3f, 1f))) : e -> {};
flasher.get(button.addImage(Icon.locked).get());
flasher.get(button.addImage(Icon.lock).get());
button.row();
flasher.get(button.add("$locked").get());
}

View File

@@ -92,15 +92,15 @@ public class FileChooser extends FloatingDialog{
Table icontable = new Table();
ImageButton up = new ImageButton(Icon.folderParent);
ImageButton up = new ImageButton(Icon.upOpen);
up.clicked(() -> {
directory = directory.parent();
updateFiles(true);
});
ImageButton back = new ImageButton(Icon.arrowLeft);
ImageButton forward = new ImageButton(Icon.arrowRight);
ImageButton back = new ImageButton(Icon.left);
ImageButton forward = new ImageButton(Icon.right);
forward.clicked(() -> stack.forward());
back.clicked(() -> stack.back());
@@ -185,7 +185,7 @@ public class FileChooser extends FloatingDialog{
files.top().left();
Fi[] names = getFileNames();
Image upimage = new Image(Icon.folderParentSmall);
Image upimage = new Image(Icon.upOpen);
TextButton upbutton = new TextButton(".." + directory.toString(), Styles.clearTogglet);
upbutton.clicked(() -> {
directory = directory.parent();
@@ -229,7 +229,7 @@ public class FileChooser extends FloatingDialog{
button.setChecked(filename.equals(filefield.getText()));
});
Image image = new Image(file.isDirectory() ? Icon.folderSmall : Icon.fileTextSmall);
Image image = new Image(file.isDirectory() ? Icon.folder : Icon.fileText);
button.add(image).padRight(4f).padLeft(4);
button.getCells().reverse();

View File

@@ -56,7 +56,7 @@ public class FloatingDialog extends Dialog{
@Override
public void addCloseButton(){
buttons.defaults().size(210f, 64f);
buttons.addImageTextButton("$back", Icon.arrowLeft, this::hide).size(210f, 64f);
buttons.addImageTextButton("$back", Icon.left, this::hide).size(210f, 64f);
keyDown(key -> {
if(key == KeyCode.ESCAPE || key == KeyCode.BACK){

View File

@@ -122,7 +122,7 @@ public class JoinDialog extends FloatingDialog{
inner.add(button.getLabel()).growX();
inner.addImageButton(Icon.arrowUpSmall, Styles.emptyi, () -> {
inner.addImageButton(Icon.upOpen, Styles.emptyi, () -> {
int index = servers.indexOf(server);
if(index > 0){
servers.remove(index);
@@ -141,16 +141,16 @@ public class JoinDialog extends FloatingDialog{
}).margin(3f).padTop(6f).top().right();
inner.addImageButton(Icon.loadingSmall, Styles.emptyi, () -> {
inner.addImageButton(Icon.refresh, Styles.emptyi, () -> {
refreshServer(server);
}).margin(3f).padTop(6f).top().right();
inner.addImageButton(Icon.pencilSmall, Styles.emptyi, () -> {
inner.addImageButton(Icon.pencil, Styles.emptyi, () -> {
renaming = server;
add.show();
}).margin(3f).padTop(6f).top().right();
inner.addImageButton(Icon.trash16Small, Styles.emptyi, () -> {
inner.addImageButton(Icon.trash, Styles.emptyi, () -> {
ui.showConfirm("$confirm", "$server.delete", () -> {
servers.removeValue(server, true);
saveServers();
@@ -303,7 +303,7 @@ public class JoinDialog extends FloatingDialog{
local.background(Tex.button);
local.add("$hosts.none").pad(10f);
local.add().growX();
local.addImageButton(Icon.loading, this::refreshLocal).pad(-12f).padLeft(0).size(70f);
local.addImageButton(Icon.refresh, this::refreshLocal).pad(-12f).padLeft(0).size(70f);
}else{
local.background(null);
}

View File

@@ -71,7 +71,7 @@ public class LoadDialog extends FloatingDialog{
title.table(t -> {
t.right();
t.addImageButton(Icon.floppy, Styles.emptytogglei, () -> {
t.addImageButton(Icon.save, Styles.emptytogglei, () -> {
slot.setAutosave(!slot.isAutosave());
}).checked(slot.isAutosave()).right();

View File

@@ -42,9 +42,9 @@ public class LoadoutDialog extends FloatingDialog{
}
});
buttons.addImageTextButton("$back", Icon.arrowLeft, this::hide).size(210f, 64f);
buttons.addImageTextButton("$back", Icon.left, this::hide).size(210f, 64f);
buttons.addImageTextButton("$settings.reset", Icon.refreshSmall, () -> {
buttons.addImageTextButton("$settings.reset", Icon.refresh, () -> {
resetter.run();
reseed();
updater.run();
@@ -83,7 +83,7 @@ public class LoadoutDialog extends FloatingDialog{
updater.run();
}).size(bsize);
t.addImageButton(Icon.pencilSmaller, Styles.cleari, () -> ui.showTextInput("$configure", stack.item.localizedName, 10, stack.amount + "", true, str -> {
t.addImageButton(Icon.pencil, Styles.cleari, () -> ui.showTextInput("$configure", stack.item.localizedName, 10, stack.amount + "", true, str -> {
if(Strings.canParsePostiveInt(str)){
int amount = Strings.parseInt(str);
if(amount >= 0 && amount <= capacity){

View File

@@ -68,7 +68,7 @@ public class MapPlayDialog extends FloatingDialog{
cont.add(selmode);
cont.row();
cont.addImageTextButton("$customize", Icon.toolsSmall, () -> dialog.show(rules, () -> rules = map.applyRules(selectedGamemode))).width(230);
cont.addImageTextButton("$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

View File

@@ -44,10 +44,10 @@ public class MapsDialog extends FloatingDialog{
buttons.clearChildren();
if(Core.graphics.isPortrait()){
buttons.addImageTextButton("$back", Icon.arrowLeft, this::hide).size(210f*2f, 64f).colspan(2);
buttons.addImageTextButton("$back", Icon.left, this::hide).size(210f*2f, 64f).colspan(2);
buttons.row();
}else{
buttons.addImageTextButton("$back", Icon.arrowLeft, this::hide).size(210f, 64f);
buttons.addImageTextButton("$back", Icon.left, this::hide).size(210f, 64f);
}
buttons.addImageTextButton("$editor.newmap", Icon.add, () -> {
@@ -67,7 +67,7 @@ public class MapsDialog extends FloatingDialog{
});
}).size(210f, 64f);
buttons.addImageTextButton("$editor.importmap", Icon.load, () -> {
buttons.addImageTextButton("$editor.importmap", Icon.download, () -> {
platform.showFileChooser(true, mapExtension, file -> {
ui.loadAnd(() -> {
maps.tryCatchMapError(() -> {
@@ -192,7 +192,7 @@ public class MapsDialog extends FloatingDialog{
table.row();
table.addImageTextButton("$editor.openin", Icon.loadMapSmall, () -> {
table.addImageTextButton("$editor.openin", Icon.download, () -> {
try{
Vars.ui.editor.beginEditMap(map.file);
dialog.hide();
@@ -203,7 +203,7 @@ public class MapsDialog extends FloatingDialog{
}
}).fillX().height(54f).marginLeft(10);
table.addImageTextButton(map.workshop && steam ? "$view.workshop" : "$delete", map.workshop && steam ? Icon.linkSmall : Icon.trash16Small, () -> {
table.addImageTextButton(map.workshop && steam ? "$view.workshop" : "$delete", map.workshop && steam ? Icon.link : Icon.trash, () -> {
if(map.workshop && steam){
platform.viewListing(map);
}else{

View File

@@ -120,18 +120,18 @@ public class ModsDialog extends FloatingDialog{
title.add("[accent]" + mod.meta.displayName() + "[lightgray] v" + mod.meta.version + (mod.enabled() ? "" : "\n" + Core.bundle.get("mod.disabled") + "")).width(200f).wrap();
title.add().growX();
title.addImageTextButton(mod.enabled() ? "$mod.disable" : "$mod.enable", mod.enabled() ? Icon.arrowDownSmall : Icon.arrowUpSmall, Styles.cleart, () -> {
title.addImageTextButton(mod.enabled() ? "$mod.disable" : "$mod.enable", mod.enabled() ? Icon.downOpen : Icon.upOpen, Styles.cleart, () -> {
mods.setEnabled(mod, !mod.enabled());
setup();
}).height(50f).margin(8f).width(130f).disabled(!mod.isSupported());
if(steam && !mod.hasSteamID()){
title.addImageButton(Icon.loadMapSmall, Styles.cleari, () -> {
title.addImageButton(Icon.download, Styles.cleari, () -> {
platform.publish(mod);
}).size(50f);
}
title.addImageButton(mod.hasSteamID() ? Icon.linkSmall : Icon.trash16Small, Styles.cleari, () -> {
title.addImageButton(mod.hasSteamID() ? Icon.link : Icon.trash, Styles.cleari, () -> {
if(!mod.hasSteamID()){
ui.showConfirm("$confirm", "$mod.remove.confirm", () -> {
mods.removeMod(mod);

View File

@@ -76,22 +76,22 @@ public class PausedDialog extends FloatingDialog{
}else{
cont.defaults().size(130f).pad(5);
cont.addRowImageTextButton("$back", Icon.play2, this::hide);
cont.addRowImageTextButton("$settings", Icon.tools, ui.settings::show);
cont.addRowImageTextButton("$back", Icon.play, this::hide);
cont.addRowImageTextButton("$settings", Icon.settings, ui.settings::show);
if(!world.isZone() && !state.isEditor()){
cont.addRowImageTextButton("$save", Icon.save, save::show);
cont.row();
cont.addRowImageTextButton("$load", Icon.load, load::show).disabled(b -> net.active());
cont.addRowImageTextButton("$load", Icon.download, load::show).disabled(b -> net.active());
}else{
cont.row();
}
cont.addRowImageTextButton("$hostserver.mobile", Icon.host, ui.host::show).disabled(b -> net.active());
cont.addRowImageTextButton("$quit", Icon.quit, this::showQuitConfirm).update(s -> {
cont.addRowImageTextButton("$quit", Icon.exit, this::showQuitConfirm).update(s -> {
s.setText(control.saves.getCurrent() != null && control.saves.getCurrent().isAutosave() ? "$save.quit" : "$quit");
s.getLabelCell().growX().wrap();
});

View File

@@ -32,7 +32,7 @@ public class SchematicsDialog extends FloatingDialog{
shouldPause = true;
addCloseButton();
buttons.addImageTextButton("$schematic.import", Icon.loadMapSmall, this::showImport);
buttons.addImageTextButton("$schematic.import", Icon.download, this::showImport);
shown(this::setup);
onResize(this::setup);
}
@@ -79,15 +79,15 @@ public class SchematicsDialog extends FloatingDialog{
ImageButtonStyle style = Styles.clearPartiali;
buttons.addImageButton(Icon.infoSmall, style, () -> {
buttons.addImageButton(Icon.info, style, () -> {
showInfo(s);
});
buttons.addImageButton(Icon.loadMapSmall, style, () -> {
buttons.addImageButton(Icon.download, style, () -> {
showExport(s);
});
buttons.addImageButton(Icon.pencilSmall, style, () -> {
buttons.addImageButton(Icon.pencil, style, () -> {
ui.showTextInput("$schematic.rename", "$name", s.name(), res -> {
s.tags.put("name", res);
s.save();
@@ -96,9 +96,9 @@ public class SchematicsDialog extends FloatingDialog{
});
if(s.hasSteamID()){
buttons.addImageButton(Icon.linkSmall, style, () -> platform.viewListing(s));
buttons.addImageButton(Icon.link, style, () -> platform.viewListing(s));
}else{
buttons.addImageButton(Icon.trash16Small, style, () -> {
buttons.addImageButton(Icon.trash, style, () -> {
if(s.mod != null){
ui.showInfo(Core.bundle.format("mod.item.remove", s.mod.meta.displayName()));
}else{
@@ -154,7 +154,7 @@ public class SchematicsDialog extends FloatingDialog{
TextButtonStyle style = Styles.cleart;
t.defaults().size(280f, 60f).left();
t.row();
t.addImageTextButton("$schematic.copy.import", Icon.copySmall, style, () -> {
t.addImageTextButton("$schematic.copy.import", Icon.copy, style, () -> {
dialog.hide();
try{
Schematic s = Schematics.readBase64(Core.app.getClipboardText());
@@ -168,7 +168,7 @@ public class SchematicsDialog extends FloatingDialog{
}
}).marginLeft(12f).disabled(b -> Core.app.getClipboardText() == null || !Core.app.getClipboardText().startsWith(schematicBaseStart));
t.row();
t.addImageTextButton("$schematic.importfile", Icon.saveMapSmall, style, () -> platform.showFileChooser(true, schematicExtension, file -> {
t.addImageTextButton("$schematic.importfile", Icon.download, style, () -> platform.showFileChooser(true, schematicExtension, file -> {
dialog.hide();
try{
@@ -183,7 +183,7 @@ public class SchematicsDialog extends FloatingDialog{
})).marginLeft(12f);
t.row();
if(steam){
t.addImageTextButton("$schematic.browseworkshop", Icon.wikiSmall, style, () -> {
t.addImageTextButton("$schematic.browseworkshop", Icon.book, style, () -> {
dialog.hide();
platform.openWorkshop();
}).marginLeft(12f);
@@ -203,18 +203,18 @@ public class SchematicsDialog extends FloatingDialog{
TextButtonStyle style = Styles.cleart;
t.defaults().size(280f, 60f).left();
if(steam && !s.hasSteamID()){
t.addImageTextButton("$schematic.shareworkshop", Icon.wikiSmall, style,
t.addImageTextButton("$schematic.shareworkshop", Icon.book, style,
() -> platform.publish(s)).marginLeft(12f);
t.row();
dialog.hide();
}
t.addImageTextButton("$schematic.copy", Icon.copySmall, style, () -> {
t.addImageTextButton("$schematic.copy", Icon.copy, style, () -> {
dialog.hide();
ui.showInfoFade("$copied");
Core.app.setClipboardText(schematics.writeBase64(s));
}).marginLeft(12f);
t.row();
t.addImageTextButton("$schematic.exportfile", Icon.saveMapSmall, style, () -> platform.showFileChooser(false, schematicExtension, file -> {
t.addImageTextButton("$schematic.exportfile", Icon.export, style, () -> platform.showFileChooser(false, schematicExtension, file -> {
dialog.hide();
try{
Schematics.write(s, file);
@@ -272,7 +272,7 @@ public class SchematicsDialog extends FloatingDialog{
if(wasSet){
super.draw();
}else{
Draw.rect(Icon.loading.getRegion(), x + width/2f, y + height/2f, width/4f, height/4f);
Draw.rect(Icon.refresh.getRegion(), x + width/2f, y + height/2f, width/4f, height/4f);
}
Draw.color(checked ? Pal.accent : borderColor);

View File

@@ -84,7 +84,7 @@ public class SettingsMenuDialog extends SettingsDialog{
t.defaults().size(270f, 60f).left();
TextButtonStyle style = Styles.cleart;
t.addImageTextButton("$settings.cleardata", Icon.trash16Small, style, () -> ui.showConfirm("$confirm", "$settings.clearall.confirm", () -> {
t.addImageTextButton("$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,7 +104,7 @@ public class SettingsMenuDialog extends SettingsDialog{
t.row();
t.addImageTextButton("$data.export", Icon.loadMapSmall, style, () -> {
t.addImageTextButton("$data.export", Icon.download, style, () -> {
if(ios){
Fi file = Core.files.local("mindustry-data-export.zip");
try{
@@ -128,7 +128,7 @@ public class SettingsMenuDialog extends SettingsDialog{
t.row();
t.addImageTextButton("$data.import", Icon.saveMapSmall, style, () -> ui.showConfirm("$confirm", "$data.import.confirm", () -> platform.showFileChooser(true, "zip", file -> {
t.addImageTextButton("$data.import", Icon.download, style, () -> ui.showConfirm("$confirm", "$data.import.confirm", () -> platform.showFileChooser(true, "zip", file -> {
try{
data.importData(file);
Core.app.exit();
@@ -146,7 +146,7 @@ public class SettingsMenuDialog extends SettingsDialog{
if(!ios){
t.row();
t.addImageTextButton("$data.openfolder", Icon.folderSmall, style, () -> Core.app.openFolder(Core.settings.getDataDirectory().absolutePath()));
t.addImageTextButton("$data.openfolder", Icon.folder, style, () -> Core.app.openFolder(Core.settings.getDataDirectory().absolutePath()));
}
});
@@ -362,7 +362,7 @@ public class SettingsMenuDialog extends SettingsDialog{
@Override
public void addCloseButton(){
buttons.addImageTextButton("$back", Icon.arrowLeftSmaller, () -> {
buttons.addImageTextButton("$back", Icon.leftOpen, () -> {
if(prefs.getChildren().first() != menu){
back();
}else{

View File

@@ -60,7 +60,7 @@ public class TechTreeDialog extends FloatingDialog{
addCloseButton();
buttons.addImageTextButton("$database", Icon.database, () -> {
buttons.addImageTextButton("$database", Icon.book, () -> {
hide();
ui.database.show();
}).size(210f, 64f);
@@ -324,7 +324,7 @@ public class TechTreeDialog extends FloatingDialog{
infoTable.table(b -> {
b.margin(0).left().defaults().left();
b.addImageButton(Icon.infoSmall, Styles.cleari, () -> ui.content.show(node.block)).growY().width(50f);
b.addImageButton(Icon.info, Styles.cleari, () -> ui.content.show(node.block)).growY().width(50f);
b.add().grow();
b.table(desc -> {
desc.left().defaults().left();
@@ -351,7 +351,7 @@ public class TechTreeDialog extends FloatingDialog{
if(mobile && locked(node)){
b.row();
b.addImageTextButton("$research", Icon.checkSmall, Styles.nodet, () -> unlock(node))
b.addImageTextButton("$research", Icon.ok, Styles.nodet, () -> unlock(node))
.disabled(i -> !data.hasItems(node.requirements)).growX().height(44f).colspan(3);
}
});

View File

@@ -45,7 +45,7 @@ public class ZoneInfoDialog extends FloatingDialog{
if(i++ % 2 == 0){
iteminfo.row();
}
iteminfo.addImage(stack.item.icon(mindustry.ui.Cicon.small)).size(8 * 3).padRight(1);
iteminfo.addImage(stack.item.icon(Cicon.small)).size(8 * 3).padRight(1);
iteminfo.add(stack.amount + "").color(Color.lightGray).padRight(5);
}
};
@@ -54,7 +54,7 @@ public class ZoneInfoDialog extends FloatingDialog{
cont.pane(cont -> {
if(zone.locked()){
cont.addImage(Icon.locked);
cont.addImage(Icon.lock);
cont.row();
cont.add("$locked").padBottom(6);
cont.row();
@@ -71,7 +71,7 @@ public class ZoneInfoDialog extends FloatingDialog{
for(Objective o : zones){
r.addImage(Icon.terrain).padRight(4);
r.add(o.display()).color(Color.lightGray);
r.addImage(o.complete() ? Icon.checkSmall : Icon.cancelSmall, o.complete() ? Color.lightGray : Color.scarlet).padLeft(3);
r.addImage(o.complete() ? Icon.ok : Icon.cancel, o.complete() ? Color.lightGray : Color.scarlet).padLeft(3);
r.row();
}
});
@@ -85,9 +85,9 @@ public class ZoneInfoDialog extends FloatingDialog{
r.add("$research.list").colspan(2).left();
r.row();
for(Unlock blocko : blocks){
r.addImage(blocko.block.icon(mindustry.ui.Cicon.small)).size(8 * 3).padRight(5);
r.addImage(blocko.block.icon(Cicon.small)).size(8 * 3).padRight(5);
r.add(blocko.block.localizedName).color(Color.lightGray).left();
r.addImage(blocko.block.unlocked() ? Icon.checkSmall : Icon.cancelSmall, blocko.block.unlocked() ? Color.lightGray : Color.scarlet).padLeft(3);
r.addImage(blocko.block.unlocked() ? Icon.ok : Icon.cancel, blocko.block.unlocked() ? Color.lightGray : Color.scarlet).padLeft(3);
r.row();
}

View File

@@ -62,12 +62,12 @@ public class HudFragment extends Fragment{
ImageButtonStyle style = Styles.clearTransi;
select.addImageButton(Icon.menuLargeSmall, style, ui.paused::show);
flip = select.addImageButton(Icon.arrowUpSmall, style, this::toggleMenus).get();
select.addImageButton(Icon.menu, style, ui.paused::show);
flip = select.addImageButton(Icon.upOpen, style, this::toggleMenus).get();
select.addImageButton(Icon.pasteSmall, style, ui.schematics::show);
select.addImageButton(Icon.paste, style, ui.schematics::show);
select.addImageButton(Icon.pauseSmall, style, () -> {
select.addImageButton(Icon.pause, style, () -> {
if(net.active()){
ui.listfrag.toggle();
}else{
@@ -75,14 +75,14 @@ public class HudFragment extends Fragment{
}
}).name("pause").update(i -> {
if(net.active()){
i.getStyle().imageUp = Icon.playersSmall;
i.getStyle().imageUp = Icon.user;
}else{
i.setDisabled(false);
i.getStyle().imageUp = state.is(State.paused) ? Icon.playSmall : Icon.pauseSmall;
i.getStyle().imageUp = state.is(State.paused) ? Icon.play : Icon.pause;
}
});
select.addImageButton(Icon.chatSmall, style,() -> {
select.addImageButton(Icon.chat, style,() -> {
if(net.active() && mobile){
if(ui.chatfrag.shown()){
ui.chatfrag.hide();
@@ -96,9 +96,9 @@ public class HudFragment extends Fragment{
}
}).update(i -> {
if(net.active() && mobile){
i.getStyle().imageUp = Icon.chatSmall;
i.getStyle().imageUp = Icon.chat;
}else{
i.getStyle().imageUp = Icon.databaseSmall;
i.getStyle().imageUp = Icon.book;
}
});
@@ -203,7 +203,7 @@ public class HudFragment extends Fragment{
float[] position = {0, 0};
t.row();
t.addImageTextButton("$editor.removeunit", Icon.quit, Styles.togglet, () -> {}).fillX().update(b -> {
t.addImageTextButton("$editor.removeunit", Icon.cancel, Styles.togglet, () -> {}).fillX().update(b -> {
boolean[] found = {false};
if(b.isChecked()){
Element e = Core.scene.hit(Core.input.mouseX(), Core.input.mouseY(), true);
@@ -319,7 +319,7 @@ public class HudFragment extends Fragment{
setDisabled(() -> !control.tutorial.canNext());
}},
new Table(f -> {
f.left().addImageButton(Icon.arrowLeftSmall, Styles.emptyi, () -> {
f.left().addImageButton(Icon.left, Styles.emptyi, () -> {
control.tutorial.prevSentence();
}).width(44f).growY().visible(() -> control.tutorial.canPrev());
}));
@@ -393,7 +393,7 @@ public class HudFragment extends Fragment{
}
});
table.margin(12);
table.addImage(Icon.check).pad(3);
table.addImage(Icon.ok).pad(3);
table.add(text).wrap().width(280f).get().setAlignment(Align.center, Align.center);
table.pack();
@@ -562,7 +562,7 @@ public class HudFragment extends Fragment{
private void toggleMenus(){
if(flip != null){
flip.getStyle().imageUp = shown ? Icon.arrowDownSmall : Icon.arrowUpSmall;
flip.getStyle().imageUp = shown ? Icon.downOpen : Icon.upOpen;
}
shown = !shown;
@@ -650,7 +650,7 @@ public class HudFragment extends Fragment{
}
private void addPlayButton(Table table){
table.right().addImageButton(Icon.playSmaller, Styles.righti, 30f, () -> {
table.right().addImageButton(Icon.play, Styles.righti, 30f, () -> {
if(net.client() && player.isAdmin){
Call.onAdminRequest(player, AdminAction.wave);
}else if(inLaunchWave()){

View File

@@ -60,7 +60,7 @@ public class MenuFragment extends Fragment{
parent.fill(c -> c.bottom().left().addButton("", Styles.infot, ui.about::show).size(84, 45));
parent.fill(c -> c.bottom().right().addButton("", Styles.discordt, ui.discord::show).size(84, 45));
}else if(becontrol.active()){
parent.fill(c -> c.bottom().right().addImageTextButton("$be.check", Icon.refreshSmall, () -> {
parent.fill(c -> c.bottom().right().addImageTextButton("$be.check", Icon.refresh, () -> {
ui.loadfrag.show();
becontrol.checkUpdate(result -> {
ui.loadfrag.hide();
@@ -100,13 +100,13 @@ public class MenuFragment extends Fragment{
container.defaults().size(size).pad(5).padTop(4f);
MobileButton
play = new MobileButton(Icon.play2, "$campaign", () -> checkPlay(ui.deploy::show)),
custom = new MobileButton(Icon.playCustom, "$customgame", () -> checkPlay(ui.custom::show)),
maps = new MobileButton(Icon.load, "$loadgame", () -> checkPlay(ui.load::show)),
play = new MobileButton(Icon.play, "$campaign", () -> checkPlay(ui.deploy::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.editor, "$editor", () -> checkPlay(ui.maps::show)),
tools = new MobileButton(Icon.tools, "$settings", ui.settings::show),
mods = new MobileButton(Icon.wiki, "$mods", ui.mods::show),
editor = new MobileButton(Icon.terrain, "$editor", () -> checkPlay(ui.maps::show)),
tools = new MobileButton(Icon.settings, "$settings", ui.settings::show),
mods = new MobileButton(Icon.box, "$mods", ui.mods::show),
donate = new MobileButton(Icon.link, "$website", () -> Core.net.openURI("https://anuke.itch.io/mindustry")),
exit = new MobileButton(Icon.exit, "$quit", () -> Core.app.exit());
@@ -164,20 +164,20 @@ public class MenuFragment extends Fragment{
t.defaults().width(width).height(70f);
buttons(t,
new Buttoni("$play", Icon.play2Small,
new Buttoni("$campaign", Icon.play2Small, () -> checkPlay(ui.deploy::show)),
new Buttoni("$joingame", Icon.addSmall, () -> checkPlay(ui.join::show)),
new Buttoni("$customgame", Icon.editorSmall, () -> checkPlay(ui.custom::show)),
new Buttoni("$loadgame", Icon.loadSmall, () -> checkPlay(ui.load::show)),
new Buttoni("$tutorial", Icon.infoSmall, () -> checkPlay(control::playTutorial))
new Buttoni("$play", Icon.play,
new Buttoni("$campaign", Icon.play, () -> checkPlay(ui.deploy::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.editorSmall, () -> checkPlay(ui.maps::show)), steam ? new Buttoni("$workshop", Icon.saveSmall, platform::openWorkshop) : null,
new Buttoni(Core.bundle.get("mods") + "\n" + Core.bundle.get("mods.alpha"), Icon.wikiSmall, ui.mods::show),
new Buttoni("$editor", Icon.terrain, () -> checkPlay(ui.maps::show)), steam ? new Buttoni("$workshop", Icon.save, platform::openWorkshop) : null,
new Buttoni(Core.bundle.get("mods") + "\n" + Core.bundle.get("mods.alpha"), Icon.box, ui.mods::show),
//not enough space for this button
//new Buttoni("$schematics", Icon.pasteSmall, ui.schematics::show),
new Buttoni("$settings", Icon.toolsSmall, ui.settings::show),
new Buttoni("$about.button", Icon.infoSmall, ui.about::show),
new Buttoni("$quit", Icon.exitSmall, 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();

View File

@@ -100,7 +100,7 @@ public class MinimapFragment extends Fragment{
t.row();
t.add().growY();
t.row();
t.addImageTextButton("$back", Icon.backSmall, () -> shown = false).size(220f, 60f).pad(10f);
t.addImageTextButton("$back", Icon.leftOpen, () -> shown = false).size(220f, 60f).pad(10f);
});
}

View File

@@ -202,7 +202,7 @@ public class PlacementFragment extends Fragment{
blockTable.row();
}
ImageButton button = blockTable.addImageButton(Icon.lockedSmall, Styles.selecti, () -> {
ImageButton button = blockTable.addImageButton(Icon.lock, Styles.selecti, () -> {
if(unlocked(block)){
control.input.block = control.input.block == block ? null : block;
selectedBlocks.put(currentCategory, control.input.block);
@@ -311,7 +311,7 @@ public class PlacementFragment extends Fragment{
if(state.rules.bannedBlocks.contains(lastDisplay)){
topTable.row();
topTable.table(b -> {
b.addImage(Icon.cancelSmall).padRight(2).color(Color.scarlet);
b.addImage(Icon.cancel).padRight(2).color(Color.scarlet);
b.add("$banned");
b.left();
}).padTop(2).left();
@@ -378,7 +378,7 @@ public class PlacementFragment extends Fragment{
continue;
}
categories.addImageButton(Core.atlas.drawable("icon-" + cat.name() + "-smaller"), Styles.clearToggleTransi, () -> {
categories.addImageButton(ui.getIcon(cat.name()), Styles.clearToggleTransi, () -> {
currentCategory = cat;
if(control.input.block != null){
control.input.block = getSelectedBlock(currentCategory);

View File

@@ -104,14 +104,14 @@ public class PlayerListFragment extends Fragment{
button.table(t -> {
t.defaults().size(bs);
t.addImageButton(Icon.banSmall, Styles.clearPartiali,
t.addImageButton(Icon.hammer, Styles.clearPartiali,
() -> ui.showConfirm("$confirm", "$confirmban", () -> Call.onAdminRequest(user, AdminAction.ban)));
t.addImageButton(Icon.cancelSmall, Styles.clearPartiali,
t.addImageButton(Icon.cancel, Styles.clearPartiali,
() -> ui.showConfirm("$confirm", "$confirmkick", () -> Call.onAdminRequest(user, AdminAction.kick)));
t.row();
t.addImageButton(Icon.adminSmall, Styles.clearTogglePartiali, () -> {
t.addImageButton(Icon.admin, Styles.clearTogglePartiali, () -> {
if(net.client()) return;
String id = user.uuid;
@@ -127,13 +127,13 @@ public class PlayerListFragment extends Fragment{
.touchable(() -> net.client() ? Touchable.disabled : Touchable.enabled)
.checked(user.isAdmin);
t.addImageButton(Icon.zoomSmall, Styles.clearPartiali, () -> Call.onAdminRequest(user, AdminAction.trace));
t.addImageButton(Icon.zoom, Styles.clearPartiali, () -> Call.onAdminRequest(user, AdminAction.trace));
}).padRight(12).size(bs + 10f, bs);
}else if(!user.isLocal && !user.isAdmin && net.client() && playerGroup.size() >= 3 && player.getTeam() == user.getTeam()){ //votekick
button.add().growY();
button.addImageButton(Icon.banSmall, Styles.clearPartiali,
button.addImageButton(Icon.hammer, Styles.clearPartiali,
() -> ui.showConfirm("$confirm", "$confirmvotekick", () -> Call.sendChatMessage("/votekick " + user.name))).size(h);
}

View File

@@ -98,7 +98,7 @@ public class MessageBlock extends Block{
public void buildConfiguration(Tile tile, Table table){
MessageBlockEntity entity = tile.ent();
table.addImageButton(Icon.pencilSmall, () -> {
table.addImageButton(Icon.pencil, () -> {
if(mobile){
Core.input.getTextInput(new TextInput(){{
text = entity.message;

View File

@@ -52,7 +52,7 @@ public class LightBlock extends Block{
public void buildConfiguration(Tile tile, Table table){
LightEntity entity = tile.ent();
table.addImageButton(Icon.pencilSmall, () -> {
table.addImageButton(Icon.pencil, () -> {
ui.picker.show(Tmp.c1.set(entity.color).a(0.5f), false, res -> {
entity.color = res.rgba();
lastColor = entity.color;

View File

@@ -66,7 +66,7 @@ public class CommandCenter extends Block{
super.load();
for(UnitCommand cmd : UnitCommand.all){
commandRegions[cmd.ordinal()] = Core.atlas.find("icon-command-" + cmd.name() + "-small");
commandRegions[cmd.ordinal()] = Core.atlas.find("Icon.command-" + cmd.name() + "-");
}
}
@@ -91,7 +91,7 @@ public class CommandCenter extends Block{
Table buttons = new Table();
for(UnitCommand cmd : UnitCommand.all){
buttons.addImageButton(Core.atlas.drawable("icon-command-" + cmd.name() + "-small"), Styles.clearToggleTransi, () -> tile.configure(cmd.ordinal()))
buttons.addImageButton(Core.atlas.drawable("Icon.command-" + cmd.name() + "-"), Styles.clearToggleTransi, () -> tile.configure(cmd.ordinal()))
.size(44).group(group).update(b -> b.setChecked(entity.command == cmd));
}
table.add(buttons);