mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-23 03:49:22 +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, "for " + this.generator.maxBurnTime + " t", this.leftPos + 87, this.topPos + 75, 0xFFFFFF);
|
||||
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;
|
||||
float xS = (this.leftPos + 87) * 1.365F - this.font.width("(per " + usage + " mB)") / 2F;
|
||||
StringUtil.renderScaledAsciiString(this.font, "(per " + usage + " mB)", xS, (this.topPos + 85) * 1.345F, 0xFFFFFF, true, 0.75F);
|
||||
drawCenteredString(matrices, this.font, "(per " + usage + " mB)",0, 0, 0xFFFFFF);
|
||||
matrices.popPose();
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
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 net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
@ -69,16 +71,15 @@ public final class StringUtil {
|
|||
// }
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static void renderScaledAsciiString(FontRenderer font, String text, float x, float y, int color, boolean shadow, float scale) {
|
||||
// GlStateManager._pushMatrix();
|
||||
// GlStateManager.scale(scale, scale, scale);
|
||||
// boolean oldUnicode = font.getUnicodeFlag();
|
||||
// font.setUnicodeFlag(false);
|
||||
//
|
||||
// font.draw(text, x / scale, y / scale, color, shadow);
|
||||
//
|
||||
// font.setUnicodeFlag(oldUnicode);
|
||||
// GlStateManager._popMatrix();
|
||||
public static void renderScaledString(MatrixStack matrices, FontRenderer font, String text, float x, float y, int color, boolean shadow, float scale) {
|
||||
matrices.pushPose();
|
||||
matrices.translate(x, y, 0);
|
||||
matrices.scale(scale, scale, 1.0F);
|
||||
if (shadow)
|
||||
font.drawShadow(matrices, text, 0, 0, color);
|
||||
else
|
||||
font.draw(matrices, text, x, y, color);
|
||||
matrices.popPose();
|
||||
}
|
||||
|
||||
// static void setupLangMap() {
|
||||
|
|
Loading…
Reference in a new issue