local records widget improved

This commit is contained in:
Steffen Schröder 2014-01-01 18:42:43 +01:00
parent 97429e579e
commit 31fdecafa5

View File

@ -245,23 +245,13 @@ class LocalRecordsPlugin implements CallbackListener, Plugin {
$notifyOnlyDriver = $this->maniaControl->settingManager->getSetting($this, self::SETTING_NOTIFY_ONLY_DRIVER); $notifyOnlyDriver = $this->maniaControl->settingManager->getSetting($this, self::SETTING_NOTIFY_ONLY_DRIVER);
$notifyOnlyBestRecords = $this->maniaControl->settingManager->getSetting($this, self::SETTING_NOTIFY_BEST_RECORDS); $notifyOnlyBestRecords = $this->maniaControl->settingManager->getSetting($this, self::SETTING_NOTIFY_BEST_RECORDS);
if ($notifyOnlyDriver || $notifyOnlyBestRecords > 0 && $newRecord->rank > $notifyOnlyBestRecords) { if ($notifyOnlyDriver || $notifyOnlyBestRecords > 0 && $newRecord->rank > $notifyOnlyBestRecords) {
if (!$oldRecord || $newRecord->rank < $oldRecord->rank) { $improvement = ((!$oldRecord || $newRecord->rank < $oldRecord->rank) ? 'gained the' : 'improved Your');
$improvement = 'gained the';
}
else {
$improvement = 'improved Your';
}
$message = 'You ' . $improvement . ' $<$o' . $newRecord->rank . '.$> Local Record: ' . $message = 'You ' . $improvement . ' $<$o' . $newRecord->rank . '.$> Local Record: ' .
Formatter::formatTime($newRecord->time); Formatter::formatTime($newRecord->time);
$this->maniaControl->chat->sendInformation($message, $player->login); $this->maniaControl->chat->sendInformation($message, $player->login);
} }
else { else {
if (!$oldRecord || $newRecord->rank < $oldRecord->rank) { $improvement = ((!$oldRecord || $newRecord->rank < $oldRecord->rank) ? 'gained the' : 'improved the');
$improvement = 'gained the';
}
else {
$improvement = 'improved the';
}
$message = '$<' . $player->nickname . '$> ' . $improvement . ' $<$o' . $newRecord->rank . '.$> Local Record: ' . $message = '$<' . $player->nickname . '$> ' . $improvement . ' $<$o' . $newRecord->rank . '.$> Local Record: ' .
Formatter::formatTime($newRecord->time); Formatter::formatTime($newRecord->time);
$this->maniaControl->chat->sendInformation($message); $this->maniaControl->chat->sendInformation($message);
@ -352,7 +342,7 @@ class LocalRecordsPlugin implements CallbackListener, Plugin {
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$recordFrame->add($backgroundQuad); $recordFrame->add($backgroundQuad);
$backgroundQuad->setSize($width * 1.03, $lineHeight * 1.25); $backgroundQuad->setSize($width * 1.03, $lineHeight * 1.32);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$rankLabel = new Label(); $rankLabel = new Label();