Working with 7.4.1

This commit is contained in:
Neale Pickett 2012-04-05 20:33:45 -06:00
parent d677328594
commit 8e8ea4c913
1 changed files with 11 additions and 7 deletions

View File

@ -27,25 +27,29 @@ public class JammerButton extends TimerButton
} }
public void onClick(View v) { public void onClick(View v) {
if (! paused) { if (! paused && peer.running) {
long orem = peer.remaining(); penalized = true;
if (peer.penalized) {
// 7.4.1 -- Add a minute
} else {
// 7.4 -- Take a minute away from the other side
// if it goes negative, that's our time.
long orem = peer.remaining() - 60000;
if ((! running) && (! penalized) && (orem > 0)) {
orem -= 60000;
if (orem < 0) { if (orem < 0) {
set(-orem); set(-orem);
start(); start();
peer.set(0); peer.set(0);
peer.stop(); peer.stop();
peer.penalized = true;
} else { } else {
peer.set(orem); peer.set(orem);
} }
} else { return;
}
}
super.onClick(v); super.onClick(v);
} }
}
}
public void pause() { public void pause() {
super.pause(); super.pause();