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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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