Fixed Karma + chat
This commit is contained in:
parent
14dcaa92f1
commit
665965c3d8
@ -75,10 +75,10 @@ class Chat {
|
|||||||
|
|
||||||
if (!$login) {
|
if (!$login) {
|
||||||
$prefix = $this->getPrefix($prefix);
|
$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);
|
$this->maniaControl->client->chatSendServerMessage($chatMessage);
|
||||||
} else {
|
} else {
|
||||||
$chatMessage = '$z$s$<' . $this->getPrefix($prefix) . $message . '$>$z$s';
|
$chatMessage = '$<$z$ff0' . $this->getPrefix($prefix) . $message . '$>';
|
||||||
if ($login instanceof Player) {
|
if ($login instanceof Player) {
|
||||||
$login = $login->login;
|
$login = $login->login;
|
||||||
}
|
}
|
||||||
|
@ -425,9 +425,9 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
$karma = $karmaPlugin->getMapKarma($map);
|
$karma = $karmaPlugin->getMapKarma($map);
|
||||||
$votes = $karmaPlugin->getMapVotes($map);
|
$votes = $karmaPlugin->getMapVotes($map);
|
||||||
if (is_numeric($karma)) {
|
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;
|
$endKarma = $karma;
|
||||||
$karmaText = ' ' . round($karma * 100.) . ' (' . $votes['count'] . ')';
|
|
||||||
} else {
|
} else {
|
||||||
$min = 0;
|
$min = 0;
|
||||||
$plus = 0;
|
$plus = 0;
|
||||||
@ -465,7 +465,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
$karmaLabel->setTextSize(0.9);
|
$karmaLabel->setTextSize(0.9);
|
||||||
$karmaLabel->setTextColor('000');
|
$karmaLabel->setTextColor('000');
|
||||||
$karmaLabel->setAlign(Control::CENTER, Control::CENTER);
|
$karmaLabel->setAlign(Control::CENTER, Control::CENTER);
|
||||||
$karmaLabel->setText($karmaText);
|
$karmaLabel->setText(' ' . $endKarma . ' (' . $votes['count'] . 'x / ' . round($karma * 100.) . '%)');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -550,6 +550,16 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
|
|||||||
return $votes;
|
return $votes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all players votes
|
||||||
|
*
|
||||||
|
* @param Map $map
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getMapPlayerVotes(Map $map) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build karma voting manialink if necessary
|
* Build karma voting manialink if necessary
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user