Bugfix, CustomVotesPlugin Widget

This commit is contained in:
Jocy 2017-05-22 18:12:15 +02:00
parent 13cc7e544d
commit 8055468f20

View File

@ -702,12 +702,13 @@ class CustomVotesPlugin implements SidebarMenuEntryListener, CommandListener, Ca
$label->setTextColor('F80'); $label->setTextColor('F80');
$label->setText('$sStarted by ' . $this->currentVote->voter->nickname); $label->setText('$sStarted by ' . $this->currentVote->voter->nickname);
//Time Gauge //Time Gauge
$timeGauge = new Gauge(); $timeGauge = new Gauge();
$frame->addChild($timeGauge); $frame->addChild($timeGauge);
$timeGauge->setY(1.5); $timeGauge->setY(1.5);
$timeGauge->setSize($width * 0.95, 6); $timeGauge->setSize($width * 0.95, 6);
$timeGauge->setDrawBlockBackground(false); $timeGauge->setDrawBackground(false);
if (!$timeUntilExpire) { if (!$timeUntilExpire) {
$timeUntilExpire = 1; $timeUntilExpire = 1;
} }
@ -730,7 +731,7 @@ class CustomVotesPlugin implements SidebarMenuEntryListener, CommandListener, Ca
$frame->addChild($voteGauge); $frame->addChild($voteGauge);
$voteGauge->setY(-4); $voteGauge->setY(-4);
$voteGauge->setSize($width * 0.65, 12); $voteGauge->setSize($width * 0.65, 12);
$voteGauge->setDrawBlockBackground(false); $voteGauge->setDrawBackground(false);
$voteGauge->setRatio($votePercentage + 0.10 - $votePercentage * 0.10); $voteGauge->setRatio($votePercentage + 0.10 - $votePercentage * 0.10);
$gaugeColor = ColorUtil::floatToStatusColor($votePercentage); $gaugeColor = ColorUtil::floatToStatusColor($votePercentage);
$voteGauge->setColor($gaugeColor . '6'); $voteGauge->setColor($gaugeColor . '6');