Fixes for timers.

This commit is contained in:
magenoxx 2013-06-20 15:50:06 +04:00
parent 724e7eff21
commit 7c187a1d2a
3 changed files with 19 additions and 6 deletions

View file

@ -206,21 +206,28 @@ public class PlayerPanelExt extends javax.swing.JPanel {
}
}
this.avatar.setText(player.getName());
String priorityTimeValue = getPriorityTimeLeftString(player);
this.timer.setCount(player.getPriorityTimeLeft());
this.avatar.setTopText(priorityTimeValue);
if (player.getPriorityTimeLeft() != Integer.MAX_VALUE) {
String priorityTimeValue = getPriorityTimeLeftString(player);
this.timer.setCount(player.getPriorityTimeLeft());
this.avatar.setTopText(priorityTimeValue);
}
this.btnPlayer.setText(player.getName());
if (player.isActive()) {
this.avatar.setBorder(greenBorder);
this.btnPlayer.setBorder(greenBorder);
this.timer.resume();
} else if (player.hasLeft()) {
this.avatar.setBorder(redBorder);
this.btnPlayer.setBorder(redBorder);
this.timer.pause();
} else {
this.avatar.setBorder(emptyBorder);
this.btnPlayer.setBorder(emptyBorder);
}
if (player.hasPriority()) {
System.out.println("resume: " + player.getName());
this.timer.resume();
} else {
System.out.println("pause: " + player.getName());
this.timer.pause();
}