Fixed Refined Storage not drawing small text correctly with Unicode font
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
- Fixed Grid crash with search field (raoulvdberge)
|
||||
- Fixed External Storage not working without Storage Drawers (raoulvdberge)
|
||||
- Fixed External Storage not calculating max stack size in the calculation of it's capacity display in the GUI (raoulvdberge)
|
||||
- Fixed Refined Storage not drawing small text correctly with Unicode font (raoulvdberge)
|
||||
|
||||
### 1.5.14
|
||||
- Updated Forge to 2426 (raoulvdberge)
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.raoulvdberge.refinedstorage.api.render;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
@@ -35,6 +36,11 @@ public interface IElementDrawers {
|
||||
return getNullDrawer();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the font renderer
|
||||
*/
|
||||
FontRenderer getFontRenderer();
|
||||
|
||||
/**
|
||||
* DO NOT OVERRIDE!
|
||||
*
|
||||
|
@@ -29,7 +29,7 @@ public class CraftingMonitorElementFluidRender implements ICraftingMonitorElemen
|
||||
public void draw(int x, int y, IElementDrawers drawers) {
|
||||
drawers.getFluidDrawer().draw(x + 2 + offset, y + 1, stack);
|
||||
|
||||
float scale = 0.5f;
|
||||
float scale = drawers.getFontRenderer().getUnicodeFlag() ? 1F : 0.5F;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.scale(scale, scale, 1);
|
||||
|
@@ -31,7 +31,7 @@ public class CraftingMonitorElementItemRender implements ICraftingMonitorElement
|
||||
public void draw(int x, int y, IElementDrawers drawers) {
|
||||
drawers.getItemDrawer().draw(x + 2 + offset, y + 1, stack);
|
||||
|
||||
float scale = 0.5f;
|
||||
float scale = drawers.getFontRenderer().getUnicodeFlag() ? 1F : 0.5F;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.scale(scale, scale, 1);
|
||||
|
@@ -32,7 +32,7 @@ public class CraftingMonitorElementText implements ICraftingMonitorElement {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void draw(int x, int y, IElementDrawers drawers) {
|
||||
float scale = 0.5f;
|
||||
float scale = drawers.getFontRenderer().getUnicodeFlag() ? 1F : 0.5F;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.scale(scale, scale, 1);
|
||||
|
@@ -69,7 +69,7 @@ public class CraftingPreviewElementFluidStack implements ICraftingPreviewElement
|
||||
y += 7;
|
||||
drawers.getFluidDrawer().draw(x, y, getElement());
|
||||
|
||||
float scale = 0.5f;
|
||||
float scale = drawers.getFontRenderer().getUnicodeFlag() ? 1F : 0.5F;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.scale(scale, scale, 1);
|
||||
|
@@ -68,11 +68,14 @@ public class CraftingPreviewElementItemStack implements ICraftingPreviewElement<
|
||||
if (missing) {
|
||||
drawers.getOverlayDrawer().draw(x, y, 0xFFF2DEDE);
|
||||
}
|
||||
|
||||
x += 5;
|
||||
y += 7;
|
||||
|
||||
drawers.getItemDrawer().draw(x, y, getElement());
|
||||
|
||||
float scale = 0.5f;
|
||||
float scale = drawers.getFontRenderer().getUnicodeFlag() ? 1F : 0.5F;
|
||||
|
||||
y += 2;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
@@ -6,6 +6,7 @@ import com.raoulvdberge.refinedstorage.api.render.IElementDrawers;
|
||||
import com.raoulvdberge.refinedstorage.gui.sidebutton.SideButton;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFluid;
|
||||
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
@@ -49,6 +50,11 @@ public abstract class GuiBase extends GuiContainer {
|
||||
public IElementDrawer<String> getStringDrawer() {
|
||||
return GuiBase.this::drawString;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontRenderer getFontRenderer() {
|
||||
return fontRenderer;
|
||||
}
|
||||
}
|
||||
|
||||
private int lastButtonId;
|
||||
|
@@ -74,7 +74,7 @@ public class GuiController extends GuiBase {
|
||||
|
||||
drawItem(x, y + 5, node.getStack());
|
||||
|
||||
float scale = 0.5f;
|
||||
float scale = fontRenderer.getUnicodeFlag() ? 1F : 0.5F;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.scale(scale, scale, 1);
|
||||
|
@@ -105,7 +105,8 @@ public class GuiCraftingPreview extends GuiBase {
|
||||
|
||||
int x = 7;
|
||||
int y = 15;
|
||||
float scale = 0.5f;
|
||||
|
||||
float scale = fontRenderer.getUnicodeFlag() ? 1F : 0.5F;
|
||||
|
||||
if (stacks.isEmpty()) {
|
||||
GlStateManager.pushMatrix();
|
||||
|
@@ -100,6 +100,8 @@ public class GuiReaderWriter extends GuiBase {
|
||||
|
||||
int item = scrollbar != null ? scrollbar.getOffset() : 0;
|
||||
|
||||
float scale = fontRenderer.getUnicodeFlag() ? 1F : 0.5F;
|
||||
|
||||
for (int i = 0; i < VISIBLE_ROWS; ++i) {
|
||||
if (item < getChannels().size()) {
|
||||
if (item == itemSelected) {
|
||||
@@ -107,8 +109,6 @@ public class GuiReaderWriter extends GuiBase {
|
||||
itemSelectedY = y;
|
||||
}
|
||||
|
||||
float scale = 0.5f;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.scale(scale, scale, 1);
|
||||
|
||||
|
Reference in New Issue
Block a user