upstream updates
This commit is contained in:
@@ -15,7 +15,7 @@ import java.awt.event.KeyEvent;
|
||||
public class Player extends Item implements Avatar {
|
||||
|
||||
private int keyRepeatRate = 5;
|
||||
|
||||
private int shortcut_modifier = Toolkit.getDefaultToolkit ().getMenuShortcutKeyMask();
|
||||
|
||||
protected boolean handleSaveSmallChip() {
|
||||
return false;
|
||||
@@ -363,16 +363,16 @@ public class Player extends Item implements Avatar {
|
||||
else if (e.getKeyCode() == KeyEvent.VK_SLASH && handleHelp()) {
|
||||
return false;
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_RIGHT && handleMoveRight(e.isShiftDown(), e.isControlDown())) {
|
||||
else if (e.getKeyCode() == KeyEvent.VK_RIGHT && handleMoveRight(e.isShiftDown(), (e.getModifiers() & shortcut_modifier) > 0)) {
|
||||
return true;
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_LEFT && handleMoveLeft(e.isShiftDown(), e.isControlDown())) {
|
||||
else if (e.getKeyCode() == KeyEvent.VK_LEFT && handleMoveLeft(e.isShiftDown(), (e.getModifiers() & shortcut_modifier) > 0)) {
|
||||
return true;
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_UP && handleMoveUp(e.isShiftDown(), e.isControlDown())) {
|
||||
else if (e.getKeyCode() == KeyEvent.VK_UP && handleMoveUp(e.isShiftDown(), (e.getModifiers() & shortcut_modifier) > 0)) {
|
||||
return true;
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_DOWN && handleMoveDown(e.isShiftDown(), e.isControlDown())) {
|
||||
else if (e.getKeyCode() == KeyEvent.VK_DOWN && handleMoveDown(e.isShiftDown(), (e.getModifiers() & shortcut_modifier) > 0)) {
|
||||
return true;
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_SPACE && handlePickupDrop()) {
|
||||
@@ -456,22 +456,22 @@ public class Player extends Item implements Avatar {
|
||||
|
||||
public boolean KeyDown(KeyEvent e) {
|
||||
if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
|
||||
if (handleRepeatRight(e.isControlDown())) {
|
||||
if (handleRepeatRight((e.getModifiers() & shortcut_modifier) > 0)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_LEFT) {
|
||||
if (handleRepeatLeft(e.isControlDown())) {
|
||||
if (handleRepeatLeft((e.getModifiers() & shortcut_modifier) > 0)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_UP) {
|
||||
if (handleRepeatUp(e.isControlDown())) {
|
||||
if (handleRepeatUp((e.getModifiers() & shortcut_modifier) > 0)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
|
||||
if (handleRepeatDown(e.isControlDown())) {
|
||||
if (handleRepeatDown((e.getModifiers() & shortcut_modifier) > 0)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import java.awt.event.KeyEvent;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
public class Remote extends Item implements Avatar {
|
||||
private int shortcut_modifier = Toolkit.getDefaultToolkit ().getMenuShortcutKeyMask();
|
||||
|
||||
public Remote() {
|
||||
width = 4;
|
||||
height = 20;
|
||||
@@ -98,28 +100,28 @@ public class Remote extends Item implements Avatar {
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
|
||||
if (carriedBy == null) {
|
||||
moveRight(e.isControlDown());
|
||||
moveRight((e.getModifiers() & shortcut_modifier) > 0);
|
||||
}
|
||||
repeating = 0;
|
||||
return true;
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_LEFT) {
|
||||
if (carriedBy == null) {
|
||||
moveLeft(e.isControlDown());
|
||||
moveLeft((e.getModifiers() & shortcut_modifier) > 0);
|
||||
}
|
||||
repeating = 0;
|
||||
return true;
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_UP) {
|
||||
if (carriedBy == null) {
|
||||
moveUp(e.isControlDown());
|
||||
moveUp((e.getModifiers() & shortcut_modifier) > 0);
|
||||
}
|
||||
repeating = 0;
|
||||
return true;
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
|
||||
if (carriedBy == null) {
|
||||
moveDown(e.isControlDown());
|
||||
moveDown((e.getModifiers() & shortcut_modifier) > 0);
|
||||
}
|
||||
repeating = 0;
|
||||
return true;
|
||||
@@ -134,7 +136,7 @@ public class Remote extends Item implements Avatar {
|
||||
if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
|
||||
repeating++;
|
||||
if (repeating > 10) {
|
||||
moveRight(e.isControlDown());
|
||||
moveRight((e.getModifiers() & shortcut_modifier) > 0);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -142,7 +144,7 @@ public class Remote extends Item implements Avatar {
|
||||
else if (e.getKeyCode() == KeyEvent.VK_LEFT) {
|
||||
repeating++;
|
||||
if (repeating > 10) {
|
||||
moveLeft(e.isControlDown());
|
||||
moveLeft((e.getModifiers() & shortcut_modifier) > 0);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -150,7 +152,7 @@ public class Remote extends Item implements Avatar {
|
||||
else if (e.getKeyCode() == KeyEvent.VK_UP) {
|
||||
repeating++;
|
||||
if (repeating > 10) {
|
||||
moveUp(e.isControlDown());
|
||||
moveUp((e.getModifiers() & shortcut_modifier) > 0);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -158,7 +160,7 @@ public class Remote extends Item implements Avatar {
|
||||
else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
|
||||
repeating++;
|
||||
if (repeating > 10) {
|
||||
moveDown(e.isControlDown());
|
||||
moveDown((e.getModifiers() & shortcut_modifier) > 0);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.util.ArrayList;
|
||||
public class SolderingPen extends Device implements Avatar {
|
||||
private boolean hot;
|
||||
private Port currentPort = null; // Port that Soldering pen is currently over
|
||||
private int shortcut_modifier = Toolkit.getDefaultToolkit ().getMenuShortcutKeyMask();
|
||||
|
||||
public SolderingPen() {
|
||||
width = 22;
|
||||
@@ -313,28 +314,28 @@ public class SolderingPen extends Device implements Avatar {
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
|
||||
if (carriedBy == null) {
|
||||
moveRight(e.isControlDown());
|
||||
moveRight((e.getModifiers() & shortcut_modifier) > 0);
|
||||
}
|
||||
repeating = 0;
|
||||
return true;
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_LEFT) {
|
||||
if (carriedBy == null) {
|
||||
moveLeft(e.isControlDown());
|
||||
moveLeft((e.getModifiers() & shortcut_modifier) > 0);
|
||||
}
|
||||
repeating = 0;
|
||||
return true;
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_UP) {
|
||||
if (carriedBy == null) {
|
||||
moveUp(e.isControlDown());
|
||||
moveUp((e.getModifiers() & shortcut_modifier) > 0);
|
||||
}
|
||||
repeating = 0;
|
||||
return true;
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
|
||||
if (carriedBy == null) {
|
||||
moveDown(e.isControlDown());
|
||||
moveDown((e.getModifiers() & shortcut_modifier) > 0);
|
||||
}
|
||||
repeating = 0;
|
||||
return true;
|
||||
@@ -358,7 +359,7 @@ public class SolderingPen extends Device implements Avatar {
|
||||
if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
|
||||
repeating++;
|
||||
if (repeating > 10) {
|
||||
moveRight(e.isControlDown());
|
||||
moveRight((e.getModifiers() & shortcut_modifier) > 0);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -366,7 +367,7 @@ public class SolderingPen extends Device implements Avatar {
|
||||
else if (e.getKeyCode() == KeyEvent.VK_LEFT) {
|
||||
repeating++;
|
||||
if (repeating > 10) {
|
||||
moveLeft(e.isControlDown());
|
||||
moveLeft((e.getModifiers() & shortcut_modifier) > 0);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -374,7 +375,7 @@ public class SolderingPen extends Device implements Avatar {
|
||||
else if (e.getKeyCode() == KeyEvent.VK_UP) {
|
||||
repeating++;
|
||||
if (repeating > 10) {
|
||||
moveUp(e.isControlDown());
|
||||
moveUp((e.getModifiers() & shortcut_modifier) > 0);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -382,7 +383,7 @@ public class SolderingPen extends Device implements Avatar {
|
||||
else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
|
||||
repeating++;
|
||||
if (repeating > 10) {
|
||||
moveDown(e.isControlDown());
|
||||
moveDown((e.getModifiers() & shortcut_modifier) > 0);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -428,6 +429,8 @@ public class SolderingPen extends Device implements Avatar {
|
||||
}
|
||||
}
|
||||
|
||||
CheckPort();
|
||||
|
||||
level.roomdisplay.dq.selectCursor();
|
||||
return true;
|
||||
}
|
||||
@@ -505,6 +508,8 @@ public class SolderingPen extends Device implements Avatar {
|
||||
|
||||
handleRemote();
|
||||
|
||||
CheckPort();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ public class AutoWire extends Item {
|
||||
|
||||
if (animation == 1) {
|
||||
if (portdevices[0].ports[0].myWire == null) { // Wiring
|
||||
portdevices[0].ports[0].myWire = new Wire(chip.ports[0], portdevices[0].ports[0]);
|
||||
portdevices[0].ports[0].myWire = new Wire(chip.ports[0], portdevices[0].ports[0]);
|
||||
}
|
||||
else { // Unwiring
|
||||
portdevices[0].ports[0].myWire.Remove();
|
||||
|
||||
@@ -64,7 +64,7 @@ public class GateKeeper extends Item {
|
||||
|
||||
public void Animate() {
|
||||
if (behavior == 1) {
|
||||
if (x != goToX && y != goToY) {
|
||||
if (x != goToX || y != goToY) {
|
||||
if (x != goToX) {
|
||||
int diff = Math.abs(goToX - x);
|
||||
int dir = diff / (goToX - x);
|
||||
|
||||
@@ -240,9 +240,11 @@ public class Sentry extends Item {
|
||||
|
||||
if (behavior == -1) {
|
||||
if (carrying == null) {
|
||||
x = robot.x + robot.width / 2 - width / 2;
|
||||
y = robot.y + robot.height / 2 - height / 2;
|
||||
PicksUp(robot);
|
||||
if(robot != null) {
|
||||
x = robot.x + robot.width / 2 - width / 2;
|
||||
y = robot.y + robot.height / 2 - height / 2;
|
||||
PicksUp(robot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ public class MainMenu extends Level {
|
||||
room.AddTextBox("Saved Games", 9 * 28, 10 * 32, 80);
|
||||
room.AddTextBox("Games", 450, 6 * 32 + 8, 500);
|
||||
room.AddArrow(559, 6 * 32, Arrow.DIR_RIGHT, 28, Color.white);
|
||||
room.AddTextBox("{000,000,000} Version 2.7", 0, 16, 500);
|
||||
room.AddTextBox("{000,000,000} Version 2.8", 0, 16, 500);
|
||||
if (cheatmode) {
|
||||
room.AddTextBox("{BIG} CHEAT ENABLED!", 91, 8 * 32, 500);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.droidquest.levels.Level;
|
||||
public class BatteryIn extends Material {
|
||||
// Charges the Battery when an Energy Crystal is passed over it.
|
||||
|
||||
public void BatteryIn() {
|
||||
public BatteryIn() {
|
||||
passable = true;
|
||||
GenerateIcons();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user