Code style fixes

This commit is contained in:
Raoul Van den Berge
2016-03-25 22:22:31 +01:00
parent 25b302f914
commit 002b5c0dda

View File

@@ -49,11 +49,9 @@ public class GuiController extends GuiBase {
scrollbar.draw(this); scrollbar.draw(this);
} }
private int calculateOffsetOnScale(int pos ,float scale) private int calculateOffsetOnScale(int pos, float scale) {
{ float multiplier = (pos / scale);
float multiplier = (pos / scale); return (int) multiplier;
return (int)multiplier;
} }
@Override @Override
@@ -70,8 +68,6 @@ public class GuiController extends GuiBase {
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting();
ItemStack hoveringMachineStack = null;
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
if (slot < controller.getMachines().size()) { if (slot < controller.getMachines().size()) {
TileMachine machine = controller.getMachines().get(slot); TileMachine machine = controller.getMachines().get(slot);
@@ -80,17 +76,13 @@ public class GuiController extends GuiBase {
ItemStack machineStack = new ItemStack(machineBlock, 1, machineBlock.getMetaFromState(machineState)); ItemStack machineStack = new ItemStack(machineBlock, 1, machineBlock.getMetaFromState(machineState));
if (inBounds(x, y, 16, 16, mouseX, mouseY)) { drawItem(x, y + 5, machineStack);
hoveringMachineStack = machineStack;
}
drawItem(x, y+5, machineStack);
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
float scale = 0.5f; float scale = 0.5f;
GlStateManager.scale(scale,scale,1); GlStateManager.scale(scale, scale, 1);
drawString(calculateOffsetOnScale(x+1,scale) , calculateOffsetOnScale(y-3,scale), machineStack.getDisplayName()); drawString(calculateOffsetOnScale(x + 1, scale), calculateOffsetOnScale(y - 3, scale), machineStack.getDisplayName());
drawString(calculateOffsetOnScale(x+21,scale), calculateOffsetOnScale(y+10,scale),t("misc.refinedstorage:energy_usage_minimal", machine.getEnergyUsage())); drawString(calculateOffsetOnScale(x + 21, scale), calculateOffsetOnScale(y + 10, scale), t("misc.refinedstorage:energy_usage_minimal", machine.getEnergyUsage()));
GlStateManager.popMatrix(); GlStateManager.popMatrix();
} }
@@ -104,13 +96,6 @@ public class GuiController extends GuiBase {
slot++; slot++;
} }
/* Not needed?
if (hoveringMachineStack != null) {
drawTooltip(mouseX, mouseY, hoveringMachineStack);
}
*/
if (inBounds(barX, barY, barWidth, barHeight, mouseX, mouseY)) { if (inBounds(barX, barY, barWidth, barHeight, mouseX, mouseY)) {
drawTooltip(mouseX, mouseY, t("misc.refinedstorage:energy_usage", controller.getEnergyUsage()) + "\n" + t("misc.refinedstorage:energy_stored", controller.getEnergyStored(null), controller.getMaxEnergyStored(null))); drawTooltip(mouseX, mouseY, t("misc.refinedstorage:energy_usage", controller.getEnergyUsage()) + "\n" + t("misc.refinedstorage:energy_stored", controller.getEnergyStored(null), controller.getMaxEnergyStored(null)));
} }