minor coding improvements
This commit is contained in:
parent
4d5e0ee6b0
commit
46c5706375
@ -421,8 +421,8 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
$switchLabel->setTextSize(2);
|
$switchLabel->setTextSize(2);
|
||||||
$switchLabel->setText('»');
|
$switchLabel->setText('»');
|
||||||
$switchLabel->setTextColor('0f0');
|
$switchLabel->setTextColor('0f0');
|
||||||
$switchLabel->setAction(self::ACTION_START_SWITCH_VOTE . '.' . ($map->uid));
|
$switchLabel->setAction(self::ACTION_START_SWITCH_VOTE . '.' . $map->uid);
|
||||||
$description = 'Start Map-Switch Vote: $<' . $map->name . '$>';
|
$description = 'Start Map-Switch Vote: ' . $map->getEscapedName();
|
||||||
$switchLabel->addTooltipLabelFeature($descriptionLabel, $description);
|
$switchLabel->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -596,7 +596,6 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
public function handleManialinkPageAnswer(array $callback) {
|
public function handleManialinkPageAnswer(array $callback) {
|
||||||
$actionId = $callback[1][2];
|
$actionId = $callback[1][2];
|
||||||
$actionArray = explode('.', $actionId);
|
$actionArray = explode('.', $actionId);
|
||||||
|
|
||||||
if (count($actionArray) <= 2) {
|
if (count($actionArray) <= 2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ class PluginManager {
|
|||||||
}
|
}
|
||||||
$pluginFiles = scandir($directory);
|
$pluginFiles = scandir($directory);
|
||||||
foreach ($pluginFiles as $pluginFile) {
|
foreach ($pluginFiles as $pluginFile) {
|
||||||
if (stripos($pluginFile, '.') === 0) {
|
if (substr($pluginFile, 0, 1) === '.') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,8 +169,7 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
|
|||||||
$array['$oId'] = $posX + 5;
|
$array['$oId'] = $posX + 5;
|
||||||
$array['$oNickname'] = $posX + 14;
|
$array['$oNickname'] = $posX + 14;
|
||||||
|
|
||||||
|
// Headline
|
||||||
//Compute Headline
|
|
||||||
$posX = $xStart + 55;
|
$posX = $xStart + 55;
|
||||||
$statRankings = array();
|
$statRankings = array();
|
||||||
foreach ($this->statArray as $key => $stat) {
|
foreach ($this->statArray as $key => $stat) {
|
||||||
@ -193,7 +192,7 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var Label_Text $label [] */
|
/** @var Label_Text $label */
|
||||||
$label = $labels[$index];
|
$label = $labels[$index];
|
||||||
|
|
||||||
$label->setAction(self::ACTION_SORT_STATS . '.' . $statArray["Name"]);
|
$label->setAction(self::ACTION_SORT_STATS . '.' . $statArray["Name"]);
|
||||||
@ -245,14 +244,12 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
|
|||||||
$statValue = round(floatval($statValue), 2);
|
$statValue = round(floatval($statValue), 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$displayArray[$stat['Name']] = array("Value" => strval($statValue), "Width" => $stat['Width']);
|
$displayArray[$stat['Name']] = array('Value' => strval($statValue), 'Width' => $stat['Width']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$array = array($index => $xStart + 5, $listPlayer->nickname => $xStart + 14);
|
$array = array($index => $xStart + 5, $listPlayer->nickname => $xStart + 14);
|
||||||
$this->maniaControl->manialinkManager->labelLine($playerFrame, $array);
|
$this->maniaControl->manialinkManager->labelLine($playerFrame, $array);
|
||||||
|
|
||||||
|
|
||||||
$posX = $xStart + 55;
|
$posX = $xStart + 55;
|
||||||
foreach ($displayArray as $key => $array) {
|
foreach ($displayArray as $key => $array) {
|
||||||
$label = new Label_Text();
|
$label = new Label_Text();
|
||||||
@ -267,7 +264,6 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
|
|||||||
$posX += $array['Width'];
|
$posX += $array['Width'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$playerFrame->setY($posY);
|
$playerFrame->setY($posY);
|
||||||
|
|
||||||
if ($index % 2 !== 0) {
|
if ($index % 2 !== 0) {
|
||||||
@ -278,12 +274,10 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
|
|||||||
$lineQuad->setZ(0.001);
|
$lineQuad->setZ(0.001);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$index++;
|
$index++;
|
||||||
$posY -= 4;
|
$posY -= 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render and display xml
|
|
||||||
$this->maniaControl->manialinkManager->displayWidget($maniaLink, $player, 'SimpleStatsList');
|
$this->maniaControl->manialinkManager->displayWidget($maniaLink, $player, 'SimpleStatsList');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,7 +293,7 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$action = $actionArray[0] . "." . $actionArray[1];
|
$action = $actionArray[0] . '.' . $actionArray[1];
|
||||||
|
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case self::ACTION_SORT_STATS:
|
case self::ACTION_SORT_STATS:
|
||||||
|
@ -917,5 +917,4 @@ class CurrentVote {
|
|||||||
public function getVoteCount() {
|
public function getVoteCount() {
|
||||||
return count($this->playersVoted);
|
return count($this->playersVoted);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user