Skip to content

Commit d6bb387

Browse files
committed
* Fix crash, fix display
1 parent 61f35b4 commit d6bb387

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/UI/Frames/StatsFrame.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require 'yaml'
22
require_relative 'HomeFrame'
33
require_relative '../Frame'
4+
require_relative '../../Timer'
45

56
##
67
# File :: StatsFrame.rb
@@ -83,7 +84,7 @@ def createPlayerScrollData(lvl)
8384
box.set_homogeneous(true)
8485
box.pack_start(Gtk::Label.new(lvl.name),:expand => true, :fill => true, :padding =>2)
8586
box.pack_start(Gtk::Label.new(lvl.allStat.maxStars.numberOfStars.to_s),:expand => true, :fill => true, :padding =>2)
86-
box.pack_start(Gtk::Label.new(lvl.allStat.bestTime.time.elapsedTime.round),:expand => true, :fill => true, :padding =>2)
87+
box.pack_start(Gtk::Label.new(lvl.allStat.bestTime.time.elapsedTime),:expand => true, :fill => true, :padding =>2)
8788
box.pack_start(Gtk::Label.new(lvl.allStat.minHelp.usedHelp.to_s),:expand => true, :fill => true, :padding =>2)
8889
box.pack_start(Gtk::Label.new(lvl.allStat.minClick.nbClick.to_s),:expand => true, :fill => true, :padding =>2)
8990
box.pack_start(Gtk::Label.new(lvl.allStat.nbFinished.to_s),:expand => true, :fill => true, :padding =>2)
@@ -142,7 +143,7 @@ def calculateGlobalStat(user)
142143
end
143144
end
144145
end
145-
return [totalClick, totalTime, totalHelp , totalFinished]
146+
return [totalClick, totalTime.round, totalHelp , totalFinished]
146147
end
147148

148149
def createGlobalButton(user)
@@ -156,7 +157,7 @@ def createGlobalButton(user)
156157
totalClick, totalTime, totalHelp , totalFinished = calculateGlobalStat(user)
157158

158159
createGlobalScroll(@lang["stats"]["global"]["stars"], user.totalStars.to_s)
159-
createGlobalScroll(@lang["stats"]["global"]["time"], totalTime.to_s)
160+
createGlobalScroll(@lang["stats"]["global"]["time"], Timer.toTime(totalTime))
160161
createGlobalScroll(@lang["stats"]["global"]["help"], totalHelp.to_s)
161162
createGlobalScroll(@lang["stats"]["global"]["click"], totalClick.to_s)
162163
createGlobalScroll(@lang["stats"]["global"]["finished"],totalFinished.to_s)

0 commit comments

Comments
 (0)