allow shift-click to clear trigger/action slots
This commit is contained in:
parent
58c230f248
commit
ae51723c82
1 changed files with 44 additions and 37 deletions
|
@ -9,6 +9,7 @@
|
|||
package buildcraft.transport.gui;
|
||||
|
||||
import java.util.Iterator;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
@ -271,14 +272,15 @@ public class GuiGateInterface extends GuiAdvancedInterface {
|
|||
|
||||
IStatement changed = null;
|
||||
|
||||
if (isShiftKeyDown()) {
|
||||
changed = null;
|
||||
} else {
|
||||
if (triggerSlot.getStatement() == null) {
|
||||
|
||||
if (k == 0) {
|
||||
changed = container.getFirstTrigger();
|
||||
} else {
|
||||
changed = container.getLastTrigger();
|
||||
}
|
||||
|
||||
} else {
|
||||
Iterator<IStatement> it = container.getTriggerIterator(k != 0);
|
||||
|
||||
|
@ -296,6 +298,7 @@ public class GuiGateInterface extends GuiAdvancedInterface {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (changed == null) {
|
||||
container.setTrigger(triggerSlot.slot, null, true);
|
||||
|
@ -314,8 +317,11 @@ public class GuiGateInterface extends GuiAdvancedInterface {
|
|||
ActionSlot actionSlot = (ActionSlot) slot;
|
||||
|
||||
IStatement changed = null;
|
||||
if (actionSlot.getStatement() == null) {
|
||||
|
||||
if (isShiftKeyDown()) {
|
||||
changed = null;
|
||||
} else {
|
||||
if (actionSlot.getStatement() == null) {
|
||||
if (k == 0) {
|
||||
changed = container.getFirstAction();
|
||||
} else {
|
||||
|
@ -339,6 +345,7 @@ public class GuiGateInterface extends GuiAdvancedInterface {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (changed == null) {
|
||||
container.setAction(actionSlot.slot, null, true);
|
||||
|
|
Loading…
Reference in a new issue