improved constants access

This commit is contained in:
Steffen Schröder 2014-06-22 19:02:18 +02:00
parent c7a7693c6f
commit bb5058e532
16 changed files with 112 additions and 119 deletions

View File

@ -152,7 +152,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$descriptionLabel = new Label();
$manialink->add($descriptionLabel);
$descriptionLabel->setPosition($posX - count($this->adminMenuItems) * $itemSize * 1.15 - 6, $posY);
$descriptionLabel->setAlign(Control::RIGHT, Control::TOP);
$descriptionLabel->setAlign($descriptionLabel::RIGHT, $descriptionLabel::TOP);
$descriptionLabel->setSize(40, 4);
$descriptionLabel->setTextSize(1.4);
$descriptionLabel->setTextColor('fff');
@ -161,13 +161,13 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$popoutFrame = new Frame();
$manialink->add($popoutFrame);
$popoutFrame->setPosition($posX - $itemSize * 0.5, $posY);
$popoutFrame->setHAlign(Control::RIGHT);
$popoutFrame->setHAlign($popoutFrame::RIGHT);
$popoutFrame->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY);
$popoutFrame->setVisible(false);
$backgroundQuad = new Quad();
$popoutFrame->add($backgroundQuad);
$backgroundQuad->setHAlign(Control::RIGHT);
$backgroundQuad->setHAlign($backgroundQuad::RIGHT);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$backgroundQuad->setSize(count($this->adminMenuItems) * $itemSize * 1.15 + 2, $itemSize * $itemMarginFactorY);
@ -182,7 +182,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$popoutFrame->add($menuQuad);
$menuQuad->setSize($itemSize, $itemSize);
$menuQuad->setX($itemPosX);
$menuQuad->setHAlign(Control::RIGHT);
$menuQuad->setHAlign($menuQuad::RIGHT);
$itemPosX -= $itemSize * 1.05;
if ($menuItem[1]) {
@ -216,7 +216,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$descriptionLabel = new Label();
$manialink->add($descriptionLabel);
$descriptionLabel->setPosition($posX - count($this->playerMenuItems) * $itemSize * 1.15 - 6, $posY - $itemSize * $itemMarginFactorY);
$descriptionLabel->setAlign(Control::RIGHT, Control::TOP);
$descriptionLabel->setAlign($descriptionLabel::RIGHT, $descriptionLabel::TOP);
$descriptionLabel->setSize(40, 4);
$descriptionLabel->setTextSize(1.4);
$descriptionLabel->setTextColor('fff');
@ -225,13 +225,13 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$popoutFrame = new Frame();
$manialink->add($popoutFrame);
$popoutFrame->setPosition($posX - $itemSize * 0.5, $posY - $itemSize * $itemMarginFactorY);
$popoutFrame->setHAlign(Control::RIGHT);
$popoutFrame->setHAlign($popoutFrame::RIGHT);
$popoutFrame->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY);
$popoutFrame->setVisible(false);
$backgroundQuad = new Quad();
$popoutFrame->add($backgroundQuad);
$backgroundQuad->setHAlign(Control::RIGHT);
$backgroundQuad->setHAlign($backgroundQuad::RIGHT);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$backgroundQuad->setSize(count($this->playerMenuItems) * $itemSize * 1.15 + 2, $itemSize * $itemMarginFactorY);
@ -246,7 +246,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$popoutFrame->add($menuQuad);
$menuQuad->setSize($itemSize, $itemSize);
$menuQuad->setX($itemPosX);
$menuQuad->setHAlign(Control::RIGHT);
$menuQuad->setHAlign($menuQuad::RIGHT);
$itemPosX -= $itemSize * 1.05;
if ($menuItem[1]) {

View File

@ -152,13 +152,13 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
$nameLabel = new Label_Text();
$settingFrame->add($nameLabel);
$nameLabel->setHAlign(Control::LEFT);
$nameLabel->setHAlign($nameLabel::LEFT);
$nameLabel->setX($width * -0.46);
$nameLabel->setSize($width * 0.6, $settingHeight);
$nameLabel->setStyle($nameLabel::STYLE_TextCardSmall);
$nameLabel->setTextSize($labelTextSize);
$nameLabel->setText($setting->setting);
$nameLabel->setTextColor("FFF");
$nameLabel->setTextColor('fff');
$settingName = self::ACTION_PREFIX_SETTING . $setting->index;
if ($setting->type === Setting::TYPE_BOOL) {

View File

@ -3,7 +3,6 @@
namespace ManiaControl\Configurators;
use FML\Components\CheckBox;
use FML\Controls\Control;
use FML\Controls\Entry;
use FML\Controls\Frame;
use FML\Controls\Label;
@ -178,22 +177,22 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
$frame->add($pagerPrev);
$pagerPrev->setPosition($width * 0.39, $height * -0.44, 2);
$pagerPrev->setSize($pagerSize, $pagerSize);
$pagerPrev->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_ArrowPrev);
$pagerPrev->setSubStyle($pagerPrev::SUBSTYLE_ArrowPrev);
$pagerNext = new Quad_Icons64x64_1();
$frame->add($pagerNext);
$pagerNext->setPosition($width * 0.45, $height * -0.44, 2);
$pagerNext->setSize($pagerSize, $pagerSize);
$pagerNext->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_ArrowNext);
$pagerNext->setSubStyle($pagerNext::SUBSTYLE_ArrowNext);
$paging->addButton($pagerNext);
$paging->addButton($pagerPrev);
$pageCountLabel = new Label();
$pageCountLabel = new Label_Text();
$frame->add($pageCountLabel);
$pageCountLabel->setHAlign(Control::RIGHT);
$pageCountLabel->setHAlign($pageCountLabel::RIGHT);
$pageCountLabel->setPosition($width * 0.35, $height * -0.44, 1);
$pageCountLabel->setStyle('TextTitle1');
$pageCountLabel->setStyle($pageCountLabel::STYLE_TextTitle1);
$pageCountLabel->setTextSize(2);
$paging->setLabel($pageCountLabel);
@ -253,7 +252,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
$descriptionLabel = new Label();
$pageFrame->add($descriptionLabel);
$descriptionLabel->setHAlign(Control::LEFT);
$descriptionLabel->setHAlign($descriptionLabel::LEFT);
$descriptionLabel->setPosition($width * -0.45, $height * -0.44);
$descriptionLabel->setSize($width * 0.7, $settingHeight);
$descriptionLabel->setTextSize($labelTextSize);

View File

@ -3,10 +3,8 @@
namespace ManiaControl\Configurators;
use FML\Components\CheckBox;
use FML\Controls\Control;
use FML\Controls\Entry;
use FML\Controls\Frame;
use FML\Controls\Label;
use FML\Controls\Labels\Label_Text;
use FML\Controls\Quad;
use FML\Controls\Quads\Quad_Icons64x64_1;
@ -141,7 +139,8 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
$script->addFeature($paging);
$frame = new Frame();
$serverSettings = $this->maniaControl->client->getServerOptions()->toArray();
$serverSettings = $this->maniaControl->client->getServerOptions()
->toArray();
// Config
$pagerSize = 9.;
@ -164,11 +163,11 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
$paging->addButton($pagerNext);
$paging->addButton($pagerPrev);
$pageCountLabel = new Label();
$pageCountLabel = new Label_Text();
$frame->add($pageCountLabel);
$pageCountLabel->setHAlign(Control::RIGHT);
$pageCountLabel->setHAlign($pageCountLabel::RIGHT);
$pageCountLabel->setPosition($width * 0.35, $height * -0.44, 1);
$pageCountLabel->setStyle('TextTitle1');
$pageCountLabel->setStyle($pageCountLabel::STYLE_TextTitle1);
$pageCountLabel->setTextSize(2);
$paging->setLabel($pageCountLabel);
@ -198,13 +197,13 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
$nameLabel = new Label_Text();
$settingFrame->add($nameLabel);
$nameLabel->setHAlign(Control::LEFT);
$nameLabel->setHAlign($nameLabel::LEFT);
$nameLabel->setX($width * -0.46);
$nameLabel->setSize($width * 0.4, $settingHeight);
$nameLabel->setStyle($nameLabel::STYLE_TextCardSmall);
$nameLabel->setTextSize($labelTextSize);
$nameLabel->setText($name);
$nameLabel->setTextColor("FFF");
$nameLabel->setTextColor('fff');
if (is_bool($value)) {
// Boolean checkbox
@ -254,7 +253,8 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
return;
}
$serverSettings = $this->maniaControl->client->getServerOptions()->toArray();
$serverSettings = $this->maniaControl->client->getServerOptions()
->toArray();
$prefixLength = strlen(self::ACTION_PREFIX_SETTING);

View File

@ -245,7 +245,7 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
$awardLabel = new Label_Text();
$mapFrame->add($awardLabel);
$awardLabel->setX($posX + 98.5);
$awardLabel->setHAlign(Control::LEFT);
$awardLabel->setHAlign($awardLabel::LEFT);
$awardLabel->setText($map->awards);
$awardLabel->setTextSize(1.3);
}
@ -283,14 +283,14 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
$label = new Label_Text();
$frame->add($label);
$label->setPosition(-$width / 2 + 5, $height / 2 - 5);
$label->setHAlign(Control::LEFT);
$label->setHAlign($label::LEFT);
$label->setTextSize(1.3);
$label->setText("Search:");
$label->setText('Search: ');
$entry = new Entry();
$frame->add($entry);
$entry->setStyle(Label_Text::STYLE_TextValueSmall);
$entry->setHAlign(Control::LEFT);
$entry->setHAlign($entry::LEFT);
$entry->setPosition(-$width / 2 + 15, $height / 2 - 5);
$entry->setTextSize(1);
$entry->setSize($width * 0.25, 4);
@ -301,7 +301,7 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
$label = new Label_Button();
$frame->add($label);
$label->setPosition(-$width / 2 + 63, $height / 2 - 5);
$label->setText("MapName");
$label->setText('MapName');
$label->setTextSize(1.3);
$quad = new Quad_BgsPlayerCard();
@ -315,7 +315,7 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
$label = new Label_Button();
$frame->add($label);
$label->setPosition(-$width / 2 + 82, $height / 2 - 5);
$label->setText("Author");
$label->setText('Author');
$label->setTextSize(1.3);
$quad = new Quad_BgsPlayerCard();

View File

@ -108,7 +108,7 @@ class StyleManager {
// Predefine Description Label
$descriptionLabel = new Label();
$descriptionLabel->setAlign(Control::LEFT, Control::TOP);
$descriptionLabel->setAlign($descriptionLabel::LEFT, $descriptionLabel::TOP);
$descriptionLabel->setPosition(-$width / 2 + 10, -$height / 2 + 5);
$descriptionLabel->setSize($width * 0.7, 4);
$descriptionLabel->setTextSize(2);
@ -198,7 +198,7 @@ class StyleManager {
$pageCountLabel = new Label_Text();
$frame->add($pageCountLabel);
$pageCountLabel->setHAlign(Control::RIGHT);
$pageCountLabel->setHAlign($pageCountLabel::RIGHT);
$pageCountLabel->setPosition($width * 0.40, $height * -0.44, 1);
$pageCountLabel->setStyle($pageCountLabel::STYLE_TextTitle1);
$pageCountLabel->setTextSize(1.3);

View File

@ -154,16 +154,16 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
// Clear Map-Queue
$label = new Label_Button();
$frame->add($label);
$label->setText("Clear Map-Queue");
$label->setText('Clear Map-Queue');
$label->setTextSize(1);
$label->setPosition($width / 2 - 8, -$height / 2 + 9);
$label->setHAlign(Control::RIGHT);
$label->setHAlign($label::RIGHT);
$quad = new Quad_BgsPlayerCard();
$frame->add($quad);
$quad->setPosition($width / 2 - 5, -$height / 2 + 9, 0.01);
$quad->setSubStyle($quad::SUBSTYLE_BgPlayerCardBig);
$quad->setHAlign(Control::RIGHT);
$quad->setHAlign($quad::RIGHT);
$quad->setSize(29, 4);
$quad->setAction(self::ACTION_CLEAR_MAPQUEUE);
}
@ -172,16 +172,16 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
// Check Update
$label = new Label_Button();
$frame->add($label);
$label->setText("Check MX Updates");
$label->setText('Check MX for Updates');
$label->setTextSize(1);
$label->setPosition($width / 2 - 41, -$height / 2 + 9, 0.01);
$label->setHAlign(Control::RIGHT);
$label->setHAlign($label::RIGHT);
$quad = new Quad_BgsPlayerCard();
$frame->add($quad);
$quad->setPosition($width / 2 - 37, -$height / 2 + 9, 0.01);
$quad->setSubStyle($quad::SUBSTYLE_BgPlayerCardBig);
$quad->setHAlign(Control::RIGHT);
$quad->setHAlign($quad::RIGHT);
$quad->setSize(35, 4);
$quad->setAction(self::ACTION_CHECK_UPDATE);

View File

@ -79,14 +79,14 @@ class PlayerDetailed {
$countryQuad->setPosition(-$this->width / 2 + 10, $posY);
$countryQuad->setSize(5, 5);
$countryQuad->setZ(-0.1);
$countryQuad->setHAlign(Control::LEFT);
$countryQuad->setHAlign($countryQuad::LEFT);
//Nickname
$label = new Label_Text();
$frame->add($label);
$label->setPosition(-$this->width / 2 + 15, $posY);
$label->setText($target->nickname);
$label->setHAlign(Control::LEFT);
$label->setHAlign($label::LEFT);
//Define MainLabel (Login)
@ -95,26 +95,26 @@ class PlayerDetailed {
$frame->add($mainLabel);
$mainLabel->setPosition(-$this->width / 2 + 10, $posY);
$mainLabel->setTextSize(1.2);
$mainLabel->setHAlign(Control::LEFT);
$mainLabel->setText("Login:");
$mainLabel->setHAlign($mainLabel::LEFT);
$mainLabel->setText('Login: ');
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$label->setY($posY);
$label->setText("Nation: ");
$label->setText('Nation: ');
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$label->setY($posY);
$label->setText("Province:");
$label->setText('Province: ');
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$label->setY($posY);
$label->setText("Authorization:");
$label->setText('Authorization: ');
$posY -= 5;
$label = clone $mainLabel;
@ -126,13 +126,13 @@ class PlayerDetailed {
$label = clone $mainLabel;
$frame->add($label);
$label->setY($posY);
$label->setText("Ladder Score:");
$label->setText('Ladder Score: ');
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$label->setY($posY);
$label->setText("Inscribed Zone:");
$label->setText('Inscribed Zone: ');
$posY -= 5;
$label = clone $mainLabel;
@ -147,7 +147,7 @@ class PlayerDetailed {
$mainLabel->setPosition(-$this->width / 2 + 30, $posY);
$mainLabel->setText($target->login);
$mainLabel->setTextSize(1.2);
$mainLabel->setHAlign(Control::LEFT);
$mainLabel->setHAlign($mainLabel::LEFT);
//Country
$posY -= 5;
@ -189,13 +189,13 @@ class PlayerDetailed {
$label = clone $mainLabel;
$frame->add($label);
$label->setY($posY);
$label->setText(date("d M Y", time() - 3600 * 24 * $target->daysSinceZoneInscription));
$label->setText(date('d M Y', time() - 3600 * 24 * $target->daysSinceZoneInscription));
$quad = new Quad();
$frame->add($quad);
$quad->setImage('file://Avatars/' . $targetLogin . "/default");
$quad->setPosition(-$this->width / 2 + 50, -$this->height / 2 + 34);
$quad->setAlign(Control::RIGHT, Control::TOP);
$quad->setAlign($quad::RIGHT, $quad::TOP);
$quad->setSize(20, 20);
//Statistics
@ -205,9 +205,9 @@ class PlayerDetailed {
$quad = new Label_Button();
$frame->add($quad);
$quad->setStyle($quad::STYLE_CardMain_Quit);
$quad->setHAlign(Control::LEFT);
$quad->setHAlign($quad::LEFT);
$quad->setScale(0.75);
$quad->setText("Back");
$quad->setText('Back');
$quad->setPosition(-$this->width / 2 + 7, -$this->height / 2 + 7);
$quad->setAction(PlayerCommands::ACTION_OPEN_PLAYERLIST);
@ -248,14 +248,14 @@ class PlayerDetailed {
$lineQuad->setSize(49, 4);
$lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig);
$lineQuad->setPosition($posX, $posY, 0.001);
$lineQuad->setHAlign(Control::LEFT);
$lineQuad->setHAlign($lineQuad::LEFT);
}
$label = new Label_Text();
$frame->add($label);
$label->setPosition($posX + 4, $posY);
$label->setText($statProperties->name);
$label->setHAlign(Control::LEFT);
$label->setHAlign($label::LEFT);
$label->setTextSize(1.5);
$label = new Label_Text();

View File

@ -2,7 +2,6 @@
namespace ManiaControl\Players;
use FML\Controls\Control;
use FML\Controls\Frame;
use FML\Controls\Labels\Label_Button;
use FML\Controls\Labels\Label_Text;
@ -436,10 +435,8 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
$posX = $width / 2 + 2.5;
$width = 35;
$height = $height * 0.75;
$hAlign = Control::LEFT;
$style = Label_Text::STYLE_TextCardSmall;
$textSize = 1.5;
$textColor = 'FFF';
$textColor = 'fff';
$quadWidth = $width - 7;
// mainframe
@ -452,7 +449,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
$frame->add($closeQuad);
$closeQuad->setPosition($width * 0.4, $height * 0.43, 3);
$closeQuad->setSize(6, 6);
$closeQuad->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_QuitRace);
$closeQuad->setSubStyle($closeQuad::SUBSTYLE_QuitRace);
$closeQuad->setAction(self::ACTION_CLOSE_PLAYER_ADV);
// Background Quad
@ -473,10 +470,10 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Show headline
$label = new Label_Text();
$frame->add($label);
$label->setHAlign($hAlign);
$label->setHAlign($label::LEFT);
$label->setX(-$width / 2 + 5);
$label->setY($height / 2 - 5);
$label->setStyle($style);
$label->setStyle($label::STYLE_TextCardSmall);
$label->setTextSize($textSize);
$label->setText('Advanced Actions');
$label->setTextColor($textColor);
@ -484,10 +481,10 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Show Nickname
$label = new Label_Text();
$frame->add($label);
$label->setHAlign($hAlign);
$label->setHAlign($label::LEFT);
$label->setX(0);
$label->setY($height / 2 - 8);
$label->setStyle($style);
$label->setStyle($label::STYLE_TextCardSmall);
$label->setTextSize($textSize);
$label->setText($player->nickname);
$label->setTextColor($textColor);
@ -505,7 +502,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
$frame->add($label);
$label->setX(0);
$label->setY($posY);
$label->setStyle($style);
$label->setStyle($label::STYLE_TextCardSmall);
$label->setTextSize($textSize);
$label->setTextColor($textColor);

View File

@ -4,7 +4,6 @@ namespace ManiaControl\Plugins;
use FML\Components\CheckBox;
use FML\Components\ValuePicker;
use FML\Controls\Control;
use FML\Controls\Entry;
use FML\Controls\Frame;
use FML\Controls\Label;
@ -113,7 +112,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$pageCountLabel = new Label_Text();
$frame->add($pageCountLabel);
$pageCountLabel->setHAlign(Control::RIGHT);
$pageCountLabel->setHAlign($pageCountLabel::RIGHT);
$pageCountLabel->setPosition($width * 0.35, $height * -0.44, 1);
$pageCountLabel->setStyle($pageCountLabel::STYLE_TextTitle1);
$pageCountLabel->setTextSize(2);
@ -165,7 +164,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$nameLabel = new Label_Text();
$pluginFrame->add($nameLabel);
$nameLabel->setHAlign(Control::LEFT);
$nameLabel->setHAlign($nameLabel::LEFT);
$nameLabel->setX($width * -0.4);
$nameLabel->setSize($width * 0.5, $entryHeight);
$nameLabel->setStyle($nameLabel::STYLE_TextCardSmall);
@ -174,7 +173,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$descriptionLabel = new Label();
$pageFrame->add($descriptionLabel);
$descriptionLabel->setAlign(Control::LEFT, Control::TOP);
$descriptionLabel->setAlign($descriptionLabel::LEFT, $descriptionLabel::TOP);
$descriptionLabel->setPosition($width * -0.45, $height * -0.22);
$descriptionLabel->setSize($width * 0.7, $entryHeight);
$descriptionLabel->setTextSize(2);
@ -196,7 +195,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$statusChangeButton = new Label_Button();
$pluginFrame->add($statusChangeButton);
$statusChangeButton->setHAlign(Control::RIGHT);
$statusChangeButton->setHAlign($statusChangeButton::RIGHT);
$statusChangeButton->setX($width * 0.45);
$statusChangeButton->setStyle($statusChangeButton::STYLE_CardButtonSmall);
if ($active) {
@ -225,7 +224,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
if ($pluginUpdates) {
$updatePluginsButton = new Label_Button();
$frame->add($updatePluginsButton);
$updatePluginsButton->setHAlign(Control::RIGHT);
$updatePluginsButton->setHAlign($updatePluginsButton::RIGHT);
$updatePluginsButton->setPosition($width * 0.5, -29, 2);
$updatePluginsButton->setWidth(10);
$updatePluginsButton->setStyle($updatePluginsButton::STYLE_CardButtonSmallS);
@ -282,13 +281,13 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$nameLabel = new Label_Text();
$settingFrame->add($nameLabel);
$nameLabel->setHAlign(Control::LEFT);
$nameLabel->setHAlign($nameLabel::LEFT);
$nameLabel->setX($width * -0.46);
$nameLabel->setSize($width * 0.6, $settingHeight);
$nameLabel->setStyle($nameLabel::STYLE_TextCardSmall);
$nameLabel->setTextSize(2);
$nameLabel->setText($setting->setting);
$nameLabel->setTextColor("FFF");
$nameLabel->setTextColor('fff');
if ($setting->type === Setting::TYPE_BOOL) {
// Boolean checkbox
@ -323,14 +322,14 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$index++;
}
$quad = new Label_Button();
$frame->add($quad);
$quad->setStyle($quad::STYLE_CardMain_Quit);
$quad->setHAlign(Control::LEFT);
$quad->setScale(0.75);
$quad->setText("Back");
$quad->setPosition(-$width / 2 + 7, -$height / 2 + 7);
$quad->setAction(self::ACTION_BACK_TO_PLUGINS);
$backButton = new Label_Button();
$frame->add($backButton);
$backButton->setStyle($backButton::STYLE_CardMain_Quit);
$backButton->setHAlign($backButton::LEFT);
$backButton->setScale(0.75);
$backButton->setText('Back');
$backButton->setPosition(-$width / 2 + 7, -$height / 2 + 7);
$backButton->setAction(self::ACTION_BACK_TO_PLUGINS);
return $frame;
}

View File

@ -2,7 +2,6 @@
namespace ManiaControl\Statistics;
use FML\Controls\Control;
use FML\Controls\Frame;
use FML\Controls\Label;
use FML\Controls\Labels\Label_Text;
@ -155,7 +154,7 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
// Predefine Description Label
$descriptionLabel = new Label();
$frame->add($descriptionLabel);
$descriptionLabel->setAlign(Control::LEFT, Control::TOP);
$descriptionLabel->setAlign($descriptionLabel::LEFT, $descriptionLabel::TOP);
$descriptionLabel->setPosition($xStart + 10, -$height / 2 + 5);
$descriptionLabel->setSize($width * 0.7, 4);
$descriptionLabel->setTextSize(2);
@ -203,10 +202,8 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
}
// define standard properties
$hAlign = Control::LEFT;
$style = Label_Text::STYLE_TextCardSmall;
$textSize = 1.5;
$textColor = 'FFF';
$textColor = 'fff';
$index = 1;
$posY -= 10;
@ -260,9 +257,9 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
foreach ($displayArray as $key => $array) {
$label = new Label_Text();
$playerFrame->add($label);
$label->setHAlign($hAlign);
$label->setHAlign($label::LEFT);
$label->setX($posX);
$label->setStyle($style);
$label->setStyle($label::STYLE_TextCardSmall);
$label->setTextSize($textSize);
$label->setText($array['Value']);
$label->setTextColor($textColor);

View File

@ -321,7 +321,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
$descriptionLabel = new Label();
$descriptionFrame->add($descriptionLabel);
$descriptionLabel->setAlign(Control::RIGHT, Control::TOP);
$descriptionLabel->setAlign($descriptionLabel::RIGHT, $descriptionLabel::TOP);
$descriptionLabel->setSize(40, 4);
$descriptionLabel->setTextSize(1.4);
$descriptionLabel->setTextColor('fff');
@ -330,13 +330,13 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
$popoutFrame = new Frame();
$maniaLink->add($popoutFrame);
$popoutFrame->setPosition($posX - $itemSize * 0.5, $posY);
$popoutFrame->setHAlign(Control::RIGHT);
$popoutFrame->setHAlign($popoutFrame::RIGHT);
$popoutFrame->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY);
$popoutFrame->setVisible(false);
$backgroundQuad = new Quad();
$popoutFrame->add($backgroundQuad);
$backgroundQuad->setHAlign(Control::RIGHT);
$backgroundQuad->setHAlign($backgroundQuad::RIGHT);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$backgroundQuad->setSize($menuEntries * $itemSize * 1.15 + 2, $itemSize * $itemMarginFactorY);

View File

@ -440,7 +440,7 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
$backgroundQuad = new Quad();
$frame->add($backgroundQuad);
$backgroundQuad->setVAlign(Control::TOP);
$backgroundQuad->setVAlign($backgroundQuad::TOP);
$height = 7. + $lines * $lineHeight;
$backgroundQuad->setSize($width * 1.05, $height);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle);
@ -474,7 +474,7 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
//Rank
$rankLabel = new Label();
$recordFrame->add($rankLabel);
$rankLabel->setHAlign(Control::LEFT);
$rankLabel->setHAlign($rankLabel::LEFT);
$rankLabel->setX($width * -0.47);
$rankLabel->setSize($width * 0.06, $lineHeight);
$rankLabel->setTextSize(1);
@ -485,7 +485,7 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
//Name
$nameLabel = new Label();
$recordFrame->add($nameLabel);
$nameLabel->setHAlign(Control::LEFT);
$nameLabel->setHAlign($nameLabel::LEFT);
$nameLabel->setX($width * -0.4);
$nameLabel->setSize($width * 0.6, $lineHeight);
$nameLabel->setTextSize(1);
@ -495,7 +495,7 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
//Time
$timeLabel = new Label();
$recordFrame->add($timeLabel);
$timeLabel->setHAlign(Control::RIGHT);
$timeLabel->setHAlign($timeLabel::RIGHT);
$timeLabel->setX($width * 0.47);
$timeLabel->setSize($width * 0.25, $lineHeight);
$timeLabel->setTextSize(1);

View File

@ -2,10 +2,8 @@
namespace MCTeam;
use FML\Controls\Control;
use FML\Controls\Frame;
use FML\Controls\Label;
use FML\Controls\Labels\Label_Button;
use FML\Controls\Labels\Label_Text;
use FML\Controls\Quad;
use FML\Controls\Quads\Quad_BgsPlayerCard;
@ -160,7 +158,9 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
$itemMarginFactorY = 1.2;
//If game is shootmania lower the icons position by 20
if ($this->maniaControl->mapManager->getCurrentMap()->getGame() === 'sm') {
if ($this->maniaControl->mapManager->getCurrentMap()
->getGame() === 'sm'
) {
$posY -= $shootManiaOffset;
}
@ -187,19 +187,19 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
$itemQuad->setSize($itemSize, $itemSize);
$iconFrame->add($itemQuad);
$valueArray = explode(",", $values);
$valueArray = explode(',', $values);
// Values Menu
$popoutFrame = new Frame();
$maniaLink->add($popoutFrame);
$popoutFrame->setPosition($posX - $itemSize * 0.5, $posY);
$popoutFrame->setHAlign(Control::RIGHT);
$popoutFrame->setHAlign($popoutFrame::RIGHT);
$popoutFrame->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY);
$popoutFrame->setVisible(false);
$quad = new Quad();
$popoutFrame->add($quad);
$quad->setHAlign(Control::RIGHT);
$quad->setHAlign($quad::RIGHT);
$quad->setStyles($quadStyle, $quadSubstyle);
$quad->setSize(strlen($values) * 2 + count($valueArray) * 1, $itemSize * $itemMarginFactorY);
@ -210,27 +210,27 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
$descriptionFrame = new Frame();
$maniaLink->add($descriptionFrame);
$descriptionFrame->setPosition($posX - 50, $posY - 5);
$descriptionFrame->setHAlign(Control::RIGHT);
$descriptionFrame->setHAlign($descriptionFrame::RIGHT);
$descriptionLabel = new Label();
$descriptionFrame->add($descriptionLabel);
$descriptionLabel->setAlign(Control::LEFT, Control::TOP);
$descriptionLabel->setAlign($descriptionLabel::LEFT, $descriptionLabel::TOP);
$descriptionLabel->setSize(40, 4);
$descriptionLabel->setTextSize(2);
$descriptionLabel->setVisible(true);
$descriptionLabel->setTextColor("0F0");
$descriptionLabel->setTextColor('0f0');
// Add items
$posX = -2;
foreach (array_reverse($valueArray) as $value) {
$label = new Label_Button();
$label = new Label_Text();
$popoutFrame->add($label);
$label->setX($posX);
$label->setHAlign(Control::RIGHT);
$label->setHAlign($label::RIGHT);
$label->setText('$s$FFF' . $value . '$09FP');
$label->setTextSize(1.2);
$label->setAction(self::ACTION_DONATE_VALUE . "." . $value);
$label->setStyle(Label_Text::STYLE_TextCardSmall);
$label->setStyle($label::STYLE_TextCardSmall);
$description = "Donate {$value} Planets";
$label->addTooltipLabelFeature($descriptionLabel, $description);

View File

@ -235,7 +235,7 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
$backgroundQuad = new Quad();
$frame->add($backgroundQuad);
$backgroundQuad->setVAlign(Control::TOP);
$backgroundQuad->setVAlign($backgroundQuad::TOP);
$adjustOuterBorder = $this->maniaControl->settingManager->getSettingValue($this, self::SETTING_ADJUST_OUTER_BORDER);
$height = 7. + ($adjustOuterBorder ? count($records) : $lines) * $lineHeight;
$backgroundQuad->setSize($width * 1.05, $height);
@ -269,7 +269,7 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
$rankLabel = new Label();
$recordFrame->add($rankLabel);
$rankLabel->setHAlign(Control::LEFT);
$rankLabel->setHAlign($rankLabel::LEFT);
$rankLabel->setX($width * -0.47);
$rankLabel->setSize($width * 0.06, $lineHeight);
$rankLabel->setTextSize(1);
@ -279,7 +279,7 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
$nameLabel = new Label();
$recordFrame->add($nameLabel);
$nameLabel->setHAlign(Control::LEFT);
$nameLabel->setHAlign($nameLabel::LEFT);
$nameLabel->setX($width * -0.4);
$nameLabel->setSize($width * 0.6, $lineHeight);
$nameLabel->setTextSize(1);
@ -288,7 +288,7 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
$timeLabel = new Label();
$recordFrame->add($timeLabel);
$timeLabel->setHAlign(Control::RIGHT);
$timeLabel->setHAlign($timeLabel::RIGHT);
$timeLabel->setX($width * 0.47);
$timeLabel->setSize($width * 0.25, $lineHeight);
$timeLabel->setTextSize(1);

View File

@ -269,9 +269,9 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$label = new Label_Text();
$frame->add($label);
$label->setPosition(0, 1.5, 0.2);
$label->setVAlign(Control::TOP);
$label->setVAlign($label::TOP);
$label->setTextSize(1);
$label->setTextColor("FFF");
$label->setTextColor('fff');
$label->addClockFeature(false);
// Send manialink
@ -319,17 +319,18 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$label->setSize($width - 5, $height);
$label->setTextSize(1.3);
$label->setText(Formatter::stripDirtyCodes($serverName));
$label->setTextColor("FFF");
$label->setTextColor('fff');
//$label->setAutoNewLine(true);
// Player Quad / Label
$label = new Label_Text();
$frame->add($label);
$label->setPosition(-$width / 2 + 9, -1.5, 0.2);
$label->setHAlign(Control::LEFT);
$label->setHAlign($label::LEFT);
$label->setTextSize(1);
$label->setScale(0.8);
$label->setText($playerCount . " / " . $maxPlayers['NextValue']);
$label->setTextColor("FFF");
$label->setTextColor('fff');
$quad = new Quad_Icons128x128_1();
$frame->add($quad);
@ -341,11 +342,11 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$label = new Label_Text();
$frame->add($label);
$label->setPosition(2, -1.5, 0.2);
$label->setHAlign(Control::LEFT);
$label->setHAlign($label::LEFT);
$label->setTextSize(1);
$label->setScale(0.8);
$label->setText($spectatorCount . " / " . $maxSpectators['NextValue']);
$label->setTextColor("FFF");
$label->setTextColor('fff');
$quad = new Quad_Icons64x64_1();
$frame->add($quad);