From af442dba4fe3d52f8d1aaa9655096c3251557946 Mon Sep 17 00:00:00 2001 From: Raoul Van den Berge Date: Thu, 22 Sep 2016 20:31:57 +0200 Subject: [PATCH] GUI tweaks to crafting preview --- .../gui/GuiCraftingPreview.java | 25 +++++++++++------- .../textures/gui/crafting_preview.png | Bin 1941 -> 1789 bytes 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/main/java/refinedstorage/gui/GuiCraftingPreview.java b/src/main/java/refinedstorage/gui/GuiCraftingPreview.java index 1a20a5072..49c6942c4 100755 --- a/src/main/java/refinedstorage/gui/GuiCraftingPreview.java +++ b/src/main/java/refinedstorage/gui/GuiCraftingPreview.java @@ -37,7 +37,7 @@ public class GuiCraftingPreview extends GuiBase { public boolean canInteractWith(EntityPlayer player) { return false; } - }, 176, 181); + }, 168, 171); this.stacks = new ArrayList<>(stacks); this.parent = parent; @@ -45,13 +45,13 @@ public class GuiCraftingPreview extends GuiBase { this.hash = hash; this.quantity = quantity; - this.scrollbar = new Scrollbar(157, 20, 12, 59); + this.scrollbar = new Scrollbar(149, 20, 12, 119); } @Override public void init(int x, int y) { - startButton = addButton(x + 100, y + 150, 50, 20, t("misc.refinedstorage:start")); - cancelButton = addButton(x + 20, y + 150, 50, 20, t("gui.cancel")); + cancelButton = addButton(x + 16, y + 144, 50, 20, t("gui.cancel")); + startButton = addButton(x + 85, y + 144, 50, 20, t("misc.refinedstorage:start")); startButton.enabled = stacks.stream().filter(CraftingPreviewStack::cantCraft).count() == 0; } @@ -68,16 +68,17 @@ public class GuiCraftingPreview extends GuiBase { drawTexture(x, y, 0, 0, width, height); - x += 15; + x += 7; y += 20; int slot = scrollbar.getOffset() * 2; + for (int i = 0; i < 8; ++i) { if (slot < stacks.size()) { CraftingPreviewStack stack = stacks.get(slot); if (stack.cantCraft()) { - drawTexture(x, y, 0, 185, 67, 29); + drawTexture(x, y, 189, 0, 67, 29); } } @@ -96,7 +97,7 @@ public class GuiCraftingPreview extends GuiBase { public void drawForeground(int mouseX, int mouseY) { drawString(7, 7, t("gui.refinedstorage:crafting_preview")); - int x = 22; + int x = 12; int y = 22; int slot = scrollbar.getOffset() * 2; @@ -116,13 +117,17 @@ public class GuiCraftingPreview extends GuiBase { GlStateManager.pushMatrix(); GlStateManager.scale(scale, scale, 1); + int yy = y + 8; + if (stack.needsCrafting()) { String format = stack.cantCraft() ? "gui.refinedstorage:crafting_preview.missing" : "gui.refinedstorage:crafting_preview.to_craft"; - drawString(calculateOffsetOnScale(x + 20, scale), calculateOffsetOnScale(y + 8, scale), t(format, stack.getToCraft())); + drawString(calculateOffsetOnScale(x + 23, scale), calculateOffsetOnScale(yy, scale), t(format, stack.getToCraft())); + + yy += 15; } if (stack.getStock() > 0) { - drawString(calculateOffsetOnScale(x + 20, scale), calculateOffsetOnScale(y + 13, scale), t("gui.refinedstorage:crafting_preview.available", stack.getStock())); + drawString(calculateOffsetOnScale(x + 23, scale), calculateOffsetOnScale(yy, scale), t("gui.refinedstorage:crafting_preview.available", stack.getStock())); } GlStateManager.popMatrix(); @@ -132,7 +137,7 @@ public class GuiCraftingPreview extends GuiBase { } } - if (i%2 == 1) { + if (i % 2 == 1) { x -= 68; y += 30; } else { diff --git a/src/main/resources/assets/refinedstorage/textures/gui/crafting_preview.png b/src/main/resources/assets/refinedstorage/textures/gui/crafting_preview.png index a1950cafcc58f1f2ef37dc3a003aa9febf585076..a37a2cbff531620394da8bc64d7bfafef964af92 100644 GIT binary patch literal 1789 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5Fo{p?&#~tz_78O`%fY(0|PTd zfKP}kP~6qLG}_)Usv{fED}N*Mto1(s)0h1C9V-A z!TD(=<%vb93~dIoxi25Y&v4lpn<`FpxJhE&A8y?HS2mIH%pVEcq= z|Nkd$H_H!PvPr6$eQ&YoOU=j!Go2$gu6b=#|9Wy=|MoSfbN|ibd?KW*JHO!n?eoHo zF-c2gAEbZNoBp30D4NSqdFlwTbW;eg)0r;833Ld+>Yb9y=H7Rofd&Ye`&aQyNf)`U+$b0>V3 zlLHz5L{k`OO~ah;A3!_>|CtsbL8#r}ki5WKP^o!f)82ny_VPV=??2D5__Q|Tw*O5x zcgueh-TPswy)whiTMQ}L%oEn~I&3o=IF5Jpb^DtSy*)H1I9vjG#?#f$Wt~$(697Mc B1-AeI literal 1941 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5Fo{p?&#~tz_78O`%fY(0|PTd zfKP}kP~6^|}#ootT z{{5G~cj}7FrDq;_xlP6z4i4~ zi&roeR5!B-I52$E^JZXV5oowAtVm_%OZ6t*BNxUda)YFXb`pq@BRWcr^{`$Q?S=NX7$3zAujsy2nITe5rfG1WO81CFtKnjQl-`GG} z-o%D!H{4cbIR5#b*;VE>^>^+re9YDG{C|_)+ojsOADoKgJRmchVgKjC(DN)01ZVD8 zmCp2`!zbpdF=K^`+PYUW8Elk^|zWXu2n