当前位置: 首页>>代码示例>>Java>>正文


Java KeyBinding.resetKeyBindingArrayAndHash方法代码示例

本文整理汇总了Java中net.minecraft.client.settings.KeyBinding.resetKeyBindingArrayAndHash方法的典型用法代码示例。如果您正苦于以下问题:Java KeyBinding.resetKeyBindingArrayAndHash方法的具体用法?Java KeyBinding.resetKeyBindingArrayAndHash怎么用?Java KeyBinding.resetKeyBindingArrayAndHash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.settings.KeyBinding的用法示例。


在下文中一共展示了KeyBinding.resetKeyBindingArrayAndHash方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import net.minecraft.client.settings.KeyBinding; //导入方法依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    if (button.id == 200)
    {
        this.mc.displayGuiScreen(this.parentScreen);
    }
    else if (button.id == 201)
    {
        for (KeyBinding keybinding : this.mc.gameSettings.keyBindings)
        {
            keybinding.setKeyCode(keybinding.getKeyCodeDefault());
        }

        KeyBinding.resetKeyBindingArrayAndHash();
    }
    else if (button.id < 100 && button instanceof GuiOptionButton)
    {
        this.options.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1);
        button.displayString = this.options.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:25,代码来源:GuiControls.java

示例2: mousePressed

import net.minecraft.client.settings.KeyBinding; //导入方法依赖的package包/类
public boolean mousePressed(int slotIndex, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_)
{
    if (this.btnChangeKeyBinding.mousePressed(GuiKeyBindingList.this.mc, p_148278_2_, p_148278_3_))
    {
        GuiKeyBindingList.this.field_148191_k.buttonId = this.keybinding;
        return true;
    }
    else if (this.btnReset.mousePressed(GuiKeyBindingList.this.mc, p_148278_2_, p_148278_3_))
    {
        GuiKeyBindingList.this.mc.gameSettings.setOptionKeyBinding(this.keybinding, this.keybinding.getKeyCodeDefault());
        KeyBinding.resetKeyBindingArrayAndHash();
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:19,代码来源:GuiKeyBindingList.java

示例3: mousePressed

import net.minecraft.client.settings.KeyBinding; //导入方法依赖的package包/类
/**
 * Called when the mouse is clicked within this entry. Returning true means that something within this entry was
 * clicked and the list should not be dragged.
 */
public boolean mousePressed(int slotIndex, int mouseX, int mouseY, int mouseEvent, int relativeX, int relativeY)
{
    if (this.btnChangeKeyBinding.mousePressed(GuiKeyBindingList.this.mc, mouseX, mouseY))
    {
        GuiKeyBindingList.this.controlsScreen.buttonId = this.keybinding;
        return true;
    }
    else if (this.btnReset.mousePressed(GuiKeyBindingList.this.mc, mouseX, mouseY))
    {
        this.keybinding.setToDefault();
        GuiKeyBindingList.this.mc.gameSettings.setOptionKeyBinding(this.keybinding, this.keybinding.getKeyCodeDefault());
        KeyBinding.resetKeyBindingArrayAndHash();
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:24,代码来源:GuiKeyBindingList.java

示例4: mousePressed

import net.minecraft.client.settings.KeyBinding; //导入方法依赖的package包/类
public boolean mousePressed(int slotIndex, int mouseX, int mouseY, int mouseEvent, int relativeX, int relativeY)
{
    if (this.btnChangeKeyBinding.mousePressed(GuiKeyBindingList.this.mc, mouseX, mouseY))
    {
        GuiKeyBindingList.this.controlsScreen.buttonId = this.keybinding;
        return true;
    }
    else if (this.btnReset.mousePressed(GuiKeyBindingList.this.mc, mouseX, mouseY))
    {
        GuiKeyBindingList.this.mc.gameSettings.setOptionKeyBinding(this.keybinding, this.keybinding.getKeyCodeDefault());
        KeyBinding.resetKeyBindingArrayAndHash();
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:19,代码来源:GuiKeyBindingList.java

示例5: actionPerformed

import net.minecraft.client.settings.KeyBinding; //导入方法依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    if (button.id == 200)
    {
        this.mc.displayGuiScreen(this.parentScreen);
    }
    else if (button.id == 201)
    {
        for (KeyBinding keybinding : this.mc.gameSettings.keyBindings)
        {
            keybinding.setToDefault();
        }

        KeyBinding.resetKeyBindingArrayAndHash();
    }
    else if (button.id < 100 && button instanceof GuiOptionButton)
    {
        this.options.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1);
        button.displayString = this.options.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:25,代码来源:GuiControls.java

示例6: keyTyped

import net.minecraft.client.settings.KeyBinding; //导入方法依赖的package包/类
@Override
public void keyTyped(char ch, int key) {
    if (changingKeybinding) {
        changingKeybinding = false;
        updateKeybindingButtonText();

        KeyHandler.getInstance().keybindOpenOptions.setKeyCode(key);
        KeyBinding.resetKeyBindingArrayAndHash();
        FMLClientHandler.instance().getClient().player.sendStatusMessage(new TextComponentString(TextFormatting.GREEN + "Bound the opening of this menu to the '" + Keyboard.getKeyName(key) + "' key."), false);
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:12,代码来源:GuiHelmetMainOptions.java

示例7: bind

import net.minecraft.client.settings.KeyBinding; //导入方法依赖的package包/类
@Override
public void bind(int keyCode) {
    if(bind != null) {
        bind.setKeyCode(keyCode);
        KeyBinding.resetKeyBindingArrayAndHash();
    }
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:8,代码来源:CommandStub.java

示例8: mouseClicked

import net.minecraft.client.settings.KeyBinding; //导入方法依赖的package包/类
/**
 * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
 */
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException
{
    if (this.buttonId != null)
    {
        this.options.setOptionKeyBinding(this.buttonId, -100 + mouseButton);
        this.buttonId = null;
        KeyBinding.resetKeyBindingArrayAndHash();
    }
    else if (mouseButton != 0 || !this.keyBindingList.mouseClicked(mouseX, mouseY, mouseButton))
    {
        super.mouseClicked(mouseX, mouseY, mouseButton);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:17,代码来源:GuiControls.java

示例9: keyTyped

import net.minecraft.client.settings.KeyBinding; //导入方法依赖的package包/类
/**
 * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of
 * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
 */
protected void keyTyped(char typedChar, int keyCode) throws IOException
{
    if (this.buttonId != null)
    {
        if (keyCode == 1)
        {
            this.buttonId.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.NONE, 0);
            this.options.setOptionKeyBinding(this.buttonId, 0);
        }
        else if (keyCode != 0)
        {
            this.buttonId.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), keyCode);
            this.options.setOptionKeyBinding(this.buttonId, keyCode);
        }
        else if (typedChar > 0)
        {
            this.buttonId.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), typedChar + 256);
            this.options.setOptionKeyBinding(this.buttonId, typedChar + 256);
        }

        if (!net.minecraftforge.client.settings.KeyModifier.isKeyCodeModifier(keyCode))
        this.buttonId = null;
        this.time = Minecraft.getSystemTime();
        KeyBinding.resetKeyBindingArrayAndHash();
    }
    else
    {
        super.keyTyped(typedChar, keyCode);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:35,代码来源:GuiControls.java

示例10: keyTyped

import net.minecraft.client.settings.KeyBinding; //导入方法依赖的package包/类
/**
 * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of
 * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
 */
protected void keyTyped(char typedChar, int keyCode) throws IOException
{
    if (this.buttonId != null)
    {
        if (keyCode == 1)
        {
            this.options.setOptionKeyBinding(this.buttonId, 0);
        }
        else if (keyCode != 0)
        {
            this.options.setOptionKeyBinding(this.buttonId, keyCode);
        }
        else if (typedChar > 0)
        {
            this.options.setOptionKeyBinding(this.buttonId, typedChar + 256);
        }

        this.buttonId = null;
        this.time = Minecraft.getSystemTime();
        KeyBinding.resetKeyBindingArrayAndHash();
    }
    else
    {
        super.keyTyped(typedChar, keyCode);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:31,代码来源:GuiControls.java

示例11: mouseClicked

import net.minecraft.client.settings.KeyBinding; //导入方法依赖的package包/类
/**
 * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
 */
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException
{
    if (this.buttonId != null)
    {
        this.buttonId.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), -100 + mouseButton);
        this.options.setOptionKeyBinding(this.buttonId, -100 + mouseButton);
        this.buttonId = null;
        KeyBinding.resetKeyBindingArrayAndHash();
    }
    else if (mouseButton != 0 || !this.keyBindingList.mouseClicked(mouseX, mouseY, mouseButton))
    {
        super.mouseClicked(mouseX, mouseY, mouseButton);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:GuiControls.java


注:本文中的net.minecraft.client.settings.KeyBinding.resetKeyBindingArrayAndHash方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。