Merge pull request #162 from Chapelier2000/master

Fix Display time higher than 60 minutes
This commit is contained in:
Lukas Kremsmayr 2017-07-18 15:30:28 +02:00 committed by GitHub
commit 8e4b91d937
2 changed files with 11 additions and 1 deletions

View File

@ -40,7 +40,7 @@ abstract class Formatter implements UsageInformationAble {
$minutes = floor($seconds / 60); $minutes = floor($seconds / 60);
$hours = floor($minutes / 60); $hours = floor($minutes / 60);
$minutes -= $hours * 60; $minutes -= $hours * 60;
$seconds -= $hours * 60 + $minutes * 60; $seconds -= ($hours * 60 + $minutes) * 60;
$format = ($hours > 0 ? $hours . ':' : ''); $format = ($hours > 0 ? $hours . ':' : '');
$format .= ($hours > 0 && $minutes < 10 ? '0' : '') . $minutes . ':'; $format .= ($hours > 0 && $minutes < 10 ? '0' : '') . $minutes . ':';
$format .= ($seconds < 10 ? '0' : '') . $seconds . ':'; $format .= ($seconds < 10 ? '0' : '') . $seconds . ':';

View File

@ -262,6 +262,16 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$label->setTextColor('fff'); $label->setTextColor('fff');
$label->setSize($width - 5, $height); $label->setSize($width - 5, $height);
//AUTEUR TIME
$label = new Label_Text();
$frame->addChild($label);
$label->setPosition(0, -4.3, 0.2);
$label->setTextSize(1);
$label->setScale(0.8);
$label->setText('$s' . Formatter::formatTime($map->authorTime));
$label->setTextColor('F7F');
$label->setSize($width - 5, $height);
if (isset($map->mx->pageurl)) { if (isset($map->mx->pageurl)) {
$quad = new Quad(); $quad = new Quad();
$frame->addChild($quad); $frame->addChild($quad);