mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 16:58:34 +01:00
more oil generator work.
This commit is contained in:
parent
538d77c831
commit
9bb1105c7c
2 changed files with 14 additions and 13 deletions
|
@ -77,10 +77,10 @@ public class GuiOilGenerator extends AAScreen<ContainerOilGenerator> {
|
||||||
drawCenteredString(matrices, this.font, this.generator.currentEnergyProduce + " " + I18n.get("actuallyadditions.fet"), this.leftPos + 87, this.topPos + 65, 0xFFFFFF);
|
drawCenteredString(matrices, this.font, this.generator.currentEnergyProduce + " " + I18n.get("actuallyadditions.fet"), this.leftPos + 87, this.topPos + 65, 0xFFFFFF);
|
||||||
drawCenteredString(matrices, this.font, "for " + this.generator.maxBurnTime + " t", this.leftPos + 87, this.topPos + 75, 0xFFFFFF);
|
drawCenteredString(matrices, this.font, "for " + this.generator.maxBurnTime + " t", this.leftPos + 87, this.topPos + 75, 0xFFFFFF);
|
||||||
matrices.pushPose();
|
matrices.pushPose();
|
||||||
matrices.scale(0.75F, 0.75F, 1F);
|
matrices.translate(this.leftPos + 87, this.topPos + 85, 0);
|
||||||
|
matrices.scale(0.5625F, 0.5625F, 1F);
|
||||||
int usage = this.generator.fuelUsage;
|
int usage = this.generator.fuelUsage;
|
||||||
float xS = (this.leftPos + 87) * 1.365F - this.font.width("(per " + usage + " mB)") / 2F;
|
drawCenteredString(matrices, this.font, "(per " + usage + " mB)",0, 0, 0xFFFFFF);
|
||||||
StringUtil.renderScaledAsciiString(this.font, "(per " + usage + " mB)", xS, (this.topPos + 85) * 1.345F, 0xFFFFFF, true, 0.75F);
|
|
||||||
matrices.popPose();
|
matrices.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.util;
|
package de.ellpeck.actuallyadditions.mod.util;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
|
@ -69,16 +71,15 @@ public final class StringUtil {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public static void renderScaledAsciiString(FontRenderer font, String text, float x, float y, int color, boolean shadow, float scale) {
|
public static void renderScaledString(MatrixStack matrices, FontRenderer font, String text, float x, float y, int color, boolean shadow, float scale) {
|
||||||
// GlStateManager._pushMatrix();
|
matrices.pushPose();
|
||||||
// GlStateManager.scale(scale, scale, scale);
|
matrices.translate(x, y, 0);
|
||||||
// boolean oldUnicode = font.getUnicodeFlag();
|
matrices.scale(scale, scale, 1.0F);
|
||||||
// font.setUnicodeFlag(false);
|
if (shadow)
|
||||||
//
|
font.drawShadow(matrices, text, 0, 0, color);
|
||||||
// font.draw(text, x / scale, y / scale, color, shadow);
|
else
|
||||||
//
|
font.draw(matrices, text, x, y, color);
|
||||||
// font.setUnicodeFlag(oldUnicode);
|
matrices.popPose();
|
||||||
// GlStateManager._popMatrix();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static void setupLangMap() {
|
// static void setupLangMap() {
|
||||||
|
|
Loading…
Reference in a new issue