From 665965c3d872778d171132ca0f654986974f7215 Mon Sep 17 00:00:00 2001 From: Max Klaversma Date: Wed, 30 Apr 2014 16:57:49 +0200 Subject: [PATCH] Fixed Karma + chat --- application/core/Chat.php | 4 ++-- application/core/Maps/MapList.php | 6 +++--- application/plugins/Karma.php | 10 ++++++++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/application/core/Chat.php b/application/core/Chat.php index 7f7a4248..0d71b3e6 100644 --- a/application/core/Chat.php +++ b/application/core/Chat.php @@ -75,10 +75,10 @@ class Chat { if (!$login) { $prefix = $this->getPrefix($prefix); - $chatMessage = '$z$s$<' . str_replace(' ', '', $prefix) . $prefix . $message . '$>$z$s'; + $chatMessage = '$<$z$ff0' . str_replace(' ', '', $prefix) . $prefix . $message . '$>'; $this->maniaControl->client->chatSendServerMessage($chatMessage); } else { - $chatMessage = '$z$s$<' . $this->getPrefix($prefix) . $message . '$>$z$s'; + $chatMessage = '$<$z$ff0' . $this->getPrefix($prefix) . $message . '$>'; if ($login instanceof Player) { $login = $login->login; } diff --git a/application/core/Maps/MapList.php b/application/core/Maps/MapList.php index cecc631c..1dc5145c 100644 --- a/application/core/Maps/MapList.php +++ b/application/core/Maps/MapList.php @@ -425,9 +425,9 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener { $karma = $karmaPlugin->getMapKarma($map); $votes = $karmaPlugin->getMapVotes($map); if (is_numeric($karma)) { - if($this->maniaControl->settingManager->getSetting($karmaPlugin, $karmaPlugin::SETTING_NEWKARMA) === true) { + if($this->maniaControl->settingManager->getSetting($karmaPlugin, $karmaPlugin::SETTING_NEWKARMA)) { $endKarma = $karma; - $karmaText = ' ' . round($karma * 100.) . ' (' . $votes['count'] . ')'; + } else { $min = 0; $plus = 0; @@ -465,7 +465,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener { $karmaLabel->setTextSize(0.9); $karmaLabel->setTextColor('000'); $karmaLabel->setAlign(Control::CENTER, Control::CENTER); - $karmaLabel->setText($karmaText); + $karmaLabel->setText(' ' . $endKarma . ' (' . $votes['count'] . 'x / ' . round($karma * 100.) . '%)'); } } diff --git a/application/plugins/Karma.php b/application/plugins/Karma.php index 7d029186..3a7b2b2e 100644 --- a/application/plugins/Karma.php +++ b/application/plugins/Karma.php @@ -550,6 +550,16 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin { return $votes; } + /** + * Get all players votes + * + * @param Map $map + * @return array + */ + public function getMapPlayerVotes(Map $map) { + + } + /** * Build karma voting manialink if necessary *