Fixes #2556, #2579: Restore old click behaviour.

This commit is contained in:
yueh 2016-11-05 23:27:14 +01:00
parent 0ceb4765a2
commit 7ac817e9ae

View file

@ -217,7 +217,7 @@ public abstract class AEBaseGui extends GuiContainer
// All lines after the first are colored gray // All lines after the first are colored gray
for( int i = 1; i < lines.size(); i++ ) for( int i = 1; i < lines.size(); i++ )
{ {
lines.set(i, TextFormatting.GRAY + lines.get(i)); lines.set( i, TextFormatting.GRAY + lines.get( i ) );
} }
this.drawHoveringText( lines, x, y, fontRendererObj ); this.drawHoveringText( lines, x, y, fontRendererObj );
@ -317,7 +317,7 @@ public abstract class AEBaseGui extends GuiContainer
} }
} }
//TODO 1.9.4 aftermath - Whole ClickType thing, to be checked. // TODO 1.9.4 aftermath - Whole ClickType thing, to be checked.
@Override @Override
protected void handleMouseClick( final Slot slot, final int slotIdx, final int mouseButton, final ClickType clickType ) protected void handleMouseClick( final Slot slot, final int slotIdx, final int mouseButton, final ClickType clickType )
{ {
@ -325,7 +325,7 @@ public abstract class AEBaseGui extends GuiContainer
if( slot instanceof SlotFake ) if( slot instanceof SlotFake )
{ {
final InventoryAction action = isCtrlKeyDown() ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN; final InventoryAction action = mouseButton == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
if( this.drag_click.size() > 1 ) if( this.drag_click.size() > 1 )
{ {
@ -369,7 +369,7 @@ public abstract class AEBaseGui extends GuiContainer
else else
{ {
// Craft stack on right-click, craft single on left-click // Craft stack on right-click, craft single on left-click
action = (mouseButton == 1) ? InventoryAction.CRAFT_STACK : InventoryAction.CRAFT_ITEM; action = ( mouseButton == 1 ) ? InventoryAction.CRAFT_STACK : InventoryAction.CRAFT_ITEM;
} }
final PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 ); final PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
@ -409,10 +409,10 @@ public abstract class AEBaseGui extends GuiContainer
switch( clickType ) switch( clickType )
{ {
case PICKUP: // pickup / set-down. case PICKUP: // pickup / set-down.
action = (mouseButton == 1) ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN; action = ( mouseButton == 1 ) ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
break; break;
case QUICK_MOVE: case QUICK_MOVE:
action = isCtrlKeyDown() ? InventoryAction.PICKUP_SINGLE : InventoryAction.SHIFT_CLICK; action = ( mouseButton == 1 ) ? InventoryAction.PICKUP_SINGLE : InventoryAction.SHIFT_CLICK;
break; break;
case CLONE: // creative dupe: case CLONE: // creative dupe:
@ -445,7 +445,7 @@ public abstract class AEBaseGui extends GuiContainer
switch( clickType ) switch( clickType )
{ {
case PICKUP: // pickup / set-down. case PICKUP: // pickup / set-down.
action = (mouseButton == 1) ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN; action = ( mouseButton == 1 ) ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
stack = ( (SlotME) slot ).getAEStack(); stack = ( (SlotME) slot ).getAEStack();
if( stack != null && action == InventoryAction.PICKUP_OR_SET_DOWN && stack.getStackSize() == 0 && player.inventory.getItemStack() == null ) if( stack != null && action == InventoryAction.PICKUP_OR_SET_DOWN && stack.getStackSize() == 0 && player.inventory.getItemStack() == null )
@ -455,7 +455,7 @@ public abstract class AEBaseGui extends GuiContainer
break; break;
case QUICK_MOVE: case QUICK_MOVE:
action = isCtrlKeyDown() ? InventoryAction.PICKUP_SINGLE : InventoryAction.SHIFT_CLICK; action = ( mouseButton == 1 ) ? InventoryAction.PICKUP_SINGLE : InventoryAction.SHIFT_CLICK;
stack = ( (SlotME) slot ).getAEStack(); stack = ( (SlotME) slot ).getAEStack();
break; break;
@ -848,6 +848,7 @@ public abstract class AEBaseGui extends GuiContainer
final ResourceLocation loc = new ResourceLocation( AppEng.MOD_ID, "textures/" + file ); final ResourceLocation loc = new ResourceLocation( AppEng.MOD_ID, "textures/" + file );
this.mc.getTextureManager().bindTexture( loc ); this.mc.getTextureManager().bindTexture( loc );
} }
protected GuiScrollbar getScrollBar() protected GuiScrollbar getScrollBar()
{ {
return this.myScrollBar; return this.myScrollBar;