RF power tool tips, tell me where I missed them
This commit is contained in:
parent
b61acffc68
commit
fff846b512
9 changed files with 31 additions and 45 deletions
|
@ -10,6 +10,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|||
import org.lwjgl.input.Keyboard;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.api.power.IEnergyInterfaceItem;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.util.Color;
|
||||
import techreborn.Core;
|
||||
|
||||
|
@ -30,10 +31,10 @@ public class StackToolTipEvent {
|
|||
} else {
|
||||
color = ChatFormatting.YELLOW;
|
||||
}
|
||||
event.toolTip.add(color + "" + (int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getEnergy(event.itemStack) + ChatFormatting.LIGHT_PURPLE + " stored eu");
|
||||
event.toolTip.add(Color.GREEN + "" + (int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxPower(event.itemStack) + ChatFormatting.LIGHT_PURPLE + " max eu");
|
||||
event.toolTip.add(color + "" + PowerSystem.getLocaliszedPower((int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getEnergy(event.itemStack)) + ChatFormatting.LIGHT_PURPLE + " stored");
|
||||
event.toolTip.add(Color.GREEN + "" + PowerSystem.getLocaliszedPower((int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxPower(event.itemStack)) + ChatFormatting.LIGHT_PURPLE + " max");
|
||||
event.toolTip.add(ChatFormatting.GREEN + "" + percentage + "%" + ChatFormatting.LIGHT_PURPLE + " charged");
|
||||
event.toolTip.add(Color.GREEN + "" + (int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxTransfer(event.itemStack) + ChatFormatting.LIGHT_PURPLE + " eu/tick in/out");
|
||||
event.toolTip.add(Color.GREEN + "" + PowerSystem.getLocaliszedPower((int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxTransfer(event.itemStack)) + ChatFormatting.LIGHT_PURPLE + " /tick in/out");
|
||||
}
|
||||
} else {
|
||||
try{
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import reborncore.common.packets.PacketHandler;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.client.container.ContainerAesu;
|
||||
import techreborn.packets.PacketAesu;
|
||||
import techreborn.tiles.TileAesu;
|
||||
|
@ -57,9 +58,9 @@ public class GuiAesu extends GuiContainer {
|
|||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_) {
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("tile.techreborn.aesu.name"), 40, 10, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString((int) containerAesu.euOut + " eu/tick", 10, 20, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString((int) containerAesu.storedEu + " eu", 10, 30, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString((int) containerAesu.euChange + " eu change", 10, 40, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euOut) + " /tick", 10, 20, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.storedEu) + " ", 10, 30, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euChange) + " change", 10, 40, Color.WHITE.getRGB());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.client.resources.I18n;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.client.container.ContainerDieselGenerator;
|
||||
import techreborn.tiles.generator.TileDieselGenerator;
|
||||
|
||||
|
@ -47,8 +48,8 @@ public class GuiDieselGenerator extends GuiContainer {
|
|||
this.fontRendererObj.drawString(containerDieselGenerator.fluid + "", 10,
|
||||
30, 16448255);
|
||||
|
||||
this.fontRendererObj.drawString("EU Amount", 10, 40, 16448255);
|
||||
this.fontRendererObj.drawString(containerDieselGenerator.energy + "", 10,
|
||||
this.fontRendererObj.drawString("Power Amount", 10, 40, 16448255);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerDieselGenerator.energy) + "", 10,
|
||||
50, 16448255);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.util.StatCollector;
|
|||
import reborncore.client.multiblock.MultiblockSet;
|
||||
import reborncore.common.misc.Location;
|
||||
import reborncore.common.multiblock.CoordTriplet;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.client.ClientMultiBlocks;
|
||||
import techreborn.client.container.ContainerFusionReactor;
|
||||
import techreborn.proxies.ClientProxy;
|
||||
|
@ -38,10 +39,10 @@ public class GuiFusionReactor extends GuiContainer {
|
|||
this.fontRendererObj.drawString(name, 87, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
|
||||
this.fontRendererObj.drawString("EU: " + containerFusionReactor.energy, 11, 8, 16448255);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerFusionReactor.energy), 11, 8, 16448255);
|
||||
this.fontRendererObj.drawString("Coils: " + (containerFusionReactor.coilStatus == 1 ? "Yes" : "No"), 11, 16, 16448255);
|
||||
if(containerFusionReactor.neededEU > 1 && containerFusionReactor.tickTime < 1)
|
||||
this.fontRendererObj.drawString("Start EU: " + percentage(containerFusionReactor.neededEU, containerFusionReactor.energy) + "%", 11, 24, 16448255);
|
||||
this.fontRendererObj.drawString("Start: " + percentage(containerFusionReactor.neededEU, containerFusionReactor.energy) + "%", 11, 24, 16448255);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.client.container.ContainerGenerator;
|
||||
import techreborn.tiles.generator.TileGenerator;
|
||||
|
||||
|
@ -58,6 +59,6 @@ public class GuiGenerator extends GuiContainer {
|
|||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
|
||||
this.fontRendererObj.drawString(containerGenerator.energy + "eu", 25, this.ySize- 150, 4210752);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 25, this.ySize- 150, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import reborncore.common.packets.PacketHandler;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.client.container.ContainerIDSU;
|
||||
import techreborn.packets.PacketIdsu;
|
||||
import techreborn.tiles.idsu.TileIDSU;
|
||||
|
@ -59,9 +60,9 @@ public class GuiIDSU extends GuiContainer {
|
|||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_) {
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("tile.techreborn.idsu.name"), 40, 10, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(containerIDSU.euOut + " eu/tick", 10, 20, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(containerIDSU.storedEu + " eu", 10, 30, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(containerIDSU.euChange + " eu change", 10, 40, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euOut) + "/tick", 10, 20, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.storedEu), 10, 30, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euChange) + " change", 10, 40, Color.WHITE.getRGB());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,6 +5,7 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.client.container.ContainerLesu;
|
||||
import techreborn.tiles.lesu.TileLesu;
|
||||
|
||||
|
@ -41,22 +42,11 @@ public class GuiLesu extends GuiContainer {
|
|||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_) {
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("tile.techreborn.lesu.name"), 40, 10, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(GetEUString(containerLesu.euOut) + "/t", 10, 20, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(GetEUString(containerLesu.storedEu), 10, 30, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(GetEUString(containerLesu.euChange) + " change", 10, 40, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euOut) + "/t", 10, 20, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.storedEu), 10, 30, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euChange) + " change", 10, 40, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(containerLesu.connectedBlocks + " blocks", 10, 50, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(GetEUString(containerLesu.euStorage) + " max", 10, 60, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euStorage) + " max", 10, 60, Color.WHITE.getRGB());
|
||||
}
|
||||
|
||||
private String GetEUString(double euValue) {
|
||||
if (euValue >= 1000000) {
|
||||
double tenX = Math.round(euValue / 100000);
|
||||
return Double.toString(tenX / 10.0).concat(" m EU");
|
||||
} else if (euValue >= 1000) {
|
||||
double tenX = Math.round(euValue / 100);
|
||||
return Double.toString(tenX / 10.0).concat(" k EU");
|
||||
} else {
|
||||
return Double.toString(Math.floor(euValue)).concat(" EU");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
|||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import reborncore.api.power.IEnergyInterfaceItem;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.util.Color;
|
||||
import techreborn.client.keybindings.KeyBindings;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
|
@ -67,7 +68,7 @@ public class ChargeHud {
|
|||
if (CurrentCharge <= quarter) {
|
||||
color = Color.DARK_RED;
|
||||
}
|
||||
mc.fontRendererObj.drawString(color + GetEUString(CurrentCharge) + "/" + GetEUString(MaxCharge), 20, y, 0);
|
||||
mc.fontRendererObj.drawString(color + PowerSystem.getLocaliszedPower(CurrentCharge) + "/" + PowerSystem.getLocaliszedPower(MaxCharge), 20, y, 0);
|
||||
y += 20;
|
||||
}
|
||||
|
||||
|
@ -89,7 +90,7 @@ public class ChargeHud {
|
|||
if (CurrentCharge <= quarter) {
|
||||
color = Color.DARK_RED;
|
||||
}
|
||||
mc.fontRendererObj.drawString(color + GetEUString(CurrentCharge) + "/" + GetEUString(MaxCharge), 20, y, 0);
|
||||
mc.fontRendererObj.drawString(color + PowerSystem.getLocaliszedPower(CurrentCharge) + "/" + PowerSystem.getLocaliszedPower(MaxCharge), 20, y, 0);
|
||||
}
|
||||
}
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
@ -110,15 +111,4 @@ public class ChargeHud {
|
|||
}
|
||||
}
|
||||
|
||||
private String GetEUString(double euValue) {
|
||||
if (euValue > 1000000) {
|
||||
double tenX = Math.round(euValue / 100000);
|
||||
return Double.toString(tenX / 10.0).concat("M ");
|
||||
} else if (euValue > 1000) {
|
||||
double tenX = Math.round(euValue / 100);
|
||||
return Double.toString(tenX / 10.0).concat("k ");
|
||||
} else {
|
||||
return Double.toString(Math.floor(euValue)).concat(" EU");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.tiles.TileAesu;
|
||||
|
||||
|
@ -32,9 +33,8 @@ public class ItemBlockAesu extends ItemBlock {
|
|||
boolean par4) {
|
||||
if (stack != null && stack.hasTagCompound()) {
|
||||
if (stack.getTagCompound().getCompoundTag("tileEntity") != null)
|
||||
list.add(stack.getTagCompound().getCompoundTag("tileEntity")
|
||||
.getInteger("energy")
|
||||
+ " eu");
|
||||
list.add(PowerSystem.getLocaliszedPower(stack.getTagCompound().getCompoundTag("tileEntity")
|
||||
.getInteger("energy")));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue