diff --git a/build.gradle b/build.gradle index df798bbc70..82d955639d 100644 --- a/build.gradle +++ b/build.gradle @@ -80,7 +80,7 @@ project(":core") { apply plugin: "java" dependencies { - compile 'com.github.anuken:ucore:4cb594bc68' + compile 'com.github.anuken:ucore:7938cb4bf9' compile "com.badlogicgames.gdx:gdx:$gdxVersion" compile "com.badlogicgames.gdx:gdx-ai:1.8.1" } diff --git a/core/src/io/anuke/mindustry/core/Tutorial.java b/core/src/io/anuke/mindustry/core/Tutorial.java index c2630ee553..01dbdbaeeb 100644 --- a/core/src/io/anuke/mindustry/core/Tutorial.java +++ b/core/src/io/anuke/mindustry/core/Tutorial.java @@ -18,7 +18,6 @@ import io.anuke.ucore.scene.builders.table; import io.anuke.ucore.scene.ui.ImageButton; import io.anuke.ucore.scene.ui.Label; import io.anuke.ucore.scene.ui.TextButton; -import io.anuke.ucore.scene.ui.layout.Unit; import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Tmp; @@ -62,8 +61,8 @@ public class Tutorial{ }}.end(); - prev.pad(Unit.dp.scl(16)); - next.pad(Unit.dp.scl(16)); + prev.pad(16); + next.pad(16); prev.setDisabled(()->!canMove(false) || !stage.canBack); next.setDisabled(()->!stage.canForward); diff --git a/core/src/io/anuke/mindustry/core/UI.java b/core/src/io/anuke/mindustry/core/UI.java index 84ecf02d74..8ac9f407aa 100644 --- a/core/src/io/anuke/mindustry/core/UI.java +++ b/core/src/io/anuke/mindustry/core/UI.java @@ -182,7 +182,7 @@ public class UI extends SceneModule{ //gameerror.setFillParent(true); discord = new Dialog("Discord", "dialog"); - discord.content().pad(Unit.dp.scl(12f)); + discord.content().pad(12f); discord.content().add("Join the mindustry discord!\n[orange]" + Vars.discordURL); discord.buttons().defaults().size(200f, 50); discord.buttons().addButton("Open link", () -> Mindustry.platforms.openLink(Vars.discordURL)); @@ -367,7 +367,7 @@ public class UI extends SceneModule{ public void showError(String text){ new Dialog("[crimson]An error has occured", "dialog"){{ - content().pad(Unit.dp.scl(15)); + content().pad(15); content().add(text); getButtonTable().addButton("OK", ()->{ hide(); diff --git a/core/src/io/anuke/mindustry/mapeditor/MapEditorDialog.java b/core/src/io/anuke/mindustry/mapeditor/MapEditorDialog.java index ca1199edef..b3da5ffa31 100644 --- a/core/src/io/anuke/mindustry/mapeditor/MapEditorDialog.java +++ b/core/src/io/anuke/mindustry/mapeditor/MapEditorDialog.java @@ -22,7 +22,6 @@ import io.anuke.ucore.graphics.Pixmaps; import io.anuke.ucore.scene.builders.*; import io.anuke.ucore.scene.ui.*; import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; public class MapEditorDialog extends Dialog{ private MapEditor editor; @@ -152,7 +151,7 @@ public class MapEditorDialog extends Dialog{ public void build(){ new table(){{ - float isize = Unit.dp.scl(16*2f); + float isize = 16*2f; aleft(); new table(){{ @@ -220,7 +219,7 @@ public class MapEditorDialog extends Dialog{ for(EditorTool tool : EditorTool.values()){ ImageButton button = new ImageButton("icon-" + tool.name(), "toggle"); button.clicked(() -> view.setTool(tool)); - button.resizeImage(Unit.dp.scl(16*2f)); + button.resizeImage(16*2f); group.add(button); tools.add(button).size(80f, 85f).padBottom(-6f); @@ -312,7 +311,7 @@ public class MapEditorDialog extends Dialog{ ImageButton button = new ImageButton(Draw.hasRegion(block.name) ? Draw.region(block.name) : Draw.region(block.name + "1"), "toggle"); button.clicked(() -> editor.setDrawBlock(block)); - button.resizeImage(Unit.dp.scl(8*4f)); + button.resizeImage(8*4f); group.add(button); content.add(button).pad(4f).size(53f, 58f); @@ -321,7 +320,7 @@ public class MapEditorDialog extends Dialog{ } } - content.padLeft(Unit.dp.scl(-5f)); + content.padLeft(-5f); group.getButtons().get(2).setChecked(true); diff --git a/core/src/io/anuke/mindustry/mapeditor/MapGenerateDialog.java b/core/src/io/anuke/mindustry/mapeditor/MapGenerateDialog.java index 69677fd34a..965fd7858d 100644 --- a/core/src/io/anuke/mindustry/mapeditor/MapGenerateDialog.java +++ b/core/src/io/anuke/mindustry/mapeditor/MapGenerateDialog.java @@ -15,7 +15,6 @@ import io.anuke.ucore.scene.ui.Image; import io.anuke.ucore.scene.ui.ScrollPane; import io.anuke.ucore.scene.ui.layout.Stack; import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; public class MapGenerateDialog extends FloatingDialog{ private MapEditor editor; @@ -46,7 +45,7 @@ public class MapGenerateDialog extends FloatingDialog{ image.setScaling(Scaling.fit); Table preft = new Table(); preft.left(); - preft.pad(Unit.dp.scl(4f)).padRight(Unit.dp.scl(25f)); + preft.pad(4f).padRight(25f); for(GenPref pref : editor.getFilter().getPrefs().values()){ CheckBox box = new CheckBox(pref.name); diff --git a/core/src/io/anuke/mindustry/mapeditor/MapLoadDialog.java b/core/src/io/anuke/mindustry/mapeditor/MapLoadDialog.java index 2357966a6b..d6796ce7e8 100644 --- a/core/src/io/anuke/mindustry/mapeditor/MapLoadDialog.java +++ b/core/src/io/anuke/mindustry/mapeditor/MapLoadDialog.java @@ -9,7 +9,6 @@ import io.anuke.ucore.scene.ui.ButtonGroup; import io.anuke.ucore.scene.ui.ScrollPane; import io.anuke.ucore.scene.ui.TextButton; import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; public class MapLoadDialog extends FloatingDialog{ Map selected = Vars.world.maps().getMap(0); @@ -24,7 +23,7 @@ public class MapLoadDialog extends FloatingDialog{ Table table = new Table(); table.defaults().size(200f, 90f).pad(4f); - table.pad(Unit.dp.scl(10f)); + table.pad(10f); ScrollPane pane = new ScrollPane(table, "horizontal"); pane.setFadeScrollBars(false); @@ -33,7 +32,7 @@ public class MapLoadDialog extends FloatingDialog{ if(!map.visible) continue; TextButton button = new TextButton(map.name, "toggle"); - button.add(new BorderImage(map.texture, 2f)).size(Unit.dp.scl(16*4f)); + button.add(new BorderImage(map.texture, 2f)).size(16*4f); button.getCells().reverse(); button.clicked(() -> selected = map); button.getLabelCell().grow().left().padLeft(5f); diff --git a/core/src/io/anuke/mindustry/mapeditor/MapView.java b/core/src/io/anuke/mindustry/mapeditor/MapView.java index 806cea0a65..28f90440cb 100644 --- a/core/src/io/anuke/mindustry/mapeditor/MapView.java +++ b/core/src/io/anuke/mindustry/mapeditor/MapView.java @@ -124,7 +124,7 @@ public class MapView extends Element implements GestureListener{ if(pop) ScissorStack.popScissors(); Draw.color(Colors.get("accent")); - Draw.thick(Unit.dp.scl(3f)); + Draw.thick(3f); Draw.linerect(x + width/2 - size/2, y + height/2 - size/2, size, size); Draw.reset(); } diff --git a/core/src/io/anuke/mindustry/ui/FileChooser.java b/core/src/io/anuke/mindustry/ui/FileChooser.java index fdd238ab74..fc7bb04da3 100644 --- a/core/src/io/anuke/mindustry/ui/FileChooser.java +++ b/core/src/io/anuke/mindustry/ui/FileChooser.java @@ -43,8 +43,8 @@ public class FileChooser extends FloatingDialog{ } private void setupWidgets(){ - getCell(content()).maxWidth(Gdx.graphics.getWidth()/2); - content().pad(-Unit.dp.scl(10)); + getCell(content()).width(Gdx.graphics.getWidth() / Unit.dp.scl(2f)); + content().pad(-10); Table content = new Table(); @@ -87,7 +87,7 @@ public class FileChooser extends FloatingDialog{ Table icontable = new Table(); - float isize = Unit.dp.scl(14*2); + float isize = 14*2; ImageButton up = new ImageButton("icon-folder-parent"); up.resizeImage(isize); @@ -135,7 +135,7 @@ public class FileChooser extends FloatingDialog{ //content.add(navigation).colspan(3).left().padBottom(10f).expandX().fillX().height(40f); //content.row(); - content.center().add(pane).width(Gdx.graphics.getWidth()/2).colspan(3).units(Unit.px).grow(); + content.center().add(pane).width(Gdx.graphics.getWidth()/2).colspan(3).grow(); content.row(); if(!open){ diff --git a/core/src/io/anuke/mindustry/ui/FloatingDialog.java b/core/src/io/anuke/mindustry/ui/FloatingDialog.java index dc6a811a4c..0b27644301 100644 --- a/core/src/io/anuke/mindustry/ui/FloatingDialog.java +++ b/core/src/io/anuke/mindustry/ui/FloatingDialog.java @@ -5,7 +5,6 @@ import com.badlogic.gdx.graphics.Colors; import com.badlogic.gdx.utils.Align; import io.anuke.ucore.scene.ui.Dialog; -import io.anuke.ucore.scene.ui.layout.Unit; public class FloatingDialog extends Dialog{ @@ -20,7 +19,7 @@ public class FloatingDialog extends Dialog{ @Override public void addCloseButton(){ - buttons().addImageTextButton("Back", "icon-arrow-left", Unit.dp.scl(30f), ()->{ + buttons().addImageTextButton("Back", "icon-arrow-left", 30f, ()->{ hide(); }).size(230f, 64f); diff --git a/core/src/io/anuke/mindustry/ui/LevelDialog.java b/core/src/io/anuke/mindustry/ui/LevelDialog.java index b9e82f4bd6..45d69703df 100644 --- a/core/src/io/anuke/mindustry/ui/LevelDialog.java +++ b/core/src/io/anuke/mindustry/ui/LevelDialog.java @@ -11,7 +11,6 @@ import io.anuke.ucore.core.Timers; import io.anuke.ucore.scene.ui.*; import io.anuke.ucore.scene.ui.layout.Stack; import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; import io.anuke.ucore.scene.utils.Elements; public class LevelDialog extends FloatingDialog{ @@ -106,7 +105,7 @@ public class LevelDialog extends FloatingDialog{ maps.add(stack).width(170).top().pad(4f); - maps.padRight(Unit.dp.scl(26)); + maps.padRight(26); i ++; } diff --git a/core/src/io/anuke/mindustry/ui/LoadDialog.java b/core/src/io/anuke/mindustry/ui/LoadDialog.java index ebd20e1f12..d9b640838b 100644 --- a/core/src/io/anuke/mindustry/ui/LoadDialog.java +++ b/core/src/io/anuke/mindustry/ui/LoadDialog.java @@ -12,7 +12,6 @@ import io.anuke.ucore.scene.ui.Label; import io.anuke.ucore.scene.ui.ScrollPane; import io.anuke.ucore.scene.ui.TextButton; import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; //TODO unified save/load dialogs public class LoadDialog extends FloatingDialog{ @@ -44,13 +43,13 @@ public class LoadDialog extends FloatingDialog{ pane = new ScrollPane(slots); pane.setFadeScrollBars(false); - slots.padRight(Unit.dp.scl(24)); + slots.padRight(24); for(int i = 0; i < Vars.saveSlots; i++){ final int slot = i; TextButton button = new TextButton("[accent]Slot " + (i + 1)); - button.pad(Unit.dp.scl(12)); + button.pad(12); button.getLabelCell().top().left().growX(); button.row(); diff --git a/core/src/io/anuke/mindustry/ui/MenuDialog.java b/core/src/io/anuke/mindustry/ui/MenuDialog.java index 0fc6c3a46b..e923274856 100644 --- a/core/src/io/anuke/mindustry/ui/MenuDialog.java +++ b/core/src/io/anuke/mindustry/ui/MenuDialog.java @@ -11,7 +11,6 @@ import io.anuke.ucore.scene.builders.imagebutton; import io.anuke.ucore.scene.ui.ConfirmDialog; import io.anuke.ucore.scene.ui.ImageButton; import io.anuke.ucore.scene.ui.layout.Cell; -import io.anuke.ucore.scene.ui.layout.Unit; public class MenuDialog extends FloatingDialog{ private SaveDialog save = new SaveDialog(); @@ -74,7 +73,7 @@ public class MenuDialog extends FloatingDialog{ PressGroup group = new PressGroup(); content().defaults().size(120f).pad(5); - float isize = Unit.dp.scl(14f*4); + float isize = 14f*4; new imagebutton("icon-play-2", isize, () -> { hide(); diff --git a/core/src/io/anuke/mindustry/ui/MindustryKeybindDialog.java b/core/src/io/anuke/mindustry/ui/MindustryKeybindDialog.java index 049e9ff94c..273b967613 100644 --- a/core/src/io/anuke/mindustry/ui/MindustryKeybindDialog.java +++ b/core/src/io/anuke/mindustry/ui/MindustryKeybindDialog.java @@ -6,7 +6,6 @@ import com.badlogic.gdx.utils.Align; import io.anuke.ucore.scene.ui.Image; import io.anuke.ucore.scene.ui.KeybindDialog; -import io.anuke.ucore.scene.ui.layout.Unit; public class MindustryKeybindDialog extends KeybindDialog{ @@ -22,7 +21,7 @@ public class MindustryKeybindDialog extends KeybindDialog{ @Override public void addCloseButton(){ - buttons().addImageTextButton("Back", "icon-arrow-left", Unit.dp.scl(30f), ()->{ + buttons().addImageTextButton("Back", "icon-arrow-left", 30f, ()->{ hide(); }).size(230f, 64f); diff --git a/core/src/io/anuke/mindustry/ui/MindustrySettingsDialog.java b/core/src/io/anuke/mindustry/ui/MindustrySettingsDialog.java index 62ae0332d8..cf941b2467 100644 --- a/core/src/io/anuke/mindustry/ui/MindustrySettingsDialog.java +++ b/core/src/io/anuke/mindustry/ui/MindustrySettingsDialog.java @@ -7,7 +7,6 @@ import com.badlogic.gdx.utils.Align; import io.anuke.ucore.scene.ui.Image; import io.anuke.ucore.scene.ui.ScrollPane; import io.anuke.ucore.scene.ui.SettingsDialog; -import io.anuke.ucore.scene.ui.layout.Unit; public class MindustrySettingsDialog extends SettingsDialog{ @@ -32,7 +31,7 @@ public class MindustrySettingsDialog extends SettingsDialog{ @Override public void addCloseButton(){ - buttons().addImageTextButton("Back", "icon-arrow-left", Unit.dp.scl(30f), ()->{ + buttons().addImageTextButton("Back", "icon-arrow-left", 30f, ()->{ hide(); }).size(230f, 64f); diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java index d1aecf75e5..351d4d5067 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java @@ -20,7 +20,6 @@ import io.anuke.ucore.scene.event.Touchable; import io.anuke.ucore.scene.ui.*; import io.anuke.ucore.scene.ui.layout.Stack; import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; import io.anuke.ucore.util.Mathf; public class BlocksFragment implements Fragment{ @@ -143,7 +142,7 @@ public class BlocksFragment implements Fragment{ desctable.defaults().left(); desctable.left(); - desctable.pad(Unit.dp.scl(12)); + desctable.pad(12); Table header = new Table(); diff --git a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java index 064043d374..6ee468df90 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java @@ -23,7 +23,6 @@ import io.anuke.ucore.scene.ui.Image; import io.anuke.ucore.scene.ui.Label; import io.anuke.ucore.scene.ui.layout.Cell; import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; public class HudFragment implements Fragment{ private Table itemtable, respawntable; @@ -38,7 +37,7 @@ public class HudFragment implements Fragment{ new table(){{ left(); defaults().size(68).left(); - float isize = Unit.dp.scl(40); + float isize = 40; new imagebutton("icon-menu", isize, ()->{ ui.showMenu(); @@ -92,7 +91,7 @@ public class HudFragment implements Fragment{ atop(); new table("pane"){{ - new label("[orange]< paused >").scale(Unit.dp.scl(0.75f)).pad(6); + new label("[orange]< paused >").scale(0.75f).pad(6); }}.end(); }}.end(); @@ -181,7 +180,7 @@ public class HudFragment implements Fragment{ } private void playButton(float uheight){ - new imagebutton("icon-play", Unit.dp.scl(30f), ()->{ + new imagebutton("icon-play", 30f, ()->{ Vars.control.runWave(); }).height(uheight).fillX().right().padTop(-8f).padBottom(-12f).padRight(-36) .padLeft(-10f).width(40f).update(l->{ diff --git a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java index 871ff40d83..57c27f3ea4 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java @@ -11,7 +11,6 @@ import io.anuke.mindustry.ui.MenuButton; import io.anuke.mindustry.ui.PressGroup; import io.anuke.ucore.scene.builders.imagebutton; import io.anuke.ucore.scene.builders.table; -import io.anuke.ucore.scene.ui.layout.Unit; public class MenuFragment implements Fragment{ @@ -46,7 +45,7 @@ public class MenuFragment implements Fragment{ if(!gwt){ add(new MenuButton("text-exit", group, Gdx.app::exit)); } - get().pad(Unit.dp.scl(16)); + get().pad(16); }}.end(); visible(()->GameState.is(State.menu)); @@ -55,7 +54,7 @@ public class MenuFragment implements Fragment{ new table(){{ new table(){{ defaults().size(120f).pad(5); - float isize = Unit.dp.scl(14f*4); + float isize = 14f*4; new imagebutton("icon-play-2", isize, () -> ui.showLevels()).text("Play").padTop(4f); @@ -84,11 +83,11 @@ public class MenuFragment implements Fragment{ new table(){{ atop().aright(); if(Mindustry.hasDiscord){ - new imagebutton("icon-discord", Unit.dp.scl(30f), ()->{ + new imagebutton("icon-discord", 30f, ()->{ ui.showDiscord(); }).margin(14); } - new imagebutton("icon-info", Unit.dp.scl(30f), ()->{ + new imagebutton("icon-info", 30f, ()->{ ui.showAbout(); }).margin(14); }}.end().visible(()->GameState.is(State.menu)); diff --git a/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java b/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java index 4c7e48ba02..abc0fc0448 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java @@ -12,7 +12,6 @@ import io.anuke.ucore.scene.builders.*; import io.anuke.ucore.scene.event.Touchable; import io.anuke.ucore.scene.ui.ButtonGroup; import io.anuke.ucore.scene.ui.ImageButton; -import io.anuke.ucore.scene.ui.layout.Unit; import io.anuke.ucore.util.Mathf; public class PlacementFragment implements Fragment{ @@ -57,7 +56,7 @@ public class PlacementFragment implements Fragment{ defaults().padBottom(-5.5f); - new imagebutton("icon-" + mode.name(), "toggle", Unit.dp.scl(10*3), ()->{ + new imagebutton("icon-" + mode.name(), "toggle", 10*3, ()->{ control.getInput().resetCursor(); player.placeMode = mode; }).group(group); @@ -67,14 +66,14 @@ public class PlacementFragment implements Fragment{ Color color = Color.GRAY;//Colors.get("accent"); //Color.valueOf("4d4d4d") - new imagebutton("icon-cancel", Unit.dp.scl(14*3), ()->{ + new imagebutton("icon-cancel", 14*3, ()->{ player.recipe = null; }).imageColor(color) .visible(()->player.recipe != null); new button("", ()->{}).get().setTouchable(Touchable.disabled);; - new imagebutton("icon-arrow", Unit.dp.scl(14*3), ()->{ + new imagebutton("icon-arrow", 14*3, ()->{ player.rotation = Mathf.mod(player.rotation + 1, 4); }).imageColor(color).visible(() -> player.recipe != null).update(image ->{ image.getImage().setRotation(player.rotation*90); @@ -108,7 +107,7 @@ public class PlacementFragment implements Fragment{ defaults().padBottom(d < 2 ? -5.5f : 0); - new imagebutton("icon-" + mode.name(), "toggle", Unit.dp.scl(10*3), ()->{ + new imagebutton("icon-" + mode.name(), "toggle", 10*3, ()->{ control.getInput().resetCursor(); player.breakMode = mode; }){{ diff --git a/core/src/io/anuke/mindustry/ui/fragments/ToolFragment.java b/core/src/io/anuke/mindustry/ui/fragments/ToolFragment.java index 0499fe34c4..57ecbdd858 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/ToolFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/ToolFragment.java @@ -10,23 +10,25 @@ import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.input.PlaceMode; import io.anuke.ucore.core.Core; import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; public class ToolFragment implements Fragment{ private Table tools; public void build(){ + float isize = 14*3; + tools = new Table(); - tools.addIButton("icon-cancel", Unit.dp.scl(42), ()->{ + + tools.addIButton("icon-cancel", isize, ()->{ player.recipe = null; }); - tools.addIButton("icon-rotate", Unit.dp.scl(42), ()->{ + tools.addIButton("icon-rotate", isize, ()->{ player.rotation ++; player.rotation %= 4; }); - tools.addIButton("icon-check", Unit.dp.scl(42), ()->{ + tools.addIButton("icon-check", isize, ()->{ player.placeMode.tapped(control.getInput().getBlockX(), control.getInput().getBlockY()); }); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java index d19c488a24..d84c925f6a 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java @@ -13,7 +13,6 @@ import io.anuke.mindustry.world.blocks.types.Configurable; import io.anuke.ucore.core.Draw; import io.anuke.ucore.core.Timers; import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Tmp; @@ -93,7 +92,7 @@ public class Sorter extends Junction implements Configurable{ public void buildTable(Tile tile, Table table){ SorterEntity entity = tile.entity(); - table.addIButton("icon-arrow-left", Unit.dp.scl(10*3), ()->{ + table.addIButton("icon-arrow-left", 10*3, ()->{ int color = entity.sortItem.ordinal(); color --; @@ -105,7 +104,7 @@ public class Sorter extends Junction implements Configurable{ table.add().size(40f); - table.addIButton("icon-arrow-right", Unit.dp.scl(10*3), ()->{ + table.addIButton("icon-arrow-right", 10*3, ()->{ int color = entity.sortItem.ordinal(); color ++; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java index 78b4949667..e705a69204 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java @@ -16,7 +16,6 @@ import io.anuke.mindustry.world.blocks.types.Configurable; import io.anuke.ucore.core.Draw; import io.anuke.ucore.core.Timers; import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; import io.anuke.ucore.util.Mathf; public class Teleporter extends Block implements Configurable{ @@ -69,13 +68,13 @@ public class Teleporter extends Block implements Configurable{ public void buildTable(Tile tile, Table table){ TeleporterEntity entity = tile.entity(); - table.addIButton("icon-arrow-left", Unit.dp.scl(10*3), ()->{ + table.addIButton("icon-arrow-left", 10*3, ()->{ entity.color = (byte)Mathf.mod(entity.color - 1, colors); }); table.add().size(40f); - table.addIButton("icon-arrow-right", Unit.dp.scl(10*3), ()->{ + table.addIButton("icon-arrow-right", 10*3, ()->{ entity.color = (byte)Mathf.mod(entity.color + 1, colors); }); } diff --git a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java index 1569cd0ba7..9270061d4d 100644 --- a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java @@ -1,5 +1,9 @@ package io.anuke.mindustry.desktop; +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration; +import com.badlogic.gdx.utils.Array; + import java.awt.Desktop; import java.io.IOException; import java.net.URI; @@ -7,18 +11,18 @@ import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.Date; -import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; -import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration; -import com.badlogic.gdx.utils.Array; - import io.anuke.mindustry.Mindustry; import io.anuke.mindustry.Vars; import io.anuke.mindustry.io.PlatformFunction; import io.anuke.ucore.scene.ui.TextField; +import io.anuke.ucore.scene.ui.layout.Unit; public class DesktopLauncher { public static void main (String[] arg) { + + Unit.dp.addition = 2f; + Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration(); config.setTitle("Mindustry"); config.setMaximized(true);