Fix bound texture in Controls screen, Closes #631 and #629

This commit is contained in:
LexManos 2013-07-01 23:35:03 -07:00
parent 4034cfe9dc
commit d5549d770d

View file

@ -10,10 +10,12 @@ import net.minecraft.client.gui.GuiSlot;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.resources.ResourceLocation;
import net.minecraft.util.EnumChatFormatting;
public class GuiControlsScrollPanel extends GuiSlot
{
protected static final ResourceLocation WIDGITS = new ResourceLocation("textures/gui/widgets.png");
private GuiControls controls;
private GameSettings options;
private Minecraft mc;
@ -73,7 +75,6 @@ public class GuiControlsScrollPanel extends GuiSlot
{
if (Mouse.next() && Mouse.getEventButtonState())
{
System.out.println(Mouse.getEventButton());
options.setKeyBinding(selected, -100 + Mouse.getEventButton());
selected = -1;
KeyBinding.resetKeyBindingArrayAndHash();
@ -92,7 +93,7 @@ public class GuiControlsScrollPanel extends GuiSlot
boolean flag = _mouseX >= xPosition && _mouseY >= yPosition && _mouseX < xPosition + width && _mouseY < yPosition + height;
int k = (flag ? 2 : 1);
mc.renderEngine.func_110577_a(TextureMap.field_110576_c);
mc.renderEngine.func_110577_a(WIDGITS);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
controls.drawTexturedModalRect(xPosition, yPosition, 0, 46 + k * 20, width / 2, height);
controls.drawTexturedModalRect(xPosition + width / 2, yPosition, 200 - width / 2, 46 + k * 20, width / 2, height);