mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-19 20:00:00 +00:00
Cleaned and generalised item loading/searching
Reimplemented subsets Added regex searching Fixed format error on delete all Fixed GuiButton handling clicks before NEI widgets could override Re-Implemented banned blocks implementation Added brewing recipes again note test obf ASM beacons Fixed some calls being intercepted by item panel when mouse was over a gui element Fixed crash on closing potion window with escape Disabled fast transfer, scrolling, and drag 'n' drop in creative Added item panel sorting Removed TMI uninstaller Fixed /give command Updated to 1.7.10
This commit is contained in:
1 parent
3c9ebc6961
commit
3c84527806
67 files changed
+3251
-2319
No files matched your search
@@ -6,90 +6,77 @@ import org.lwjgl.input.Keyboard;
|
||||
public class OptionKeyBind extends OptionButton
|
||||
{
|
||||
private boolean hasFocus = false;
|
||||
|
||||
public OptionKeyBind(String name)
|
||||
{
|
||||
super("keys."+name);
|
||||
|
||||
public OptionKeyBind(String name) {
|
||||
super("keys." + name);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onMouseClicked(int mousex, int mousey, int button)
|
||||
{
|
||||
public void onMouseClicked(int mousex, int mousey, int button) {
|
||||
hasFocus = false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void keyTyped(char c, int keycode)
|
||||
{
|
||||
if(hasFocus)
|
||||
{
|
||||
public void keyTyped(char c, int keycode) {
|
||||
if (hasFocus) {
|
||||
setValue(keycode);
|
||||
hasFocus = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onClick(int button)
|
||||
{
|
||||
if(renderDefault())
|
||||
public boolean onClick(int button) {
|
||||
if (defaulting())
|
||||
return false;
|
||||
|
||||
if(button == 0)
|
||||
{
|
||||
|
||||
if (button == 0) {
|
||||
hasFocus = true;
|
||||
return true;
|
||||
}
|
||||
if(button == 1 && getValue() != 0)
|
||||
{
|
||||
if (button == 1 && getValue() != 0) {
|
||||
setValue(0);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean conflicted()
|
||||
{
|
||||
if(getValue() == 0)
|
||||
|
||||
public boolean conflicted() {
|
||||
if (getValue() == 0)
|
||||
return false;
|
||||
|
||||
for(Option o : slot.options)
|
||||
if(o instanceof OptionKeyBind && o != this && ((OptionKeyBind)o).getValue() == getValue())
|
||||
|
||||
for (Option o : slot.options)
|
||||
if (o instanceof OptionKeyBind && o != this && ((OptionKeyBind) o).getValue() == getValue())
|
||||
return true;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setValue(int keycode)
|
||||
{
|
||||
|
||||
public void setValue(int keycode) {
|
||||
getTag().setIntValue(keycode);
|
||||
}
|
||||
|
||||
public int getValue()
|
||||
{
|
||||
|
||||
public int getValue() {
|
||||
return renderTag().getIntValue();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getPrefix()
|
||||
{
|
||||
public String getPrefix() {
|
||||
return translateN(name);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getButtonText()
|
||||
{
|
||||
if(hasFocus)
|
||||
return EnumChatFormatting.WHITE+"> "+EnumChatFormatting.YELLOW+"??? "+EnumChatFormatting.WHITE+"<";
|
||||
|
||||
if(conflicted())
|
||||
public String getButtonText() {
|
||||
if (hasFocus)
|
||||
return EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + "??? " + EnumChatFormatting.WHITE + "<";
|
||||
|
||||
if (conflicted())
|
||||
return EnumChatFormatting.RED + Keyboard.getKeyName(getValue());
|
||||
|
||||
|
||||
return Keyboard.getKeyName(getValue());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getTextColour(int mousex, int mousey)
|
||||
{
|
||||
public int getTextColour(int mousex, int mousey) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user