Fixed craftable items showing "1 total" if not stored in system in Grid

This commit is contained in:
raoulvdberge
2017-12-07 21:13:33 +01:00
parent 127857d9b5
commit 0546d227c5
2 changed files with 19 additions and 10 deletions

View File

@@ -6,6 +6,7 @@
- Fixed Exporter in Regulator Mode not regulating properly when same item is specified multiple times (raoulvdberge) - Fixed Exporter in Regulator Mode not regulating properly when same item is specified multiple times (raoulvdberge)
- Fixed air appearing in Grid (raoulvdberge) - Fixed air appearing in Grid (raoulvdberge)
- Fixed config categories not correctly appearing in ingame config GUI (raoulvdberge) - Fixed config categories not correctly appearing in ingame config GUI (raoulvdberge)
- Fixed craftable items showing "1 total" if not stored in system in Grid (raoulvdberge)
- Removed "detailed" Grid view type variant, made detailed tooltips a config option instead (raoulvdberge) - Removed "detailed" Grid view type variant, made detailed tooltips a config option instead (raoulvdberge)
### 1.5.25 ### 1.5.25

View File

@@ -509,7 +509,9 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
List<String> textLines = Lists.newArrayList(gridStack.getTooltip().split("\n")); List<String> textLines = Lists.newArrayList(gridStack.getTooltip().split("\n"));
if (RS.INSTANCE.config.detailedTooltip) { if (RS.INSTANCE.config.detailedTooltip) {
textLines.add(""); if (!(gridStack instanceof GridStackItem) || !((GridStackItem) gridStack).doesDisplayCraftText()) {
textLines.add("");
}
if (gridStack.getTrackerEntry() != null) { if (gridStack.getTrackerEntry() != null) {
textLines.add(""); textLines.add("");
@@ -550,10 +552,14 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
// RS BEGIN // RS BEGIN
if (RS.INSTANCE.config.detailedTooltip) { if (RS.INSTANCE.config.detailedTooltip) {
int size = (int) (font.getStringWidth(I18n.format("misc.refinedstorage:total", gridStack.getFormattedFullQuantity())) * textScale); int size;
if (size > tooltipTextWidth) { if (!(gridStack instanceof GridStackItem) || !((GridStackItem) gridStack).doesDisplayCraftText()) {
tooltipTextWidth = size; size = (int) (font.getStringWidth(I18n.format("misc.refinedstorage:total", gridStack.getFormattedFullQuantity())) * textScale);
if (size > tooltipTextWidth) {
tooltipTextWidth = size;
}
} }
if (gridStack.getTrackerEntry() != null) { if (gridStack.getTrackerEntry() != null) {
@@ -618,12 +624,14 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
GlStateManager.scale(textScale, textScale, 1); GlStateManager.scale(textScale, textScale, 1);
font.drawStringWithShadow( if (!(gridStack instanceof GridStackItem) || !((GridStackItem) gridStack).doesDisplayCraftText()) {
TextFormatting.GRAY + I18n.format("misc.refinedstorage:total", gridStack.getFormattedFullQuantity()), font.drawStringWithShadow(
RenderUtils.getOffsetOnScale(tooltipX, textScale), TextFormatting.GRAY + I18n.format("misc.refinedstorage:total", gridStack.getFormattedFullQuantity()),
RenderUtils.getOffsetOnScale(tooltipTop + tooltipHeight - (gridStack.getTrackerEntry() != null ? 15 : 6) - (font.getUnicodeFlag() ? 2 : 0), textScale), RenderUtils.getOffsetOnScale(tooltipX, textScale),
-1 RenderUtils.getOffsetOnScale(tooltipTop + tooltipHeight - (gridStack.getTrackerEntry() != null ? 15 : 6) - (font.getUnicodeFlag() ? 2 : 0), textScale),
); -1
);
}
if (gridStack.getTrackerEntry() != null) { if (gridStack.getTrackerEntry() != null) {
font.drawStringWithShadow( font.drawStringWithShadow(