|
@@ -49,7 +49,7 @@ public class GuiNewKeyBindingList extends GuiKeyBindingList {
|
|
// this.listEntries[i++] = new GuiNewKeyBindingList.CategoryEntry(s1);
|
|
// this.listEntries[i++] = new GuiNewKeyBindingList.CategoryEntry(s1);
|
|
}
|
|
}
|
|
|
|
|
|
- int j = mcIn.fontRendererObj.getStringWidth(I18n.format(keybinding.getKeyDescription(), new Object[0]));
|
|
|
|
|
|
+ int j = mcIn.fontRendererObj.getStringWidth(I18n.format(keybinding.getKeyDescription()));
|
|
|
|
|
|
if(j > this.maxListLabelWidth) {
|
|
if(j > this.maxListLabelWidth) {
|
|
this.maxListLabelWidth = j;
|
|
this.maxListLabelWidth = j;
|
|
@@ -135,9 +135,9 @@ public class GuiNewKeyBindingList extends GuiKeyBindingList {
|
|
|
|
|
|
private KeyEntry(KeyBinding name) {
|
|
private KeyEntry(KeyBinding name) {
|
|
this.keybinding = name;
|
|
this.keybinding = name;
|
|
- this.keyDesc = I18n.format(name.getKeyDescription(), new Object[0]);
|
|
|
|
- this.btnChangeKeyBinding = new GuiButton(0, 0, 0, 95, 20, I18n.format(name.getKeyDescription(), new Object[0]));
|
|
|
|
- this.btnReset = new GuiButton(0, 0, 0, 50, 20, I18n.format("controls.reset", new Object[0]));
|
|
|
|
|
|
+ this.keyDesc = I18n.format(name.getKeyDescription());
|
|
|
|
+ this.btnChangeKeyBinding = new GuiButton(0, 0, 0, 95, 20, I18n.format(name.getKeyDescription()));
|
|
|
|
+ this.btnReset = new GuiButton(0, 0, 0, 50, 20, I18n.format("controls.reset"));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -148,12 +148,8 @@ public class GuiNewKeyBindingList extends GuiKeyBindingList {
|
|
public void func_192634_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float p_192634_9_) {
|
|
public void func_192634_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float p_192634_9_) {
|
|
boolean flag = GuiNewKeyBindingList.this.controlsScreen.buttonId == this.keybinding;
|
|
boolean flag = GuiNewKeyBindingList.this.controlsScreen.buttonId == this.keybinding;
|
|
GuiNewKeyBindingList.this.mc.fontRendererObj.drawString(this.keyDesc, x + 90 - GuiNewKeyBindingList.this.maxListLabelWidth, y + slotHeight / 2 - GuiNewKeyBindingList.this.mc.fontRendererObj.FONT_HEIGHT / 2, 16777215);
|
|
GuiNewKeyBindingList.this.mc.fontRendererObj.drawString(this.keyDesc, x + 90 - GuiNewKeyBindingList.this.maxListLabelWidth, y + slotHeight / 2 - GuiNewKeyBindingList.this.mc.fontRendererObj.FONT_HEIGHT / 2, 16777215);
|
|
- GuiNewKeyBindingList.this.mc.fontRendererObj.drawString(String.format("(%s)", I18n.format(keybinding.getKeyCategory())), x - 45 - GuiNewKeyBindingList.this.maxListLabelWidth, y + slotHeight / 2 - GuiNewKeyBindingList.this.mc.fontRendererObj.FONT_HEIGHT / 2, 16777215);
|
|
|
|
- if(keybinding.isSetToDefaultValue()) {
|
|
|
|
- btnReset.visible = false;
|
|
|
|
- } else {
|
|
|
|
- btnReset.visible = true;
|
|
|
|
- }
|
|
|
|
|
|
+// GuiNewKeyBindingList.this.mc.fontRendererObj.drawString(String.format("(%s)", I18n.format(keybinding.getKeyCategory())), x - 45 - GuiNewKeyBindingList.this.maxListLabelWidth, y + slotHeight / 2 - GuiNewKeyBindingList.this.mc.fontRendererObj.FONT_HEIGHT / 2, 16777215);
|
|
|
|
+ btnReset.visible = !keybinding.isSetToDefaultValue();
|
|
this.btnReset.xPosition = x + 210;
|
|
this.btnReset.xPosition = x + 210;
|
|
this.btnReset.yPosition = y;
|
|
this.btnReset.yPosition = y;
|
|
this.btnReset.enabled = !this.keybinding.isSetToDefaultValue();
|
|
this.btnReset.enabled = !this.keybinding.isSetToDefaultValue();
|
|
@@ -179,6 +175,12 @@ public class GuiNewKeyBindingList extends GuiKeyBindingList {
|
|
} else if(flag1) {
|
|
} else if(flag1) {
|
|
this.btnChangeKeyBinding.displayString = (keyCodeModifierConflict ? TextFormatting.GOLD : TextFormatting.RED) + this.btnChangeKeyBinding.displayString;
|
|
this.btnChangeKeyBinding.displayString = (keyCodeModifierConflict ? TextFormatting.GOLD : TextFormatting.RED) + this.btnChangeKeyBinding.displayString;
|
|
}
|
|
}
|
|
|
|
+// if(mouseX >= x + 90 - GuiNewKeyBindingList.this.maxListLabelWidth && mouseX <= x + listWidth) {
|
|
|
|
+ if(mouseY >= y && mouseY <= y + slotHeight) {
|
|
|
|
+// Gui.drawRect(mouseX + 8, mouseY - 2, mouseX + mc.fontRendererObj.getStringWidth(I18n.format(keybinding.getKeyCategory())), mouseY + mc.fontRendererObj.FONT_HEIGHT, 0xFF000000);
|
|
|
|
+ mc.fontRendererObj.drawString(I18n.format(keybinding.getKeyCategory()), mouseX + 10, mouseY, 0xFFFFFF);
|
|
|
|
+ }
|
|
|
|
+// }
|
|
|
|
|
|
this.btnChangeKeyBinding.func_191745_a(GuiNewKeyBindingList.this.mc, mouseX, mouseY, p_192634_9_);
|
|
this.btnChangeKeyBinding.func_191745_a(GuiNewKeyBindingList.this.mc, mouseX, mouseY, p_192634_9_);
|
|
}
|
|
}
|