From 956e35b6774a5365412d7b75ef17a8dfb6e18275 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 7 Dec 2017 14:45:04 -0500 Subject: [PATCH] UI fixes; fixed conveyor infinite item pileup --- core/assets/ui/uiskin.json | 3 ++- .../src/io/anuke/mindustry/core/Renderer.java | 2 +- .../ui/fragments/BlocksFragment.java | 22 +++++++++++------- .../blocks/types/distribution/Conveyor.java | 2 +- desktop/mindustry-saves/0.mins | Bin 11415 -> 3824 bytes .../mindustry/desktop/DesktopLauncher.java | 2 +- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/core/assets/ui/uiskin.json b/core/assets/ui/uiskin.json index 62128c4be4..fb3350a1b2 100644 --- a/core/assets/ui/uiskin.json +++ b/core/assets/ui/uiskin.json @@ -48,7 +48,8 @@ io.anuke.ucore.scene.ui.ImageTextButton$ImageTextButtonStyle: { toggle: {checked: button-down, down: button-down, up: button, font: default-font, fontColor: white, over: button-over, disabled: button, disabledFontColor: grey } }, io.anuke.ucore.scene.ui.ScrollPane$ScrollPaneStyle: { - default: {background: border, vScroll: scroll, vScrollKnob: scroll-knob-vertical} + default: {background: border, vScroll: scroll, vScrollKnob: scroll-knob-vertical}, + clear: {vScroll: scroll, vScrollKnob: scroll-knob-vertical} }, io.anuke.ucore.scene.ui.Window$WindowStyle: { default: {titleFont: default-font, background: window, titleFontColor: orange }, diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index cccd55a5a3..1f972e6c46 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -38,7 +38,7 @@ import io.anuke.ucore.util.*; public class Renderer extends RendererModule{ String[] surfaces = { "shadow", "shield", "pixel", "indicators" }; int targetscale = baseCameraScale; - int chunksize = 32; + int chunksize = 16; int[][][] cache; FloatArray shieldHits = new FloatArray(); float shieldHitDuration = 18f; diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java index d27b15fe24..f8db0692d7 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java @@ -171,23 +171,29 @@ public class BlocksFragment implements Fragment{ GameState.set(State.paused); FloatingDialog d = new FloatingDialog("Block Info"); + Table table = new Table(); + table.defaults().pad(1f).units(Unit.dp); + ScrollPane pane = new ScrollPane(table, "clear"); + pane.setFadeScrollBars(false); Table top = new Table(); top.left(); top.add(new Image(Draw.region(recipe.result.name))).size(8*5 * recipe.result.width).units(Unit.dp); top.add("[orange]"+recipe.result.formalName).padLeft(6f).units(Unit.dp); - d.content().add(top).fill().left(); - d.content().row(); - d.content().add(desclabel).width(600).units(Unit.dp); - d.content().row(); + table.add(top).fill().left(); + table.row(); + table.add(desclabel).width(600).units(Unit.dp); + table.row(); + + d.content().add(pane).grow(); if(statlist.size > 0){ - d.content().add("[coral][[extra block info]:").padTop(6).padBottom(5).left(); - d.content().row(); + table.add("[coral][[extra block info]:").padTop(6).padBottom(5).left(); + table.row(); } for(String s : statlist){ - d.content().add(s).left(); - d.content().row(); + table.add(s).left(); + table.row(); } d.buttons().addButton("OK", ()->{ diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java index ade4802b12..80b5e4e3b8 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java @@ -120,7 +120,7 @@ public class Conveyor extends Block{ int direction = source == null ? 0 : Math.abs(source.relativeTo(dest.x, dest.y) - dest.getRotation()); float minitem = dest.entity().minitem; return ((direction == 0) && minitem > 0.05f) || - ((direction %2 == 1) && minitem > 0.5f); + ((direction %2 == 1) && minitem > 0.52f); } @Override diff --git a/desktop/mindustry-saves/0.mins b/desktop/mindustry-saves/0.mins index 68c51d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sT_P%T%j2&FFQ??Jr_V@frwhzWizRi%IdBK=} zMH_W1xuQR@-+fg3GuwVNdJ9cO(^0}_fon_sdk49;VC+=f1G%<9tZSHePEr-I4M_l$fm*AnR#_((?G0inAe`9 zv9|h4TBp;e&&yM&qAn#6>r(u`2W8V>EH}5e{2yrDN;X}EcA?#9+-C1|@AtNZ&4KL~ zO(>J?gRx7k}pVb4*6)@&5Hf&qYiKxw=n;?moLM z6mri?O+?desU2^Cj?t19I-M!Gy?r7-WKYtVYWksai%*vUM*~};9tW_cR{xhMc zUyleq-KSpYnfBvDPlP3e+&|jLjefLV`WCZ!5!%ajokbO>b+NShw>Poazt$Liz;ca` zyib1QeTu#h=N`zIMLJFH+{Y+!$3t`dhaiPXRRxo)3Z`f|Cg6!yP@$a?=kOuv4?NNY9=4rW#^WnTd40JEjtj6MQNx| zC7bRiR*J5oIwk%*scVD=spQJ15-TNk1;y>QT^6Zi$~yGw9?MQtNp>2sMZ}h%JhW!7 zZ8cz@OX2NbEGRG88Gljmb;u2CL-S;!wBCmd#X2b}l+b z_RT-}b&{Qg8eg$kdzG9qfmj)_=yE$FRaL{eb*N$d;kh zYt~zUwxK#-TXq~;g}zY9X(!Q}*R5kbDpg5cr*HhMs2_?`$@LbXFUj`3VI5;sQnwHd zuCUWap){0^mZ5$(ZQcMhP9>9b(MR9;brSm+<)H#pgo;t`TYj%x6@vd#q>7MnjR7vlrf3|GK bebbU3Oe@eTH2Z;N7o%lp)sL24U8(;EO2=Xa diff --git a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java index a66e2a34a1..9eadf7daa9 100644 --- a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java @@ -17,7 +17,7 @@ public class DesktopLauncher { Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration(); config.setTitle("Mindustry"); config.setMaximized(true); - config.useVsync(false); + //config.useVsync(false); config.setWindowedMode(800, 600); config.setWindowIcon("sprites/icon.png");