Java Code Examples for net.minecraft.client.settings.GameSettings#getKeyDisplayString()

The following examples show how to use net.minecraft.client.settings.GameSettings#getKeyDisplayString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GuiKeyBindingList.java    From ehacks-pro with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void drawEntry(int index, int x, int y, int width, int height, Tessellator tesselator, int buttonX, int buttonY, boolean p_148279_9_) {
    boolean var10 = GuiKeyBindingList.this.parentScreen.currentKeyBinding == this.entryKeybinding;
    GuiKeyBindingList.this.mc.fontRenderer.drawString(this.keyDesctiption, x + 90 - GuiKeyBindingList.this.maxListLabelWidth, y + height / 2 - GuiKeyBindingList.this.mc.fontRenderer.FONT_HEIGHT / 2, 16777215);
    this.btnRemove.xPosition = x + 190;
    this.btnRemove.yPosition = y;
    this.btnRemove.drawButton(GuiKeyBindingList.this.mc, buttonX, buttonY);
    this.btnChangeKeyBinding.xPosition = x + 105;
    this.btnChangeKeyBinding.yPosition = y;
    this.btnChangeKeyBinding.displayString = GameSettings.getKeyDisplayString(this.entryKeybinding.getKeyCode());
    if (var10) {
        this.btnChangeKeyBinding.displayString = EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + this.btnChangeKeyBinding.displayString + EnumChatFormatting.WHITE + " <";
    }
    this.btnChangeKeyBinding.drawButton(GuiKeyBindingList.this.mc, buttonX, buttonY);
}
 
Example 2
Source File: GuiKeyBindingList.java    From ehacks-pro with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void drawEntry(int index, int x, int y, int width, int height, Tessellator tesselator, int buttonX, int buttonY, boolean p_148279_9_) {
    boolean var10 = GuiKeyBindingList.this.parentScreen.currentKeyBinding == this.entryKeybinding;
    GuiKeyBindingList.this.mc.fontRenderer.drawString(this.keyDesctiption, x + 90 - GuiKeyBindingList.this.maxListLabelWidth, y + height / 2 - GuiKeyBindingList.this.mc.fontRenderer.FONT_HEIGHT / 2, 16777215);
    this.btnReset.xPosition = x + 190;
    this.btnReset.yPosition = y;
    this.btnReset.enabled = this.entryKeybinding.getKeyCode() != this.entryKeybinding.getKeyCodeDefault();
    this.btnReset.drawButton(GuiKeyBindingList.this.mc, buttonX, buttonY);
    this.btnChangeKeyBinding.xPosition = x + 105;
    this.btnChangeKeyBinding.yPosition = y;
    this.btnChangeKeyBinding.displayString = GameSettings.getKeyDisplayString(this.entryKeybinding.getKeyCode());
    boolean var11 = false;

    if (this.entryKeybinding.getKeyCode() != 0) {
        ModuleKeyBinding[] var12 = GuiKeyBindingList.this.parentScreen.keyBindings;
        int var13 = var12.length;

        for (int var14 = 0; var14 < var13; ++var14) {
            ModuleKeyBinding var15 = var12[var14];

            if (var15 != this.entryKeybinding && var15.getKeyCode() == this.entryKeybinding.getKeyCode()) {
                var11 = true;
                break;
            }
        }
    }

    if (var10) {
        this.btnChangeKeyBinding.displayString = EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + this.btnChangeKeyBinding.displayString + EnumChatFormatting.WHITE + " <";
    } else if (var11) {
        this.btnChangeKeyBinding.displayString = EnumChatFormatting.RED + this.btnChangeKeyBinding.displayString;
    }

    this.btnChangeKeyBinding.drawButton(GuiKeyBindingList.this.mc, buttonX, buttonY);
}
 
Example 3
Source File: ClientProxy.java    From SimplyJetpacks with MIT License 5 votes vote down vote up
@Override
public String getPackGUIKey() {
    int keyCode = KeyHandler.keyOpenPackGUI.getKeyCode();
    if (keyCode == 0) {
        return null;
    }
    return GameSettings.getKeyDisplayString(keyCode);
}