Browse Source

Time bar fixed

jancoow 10 years ago
parent
commit
25205755f9
2 changed files with 3 additions and 3 deletions
  1. 1 1
      server/server/match/Match.java
  2. 2 2
      src/model/InfoPanel.java

+ 1 - 1
server/server/match/Match.java

@@ -175,7 +175,7 @@ public class Match implements Runnable {
 		else
 			linesinfo += "0|0|0|";
 		
-		String timeleft = ","+(int)(this.timeleft/(double)getCurrentLevel().getTime()*1000);
+		String timeleft = ","+(int)(this.timeleft/(double)getCurrentLevel().getTime()*100);
 		
 		nwuser1.sendMessage(playerinfo+ballsinfo+linesinfo+timeleft);
 		nwuser2.sendMessage(playerinfo+ballsinfo+linesinfo+timeleft);

+ 2 - 2
src/model/InfoPanel.java

@@ -21,8 +21,8 @@ public class InfoPanel {
 	public void paint(Graphics2D g2d)
 	{
 		g2d.setColor(Color.red);
-		g2d.fillRect(200, OFFSET, (int) (400*((play.getTimeleftpercent())/1000)), 20);
-		
+		g2d.fillRect(200, OFFSET, (int) (400/100*play.getTimeleftpercent()), 20);
+
 		g2d.setColor(Color.black);
 		g2d.setFont(new Font("Century Schoolbook L", Font.ROMAN_BASELINE, 22));
 		g2d.drawRect(200, OFFSET, 400, 20);