Fixed device names overflowing Controller GUI
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
|
||||
### 1.5.19
|
||||
- Updated Forge to 2493 (MC 1.12.2) (raoulvdberge)
|
||||
- Fixed RS blocks requiring a pickaxe to be broken (raoulvdberge)
|
||||
- Fixed Refined Storage blocks requiring a pickaxe to be broken (raoulvdberge)
|
||||
- Fixed Grid GUI crash (raoulvdberge)
|
||||
- Fixed device names overflowing Controller GUI (raoulvdberge)
|
||||
|
||||
### 1.5.18
|
||||
- Added Project E integration for the External Storage on the Transmutation Table (raoulvdberge)
|
||||
|
||||
@@ -79,7 +79,7 @@ public class GuiController extends GuiBase {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.scale(scale, scale, 1);
|
||||
|
||||
drawString(RenderUtils.getOffsetOnScale(x + 1, scale), RenderUtils.getOffsetOnScale(y - 2, scale), node.getStack().getDisplayName());
|
||||
drawString(RenderUtils.getOffsetOnScale(x + 1, scale), RenderUtils.getOffsetOnScale(y - 2, scale), trimNameIfNeeded(!fontRenderer.getUnicodeFlag(), node.getStack().getDisplayName()));
|
||||
drawString(RenderUtils.getOffsetOnScale(x + 21, scale), RenderUtils.getOffsetOnScale(y + 10, scale), node.getAmount() + "x");
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
@@ -111,4 +111,12 @@ public class GuiController extends GuiBase {
|
||||
private int getRows() {
|
||||
return Math.max(0, (int) Math.ceil((float) TileController.NODES.getValue().size() / 2F));
|
||||
}
|
||||
|
||||
private String trimNameIfNeeded(boolean scaled, String name) {
|
||||
int max = scaled ? 20 : 13;
|
||||
if (name.length() > max) {
|
||||
name = name.substring(0, max) + "...";
|
||||
}
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user