Shift for more info on powerbar. Closes FTBTeam/FTB-Continuum#261

This commit is contained in:
drcrazy 2018-06-25 12:26:07 +03:00
parent 7124ee6a11
commit 96d78c11a8

View file

@ -38,7 +38,6 @@ import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.client.config.GuiUtils; import net.minecraftforge.fml.client.config.GuiUtils;
import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Loader;
import org.lwjgl.input.Keyboard;
import reborncore.api.tile.IUpgradeable; import reborncore.api.tile.IUpgradeable;
import reborncore.client.guibuilder.GuiBuilder; import reborncore.client.guibuilder.GuiBuilder;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
@ -89,13 +88,13 @@ public class TRBuilder extends GuiBuilder {
TextFormatting powerColour = TextFormatting.GOLD; TextFormatting powerColour = TextFormatting.GOLD;
list.add(powerColour + PowerSystem.getLocaliszedPowerFormattedNoSuffix(energyStored) + "/" + PowerSystem.getLocaliszedPowerFormattedNoSuffix(maxEnergyStored) + " " + PowerSystem.getDisplayPower().abbreviation); list.add(powerColour + PowerSystem.getLocaliszedPowerFormattedNoSuffix(energyStored) + "/" + PowerSystem.getLocaliszedPowerFormattedNoSuffix(maxEnergyStored) + " " + PowerSystem.getDisplayPower().abbreviation);
list.add(getPercentageColour(percentage) + "" + percentage + "%" + TextFormatting.GRAY + " Charged"); list.add(getPercentageColour(percentage) + "" + percentage + "%" + TextFormatting.GRAY + " Charged");
if(gui.tile instanceof TilePowerAcceptor && Keyboard.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindSneak.getKeyCode())){ if(gui.tile instanceof TilePowerAcceptor && GuiScreen.isShiftKeyDown()){
((TilePowerAcceptor) gui.tile).addInfo(list, true); ((TilePowerAcceptor) gui.tile).addInfo(list, true);
list.add(""); list.add("");
list.add(TextFormatting.BLUE + "Click to change display unit"); list.add(TextFormatting.BLUE + "Click to change display unit");
} else { } else {
list.add(""); list.add("");
list.add(TextFormatting.BLUE + Minecraft.getMinecraft().gameSettings.keyBindSneak.getDisplayName() + TextFormatting.GRAY + " more info"); list.add(TextFormatting.BLUE + "Shift" + TextFormatting.GRAY + " for more info");
} }
net.minecraftforge.fml.client.config.GuiUtils.drawHoveringText(list, mouseX, mouseY, gui.width, gui.height, -1, gui.mc.fontRenderer); net.minecraftforge.fml.client.config.GuiUtils.drawHoveringText(list, mouseX, mouseY, gui.width, gui.height, -1, gui.mc.fontRenderer);
GlStateManager.disableLighting(); GlStateManager.disableLighting();