From 2ed22acb671d1e02c861d4e286f1dc2729635c9a Mon Sep 17 00:00:00 2001 From: Raoul Van den Berge Date: Tue, 29 Mar 2016 00:51:08 +0200 Subject: [PATCH] Remove unneeded explanation, change behaviour of quantity slots a bit --- .../container/ContainerBase.java | 46 +++++++++--------- .../container/ContainerGrid.java | 4 +- src/main/java/refinedstorage/gui/GuiGrid.java | 2 +- .../java/refinedstorage/gui/GuiInterface.java | 8 --- .../assets/refinedstorage/lang/en_US.lang | 3 -- .../assets/refinedstorage/lang/nl_NL.lang | 3 -- .../refinedstorage/textures/gui/interface.png | Bin 1921 -> 1891 bytes 7 files changed, 26 insertions(+), 40 deletions(-) diff --git a/src/main/java/refinedstorage/container/ContainerBase.java b/src/main/java/refinedstorage/container/ContainerBase.java index 77224ef32..2a876fd14 100755 --- a/src/main/java/refinedstorage/container/ContainerBase.java +++ b/src/main/java/refinedstorage/container/ContainerBase.java @@ -57,7 +57,29 @@ public abstract class ContainerBase extends Container { if (slot instanceof SlotSpecimen) { if (((SlotSpecimen) slot).isSizeAllowed()) { - if (player.inventory.getItemStack() != null) { + if (slot.getStack() != null) { + if (GuiScreen.isShiftKeyDown()) { + slot.putStack(null); + } else { + int amount = slot.getStack().stackSize; + + if (clickedButton == 0) { + amount--; + + if (amount < 1) { + amount = 1; + } + } else if (clickedButton == 1) { + amount++; + + if (amount > 64) { + amount = 64; + } + } + + slot.getStack().stackSize = amount; + } + } else if (player.inventory.getItemStack() != null) { int amount = player.inventory.getItemStack().stackSize; if (clickedButton == 1) { @@ -68,28 +90,6 @@ public abstract class ContainerBase extends Container { toPut.stackSize = amount; slot.putStack(toPut); - } else if (slot.getStack() != null) { - if (GuiScreen.isShiftKeyDown()) { - slot.putStack(null); - } else { - int amount = slot.getStack().stackSize; - - if (clickedButton == 0) { - amount++; - - if (amount > 64) { - amount = 64; - } - } else if (clickedButton == 1) { - amount--; - - if (amount < 1) { - amount = 1; - } - } - - slot.getStack().stackSize = amount; - } } } else if (player.inventory.getItemStack() == null) { slot.putStack(null); diff --git a/src/main/java/refinedstorage/container/ContainerGrid.java b/src/main/java/refinedstorage/container/ContainerGrid.java index 4bc86fc1e..0234cab7b 100755 --- a/src/main/java/refinedstorage/container/ContainerGrid.java +++ b/src/main/java/refinedstorage/container/ContainerGrid.java @@ -49,8 +49,8 @@ public class ContainerGrid extends ContainerBase { // I'm overriding detectAndSendChanges() here because the default check // checks if the item stacks are equal, and if so, then it will only send the new slot contents. // The thing is though, when the grid replaces the slots with new items from the storage - // system, the item stack replaced WILL be the same! - // That's why we override this here to get rid of the check and ALWAYS send slot changes. + // system, the item stack replaced WILL be the same and thus changes will not be sent! + // That is why we override here to get rid of the check and ALWAYS send slot changes. @Override public void detectAndSendChanges() { for (int i = 0; i < this.inventorySlots.size(); ++i) { diff --git a/src/main/java/refinedstorage/gui/GuiGrid.java b/src/main/java/refinedstorage/gui/GuiGrid.java index 00bedd564..17ae74a6d 100755 --- a/src/main/java/refinedstorage/gui/GuiGrid.java +++ b/src/main/java/refinedstorage/gui/GuiGrid.java @@ -248,7 +248,7 @@ public class GuiGrid extends GuiBase { if (grid.isConnected()) { TileController controller = grid.getController(); - if (isHoveringOverSlot() && container.getPlayer().inventory.getItemStack() != null) { + if (isHoveringOverSlot() && container.getPlayer().inventory.getItemStack() != null && (clickedButton == 0 || clickedButton == 1)) { RefinedStorage.NETWORK.sendToServer(new MessageStoragePush(controller.getPos().getX(), controller.getPos().getY(), controller.getPos().getZ(), -1, clickedButton == 1)); } else if (isHoveringOverItemInSlot() && container.getPlayer().inventory.getItemStack() == null) { boolean half = clickedButton == 1; diff --git a/src/main/java/refinedstorage/gui/GuiInterface.java b/src/main/java/refinedstorage/gui/GuiInterface.java index 2a402f3a6..6242b976d 100755 --- a/src/main/java/refinedstorage/gui/GuiInterface.java +++ b/src/main/java/refinedstorage/gui/GuiInterface.java @@ -39,13 +39,5 @@ public class GuiInterface extends GuiBase { drawString(7, 7, t("gui.refinedstorage:interface.import")); drawString(7, 42, t("gui.refinedstorage:interface.export")); drawString(7, 123, t("container.inventory")); - - if (inBounds(162, 42, 7, 7, mouseX, mouseY)) { - String message = t("gui.refinedstorage:interface.export.explanation.0"); - message += "\n" + t("gui.refinedstorage:interface.export.explanation.1"); - message += "\n" + t("gui.refinedstorage:interface.export.explanation.2"); - - drawTooltip(mouseX, mouseY, message); - } } } diff --git a/src/main/resources/assets/refinedstorage/lang/en_US.lang b/src/main/resources/assets/refinedstorage/lang/en_US.lang index 368495c67..b50764d79 100755 --- a/src/main/resources/assets/refinedstorage/lang/en_US.lang +++ b/src/main/resources/assets/refinedstorage/lang/en_US.lang @@ -17,9 +17,6 @@ gui.refinedstorage:constructor=Constructor gui.refinedstorage:relay=Relay gui.refinedstorage:interface.import=Interface Import gui.refinedstorage:interface.export=Interface Export -gui.refinedstorage:interface.export.explanation.0=Top slots: items you want exported -gui.refinedstorage:interface.export.explanation.1=Clear a slot: mouse click + SHIFT -gui.refinedstorage:interface.export.explanation.2=Incr. or decr. a slot: left/ right mouse click misc.refinedstorage:energy_stored=%d / %d RF misc.refinedstorage:energy_usage=Usage: %d RF/t diff --git a/src/main/resources/assets/refinedstorage/lang/nl_NL.lang b/src/main/resources/assets/refinedstorage/lang/nl_NL.lang index e2135d7c1..b57f86d95 100755 --- a/src/main/resources/assets/refinedstorage/lang/nl_NL.lang +++ b/src/main/resources/assets/refinedstorage/lang/nl_NL.lang @@ -17,9 +17,6 @@ gui.refinedstorage:constructor=Constructor gui.refinedstorage:relay=Relais gui.refinedstorage:interface.import=Interface Import gui.refinedstorage:interface.export=Interface Export -gui.refinedstorage:interface.export.explanation.0=Bovenste slots: items die je wilt exporten -gui.refinedstorage:interface.export.explanation.1=Slot leegmaken: muisklik + SHIFT -gui.refinedstorage:interface.export.explanation.2=Verhoog of verklein aantal: links/ rechts muisklik misc.refinedstorage:energy_stored=%d / %d RF misc.refinedstorage:energy_usage=Vebruik: %d RF/t diff --git a/src/main/resources/assets/refinedstorage/textures/gui/interface.png b/src/main/resources/assets/refinedstorage/textures/gui/interface.png index 052e3350b274bc6d1c1ff6d1f57c286a79fe9f69..04066740e541448a5fdc2027b29d801d504378d1 100755 GIT binary patch delta 682 zcmZqVf6TWbgoW!M0|Vbd#vK#0-%gHWQLjJg>Eakt5%>1i#jM*70&Rg;JMaIWc-P|J zYtx-VX>DmYJ_kx{7EdY-$hq-q$K5{5yRWSCj+grJG96#?dw<rE5-l>D7<})|NgvDF8(?{d>5l#UCG~EZIBWmXn0e7BNFf3^mEk`tB;l28ig+p+r?P)>C2jr1+VvtLJfgg58^u9 zpDi1zeU`zPi6MdK!1e24cA;z_D-|KmNC$DT9-t!K`7= z9PMW>hf8k&YDm=9mZt1@O@hORWIWMJwUk$wb~Ggoxd8u zTmka^GyFO*gJV0oA~7aY@Aiq%rQ|6eZNbOhwy*+s(*dng^P>@^<2xo+$c%qojymj z;Y=>`gq^tzM%#HEo^4}1amS2d=502G;@b=h;e(T^vIy;@;l6*!9RkpzY$B7kmCI?{@od zXcVp#y2f>Wf9s@u9CMw+rr*n%e%frgckS)e-!p@o5176DSAXs+lX=7EDf{-HW-V)o zsdZprU^ubwG!u|Q;T_<8@H&6_nZ^J2T;eVGb@}}AwLleMu<3pBCK#K+?|ZnxykA?U zrZq@1GB7Co*5f|#ocT^Y%dY;T_B;Nne=PZR%YGeK!Qb=?j~M1PTxGmg$Mi{l>F?vF zjPrn2I(&=0rhnjX_p_Co%&m?3@5Q`i+wu2?-PMX6Und)|iPgWd?b`=2+JNoBudP%4 zr$Q|O*egkF{toZ{#9ix>`V_A4ec$w{tCrQUKY90hKijby zPP4oJWg2!n*om95Cy1X|eu|B8j`h2G5eIJuhAoUw=Dt~c?E60B{lw?*#R?fsYUW0s2(jUuAjLQb~p9dhWgH)-&Dp*Oo9p@vOe`!(jh* zP|Sb;G?KvV7uF|NBDtWBvFKaXm5P0{E5BUwGIyxUm79E&O{FrMxn?^<&hOIWA^Zh@ zCujR-yk@vDze)41d2Hli)pS;c;+qU9deRMNQkf_0%waH^&g<}O6XS^(GlrR`*@%$5 d{fJ@uX?wSahhIkceB1_dm#3?r%Q~loCIAqXBV_;p