removed unnecessary assignment of (default) values

This commit is contained in:
Steffen Schröder 2014-05-18 21:59:21 +02:00
parent 722c0f483e
commit a6d9753cee
10 changed files with 11 additions and 54 deletions

View File

@ -176,7 +176,6 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
$playerFrame->add($label);
$label->setX($x + 130);
$quad->setZ(12);
$label->setAlign(Control::CENTER, Control::CENTER);
$label->setStyle($style);
$label->setTextSize(1);
$label->setTextColor($textColor);

View File

@ -256,13 +256,11 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
$quad->setZ(-0.01);
$quad->setSubStyle($substyle);
$quad->setSize(4, 4);
$quad->setHAlign(Control::CENTER);
$quad->setAction(self::ACTION_SETTING_BOOL . $settingName);
} else {
$entry = new Entry();
$settingFrame->add($entry);
$entry->setStyle(Label_Text::STYLE_TextValueSmall);
$entry->setHAlign(Control::CENTER);
$entry->setX($width / 2 * 0.55);
$entry->setTextSize(1);
$entry->setSize($width * 0.3, $settingHeight * 0.9);

View File

@ -214,7 +214,6 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
$entry = new Entry();
$settingFrame->add($entry);
$entry->setStyle(Label_Text::STYLE_TextValueSmall);
$entry->setHAlign(Control::CENTER);
$entry->setX($width / 2 * 0.46);
$entry->setTextSize(1);
$entry->setSize($width * 0.48, $settingHeight * 0.9);

View File

@ -275,7 +275,6 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
$karmaLabel->setSize(16.5 * 0.9, 5);
$karmaLabel->setTextSize(0.9);
$karmaLabel->setTextColor('000');
$karmaLabel->setAlign(Control::CENTER, Control::CENTER);
$karmaLabel->setText(' ' . round($karma * 100.) . '% (' . $voteCount . ')');
}

View File

@ -309,7 +309,6 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$label = new Label_Text();
$mapFrame->add($label);
$label->setX($width / 2 - 13);
$label->setAlign(Control::CENTER, Control::CENTER);
$label->setZ(0.2);
$label->setTextSize(1.5);
$label->setText($queuedMaps[$map->uid]);
@ -454,7 +453,6 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$karmaLabel->setSize(20 * 0.9, 5);
$karmaLabel->setTextSize(0.9);
$karmaLabel->setTextColor('000');
$karmaLabel->setAlign(Control::CENTER, Control::CENTER);
$karmaLabel->setText($karmaText);
}
}
@ -525,7 +523,6 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$label = new Label_Button();
$confirmFrame->add($label);
$label->setAlign(Control::CENTER, Control::CENTER);
$label->setText('Sure?');
$label->setTextSize(1);
$label->setScale(0.90);
@ -535,7 +532,6 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$confirmFrame->add($buttLabel);
$buttLabel->setPosition(3.2, 0.4, 0.2);
$buttLabel->setSize(3, 3);
$buttLabel->setAlign(Control::CENTER, Control::CENTER);
if (!$erase) {
$quad->setAction(self::ACTION_SWITCH_MAP . '.' . $mapUid);

View File

@ -263,7 +263,6 @@ class PlayerDetailed {
$frame->add($label);
$label->setPosition($x + 40, $y);
$label->setText($value);
$label->setVAlign(Control::CENTER2);
$label->setTextSize(1.5);
$y -= 4;

View File

@ -488,7 +488,6 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
$frame->add($label);
$label->setHAlign($hAlign);
$label->setX(0);
$label->setAlign(Control::CENTER, Control::CENTER);
$label->setY($height / 2 - 8);
$label->setStyle($style);
$label->setTextSize($textSize);
@ -507,7 +506,6 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
$label = new Label_Button();
$frame->add($label);
$label->setX(0);
$label->setAlign(Control::CENTER, Control::CENTER);
$label->setY($y);
$label->setStyle($style);
$label->setTextSize($textSize);

View File

@ -302,7 +302,6 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$entry = new Entry();
$settingFrame->add($entry);
$entry->setStyle(Label_Text::STYLE_TextValueSmall);
$entry->setHAlign(Control::CENTER);
$entry->setX($width / 2 * 0.65);
$entry->setTextSize(1);
$entry->setSize($width * 0.3, $settingHeight * 0.9);
@ -323,7 +322,6 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$quad->setZ(-0.01);
$quad->setSubStyle($substyle);
$quad->setSize(4, 4);
$quad->setHAlign(Control::CENTER2);
$quad->setAction(self::ACTION_SETTING_BOOL . $setting->index);
$entry->setVisible(false);
}

View File

@ -667,7 +667,6 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
$label = new Label_Text();
$frame->add($label);
$label->setY($height / 2 - 3);
$label->setAlign(Control::CENTER, Control::CENTER);
$label->setSize($width - 5, $height);
$label->setTextSize(1.3);
$label->setText('$s ' . $this->currentVote->voteCommand->name);
@ -676,7 +675,6 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
$label = new Label_Text();
$frame->add($label);
$label->setY($height / 2 - 6);
$label->setAlign(Control::CENTER, Control::CENTER);
$label->setSize($width - 5, 2);
$label->setTextSize(1);
$label->setTextColor("F80");
@ -700,7 +698,6 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
$label = new Label_Text();
$frame->add($label);
$label->setY(0);
$label->setAlign(Control::CENTER, Control::CENTER);
$label->setSize($width - 5, $height);
$label->setTextSize(1.1);
$label->setText('$sTime left: ' . $timeUntilExpire . "s");

View File

@ -13,13 +13,13 @@ use FML\Script\Script;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Callbacks\TimerListener;
use ManiaControl\Utils\Formatter;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\IconManager;
use ManiaControl\Maps\Map;
use ManiaControl\Players\Player;
use ManiaControl\Players\PlayerManager;
use ManiaControl\Plugins\Plugin;
use ManiaControl\Utils\Formatter;
/**
* ManiaControl Widget Plugin
@ -211,10 +211,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$label = new Label_Text();
$frame->add($label);
$label->setY(1.5);
$label->setX(0);
$label->setAlign(Control::CENTER, Control::CENTER);
$label->setZ(0.2);
$label->setPosition(0, 1.5, 0.2);
$label->setTextSize(1.3);
$label->setText(Formatter::stripDirtyCodes($map->name));
$label->setTextColor("FFF");
@ -222,11 +219,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$label = new Label_Text();
$frame->add($label);
$label->setX(0);
$label->setY(-1.4);
$label->setAlign(Control::CENTER, Control::CENTER);
$label->setZ(0.2);
$label->setPosition(0, -1.4, 0.2);
$label->setTextSize(1);
$label->setScale(0.8);
$label->setText($map->authorLogin);
@ -240,7 +233,6 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$quad->setImage($this->maniaControl->manialinkManager->iconManager->getIcon(IconManager::MX_ICON));
$quad->setPosition(-$width / 2 + 4, -1.5, -0.5);
$quad->setSize(4, 4);
$quad->setHAlign(Control::CENTER);
$quad->setUrl($map->mx->pageurl);
}
@ -277,10 +269,8 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$label = new Label_Text();
$frame->add($label);
$label->setY(1.5);
$label->setX(0);
$label->setAlign(Control::CENTER, Control::TOP);
$label->setZ(0.2);
$label->setPosition(0, 1.5, 0.2);
$label->setVAlign(Control::TOP);
$label->setTextSize(1);
$label->setTextColor("FFF");
$label->addClockFeature(false);
@ -339,7 +329,6 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$label = new Label_Text();
$frame->add($label);
$label->setPosition(0, 1.5, 0.2);
$label->setAlign(Control::CENTER, Control::CENTER);
$label->setSize($width - 5, $height);
$label->setTextSize(1.3);
$label->setText(Formatter::stripDirtyCodes($serverName));
@ -349,7 +338,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$label = new Label_Text();
$frame->add($label);
$label->setPosition(-$width / 2 + 9, -1.5, 0.2);
$label->setAlign(Control::LEFT, Control::CENTER);
$label->setHAlign(Control::LEFT);
$label->setTextSize(1);
$label->setScale(0.8);
$label->setText($playerCount . " / " . $maxPlayers['NextValue']);
@ -360,13 +349,12 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$quad->setSubStyle($quad::SUBSTYLE_Multiplayer);
$quad->setPosition(-$width / 2 + 7, -1.6, 0.2);
$quad->setSize(2.5, 2.5);
$quad->setHAlign(Control::CENTER);
// Spectator Quad / Label
$label = new Label_Text();
$frame->add($label);
$label->setPosition(2, -1.5, 0.2);
$label->setAlign(Control::LEFT, Control::CENTER);
$label->setHAlign(Control::LEFT);
$label->setTextSize(1);
$label->setScale(0.8);
$label->setText($spectatorCount . " / " . $maxSpectators['NextValue']);
@ -377,7 +365,6 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$quad->setSubStyle($quad::SUBSTYLE_Camera);
$quad->setPosition(0, -1.6, 0.2);
$quad->setSize(3.3, 2.5);
$quad->setHAlign(Control::CENTER);
// Favorite quad
$quad = new Quad_Icons64x64_1();
@ -385,7 +372,6 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$quad->setSubStyle($quad::SUBSTYLE_StateFavourite);
$quad->setPosition($width / 2 - 4, -1.5, -0.5);
$quad->setSize(3, 3);
$quad->setHAlign(Control::CENTER);
$quad->setManialink('mcontrol?favorite=' . urlencode($this->maniaControl->server->login));
// Send manialink
@ -489,10 +475,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$label = new Label_Text();
$frame->add($label);
$label->setY($height / 2 - 2.3);
$label->setX(0);
$label->setAlign(Control::CENTER, Control::CENTER);
$label->setZ(0.2);
$label->setPosition(0, $height / 2 - 2.3, 0.2);
$label->setTextSize(1);
$label->setText("Next Map");
$label->setTextColor("FFF");
@ -500,20 +483,14 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$label = new Label_Text();
$frame->add($label);
$label->setY($height / 2 - 5.5);
$label->setX(0);
$label->setAlign(Control::CENTER, Control::CENTER);
$label->setZ(0.2);
$label->setPosition(0, $height / 2 - 5.5, 0.2);
$label->setTextSize(1.3);
$label->setText($name);
$label->setTextColor("FFF");
$label = new Label_Text();
$frame->add($label);
$label->setX(0);
$label->setY(-$height / 2 + 4);
$label->setAlign(Control::CENTER, Control::CENTER);
$label->setPosition(0, -$height / 2 + 4);
$label->setZ(0.2);
$label->setTextSize(1);
$label->setScale(0.8);
@ -523,10 +500,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
if ($requester) {
$label = new Label_Text();
$frame->add($label);
$label->setX(0);
$label->setY(-$height / 2 + 2);
$label->setAlign(Control::CENTER, Control::CENTER);
$label->setZ(0.2);
$label->setPosition(0, -$height / 2 + 2, 0.2);
$label->setTextSize(1);
$label->setScale(0.7);
$label->setText($author);