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) {
if (!(gridStack instanceof GridStackItem) || !((GridStackItem) gridStack).doesDisplayCraftText()) {
textLines.add(""); textLines.add("");
}
if (gridStack.getTrackerEntry() != null) { if (gridStack.getTrackerEntry() != null) {
textLines.add(""); textLines.add("");
@@ -550,11 +552,15 @@ 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 (!(gridStack instanceof GridStackItem) || !((GridStackItem) gridStack).doesDisplayCraftText()) {
size = (int) (font.getStringWidth(I18n.format("misc.refinedstorage:total", gridStack.getFormattedFullQuantity())) * textScale);
if (size > tooltipTextWidth) { if (size > tooltipTextWidth) {
tooltipTextWidth = size; tooltipTextWidth = size;
} }
}
if (gridStack.getTrackerEntry() != null) { if (gridStack.getTrackerEntry() != null) {
size = (int) (font.getStringWidth(TimeUtils.getAgo(gridStack.getTrackerEntry().getTime(), gridStack.getTrackerEntry().getName())) * textScale); size = (int) (font.getStringWidth(TimeUtils.getAgo(gridStack.getTrackerEntry().getTime(), gridStack.getTrackerEntry().getName())) * textScale);
@@ -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);
if (!(gridStack instanceof GridStackItem) || !((GridStackItem) gridStack).doesDisplayCraftText()) {
font.drawStringWithShadow( font.drawStringWithShadow(
TextFormatting.GRAY + I18n.format("misc.refinedstorage:total", gridStack.getFormattedFullQuantity()), TextFormatting.GRAY + I18n.format("misc.refinedstorage:total", gridStack.getFormattedFullQuantity()),
RenderUtils.getOffsetOnScale(tooltipX, textScale), RenderUtils.getOffsetOnScale(tooltipX, textScale),
RenderUtils.getOffsetOnScale(tooltipTop + tooltipHeight - (gridStack.getTrackerEntry() != null ? 15 : 6) - (font.getUnicodeFlag() ? 2 : 0), textScale), RenderUtils.getOffsetOnScale(tooltipTop + tooltipHeight - (gridStack.getTrackerEntry() != null ? 15 : 6) - (font.getUnicodeFlag() ? 2 : 0), textScale),
-1 -1
); );
}
if (gridStack.getTrackerEntry() != null) { if (gridStack.getTrackerEntry() != null) {
font.drawStringWithShadow( font.drawStringWithShadow(