reanmed to new FML names

This commit is contained in:
kremsy 2017-03-25 19:15:50 +01:00
parent 120a0e2169
commit a9e24234e0
29 changed files with 476 additions and 486 deletions

View File

@ -137,22 +137,22 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
if ($this->maniaControl->getAuthenticationManager()->checkRight($player, AuthenticationManager::AUTH_LEVEL_MODERATOR)) { if ($this->maniaControl->getAuthenticationManager()->checkRight($player, AuthenticationManager::AUTH_LEVEL_MODERATOR)) {
// Admin Menu Icon Frame // Admin Menu Icon Frame
$iconFrame = new Frame(); $iconFrame = new Frame();
$manialink->add($iconFrame); $manialink->addChild($iconFrame);
$iconFrame->setPosition($posX, $posY); $iconFrame->setPosition($posX, $posY);
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$iconFrame->add($backgroundQuad); $iconFrame->addChild($backgroundQuad);
$backgroundQuad->setSize($itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY); $backgroundQuad->setSize($itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$itemQuad = new Quad_Icons64x64_1(); $itemQuad = new Quad_Icons64x64_1();
$iconFrame->add($itemQuad); $iconFrame->addChild($itemQuad);
$itemQuad->setSubStyle($itemQuad::SUBSTYLE_IconServers); $itemQuad->setSubStyle($itemQuad::SUBSTYLE_IconServers);
$itemQuad->setSize($itemSize, $itemSize); $itemQuad->setSize($itemSize, $itemSize);
// Admin Menu Description // Admin Menu Description
$descriptionLabel = new Label(); $descriptionLabel = new Label();
$manialink->add($descriptionLabel); $manialink->addChild($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($descriptionLabel::RIGHT, $descriptionLabel::TOP); $descriptionLabel->setAlign($descriptionLabel::RIGHT, $descriptionLabel::TOP);
$descriptionLabel->setSize(40, 4); $descriptionLabel->setSize(40, 4);
@ -161,15 +161,15 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
// Admin Menu // Admin Menu
$popoutFrame = new Frame(); $popoutFrame = new Frame();
$manialink->add($popoutFrame); $manialink->addChild($popoutFrame);
$popoutFrame->setPosition($posX - $itemSize * 0.5, $posY); $popoutFrame->setPosition($posX - $itemSize * 0.5, $posY);
$popoutFrame->setHAlign($popoutFrame::RIGHT); $popoutFrame->setHorizontalAlign($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->addChild($backgroundQuad);
$backgroundQuad->setHAlign($backgroundQuad::RIGHT); $backgroundQuad->setHorizontalAlign($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);
@ -181,14 +181,14 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
foreach ($menuItems as $menuItem) { foreach ($menuItems as $menuItem) {
$menuQuad = $menuItem[0]; $menuQuad = $menuItem[0];
/** @var Quad $menuQuad */ /** @var Quad $menuQuad */
$popoutFrame->add($menuQuad); $popoutFrame->addChild($menuQuad);
$menuQuad->setSize($itemSize, $itemSize); $menuQuad->setSize($itemSize, $itemSize);
$menuQuad->setX($itemPosX); $menuQuad->setX($itemPosX);
$menuQuad->setHAlign($menuQuad::RIGHT); $menuQuad->setHorizontalAlign($menuQuad::RIGHT);
$itemPosX -= $itemSize * 1.05; $itemPosX -= $itemSize * 1.05;
if ($menuItem[1]) { if ($menuItem[1]) {
$menuQuad->removeScriptFeatures(); $menuQuad->removeAllScriptFeatures();
$description = '$s' . $menuItem[1]; $description = '$s' . $menuItem[1];
$menuQuad->addTooltipLabelFeature($descriptionLabel, $description); $menuQuad->addTooltipLabelFeature($descriptionLabel, $description);
} }
@ -201,22 +201,22 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
*/ */
// Player Menu Icon Frame // Player Menu Icon Frame
$iconFrame = new Frame(); $iconFrame = new Frame();
$manialink->add($iconFrame); $manialink->addChild($iconFrame);
$iconFrame->setPosition($posX, $posY - $itemSize * $itemMarginFactorY); $iconFrame->setPosition($posX, $posY - $itemSize * $itemMarginFactorY);
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$iconFrame->add($backgroundQuad); $iconFrame->addChild($backgroundQuad);
$backgroundQuad->setSize($itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY); $backgroundQuad->setSize($itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$itemQuad = new Quad_Icons64x64_1(); $itemQuad = new Quad_Icons64x64_1();
$iconFrame->add($itemQuad); $iconFrame->addChild($itemQuad);
$itemQuad->setSubStyle($itemQuad::SUBSTYLE_IconPlayers); $itemQuad->setSubStyle($itemQuad::SUBSTYLE_IconPlayers);
$itemQuad->setSize($itemSize, $itemSize); $itemQuad->setSize($itemSize, $itemSize);
// Player Menu Description // Player Menu Description
$descriptionLabel = new Label(); $descriptionLabel = new Label();
$manialink->add($descriptionLabel); $manialink->addChild($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($descriptionLabel::RIGHT, $descriptionLabel::TOP); $descriptionLabel->setAlign($descriptionLabel::RIGHT, $descriptionLabel::TOP);
$descriptionLabel->setSize(40, 4); $descriptionLabel->setSize(40, 4);
@ -225,15 +225,15 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
// Player Menu // Player Menu
$popoutFrame = new Frame(); $popoutFrame = new Frame();
$manialink->add($popoutFrame); $manialink->addChild($popoutFrame);
$popoutFrame->setPosition($posX - $itemSize * 0.5, $posY - $itemSize * $itemMarginFactorY); $popoutFrame->setPosition($posX - $itemSize * 0.5, $posY - $itemSize * $itemMarginFactorY);
$popoutFrame->setHAlign($popoutFrame::RIGHT); $popoutFrame->setHorizontalAlign($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->addChild($backgroundQuad);
$backgroundQuad->setHAlign($backgroundQuad::RIGHT); $backgroundQuad->setHorizontalAlign($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);
@ -245,14 +245,14 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
foreach ($menuItems as $menuItem) { foreach ($menuItems as $menuItem) {
$menuQuad = $menuItem[0]; $menuQuad = $menuItem[0];
/** @var Quad $menuQuad */ /** @var Quad $menuQuad */
$popoutFrame->add($menuQuad); $popoutFrame->addChild($menuQuad);
$menuQuad->setSize($itemSize, $itemSize); $menuQuad->setSize($itemSize, $itemSize);
$menuQuad->setX($itemPosX); $menuQuad->setX($itemPosX);
$menuQuad->setHAlign($menuQuad::RIGHT); $menuQuad->setHorizontalAlign($menuQuad::RIGHT);
$itemPosX -= $itemSize * 1.05; $itemPosX -= $itemSize * 1.05;
if ($menuItem[1]) { if ($menuItem[1]) {
$menuQuad->removeScriptFeatures(); $menuQuad->removeAllScriptFeatures();
$description = '$s' . $menuItem[1]; $description = '$s' . $menuItem[1];
$menuQuad->addTooltipLabelFeature($descriptionLabel, $description); $menuQuad->addTooltipLabelFeature($descriptionLabel, $description);
} }

View File

@ -96,7 +96,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
// Main frame // Main frame
$frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging); $frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging);
$maniaLink->add($frame); $maniaLink->addChild($frame);
// Start offsets // Start offsets
$posX = -$width / 2; $posX = -$width / 2;
@ -104,11 +104,11 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
//Predefine description Label //Predefine description Label
$descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel(); $descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel();
$frame->add($descriptionLabel); $frame->addChild($descriptionLabel);
// Headline // Headline
$headFrame = new Frame(); $headFrame = new Frame();
$frame->add($headFrame); $frame->addChild($headFrame);
$headFrame->setY($posY - 5); $headFrame->setY($posY - 5);
$array = array('Id' => $posX + 5, 'Nickname' => $posX + 18, 'Login' => $posX + 70, 'Actions' => $posX + 120); $array = array('Id' => $posX + 5, 'Nickname' => $posX + 18, 'Login' => $posX + 70, 'Actions' => $posX + 120);
$this->maniaControl->getManialinkManager()->labelLine($headFrame, $array); $this->maniaControl->getManialinkManager()->labelLine($headFrame, $array);
@ -120,19 +120,19 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
foreach ($admins as $admin) { foreach ($admins as $admin) {
if ($index % self::MAX_PLAYERS_PER_PAGE === 1) { if ($index % self::MAX_PLAYERS_PER_PAGE === 1) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$paging->addPageControl($pageFrame); $paging->addPageControl($pageFrame);
$posY = $height / 2 - 10; $posY = $height / 2 - 10;
} }
$playerFrame = new Frame(); $playerFrame = new Frame();
$pageFrame->add($playerFrame); $pageFrame->addChild($playerFrame);
$playerFrame->setY($posY); $playerFrame->setY($posY);
if ($index % 2 !== 0) { if ($index % 2 !== 0) {
$lineQuad = new Quad_BgsPlayerCard(); $lineQuad = new Quad_BgsPlayerCard();
$playerFrame->add($lineQuad); $playerFrame->addChild($lineQuad);
$lineQuad->setSize($width, 4); $lineQuad->setSize($width, 4);
$lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig); $lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig);
$lineQuad->setZ(0.001); $lineQuad->setZ(0.001);
@ -144,14 +144,14 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
// Level Quad // Level Quad
$rightQuad = new Quad_BgRaceScore2(); $rightQuad = new Quad_BgRaceScore2();
$playerFrame->add($rightQuad); $playerFrame->addChild($rightQuad);
$rightQuad->setX($posX + 13); $rightQuad->setX($posX + 13);
$rightQuad->setZ(5); $rightQuad->setZ(5);
$rightQuad->setSubStyle($rightQuad::SUBSTYLE_CupFinisher); $rightQuad->setSubStyle($rightQuad::SUBSTYLE_CupFinisher);
$rightQuad->setSize(7, 3.5); $rightQuad->setSize(7, 3.5);
$rightLabel = new Label_Text(); $rightLabel = new Label_Text();
$playerFrame->add($rightLabel); $playerFrame->addChild($rightLabel);
$rightLabel->setX($posX + 13.9); $rightLabel->setX($posX + 13.9);
$rightLabel->setTextSize(0.8); $rightLabel->setTextSize(0.8);
$rightLabel->setZ(10); $rightLabel->setZ(10);
@ -171,7 +171,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
// Quad // Quad
$quad = new Quad_BgsPlayerCard(); $quad = new Quad_BgsPlayerCard();
$playerFrame->add($quad); $playerFrame->addChild($quad);
$quad->setZ(11); $quad->setZ(11);
$quad->setX($posX + 130); $quad->setX($posX + 130);
$quad->setSubStyle($quad::SUBSTYLE_BgPlayerCardBig); $quad->setSubStyle($quad::SUBSTYLE_BgPlayerCardBig);
@ -180,7 +180,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
//Label //Label
$label = new Label_Button(); $label = new Label_Button();
$playerFrame->add($label); $playerFrame->addChild($label);
$label->setX($posX + 130); $label->setX($posX + 130);
$quad->setZ(12); $quad->setZ(12);
$label->setStyle($style); $label->setStyle($style);

View File

@ -140,6 +140,7 @@ class LibXmlRpcCallbacks implements CallbackListener {
case Callbacks::MP_PODIUMSTART: case Callbacks::MP_PODIUMSTART:
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::MP_PODIUMSTART); $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::MP_PODIUMSTART);
break; break;
case Callbacks::MP_PODIUMEND:
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::MP_PODIUMEND); $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::MP_PODIUMEND);
break; break;

View File

@ -156,7 +156,7 @@ class HelpManager implements CommandListener, CallbackListener {
// Main frame // Main frame
$frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging); $frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging);
$maniaLink->add($frame); $maniaLink->addChild($frame);
// Start offsets // Start offsets
$posX = -$width / 2; $posX = -$width / 2;
@ -164,11 +164,11 @@ class HelpManager implements CommandListener, CallbackListener {
//Predefine description Label //Predefine description Label
$descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel(); $descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel();
$frame->add($descriptionLabel); $frame->addChild($descriptionLabel);
// Headline // Headline
$headFrame = new Frame(); $headFrame = new Frame();
$frame->add($headFrame); $frame->addChild($headFrame);
$headFrame->setY($posY - 5); $headFrame->setY($posY - 5);
$array = array('Command' => $posX + 5, 'Description' => $posX + 50); $array = array('Command' => $posX + 5, 'Description' => $posX + 50);
$this->maniaControl->getManialinkManager()->labelLine($headFrame, $array); $this->maniaControl->getManialinkManager()->labelLine($headFrame, $array);
@ -180,18 +180,18 @@ class HelpManager implements CommandListener, CallbackListener {
foreach ($commands as $command) { foreach ($commands as $command) {
if ($index % 15 === 1) { if ($index % 15 === 1) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$posY = $height / 2 - 10; $posY = $height / 2 - 10;
$paging->addPage($pageFrame); $paging->addPage($pageFrame); //TODO @Jocy
} }
$playerFrame = new Frame(); $playerFrame = new Frame();
$pageFrame->add($playerFrame); $pageFrame->addChild($playerFrame);
$playerFrame->setY($posY); $playerFrame->setY($posY);
if ($index % 2 !== 0) { if ($index % 2 !== 0) {
$lineQuad = new Quad_BgsPlayerCard(); $lineQuad = new Quad_BgsPlayerCard();
$playerFrame->add($lineQuad); $playerFrame->addChild($lineQuad);
$lineQuad->setSize($width, 4); $lineQuad->setSize($width, 4);
$lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig); $lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig);
$lineQuad->setZ(0.001); $lineQuad->setZ(0.001);

View File

@ -9,7 +9,6 @@ use FML\Controls\Quads\Quad_BgRaceScore2;
use FML\Controls\Quads\Quad_Icons64x64_1; use FML\Controls\Quads\Quad_Icons64x64_1;
use FML\Controls\Quads\Quad_UIConstruction_Buttons; use FML\Controls\Quads\Quad_UIConstruction_Buttons;
use FML\ManiaLink; use FML\ManiaLink;
use FML\Script\Script;
use ManiaControl\Admin\AuthenticationManager; use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Callbacks\CallbackListener; use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager; use ManiaControl\Callbacks\CallbackManager;
@ -198,25 +197,25 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn
$manialink = new ManiaLink(ManialinkManager::MAIN_MLID); $manialink = new ManiaLink(ManialinkManager::MAIN_MLID);
$frame = new Frame(); $frame = new Frame();
$manialink->add($frame); $manialink->addChild($frame);
$frame->setPosition($menuPosX, $menuPosY, ManialinkManager::MAIN_MANIALINK_Z_VALUE); $frame->setPosition($menuPosX, $menuPosY, ManialinkManager::MAIN_MANIALINK_Z_VALUE);
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setZ(-1)->setSize($menuWidth, $menuHeight)->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setZ(-1)->setSize($menuWidth, $menuHeight)->setStyles($quadStyle, $quadSubstyle);
$menuItemsFrame = new Frame(); $menuItemsFrame = new Frame();
$frame->add($menuItemsFrame); $frame->addChild($menuItemsFrame);
$menuItemsFrame->setX($menuWidth * -0.5 + $menuListWidth * 0.5); $menuItemsFrame->setX($menuWidth * -0.5 + $menuListWidth * 0.5);
$menuItemsFrame->setZ(-1); $menuItemsFrame->setZ(-1);
$itemsBackgroundQuad = new Quad(); $itemsBackgroundQuad = new Quad();
$menuItemsFrame->add($itemsBackgroundQuad); $menuItemsFrame->addChild($itemsBackgroundQuad);
$backgroundQuad->setZ(-1); $backgroundQuad->setZ(-1);
$itemsBackgroundQuad->setSize($menuListWidth, $menuHeight)->setStyles($quadStyle, $quadSubstyle); $itemsBackgroundQuad->setSize($menuListWidth, $menuHeight)->setStyles($quadStyle, $quadSubstyle);
$menusFrame = new Frame(); $menusFrame = new Frame();
$frame->add($menusFrame); $frame->addChild($menusFrame);
$menusFrame->setX($menuWidth * -0.5 + $menuListWidth + $subMenuWidth * 0.5); $menusFrame->setX($menuWidth * -0.5 + $menuListWidth + $subMenuWidth * 0.5);
// Create script and features // Create script and features
@ -227,7 +226,7 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn
foreach ($this->menus as $menu) { foreach ($this->menus as $menu) {
// Add title // Add title
$menuItemLabel = new Label_Text(); $menuItemLabel = new Label_Text();
$frame->add($menuItemLabel); $frame->addChild($menuItemLabel);
$menuItemLabel->setX($menuWidth * -0.5 + $menuListWidth * 0.5); $menuItemLabel->setX($menuWidth * -0.5 + $menuListWidth * 0.5);
$menuItemLabel->setZ(2)->setStyle(Label_Text::STYLE_TextCardRaceRank)->setY($menuItemY)->setSize($menuListWidth * 0.9, $menuItemHeight * 0.9)->setText($menu->getTitle())->setAction(self::ACTION_SELECTMENU . $menuId); $menuItemLabel->setZ(2)->setStyle(Label_Text::STYLE_TextCardRaceRank)->setY($menuItemY)->setSize($menuListWidth * 0.9, $menuItemHeight * 0.9)->setText($menu->getTitle())->setAction(self::ACTION_SELECTMENU . $menuId);
@ -235,7 +234,7 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn
if ($menuId === $menuIdShown) { if ($menuId === $menuIdShown) {
$menuControl = $menu->getMenu($subMenuWidth, $subMenuHeight, $script, $player); $menuControl = $menu->getMenu($subMenuWidth, $subMenuHeight, $script, $player);
if ($menuControl) { if ($menuControl) {
$menusFrame->add($menuControl); $menusFrame->addChild($menuControl);
} else { } else {
$this->maniaControl->getChat()->sendError('Error loading Menu!', $player); $this->maniaControl->getChat()->sendError('Error loading Menu!', $player);
} }
@ -247,17 +246,17 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn
// Add Close Quad (X) // Add Close Quad (X)
$closeQuad = new Quad_Icons64x64_1(); $closeQuad = new Quad_Icons64x64_1();
$frame->add($closeQuad); $frame->addChild($closeQuad);
$closeQuad->setPosition($menuWidth * 0.483, $menuHeight * 0.467, 3)->setSize(6, 6)->setSubStyle($closeQuad::SUBSTYLE_QuitRace)->setAction(ManialinkManager::ACTION_CLOSEWIDGET); $closeQuad->setPosition($menuWidth * 0.483, $menuHeight * 0.467, 3)->setSize(6, 6)->setSubStyle($closeQuad::SUBSTYLE_QuitRace)->setAction(ManialinkManager::ACTION_CLOSEWIDGET);
// Add close button // Add close button
$closeButton = new Label_Text(); $closeButton = new Label_Text();
$frame->add($closeButton); $frame->addChild($closeButton);
$closeButton->setPosition($menuWidth * -0.5 + $menuListWidth * 0.29, $menuHeight * -0.43)->setSize($menuListWidth * 0.3, $menuListWidth * 0.1)->setStyle($closeButton::STYLE_TextButtonNavBack)->setTextPrefix('$999')->setText('Close')->setAction(self::ACTION_TOGGLEMENU); $closeButton->setPosition($menuWidth * -0.5 + $menuListWidth * 0.29, $menuHeight * -0.43)->setSize($menuListWidth * 0.3, $menuListWidth * 0.1)->setStyle($closeButton::STYLE_TextButtonNavBack)->setTextPrefix('$999')->setText('Close')->setAction(self::ACTION_TOGGLEMENU);
// Add save button // Add save button
$saveButton = new Label_Text(); $saveButton = new Label_Text();
$frame->add($saveButton); $frame->addChild($saveButton);
$saveButton->setPosition($menuWidth * -0.5 + $menuListWidth * 0.71, $menuHeight * -0.43)->setSize($menuListWidth * 0.3, $menuListWidth * 0.1)->setStyle($saveButton::STYLE_TextButtonNavBack)->setTextPrefix('$2af')->setText('Save')->setAction(self::ACTION_SAVECONFIG); $saveButton->setPosition($menuWidth * -0.5 + $menuListWidth * 0.71, $menuHeight * -0.43)->setSize($menuListWidth * 0.3, $menuListWidth * 0.1)->setStyle($saveButton::STYLE_TextButtonNavBack)->setTextPrefix('$2af')->setText('Save')->setAction(self::ACTION_SAVECONFIG);
return $manialink; return $manialink;

View File

@ -101,13 +101,13 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
// Pagers // Pagers
$pagerPrev = new Quad_Icons64x64_1(); $pagerPrev = new Quad_Icons64x64_1();
$frame->add($pagerPrev); $frame->addChild($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($pagerPrev::SUBSTYLE_ArrowPrev); $pagerPrev->setSubStyle($pagerPrev::SUBSTYLE_ArrowPrev);
$pagerNext = new Quad_Icons64x64_1(); $pagerNext = new Quad_Icons64x64_1();
$frame->add($pagerNext); $frame->addChild($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($pagerNext::SUBSTYLE_ArrowNext); $pagerNext->setSubStyle($pagerNext::SUBSTYLE_ArrowNext);
@ -116,8 +116,8 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
$paging->addButtonControl($pagerPrev); $paging->addButtonControl($pagerPrev);
$pageCountLabel = new Label_Text(); $pageCountLabel = new Label_Text();
$frame->add($pageCountLabel); $frame->addChild($pageCountLabel);
$pageCountLabel->setHAlign($pageCountLabel::RIGHT); $pageCountLabel->setHorizontalAlign($pageCountLabel::RIGHT);
$pageCountLabel->setPosition($width * 0.35, $height * -0.44); $pageCountLabel->setPosition($width * 0.35, $height * -0.44);
$pageCountLabel->setStyle($pageCountLabel::STYLE_TextTitle1); $pageCountLabel->setStyle($pageCountLabel::STYLE_TextTitle1);
$pageCountLabel->setTextSize(2); $pageCountLabel->setTextSize(2);
@ -125,17 +125,17 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
$paging->setLabel($pageCountLabel); $paging->setLabel($pageCountLabel);
$backLabel = new Label_Button(); $backLabel = new Label_Button();
$frame->add($backLabel); $frame->addChild($backLabel);
$backLabel->setStyle($backLabel::STYLE_CardMain_Quit); $backLabel->setStyle($backLabel::STYLE_CardMain_Quit);
$backLabel->setPosition(-$width / 2 + 7, -$height / 2 + 7); $backLabel->setPosition(-$width / 2 + 7, -$height / 2 + 7);
$backLabel->setHAlign($backLabel::LEFT); $backLabel->setHorizontalAlign($backLabel::LEFT);
$backLabel->setTextSize(2); $backLabel->setTextSize(2);
$backLabel->setText('Back'); $backLabel->setText('Back');
$backLabel->setAction(self::ACTION_SETTINGCLASS_BACK); $backLabel->setAction(self::ACTION_SETTINGCLASS_BACK);
$headLabel = new Label_Text(); $headLabel = new Label_Text();
$frame->add($headLabel); $frame->addChild($headLabel);
$headLabel->setHAlign($headLabel::LEFT); $headLabel->setHorizontalAlign($headLabel::LEFT);
$headLabel->setPosition($width * -0.46, $height * 0.41); $headLabel->setPosition($width * -0.46, $height * 0.41);
$headLabel->setSize($width * 0.6, $settingHeight); $headLabel->setSize($width * 0.6, $settingHeight);
$headLabel->setStyle($headLabel::STYLE_TextCardSmall); $headLabel->setStyle($headLabel::STYLE_TextCardSmall);
@ -149,18 +149,18 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
foreach ($settings as $setting) { foreach ($settings as $setting) {
if ($index % $pageMaxCount === 0) { if ($index % $pageMaxCount === 0) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$paging->addPageControl($pageFrame); $paging->addPageControl($pageFrame);
$posY = $height * 0.41 - $settingHeight * 1.5; $posY = $height * 0.41 - $settingHeight * 1.5;
} }
$settingFrame = new Frame(); $settingFrame = new Frame();
$pageFrame->add($settingFrame); $pageFrame->addChild($settingFrame);
$settingFrame->setY($posY); $settingFrame->setY($posY);
$nameLabel = new Label_Text(); $nameLabel = new Label_Text();
$settingFrame->add($nameLabel); $settingFrame->addChild($nameLabel);
$nameLabel->setHAlign($nameLabel::LEFT); $nameLabel->setHorizontalAlign($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);
@ -175,7 +175,7 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
$quad->setPosition($width * 0.33, 0, -0.01); $quad->setPosition($width * 0.33, 0, -0.01);
$quad->setSize(4, 4); $quad->setSize(4, 4);
$checkBox = new CheckBox($settingName, $setting->value, $quad); $checkBox = new CheckBox($settingName, $setting->value, $quad);
$settingFrame->add($checkBox); $settingFrame->addChild($checkBox);
} else if ($setting->type === Setting::TYPE_SET) { } else if ($setting->type === Setting::TYPE_SET) {
// SET value picker // SET value picker
$label = new Label_Text(); $label = new Label_Text();
@ -184,11 +184,11 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
$label->setStyle($label::STYLE_TextValueSmall); $label->setStyle($label::STYLE_TextValueSmall);
$label->setTextSize(1); $label->setTextSize(1);
$valuePicker = new ValuePicker($settingName, $setting->set, $setting->value, $label); $valuePicker = new ValuePicker($settingName, $setting->set, $setting->value, $label);
$settingFrame->add($valuePicker); $settingFrame->addChild($valuePicker);
} else { } else {
// Standard entry // Standard entry
$entry = new Entry(); $entry = new Entry();
$settingFrame->add($entry); $settingFrame->addChild($entry);
$entry->setX($width * 0.33); $entry->setX($width * 0.33);
$entry->setSize($width * 0.3, $settingHeight * 0.9); $entry->setSize($width * 0.3, $settingHeight * 0.9);
$entry->setStyle(Label_Text::STYLE_TextValueSmall); $entry->setStyle(Label_Text::STYLE_TextValueSmall);
@ -228,13 +228,13 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
// Pagers // Pagers
$pagerPrev = new Quad_Icons64x64_1(); $pagerPrev = new Quad_Icons64x64_1();
$frame->add($pagerPrev); $frame->addChild($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($pagerPrev::SUBSTYLE_ArrowPrev); $pagerPrev->setSubStyle($pagerPrev::SUBSTYLE_ArrowPrev);
$pagerNext = new Quad_Icons64x64_1(); $pagerNext = new Quad_Icons64x64_1();
$frame->add($pagerNext); $frame->addChild($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($pagerNext::SUBSTYLE_ArrowNext); $pagerNext->setSubStyle($pagerNext::SUBSTYLE_ArrowNext);
@ -243,8 +243,8 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
$paging->addButtonControl($pagerPrev); $paging->addButtonControl($pagerPrev);
$pageCountLabel = new Label_Text(); $pageCountLabel = new Label_Text();
$frame->add($pageCountLabel); $frame->addChild($pageCountLabel);
$pageCountLabel->setHAlign($pageCountLabel::RIGHT); $pageCountLabel->setHorizontalAlign($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);
@ -256,7 +256,7 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
foreach ($settingClasses as $settingClass) { foreach ($settingClasses as $settingClass) {
if ($index % $pageMaxCount === 0) { if ($index % $pageMaxCount === 0) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$posY = $height * 0.41; $posY = $height * 0.41;
$paging->addPageControl($pageFrame); $paging->addPageControl($pageFrame);
} }
@ -270,8 +270,8 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
} }
$className = substr($className, 0, -3); $className = substr($className, 0, -3);
$pageFrame->add($classLabel); $pageFrame->addChild($classLabel);
$classLabel->setHAlign($classLabel::LEFT); $classLabel->setHorizontalAlign($classLabel::LEFT);
$classLabel->setPosition($width * -0.45, $posY); $classLabel->setPosition($width * -0.45, $posY);
$classLabel->setSize($width * 0.9, $settingHeight * 0.9); $classLabel->setSize($width * 0.9, $settingHeight * 0.9);
$classLabel->setStyle($classLabel::STYLE_TextCardSmall); $classLabel->setStyle($classLabel::STYLE_TextCardSmall);

View File

@ -191,7 +191,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener, Communicatio
$scriptInfo = $this->maniaControl->getClient()->getModeScriptInfo(); $scriptInfo = $this->maniaControl->getClient()->getModeScriptInfo();
} catch (GameModeException $e) { } catch (GameModeException $e) {
$label = new Label(); $label = new Label();
$frame->add($label); $frame->addChild($label);
$label->setText($e->getMessage()); $label->setText($e->getMessage());
return $frame; return $frame;
} }
@ -210,13 +210,13 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener, Communicatio
// Pagers // Pagers
$pagerPrev = new Quad_Icons64x64_1(); $pagerPrev = new Quad_Icons64x64_1();
$frame->add($pagerPrev); $frame->addChild($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($pagerPrev::SUBSTYLE_ArrowPrev); $pagerPrev->setSubStyle($pagerPrev::SUBSTYLE_ArrowPrev);
$pagerNext = new Quad_Icons64x64_1(); $pagerNext = new Quad_Icons64x64_1();
$frame->add($pagerNext); $frame->addChild($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($pagerNext::SUBSTYLE_ArrowNext); $pagerNext->setSubStyle($pagerNext::SUBSTYLE_ArrowNext);
@ -225,8 +225,8 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener, Communicatio
$paging->addButtonControl($pagerPrev); $paging->addButtonControl($pagerPrev);
$pageCountLabel = new Label_Text(); $pageCountLabel = new Label_Text();
$frame->add($pageCountLabel); $frame->addChild($pageCountLabel);
$pageCountLabel->setHAlign($pageCountLabel::RIGHT); $pageCountLabel->setHorizontalAlign($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);
@ -247,18 +247,18 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener, Communicatio
if ($index % 13 === 0) { if ($index % 13 === 0) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$posY = $height * 0.41; $posY = $height * 0.41;
$paging->addPageControl($pageFrame); $paging->addPageControl($pageFrame);
} }
$settingFrame = new Frame(); $settingFrame = new Frame();
$pageFrame->add($settingFrame); $pageFrame->addChild($settingFrame);
$settingFrame->setY($posY); $settingFrame->setY($posY);
$nameLabel = new Label_Text(); $nameLabel = new Label_Text();
$settingFrame->add($nameLabel); $settingFrame->addChild($nameLabel);
$nameLabel->setHAlign($nameLabel::LEFT); $nameLabel->setHorizontalAlign($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);
@ -273,11 +273,11 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener, Communicatio
$quad->setX($width / 2 * 0.545); $quad->setX($width / 2 * 0.545);
$quad->setSize(4, 4); $quad->setSize(4, 4);
$checkBox = new CheckBox(self::ACTION_PREFIX_SETTING . $settingName, $settingValue, $quad); $checkBox = new CheckBox(self::ACTION_PREFIX_SETTING . $settingName, $settingValue, $quad);
$settingFrame->add($checkBox); $settingFrame->addChild($checkBox);
} else { } else {
// Value entry // Value entry
$entry = new Entry(); $entry = new Entry();
$settingFrame->add($entry); $settingFrame->addChild($entry);
$entry->setStyle(Label_Text::STYLE_TextValueSmall); $entry->setStyle(Label_Text::STYLE_TextValueSmall);
$entry->setX($width / 2 * 0.55); $entry->setX($width / 2 * 0.55);
$entry->setTextSize(1); $entry->setTextSize(1);
@ -287,8 +287,8 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener, Communicatio
} }
$descriptionLabel = new Label(); $descriptionLabel = new Label();
$pageFrame->add($descriptionLabel); $pageFrame->addChild($descriptionLabel);
$descriptionLabel->setHAlign($descriptionLabel::LEFT); $descriptionLabel->setHorizontalAlign($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

@ -166,15 +166,15 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
// Main frame // Main frame
$frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging); $frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging);
$maniaLink->add($frame); $maniaLink->addChild($frame);
//Predefine description Label //Predefine description Label
$descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel(); $descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel();
$frame->add($descriptionLabel); $frame->addChild($descriptionLabel);
// Headline // Headline
$headFrame = new Frame(); $headFrame = new Frame();
$frame->add($headFrame); $frame->addChild($headFrame);
$headFrame->setY($posY - 12); $headFrame->setY($posY - 12);
$array = array('$oId' => $posX + 3.5, '$oName' => $posX + 12.5, '$oAuthor' => $posX + 59, '$oKarma' => $posX + 85, '$oType' => $posX + 103, '$oMood' => $posX + 118, '$oLast Update' => $posX + 130); $array = array('$oId' => $posX + 3.5, '$oName' => $posX + 12.5, '$oAuthor' => $posX + 59, '$oKarma' => $posX + 85, '$oType' => $posX + 103, '$oMood' => $posX + 118, '$oLast Update' => $posX + 130);
$this->maniaControl->getManialinkManager()->labelLine($headFrame, $array); $this->maniaControl->getManialinkManager()->labelLine($headFrame, $array);
@ -187,18 +187,18 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
//TODO order possibilities //TODO order possibilities
if ($index % self::MAX_MX_MAPS_PER_PAGE === 0) { if ($index % self::MAX_MX_MAPS_PER_PAGE === 0) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$posY = $height / 2 - 16; $posY = $height / 2 - 16;
$paging->addPageControl($pageFrame); $paging->addPageControl($pageFrame);
} }
// Map Frame // Map Frame
$mapFrame = new Frame(); $mapFrame = new Frame();
$pageFrame->add($mapFrame); $pageFrame->addChild($mapFrame);
if ($index % 2 === 0) { if ($index % 2 === 0) {
$lineQuad = new Quad_BgsPlayerCard(); $lineQuad = new Quad_BgsPlayerCard();
$mapFrame->add($lineQuad); $mapFrame->addChild($lineQuad);
$lineQuad->setSize($width, 4); $lineQuad->setSize($width, 4);
$lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig); $lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig);
$lineQuad->setZ(0.001); $lineQuad->setZ(0.001);
@ -213,10 +213,10 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
$mapFrame->setY($posY); $mapFrame->setY($posY);
$mxQuad = new Quad(); $mxQuad = new Quad();
$mapFrame->add($mxQuad); $mapFrame->addChild($mxQuad);
$mxQuad->setSize(3, 3); $mxQuad->setSize(3, 3);
$mxQuad->setImage($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON)); $mxQuad->setImageUrl($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON));
$mxQuad->setImageFocus($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON_MOVER)); $mxQuad->setImageFocusUrl($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON_MOVER));
$mxQuad->setX($posX + 56); $mxQuad->setX($posX + 56);
$mxQuad->setUrl($map->pageurl); $mxQuad->setUrl($map->pageurl);
$mxQuad->setZ(0.01); $mxQuad->setZ(0.01);
@ -226,7 +226,7 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
if ($this->maniaControl->getAuthenticationManager()->checkPermission($player, MapManager::SETTING_PERMISSION_ADD_MAP) if ($this->maniaControl->getAuthenticationManager()->checkPermission($player, MapManager::SETTING_PERMISSION_ADD_MAP)
) { ) {
$addQuad = new Quad_Icons64x64_1(); $addQuad = new Quad_Icons64x64_1();
$mapFrame->add($addQuad); $mapFrame->addChild($addQuad);
$addQuad->setX($posX + 53); $addQuad->setX($posX + 53);
$addQuad->setZ(-0.1); $addQuad->setZ(-0.1);
$addQuad->setSubStyle($addQuad::SUBSTYLE_Add); $addQuad->setSubStyle($addQuad::SUBSTYLE_Add);
@ -241,16 +241,16 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
//Award Quad //Award Quad
if ($map->awards > 0) { if ($map->awards > 0) {
$awardQuad = new Quad_Icons64x64_1(); $awardQuad = new Quad_Icons64x64_1();
$mapFrame->add($awardQuad); $mapFrame->addChild($awardQuad);
$awardQuad->setSize(3, 3); $awardQuad->setSize(3, 3);
$awardQuad->setSubStyle($awardQuad::SUBSTYLE_OfficialRace); $awardQuad->setSubStyle($awardQuad::SUBSTYLE_OfficialRace);
$awardQuad->setX($posX + 97); $awardQuad->setX($posX + 97);
$awardQuad->setZ(0.01); $awardQuad->setZ(0.01);
$awardLabel = new Label_Text(); $awardLabel = new Label_Text();
$mapFrame->add($awardLabel); $mapFrame->addChild($awardLabel);
$awardLabel->setX($posX + 98.5); $awardLabel->setX($posX + 98.5);
$awardLabel->setHAlign($awardLabel::LEFT); $awardLabel->setHorizontalAlign($awardLabel::LEFT);
$awardLabel->setText($map->awards); $awardLabel->setText($map->awards);
$awardLabel->setTextSize(1.3); $awardLabel->setTextSize(1.3);
} }
@ -260,18 +260,18 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
$voteCount = $map->ratingVoteCount; $voteCount = $map->ratingVoteCount;
if (is_numeric($karma) && $voteCount > 0) { if (is_numeric($karma) && $voteCount > 0) {
$karmaGauge = new Gauge(); $karmaGauge = new Gauge();
$mapFrame->add($karmaGauge); $mapFrame->addChild($karmaGauge);
$karmaGauge->setZ(2); $karmaGauge->setZ(2);
$karmaGauge->setX($posX + 89); $karmaGauge->setX($posX + 89);
$karmaGauge->setSize(16.5, 9); $karmaGauge->setSize(16.5, 9);
$karmaGauge->setDrawBg(false); $karmaGauge->setDrawBackground(false);
$karma = floatval($karma); $karma = floatval($karma);
$karmaGauge->setRatio($karma + 0.15 - $karma * 0.15); $karmaGauge->setRatio($karma + 0.15 - $karma * 0.15);
$karmaColor = ColorUtil::floatToStatusColor($karma); $karmaColor = ColorUtil::floatToStatusColor($karma);
$karmaGauge->setColor($karmaColor . '9'); $karmaGauge->setColor($karmaColor . '9');
$karmaLabel = new Label(); $karmaLabel = new Label();
$mapFrame->add($karmaLabel); $mapFrame->addChild($karmaLabel);
$karmaLabel->setZ(2); $karmaLabel->setZ(2);
$karmaLabel->setX($posX + 89); $karmaLabel->setX($posX + 89);
$karmaLabel->setSize(16.5 * 0.9, 5); $karmaLabel->setSize(16.5 * 0.9, 5);
@ -286,16 +286,16 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
} }
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setPosition(-$width / 2 + 5, $height / 2 - 5); $label->setPosition(-$width / 2 + 5, $height / 2 - 5);
$label->setHAlign($label::LEFT); $label->setHorizontalAlign($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->addChild($entry);
$entry->setStyle(Label_Text::STYLE_TextValueSmall); $entry->setStyle(Label_Text::STYLE_TextValueSmall);
$entry->setHAlign($entry::LEFT); $entry->setHorizontalAlign($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);
@ -304,13 +304,13 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
//Search for Map-Name //Search for Map-Name
$label = new Label_Button(); $label = new Label_Button();
$frame->add($label); $frame->addChild($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();
$frame->add($quad); $frame->addChild($quad);
$quad->setPosition(-$width / 2 + 63, $height / 2 - 5, 0.01); $quad->setPosition(-$width / 2 + 63, $height / 2 - 5, 0.01);
$quad->setSubStyle($quad::SUBSTYLE_BgPlayerCardBig); $quad->setSubStyle($quad::SUBSTYLE_BgPlayerCardBig);
$quad->setSize(18, 5); $quad->setSize(18, 5);
@ -318,13 +318,13 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
//Search for Author //Search for Author
$label = new Label_Button(); $label = new Label_Button();
$frame->add($label); $frame->addChild($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();
$frame->add($quad); $frame->addChild($quad);
$quad->setPosition(-$width / 2 + 82, $height / 2 - 5, 0.01); $quad->setPosition(-$width / 2 + 82, $height / 2 - 5, 0.01);
$quad->setSubStyle($quad::SUBSTYLE_BgPlayerCardBig); $quad->setSubStyle($quad::SUBSTYLE_BgPlayerCardBig);
$quad->setSize(18, 5); $quad->setSize(18, 5);

View File

@ -113,14 +113,14 @@ class IconManager implements CallbackListener {
public function preloadIcons($player = null) { public function preloadIcons($player = null) {
$maniaLink = new ManiaLink(self::PRELOAD_MLID); $maniaLink = new ManiaLink(self::PRELOAD_MLID);
$frame = new Frame(); $frame = new Frame();
$maniaLink->add($frame); $maniaLink->addChild($frame);
$frame->setPosition(500, 500); $frame->setPosition(500, 500);
foreach ($this->icons as $iconUrl) { foreach ($this->icons as $iconUrl) {
$iconQuad = new Quad(); $iconQuad = new Quad();
$iconQuad->setImage($iconUrl); $iconQuad->setImageUrl($iconUrl);
$iconQuad->setSize(1, 1); $iconQuad->setSize(1, 1);
$frame->add($iconQuad); $frame->addChild($iconQuad);
} }
// Send manialink // Send manialink

View File

@ -237,8 +237,6 @@ class ManialinkManager implements ManialinkPageAnswerListener, CallbackListener
public function sendManialink($manialinkText, $logins = null, $timeout = 0, $hideOnClick = false) { public function sendManialink($manialinkText, $logins = null, $timeout = 0, $hideOnClick = false) {
$manialinkText = (string) $manialinkText; $manialinkText = (string) $manialinkText;
var_dump($manialinkText);
if (!$manialinkText) { if (!$manialinkText) {
return true; return true;
} }
@ -389,8 +387,8 @@ class ManialinkManager implements ManialinkPageAnswerListener, CallbackListener
foreach ($positions as $key => $x) { foreach ($positions as $key => $x) {
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setHAlign($hAlign); $label->setHorizontalAlign($hAlign);
$label->setX($x); $label->setX($x);
$label->setStyle($style); $label->setStyle($style);
$label->setTextSize($textSize); $label->setTextSize($textSize);
@ -406,8 +404,8 @@ class ManialinkManager implements ManialinkPageAnswerListener, CallbackListener
} else { } else {
foreach ($labelStrings as $text => $x) { foreach ($labelStrings as $text => $x) {
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setHAlign($hAlign); $label->setHorizontalAlign($hAlign);
$label->setX($x); $label->setX($x);
$label->setStyle($style); $label->setStyle($style);
$label->setTextSize($textSize); $label->setTextSize($textSize);

View File

@ -170,27 +170,27 @@ class StyleManager {
// Background Quad // Background Quad
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setZ(-2)->setSize($width, $height)->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setZ(-2)->setSize($width, $height)->setStyles($quadStyle, $quadSubstyle);
// Add Close Quad (X) // Add Close Quad (X)
$closeQuad = new Quad_Icons64x64_1(); $closeQuad = new Quad_Icons64x64_1();
$frame->add($closeQuad); $frame->addChild($closeQuad);
$closeQuad->setPosition($width * 0.483, $height * 0.467, 3)->setSize(6, 6)->setSubStyle($closeQuad::SUBSTYLE_QuitRace)->setAction(ManialinkManager::ACTION_CLOSEWIDGET); $closeQuad->setPosition($width * 0.483, $height * 0.467, 3)->setSize(6, 6)->setSubStyle($closeQuad::SUBSTYLE_QuitRace)->setAction(ManialinkManager::ACTION_CLOSEWIDGET);
if ($script) { if ($script) {
$pagerSize = 6.; $pagerSize = 6.;
$pagerPrev = new Quad_Icons64x64_1(); $pagerPrev = new Quad_Icons64x64_1();
$frame->add($pagerPrev); $frame->addChild($pagerPrev);
$pagerPrev->setPosition($width * 0.42, $height * -0.44, 2)->setSize($pagerSize, $pagerSize)->setSubStyle($pagerPrev::SUBSTYLE_ArrowPrev); $pagerPrev->setPosition($width * 0.42, $height * -0.44, 2)->setSize($pagerSize, $pagerSize)->setSubStyle($pagerPrev::SUBSTYLE_ArrowPrev);
$pagerNext = new Quad_Icons64x64_1(); $pagerNext = new Quad_Icons64x64_1();
$frame->add($pagerNext); $frame->addChild($pagerNext);
$pagerNext->setPosition($width * 0.45, $height * -0.44, 2)->setSize($pagerSize, $pagerSize)->setSubStyle($pagerNext::SUBSTYLE_ArrowNext); $pagerNext->setPosition($width * 0.45, $height * -0.44, 2)->setSize($pagerSize, $pagerSize)->setSubStyle($pagerNext::SUBSTYLE_ArrowNext);
$pageCountLabel = new Label_Text(); $pageCountLabel = new Label_Text();
$frame->add($pageCountLabel); $frame->addChild($pageCountLabel);
$pageCountLabel->setHAlign($pageCountLabel::RIGHT)->setPosition($width * 0.40, $height * -0.44, 1)->setStyle($pageCountLabel::STYLE_TextTitle1)->setTextSize(1.3); $pageCountLabel->setHorizontalAlign($pageCountLabel::RIGHT)->setPosition($width * 0.40, $height * -0.44, 1)->setStyle($pageCountLabel::STYLE_TextTitle1)->setTextSize(1.3);
if ($paging) { if ($paging) {
$paging->addButtonControl($pagerNext)->addButtonControl($pagerPrev)->setLabel($pageCountLabel); $paging->addButtonControl($pagerNext)->addButtonControl($pagerPrev)->setLabel($pageCountLabel);

View File

@ -128,7 +128,7 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
$paging = new Paging(); $paging = new Paging();
$script->addFeature($paging); $script->addFeature($paging);
$frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging); $frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging);
$maniaLink->add($frame); $maniaLink->addChild($frame);
$width = $this->maniaControl->getManialinkManager()->getStyleManager()->getListWidgetsWidth(); $width = $this->maniaControl->getManialinkManager()->getStyleManager()->getListWidgetsWidth();
$height = $this->maniaControl->getManialinkManager()->getStyleManager()->getListWidgetsHeight(); $height = $this->maniaControl->getManialinkManager()->getStyleManager()->getListWidgetsHeight();
@ -137,11 +137,11 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
$pageFrame = null; $pageFrame = null;
$navigateRootQuad = new Quad_Icons64x64_1(); $navigateRootQuad = new Quad_Icons64x64_1();
$frame->add($navigateRootQuad); $frame->addChild($navigateRootQuad);
$navigateRootQuad->setPosition($width * -0.47, $height * 0.45)->setSize(4, 4)->setSubStyle($navigateRootQuad::SUBSTYLE_ToolRoot); $navigateRootQuad->setPosition($width * -0.47, $height * 0.45)->setSize(4, 4)->setSubStyle($navigateRootQuad::SUBSTYLE_ToolRoot);
$navigateUpQuad = new Quad_Icons64x64_1(); $navigateUpQuad = new Quad_Icons64x64_1();
$frame->add($navigateUpQuad); $frame->addChild($navigateUpQuad);
$navigateUpQuad->setPosition($width * -0.44, $height * 0.45)->setSize(4, 4)->setSubStyle($navigateUpQuad::SUBSTYLE_ToolUp); $navigateUpQuad->setPosition($width * -0.44, $height * 0.45)->setSize(4, 4)->setSubStyle($navigateUpQuad::SUBSTYLE_ToolUp);
if (!$isInMapsFolder) { if (!$isInMapsFolder) {
@ -150,21 +150,21 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
} }
$directoryLabel = new Label_Text(); $directoryLabel = new Label_Text();
$frame->add($directoryLabel); $frame->addChild($directoryLabel);
$dataFolder = $this->maniaControl->getServer()->getDirectory()->getGameDataFolder(); $dataFolder = $this->maniaControl->getServer()->getDirectory()->getGameDataFolder();
$directoryText = substr($folderPath, strlen($dataFolder)); $directoryText = substr($folderPath, strlen($dataFolder));
$directoryLabel->setPosition($width * -0.41, $height * 0.45)->setSize($width * 0.85, 4)->setHAlign($directoryLabel::LEFT)->setText($directoryText)->setTextSize(2); $directoryLabel->setPosition($width * -0.41, $height * 0.45)->setSize($width * 0.85, 4)->setHorizontalAlign($directoryLabel::LEFT)->setText($directoryText)->setTextSize(2);
$tooltipLabel = new Label(); $tooltipLabel = new Label();
$frame->add($tooltipLabel); $frame->addChild($tooltipLabel);
$tooltipLabel->setPosition($width * -0.48, $height * -0.44)->setSize($width * 0.8, 5)->setHAlign($tooltipLabel::LEFT)->setTextSize(1)->setText('tooltip'); $tooltipLabel->setPosition($width * -0.48, $height * -0.44)->setSize($width * 0.8, 5)->setHorizontalAlign($tooltipLabel::LEFT)->setTextSize(1)->setText('tooltip');
$mapFiles = $this->scanMapFiles($folderPath); $mapFiles = $this->scanMapFiles($folderPath);
if (is_array($mapFiles)) { if (is_array($mapFiles)) {
if (empty($mapFiles)) { if (empty($mapFiles)) {
$emptyLabel = new Label(); $emptyLabel = new Label();
$frame->add($emptyLabel); $frame->addChild($emptyLabel);
$emptyLabel->setY(20)->setTextColor('aaa')->setText('No files found.')->setTranslate(true); $emptyLabel->setY(20)->setTextColor('aaa')->setText('No files found.')->setTranslate(true);
} else { } else {
$canAddMaps = $this->maniaControl->getAuthenticationManager()->checkPermission($player, MapManager::SETTING_PERMISSION_ADD_MAP); $canAddMaps = $this->maniaControl->getAuthenticationManager()->checkPermission($player, MapManager::SETTING_PERMISSION_ADD_MAP);
@ -176,27 +176,27 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
if ($index % 15 === 0) { if ($index % 15 === 0) {
// New Page // New Page
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$posY = $height / 2 - 10; $posY = $height / 2 - 10;
$paging->addPage($pageFrame); $paging->addPage($pageFrame);
} }
// Map Frame // Map Frame
$mapFrame = new Frame(); $mapFrame = new Frame();
$pageFrame->add($mapFrame); $pageFrame->addChild($mapFrame);
$mapFrame->setY($posY); $mapFrame->setY($posY);
if ($index % 2 === 0) { if ($index % 2 === 0) {
// Striped background line // Striped background line
$lineQuad = new Quad_BgsPlayerCard(); $lineQuad = new Quad_BgsPlayerCard();
$mapFrame->add($lineQuad); $mapFrame->addChild($lineQuad);
$lineQuad->setZ(-1)->setSize($width, 4)->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig); $lineQuad->setZ(-1)->setSize($width, 4)->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig);
} }
// File name Label // File name Label
$nameLabel = new Label_Text(); $nameLabel = new Label_Text();
$mapFrame->add($nameLabel); $mapFrame->addChild($nameLabel);
$nameLabel->setX($width * -0.48)->setSize($width * 0.79, 4)->setHAlign($nameLabel::LEFT)->setStyle($nameLabel::STYLE_TextCardRaceRank)->setTextSize(1)->setText($fileName); $nameLabel->setX($width * -0.48)->setSize($width * 0.79, 4)->setHorizontalAlign($nameLabel::LEFT)->setStyle($nameLabel::STYLE_TextCardRaceRank)->setTextSize(1)->setText($fileName);
if (is_dir($filePath)) { if (is_dir($filePath)) {
// Folder // Folder
@ -208,14 +208,14 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
if ($canAddMaps) { if ($canAddMaps) {
// 'Add' button // 'Add' button
$addButton = new Quad_UIConstructionBullet_Buttons(); $addButton = new Quad_UIConstructionBullet_Buttons();
$mapFrame->add($addButton); $mapFrame->addChild($addButton);
$addButton->setX($width * 0.42)->setSize(4, 4)->setSubStyle($addButton::SUBSTYLE_NewBullet)->setAction(self::ACTION_ADD_FILE . $fileName)->addTooltipLabelFeature($tooltipLabel, 'Add map ' . $fileName); $addButton->setX($width * 0.42)->setSize(4, 4)->setSubStyle($addButton::SUBSTYLE_NewBullet)->setAction(self::ACTION_ADD_FILE . $fileName)->addTooltipLabelFeature($tooltipLabel, 'Add map ' . $fileName);
} }
if ($canEraseMaps) { if ($canEraseMaps) {
// 'Erase' button // 'Erase' button
$eraseButton = new Quad_UIConstruction_Buttons(); $eraseButton = new Quad_UIConstruction_Buttons();
$mapFrame->add($eraseButton); $mapFrame->addChild($eraseButton);
$eraseButton->setX($width * 0.46)->setSize(4, 4)->setSubStyle($eraseButton::SUBSTYLE_Erase)->setAction(self::ACTION_ERASE_FILE . $fileName)->addTooltipLabelFeature($tooltipLabel, 'Erase file ' . $fileName); $eraseButton->setX($width * 0.46)->setSize(4, 4)->setSubStyle($eraseButton::SUBSTYLE_Erase)->setAction(self::ACTION_ERASE_FILE . $fileName)->addTooltipLabelFeature($tooltipLabel, 'Erase file ' . $fileName);
} }
} }
@ -226,7 +226,7 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
} }
} else { } else {
$errorLabel = new Label(); $errorLabel = new Label();
$frame->add($errorLabel); $frame->addChild($errorLabel);
$errorLabel->setY(20)->setTextColor('f30')->setText('No access to the directory.')->setTranslate(true); $errorLabel->setY(20)->setTextColor('f30')->setText('No access to the directory.')->setTranslate(true);
} }

View File

@ -79,8 +79,8 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
private function initActionsMenuButtons() { private function initActionsMenuButtons() {
// Menu Open xList // Menu Open xList
$itemQuad = new Quad(); $itemQuad = new Quad();
$itemQuad->setImage($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON)); $itemQuad->setImageUrl($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON));
$itemQuad->setImageFocus($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON_MOVER)); $itemQuad->setImageFocusUrl($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON_MOVER));
$itemQuad->setAction(self::ACTION_OPEN_XLIST); $itemQuad->setAction(self::ACTION_OPEN_XLIST);
$this->maniaControl->getActionsMenu()->addPlayerMenuItem($itemQuad, 5, 'Open MX List'); $this->maniaControl->getActionsMenu()->addPlayerMenuItem($itemQuad, 5, 'Open MX List');

View File

@ -150,24 +150,24 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
// Main frame // Main frame
$frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging); $frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging);
$maniaLink->add($frame); $maniaLink->addChild($frame);
// Admin Buttons // Admin Buttons
if ($this->maniaControl->getAuthenticationManager()->checkPermission($player, MapQueue::SETTING_PERMISSION_CLEAR_MAPQUEUE) if ($this->maniaControl->getAuthenticationManager()->checkPermission($player, MapQueue::SETTING_PERMISSION_CLEAR_MAPQUEUE)
) { ) {
// Clear Map-Queue // Clear Map-Queue
$label = new Label_Button(); $label = new Label_Button();
$frame->add($label); $frame->addChild($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($label::RIGHT); $label->setHorizontalAlign($label::RIGHT);
$quad = new Quad_BgsPlayerCard(); $quad = new Quad_BgsPlayerCard();
$frame->add($quad); $frame->addChild($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($quad::RIGHT); $quad->setHorizontalAlign($quad::RIGHT);
$quad->setSize(29, 4); $quad->setSize(29, 4);
$quad->setAction(self::ACTION_CLEAR_MAPQUEUE); $quad->setAction(self::ACTION_CLEAR_MAPQUEUE);
} }
@ -176,25 +176,25 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
) { ) {
// Check Update // Check Update
$label = new Label_Button(); $label = new Label_Button();
$frame->add($label); $frame->addChild($label);
$label->setText('Check MX for 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($label::RIGHT); $label->setHorizontalAlign($label::RIGHT);
$quad = new Quad_BgsPlayerCard(); $quad = new Quad_BgsPlayerCard();
$frame->add($quad); $frame->addChild($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($quad::RIGHT); $quad->setHorizontalAlign($quad::RIGHT);
$quad->setSize(35, 4); $quad->setSize(35, 4);
$quad->setAction(self::ACTION_CHECK_UPDATE); $quad->setAction(self::ACTION_CHECK_UPDATE);
$mxQuad = new Quad(); $mxQuad = new Quad();
$frame->add($mxQuad); $frame->addChild($mxQuad);
$mxQuad->setSize(3, 3); $mxQuad->setSize(3, 3);
$mxQuad->setImage($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON_GREEN)); $mxQuad->setImageUrl($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON_GREEN));
$mxQuad->setImageFocus($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON_GREEN_MOVER)); $mxQuad->setImageFocusUrl($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON_GREEN_MOVER));
$mxQuad->setPosition($width / 2 - 67, -$height / 2 + 9); $mxQuad->setPosition($width / 2 - 67, -$height / 2 + 9);
$mxQuad->setZ(0.01); $mxQuad->setZ(0.01);
$mxQuad->setAction(self::ACTION_CHECK_UPDATE); $mxQuad->setAction(self::ACTION_CHECK_UPDATE);
@ -204,13 +204,13 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
) { ) {
// Directory browser // Directory browser
$browserButton = new Label_Button(); $browserButton = new Label_Button();
$frame->add($browserButton); $frame->addChild($browserButton);
$browserButton->setPosition($width / -2 + 20, -$height / 2 + 9, 0.01); $browserButton->setPosition($width / -2 + 20, -$height / 2 + 9, 0.01);
$browserButton->setTextSize(1); $browserButton->setTextSize(1);
$browserButton->setText('Directory Browser'); $browserButton->setText('Directory Browser');
$browserQuad = new Quad_BgsPlayerCard(); $browserQuad = new Quad_BgsPlayerCard();
$frame->add($browserQuad); $frame->addChild($browserQuad);
$browserQuad->setPosition($width / -2 + 20, -$height / 2 + 9, 0.01); $browserQuad->setPosition($width / -2 + 20, -$height / 2 + 9, 0.01);
$browserQuad->setSubStyle($browserQuad::SUBSTYLE_BgPlayerCardBig); $browserQuad->setSubStyle($browserQuad::SUBSTYLE_BgPlayerCardBig);
$browserQuad->setSize(35, 4); $browserQuad->setSize(35, 4);
@ -219,7 +219,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
// Headline // Headline
$headFrame = new Frame(); $headFrame = new Frame();
$frame->add($headFrame); $frame->addChild($headFrame);
$headFrame->setY($height / 2 - 5); $headFrame->setY($height / 2 - 5);
$posX = -$width / 2; $posX = -$width / 2;
$array = array('Id' => $posX + 5, 'Mx Id' => $posX + 10, 'Map Name' => $posX + 20, 'Author' => $posX + 68, 'Karma' => $posX + 115, 'Actions' => $width / 2 - 16); $array = array('Id' => $posX + 5, 'Mx Id' => $posX + 10, 'Map Name' => $posX + 20, 'Author' => $posX + 68, 'Karma' => $posX + 115, 'Actions' => $width / 2 - 16);
@ -227,7 +227,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
// Predefine description Label // Predefine description Label
$descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel(); $descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel();
$frame->add($descriptionLabel); $frame->addChild($descriptionLabel);
$queuedMaps = $this->maniaControl->getMapManager()->getMapQueue()->getQueuedMapsRanking(); $queuedMaps = $this->maniaControl->getMapManager()->getMapQueue()->getQueuedMapsRanking();
/** @var KarmaPlugin $karmaPlugin */ /** @var KarmaPlugin $karmaPlugin */
@ -251,7 +251,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
/** @var Map $map */ /** @var Map $map */
if ($index % self::MAX_MAPS_PER_PAGE === 0) { if ($index % self::MAX_MAPS_PER_PAGE === 0) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$posY = $height / 2 - 10; $posY = $height / 2 - 10;
$paging->addPageControl($pageFrame, $pageNumber); $paging->addPageControl($pageFrame, $pageNumber);
$pageNumber++; $pageNumber++;
@ -259,13 +259,13 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
// Map Frame // Map Frame
$mapFrame = new Frame(); $mapFrame = new Frame();
$pageFrame->add($mapFrame); $pageFrame->addChild($mapFrame);
$mapFrame->setY($posY); $mapFrame->setY($posY);
$mapFrame->setZ(0.1); $mapFrame->setZ(0.1);
if ($mapListId % 2 !== 0) { if ($mapListId % 2 !== 0) {
$lineQuad = new Quad_BgsPlayerCard(); $lineQuad = new Quad_BgsPlayerCard();
$mapFrame->add($lineQuad); $mapFrame->addChild($lineQuad);
$lineQuad->setSize($width, 4); $lineQuad->setSize($width, 4);
$lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig); $lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig);
$lineQuad->setZ(0.001); $lineQuad->setZ(0.001);
@ -273,7 +273,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
if ($currentMap === $map) { if ($currentMap === $map) {
$currentQuad = new Quad_Icons64x64_1(); $currentQuad = new Quad_Icons64x64_1();
$mapFrame->add($currentQuad); $mapFrame->addChild($currentQuad);
$currentQuad->setX($posX + 3.5); $currentQuad->setX($posX + 3.5);
$currentQuad->setZ(0.2); $currentQuad->setZ(0.2);
$currentQuad->setSize(4, 4); $currentQuad->setSize(4, 4);
@ -285,10 +285,10 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$mxId = $map->mx->id; $mxId = $map->mx->id;
$mxQuad = new Quad(); $mxQuad = new Quad();
$mapFrame->add($mxQuad); $mapFrame->addChild($mxQuad);
$mxQuad->setSize(3, 3); $mxQuad->setSize(3, 3);
$mxQuad->setImage($mxIcon); $mxQuad->setImageUrl($mxIcon);
$mxQuad->setImageFocus($mxIconHover); $mxQuad->setImageFocusUrl($mxIconHover);
$mxQuad->setX($posX + 65); $mxQuad->setX($posX + 65);
$mxQuad->setUrl($map->mx->pageurl); $mxQuad->setUrl($map->mx->pageurl);
$mxQuad->setZ(0.01); $mxQuad->setZ(0.01);
@ -297,10 +297,10 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
if ($map->updateAvailable()) { if ($map->updateAvailable()) {
$mxQuad = new Quad(); $mxQuad = new Quad();
$mapFrame->add($mxQuad); $mapFrame->addChild($mxQuad);
$mxQuad->setSize(3, 3); $mxQuad->setSize(3, 3);
$mxQuad->setImage($mxIconGreen); $mxQuad->setImageUrl($mxIconGreen);
$mxQuad->setImageFocus($mxIconGreenHover); $mxQuad->setImageFocusUrl($mxIconGreenHover);
$mxQuad->setX($posX + 62); $mxQuad->setX($posX + 62);
$mxQuad->setUrl($map->mx->pageurl); $mxQuad->setUrl($map->mx->pageurl);
$mxQuad->setZ(0.01); $mxQuad->setZ(0.01);
@ -331,7 +331,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
// Map-Queue-Map-Label // Map-Queue-Map-Label
if (isset($queuedMaps[$map->uid])) { if (isset($queuedMaps[$map->uid])) {
$label = new Label_Text(); $label = new Label_Text();
$mapFrame->add($label); $mapFrame->addChild($label);
$label->setX($width / 2 - 13); $label->setX($width / 2 - 13);
$label->setZ(0.2); $label->setZ(0.2);
$label->setTextSize(1.5); $label->setTextSize(1.5);
@ -351,7 +351,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
} else { } else {
// Map-Queue-Map-Button // Map-Queue-Map-Button
$queueLabel = new Label_Button(); $queueLabel = new Label_Button();
$mapFrame->add($queueLabel); $mapFrame->addChild($queueLabel);
$queueLabel->setX($width / 2 - 13); $queueLabel->setX($width / 2 - 13);
$queueLabel->setZ(0.2); $queueLabel->setZ(0.2);
$queueLabel->setSize(3, 3); $queueLabel->setSize(3, 3);
@ -377,7 +377,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
) { ) {
// remove map button // remove map button
$removeButton = new Label_Button(); $removeButton = new Label_Button();
$mapFrame->add($removeButton); $mapFrame->addChild($removeButton);
$removeButton->setX($width / 2 - 5); $removeButton->setX($width / 2 - 5);
$removeButton->setZ(0.2); $removeButton->setZ(0.2);
$removeButton->setSize(3, 3); $removeButton->setSize(3, 3);
@ -395,7 +395,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
) { ) {
// Switch to button // Switch to button
$switchLabel = new Label_Button(); $switchLabel = new Label_Button();
$mapFrame->add($switchLabel); $mapFrame->addChild($switchLabel);
$switchLabel->setX($width / 2 - 9); $switchLabel->setX($width / 2 - 9);
$switchLabel->setZ(0.2); $switchLabel->setZ(0.2);
$switchLabel->setSize(3, 3); $switchLabel->setSize(3, 3);
@ -415,7 +415,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
) { ) {
// Switch Map Voting for Admins // Switch Map Voting for Admins
$switchQuad = new Quad_UIConstruction_Buttons(); $switchQuad = new Quad_UIConstruction_Buttons();
$mapFrame->add($switchQuad); $mapFrame->addChild($switchQuad);
$switchQuad->setX($width / 2 - 17); $switchQuad->setX($width / 2 - 17);
$switchQuad->setZ(0.2); $switchQuad->setZ(0.2);
$switchQuad->setSubStyle($switchQuad::SUBSTYLE_Validate_Step2); $switchQuad->setSubStyle($switchQuad::SUBSTYLE_Validate_Step2);
@ -426,7 +426,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
} else { } else {
// Switch Map Voting for Player // Switch Map Voting for Player
$switchLabel = new Label_Button(); $switchLabel = new Label_Button();
$mapFrame->add($switchLabel); $mapFrame->addChild($switchLabel);
$switchLabel->setX($width / 2 - 7); $switchLabel->setX($width / 2 - 7);
$switchLabel->setZ(0.2); $switchLabel->setZ(0.2);
$switchLabel->setSize(3, 3); $switchLabel->setSize(3, 3);
@ -477,18 +477,18 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
} }
$karmaGauge = new Gauge(); $karmaGauge = new Gauge();
$mapFrame->add($karmaGauge); $mapFrame->addChild($karmaGauge);
$karmaGauge->setZ(2); $karmaGauge->setZ(2);
$karmaGauge->setX($posX + 120); $karmaGauge->setX($posX + 120);
$karmaGauge->setSize(20, 9); $karmaGauge->setSize(20, 9);
$karmaGauge->setDrawBg(false); $karmaGauge->setDrawBackground(false);
$karma = floatval($karma); $karma = floatval($karma);
$karmaGauge->setRatio($karma + 0.15 - $karma * 0.15); $karmaGauge->setRatio($karma + 0.15 - $karma * 0.15);
$karmaColor = ColorUtil::floatToStatusColor($karma); $karmaColor = ColorUtil::floatToStatusColor($karma);
$karmaGauge->setColor($karmaColor . '9'); $karmaGauge->setColor($karmaColor . '9');
$karmaLabel = new Label(); $karmaLabel = new Label();
$mapFrame->add($karmaLabel); $mapFrame->addChild($karmaLabel);
$karmaLabel->setZ(2); $karmaLabel->setZ(2);
$karmaLabel->setX($posX + 120); $karmaLabel->setX($posX + 120);
$karmaLabel->setSize(20 * 0.9, 5); $karmaLabel->setSize(20 * 0.9, 5);
@ -549,29 +549,29 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$quadSubstyle = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultMainWindowSubStyle(); $quadSubstyle = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultMainWindowSubStyle();
$confirmFrame = new Frame(); $confirmFrame = new Frame();
$maniaLink->add($confirmFrame); $maniaLink->addChild($confirmFrame);
$confirmFrame->setPosition($width / 2 + 6, $posY); $confirmFrame->setPosition($width / 2 + 6, $posY);
$confirmFrame->setVisible(false); $confirmFrame->setVisible(false);
$quad = new Quad(); $quad = new Quad();
$confirmFrame->add($quad); $confirmFrame->addChild($quad);
$quad->setStyles($quadStyle, $quadSubstyle); $quad->setStyles($quadStyle, $quadSubstyle);
$quad->setSize(12, 4); $quad->setSize(12, 4);
$quad = new Quad_BgsPlayerCard(); $quad = new Quad_BgsPlayerCard();
$confirmFrame->add($quad); $confirmFrame->addChild($quad);
$quad->setSubStyle($quad::SUBSTYLE_BgCardSystem); $quad->setSubStyle($quad::SUBSTYLE_BgCardSystem);
$quad->setSize(11, 3.5); $quad->setSize(11, 3.5);
$label = new Label_Button(); $label = new Label_Button();
$confirmFrame->add($label); $confirmFrame->addChild($label);
$label->setText('Sure?'); $label->setText('Sure?');
$label->setTextSize(1); $label->setTextSize(1);
$label->setScale(0.90); $label->setScale(0.90);
$label->setX(-1.3); $label->setX(-1.3);
$buttLabel = new Label_Button(); $buttLabel = new Label_Button();
$confirmFrame->add($buttLabel); $confirmFrame->addChild($buttLabel);
$buttLabel->setPosition(3.2, 0.4, 0.2); $buttLabel->setPosition(3.2, 0.4, 0.2);
$buttLabel->setSize(3, 3); $buttLabel->setSize(3, 3);

View File

@ -472,18 +472,18 @@ class PlayerActions implements EchoListener, CommunicationListener {
$maniaLink = new ManiaLink(ManialinkManager::MAIN_MLID); $maniaLink = new ManiaLink(ManialinkManager::MAIN_MLID);
$frame = new Frame(); $frame = new Frame();
$maniaLink->add($frame); $maniaLink->addChild($frame);
$frame->setPosition(0, 10); $frame->setPosition(0, 10);
// Background // Background
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setSize($width, $height); $backgroundQuad->setSize($width, $height);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
// Close Quad (X) // Close Quad (X)
$closeQuad = new Quad_Icons64x64_1(); $closeQuad = new Quad_Icons64x64_1();
$frame->add($closeQuad); $frame->addChild($closeQuad);
$closeQuad->setPosition($width * 0.473, $height * 0.457, 3); $closeQuad->setPosition($width * 0.473, $height * 0.457, 3);
$closeQuad->setSize(6, 6); $closeQuad->setSize(6, 6);
$closeQuad->setSubStyle($closeQuad::SUBSTYLE_QuitRace); $closeQuad->setSubStyle($closeQuad::SUBSTYLE_QuitRace);
@ -491,7 +491,7 @@ class PlayerActions implements EchoListener, CommunicationListener {
// Headline // Headline
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setY($height / 2 - 5); $label->setY($height / 2 - 5);
$label->setStyle($label::STYLE_TextCardMedium); $label->setStyle($label::STYLE_TextCardMedium);
$label->setTextSize(4); $label->setTextSize(4);
@ -502,7 +502,7 @@ class PlayerActions implements EchoListener, CommunicationListener {
foreach ($message as $line) { foreach ($message as $line) {
// Message lines // Message lines
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setStyle($label::STYLE_TextCardMedium); $label->setStyle($label::STYLE_TextCardMedium);
$label->setText($line); $label->setText($line);

View File

@ -59,160 +59,160 @@ class PlayerDetailed {
$target = $this->maniaControl->getPlayerManager()->getPlayer($targetLogin); $target = $this->maniaControl->getPlayerManager()->getPlayer($targetLogin);
// Create ManiaLink // Create ManiaLink
$maniaLink = new ManiaLink(ManialinkManager::MAIN_MLID); $manialink = new ManiaLink(ManialinkManager::MAIN_MLID);
$script = $maniaLink->getScript(); $script = $manialink->getScript();
// Main frame // Main frame
$frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script); $frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script);
$maniaLink->add($frame); $manialink->addChild($frame);
// Create script and features // Create script and features
$script = new Script(); $script = new Script();
$maniaLink->setScript($script); $manialink->setScript($script);
$posY = $this->height / 2 - 7; $posY = $this->height / 2 - 7;
//Nation Quad //Nation Quad
$countryQuad = new Quad(); $countryQuad = new Quad();
$frame->add($countryQuad); $frame->addChild($countryQuad);
$countryQuad->setImage("file://ZoneFlags/Login/{$targetLogin}/country"); $countryQuad->setImageUrl("file://ZoneFlags/Login/{$targetLogin}/country");
$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($countryQuad::LEFT); $countryQuad->setHorizontalAlign($countryQuad::LEFT);
//Nickname //Nickname
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($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($label::LEFT); $label->setHorizontalAlign($label::LEFT);
//Define MainLabel (Login) //Define MainLabel (Login)
$posY -= 8; $posY -= 8;
$mainLabel = new Label_Text(); $mainLabel = new Label_Text();
$frame->add($mainLabel); $frame->addChild($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($mainLabel::LEFT); $mainLabel->setHorizontalAlign($mainLabel::LEFT);
$mainLabel->setText('Login: '); $mainLabel->setText('Login: ');
$posY -= 5; $posY -= 5;
$label = clone $mainLabel; $label = clone $mainLabel;
$frame->add($label); $frame->addChild($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->addChild($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->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setText('Authorization: '); $label->setText('Authorization: ');
$posY -= 5; $posY -= 5;
$label = clone $mainLabel; $label = clone $mainLabel;
$frame->add($label); $frame->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setText("Ladder Rank:"); $label->setText("Ladder Rank:");
$posY -= 5; $posY -= 5;
$label = clone $mainLabel; $label = clone $mainLabel;
$frame->add($label); $frame->addChild($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->addChild($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;
$frame->add($label); $frame->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setText('Avatar'); $label->setText('Avatar');
//Login //Login
$posY = $this->height / 2 - 15; $posY = $this->height / 2 - 15;
$mainLabel = new Label_Text(); $mainLabel = new Label_Text();
$frame->add($mainLabel); $frame->addChild($mainLabel);
$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($mainLabel::LEFT); $mainLabel->setHorizontalAlign($mainLabel::LEFT);
//Country //Country
$posY -= 5; $posY -= 5;
$label = clone $mainLabel; $label = clone $mainLabel;
$frame->add($label); $frame->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setText($target->getCountry()); $label->setText($target->getCountry());
//Province //Province
$posY -= 5; $posY -= 5;
$label = clone $mainLabel; $label = clone $mainLabel;
$frame->add($label); $frame->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setText($target->getProvince()); $label->setText($target->getProvince());
//AuthLevel //AuthLevel
$posY -= 5; $posY -= 5;
$label = clone $mainLabel; $label = clone $mainLabel;
$frame->add($label); $frame->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setText($this->maniaControl->getAuthenticationManager()->getAuthLevelName($target->authLevel)); $label->setText($this->maniaControl->getAuthenticationManager()->getAuthLevelName($target->authLevel));
//LadderRank //LadderRank
$posY -= 5; $posY -= 5;
$label = clone $mainLabel; $label = clone $mainLabel;
$frame->add($label); $frame->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setText($target->ladderRank); $label->setText($target->ladderRank);
//LadderScore //LadderScore
$posY -= 5; $posY -= 5;
$label = clone $mainLabel; $label = clone $mainLabel;
$frame->add($label); $frame->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setText(round($target->ladderScore, 2)); $label->setText(round($target->ladderScore, 2));
//Played Since //Played Since
$posY -= 5; $posY -= 5;
$label = clone $mainLabel; $label = clone $mainLabel;
$frame->add($label); $frame->addChild($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->addChild($quad);
$quad->setImage('file://Avatars/' . $targetLogin . "/default"); $quad->setImageUrl('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($quad::RIGHT, $quad::TOP); $quad->setAlign($quad::RIGHT, $quad::TOP);
$quad->setSize(20, 20); $quad->setSize(20, 20);
//Statistics //Statistics
$frame->add($this->statisticsFrame($target)); $frame->addChild($this->statisticsFrame($target));
$quad = new Label_Button(); $quad = new Label_Button();
$frame->add($quad); $frame->addChild($quad);
$quad->setStyle($quad::STYLE_CardMain_Quit); $quad->setStyle($quad::STYLE_CardMain_Quit);
$quad->setHAlign($quad::LEFT); $quad->setHorizontalAlign($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);
// render and display xml // render and display xml
$this->maniaControl->getManialinkManager()->displayWidget($maniaLink, $player, 'PlayerDetailed'); $this->maniaControl->getManialinkManager()->displayWidget($manialink, $player, 'PlayerDetailed');
} }
/** /**
@ -244,22 +244,22 @@ class PlayerDetailed {
if ($index % 2 !== 0) { if ($index % 2 !== 0) {
$lineQuad = new Quad_BgsPlayerCard(); $lineQuad = new Quad_BgsPlayerCard();
$frame->add($lineQuad); $frame->addChild($lineQuad);
$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($lineQuad::LEFT); $lineQuad->setHorizontalAlign($lineQuad::LEFT);
} }
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setPosition($posX + 4, $posY); $label->setPosition($posX + 4, $posY);
$label->setText($statProperties->name); $label->setText($statProperties->name);
$label->setHAlign($label::LEFT); $label->setHorizontalAlign($label::LEFT);
$label->setTextSize(1.5); $label->setTextSize(1.5);
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setPosition($posX + 40, $posY); $label->setPosition($posX + 40, $posY);
$label->setText($value); $label->setText($value);
$label->setTextSize(1.5); $label->setTextSize(1.5);

View File

@ -149,7 +149,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Main frame // Main frame
$frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging); $frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging);
$maniaLink->add($frame); $maniaLink->addChild($frame);
// Start offsets // Start offsets
$posX = -$width / 2; $posX = -$width / 2;
@ -157,11 +157,11 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Predefine Description Label // Predefine Description Label
$descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel(); $descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel();
$frame->add($descriptionLabel); $frame->addChild($descriptionLabel);
// Headline // Headline
$headFrame = new Frame(); $headFrame = new Frame();
$frame->add($headFrame); $frame->addChild($headFrame);
$headFrame->setY($posY - 5); $headFrame->setY($posY - 5);
$labelLineArray = array('Id' => $posX + 5, 'Nickname' => $posX + 18, 'Login' => $posX + 70, 'Location' => $posX + 101); $labelLineArray = array('Id' => $posX + 5, 'Nickname' => $posX + 18, 'Login' => $posX + 70, 'Location' => $posX + 101);
@ -177,7 +177,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
foreach ($players as $listPlayer) { foreach ($players as $listPlayer) {
if ($index % self::MAX_PLAYERS_PER_PAGE === 1) { if ($index % self::MAX_PLAYERS_PER_PAGE === 1) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$paging->addPageControl($pageFrame); $paging->addPageControl($pageFrame);
$posY = $height / 2 - 10; $posY = $height / 2 - 10;
@ -185,11 +185,11 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
$path = $listPlayer->getProvince(); $path = $listPlayer->getProvince();
$playerFrame = new Frame(); $playerFrame = new Frame();
$pageFrame->add($playerFrame); $pageFrame->addChild($playerFrame);
if ($index % 2 !== 0) { if ($index % 2 !== 0) {
$lineQuad = new Quad_BgsPlayerCard(); $lineQuad = new Quad_BgsPlayerCard();
$playerFrame->add($lineQuad); $playerFrame->addChild($lineQuad);
$lineQuad->setSize($width, 4); $lineQuad->setSize($width, 4);
$lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig); $lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig);
$lineQuad->setZ(0.001); $lineQuad->setZ(0.001);
@ -204,7 +204,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Show current Player Arrow // Show current Player Arrow
if ($listPlayer->index === $player->index) { if ($listPlayer->index === $player->index) {
$currentQuad = new Quad_Icons64x64_1(); $currentQuad = new Quad_Icons64x64_1();
$playerFrame->add($currentQuad); $playerFrame->addChild($currentQuad);
$currentQuad->setX($posX + 3.5); $currentQuad->setX($posX + 3.5);
$currentQuad->setZ(0.2); $currentQuad->setZ(0.2);
$currentQuad->setSize(4, 4); $currentQuad->setSize(4, 4);
@ -215,7 +215,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
if ($listPlayer->teamId >= 0) { if ($listPlayer->teamId >= 0) {
// Player is in a Team // Player is in a Team
$teamQuad = new Quad_Emblems(); $teamQuad = new Quad_Emblems();
$playerFrame->add($teamQuad); $playerFrame->addChild($teamQuad);
$teamQuad->setX($posX + 10); $teamQuad->setX($posX + 10);
$teamQuad->setZ(0.1); $teamQuad->setZ(0.1);
$teamQuad->setSize(3.8, 3.8); $teamQuad->setSize(3.8, 3.8);
@ -231,7 +231,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
} else if ($listPlayer->isSpectator) { } else if ($listPlayer->isSpectator) {
// Player is in Spectator Mode // Player is in Spectator Mode
$specQuad = new Quad_BgRaceScore2(); $specQuad = new Quad_BgRaceScore2();
$playerFrame->add($specQuad); $playerFrame->addChild($specQuad);
$specQuad->setX($posX + 10); $specQuad->setX($posX + 10);
$specQuad->setZ(0.1); $specQuad->setZ(0.1);
$specQuad->setSubStyle($specQuad::SUBSTYLE_Spectator); $specQuad->setSubStyle($specQuad::SUBSTYLE_Spectator);
@ -242,8 +242,8 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
if ($countryCode !== 'OTH') { if ($countryCode !== 'OTH') {
// Nation Quad // Nation Quad
$countryQuad = new Quad(); $countryQuad = new Quad();
$playerFrame->add($countryQuad); $playerFrame->addChild($countryQuad);
$countryQuad->setImage("file://ZoneFlags/Login/{$listPlayer->login}/country"); $countryQuad->setImageUrl("file://ZoneFlags/Login/{$listPlayer->login}/country");
$countryQuad->setX($posX + 98); $countryQuad->setX($posX + 98);
$countryQuad->setZ(1); $countryQuad->setZ(1);
$countryQuad->setSize(4, 4); $countryQuad->setSize(4, 4);
@ -253,14 +253,14 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Level Quad // Level Quad
$rightQuad = new Quad_BgRaceScore2(); $rightQuad = new Quad_BgRaceScore2();
$playerFrame->add($rightQuad); $playerFrame->addChild($rightQuad);
$rightQuad->setX($posX + 13); $rightQuad->setX($posX + 13);
$rightQuad->setZ(3); $rightQuad->setZ(3);
$rightQuad->setSize(7, 3.5); $rightQuad->setSize(7, 3.5);
$rightQuad->setSubStyle($rightQuad::SUBSTYLE_CupFinisher); $rightQuad->setSubStyle($rightQuad::SUBSTYLE_CupFinisher);
$rightLabel = new Label_Text(); $rightLabel = new Label_Text();
$playerFrame->add($rightLabel); $playerFrame->addChild($rightLabel);
$rightLabel->setX($posX + 13.9); $rightLabel->setX($posX + 13.9);
$rightLabel->setZ(3.1); $rightLabel->setZ(3.1);
$rightLabel->setText($this->maniaControl->getAuthenticationManager()->getAuthLevelAbbreviation($listPlayer->authLevel)); $rightLabel->setText($this->maniaControl->getAuthenticationManager()->getAuthLevelAbbreviation($listPlayer->authLevel));
@ -272,7 +272,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Player Statistics // Player Statistics
$playerQuad = new Quad_Icons64x64_1(); $playerQuad = new Quad_Icons64x64_1();
$playerFrame->add($playerQuad); $playerFrame->addChild($playerQuad);
$playerQuad->setX($posX + 61); $playerQuad->setX($posX + 61);
$playerQuad->setZ(3); $playerQuad->setZ(3);
$playerQuad->setSize(2.7, 2.7); $playerQuad->setSize(2.7, 2.7);
@ -283,7 +283,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Camera Quad // Camera Quad
$playerQuad = new Quad_UIConstruction_Buttons(); $playerQuad = new Quad_UIConstruction_Buttons();
$playerFrame->add($playerQuad); $playerFrame->addChild($playerQuad);
$playerQuad->setX($posX + 64.5); $playerQuad->setX($posX + 64.5);
$playerQuad->setZ(3); $playerQuad->setZ(3);
$playerQuad->setSize(3.8, 3.8); $playerQuad->setSize(3.8, 3.8);
@ -294,7 +294,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Player Profile Quad // Player Profile Quad
$playerQuad = new Quad_UIConstruction_Buttons(); $playerQuad = new Quad_UIConstruction_Buttons();
$playerFrame->add($playerQuad); $playerFrame->addChild($playerQuad);
$playerQuad->setX($posX + 68); $playerQuad->setX($posX + 68);
$playerQuad->setZ(3); $playerQuad->setZ(3);
$playerQuad->setSize(3.8, 3.8); $playerQuad->setSize(3.8, 3.8);
@ -308,7 +308,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
if ($this->maniaControl->getAuthenticationManager()->checkRight($player, AuthenticationManager::AUTH_LEVEL_MODERATOR)) { if ($this->maniaControl->getAuthenticationManager()->checkRight($player, AuthenticationManager::AUTH_LEVEL_MODERATOR)) {
// Further Player actions Quad // Further Player actions Quad
$playerQuad = new Quad_Icons64x64_1(); $playerQuad = new Quad_Icons64x64_1();
$playerFrame->add($playerQuad); $playerFrame->addChild($playerQuad);
$playerQuad->setX($posX + 132); $playerQuad->setX($posX + 132);
$playerQuad->setZ(0.1); $playerQuad->setZ(0.1);
$playerQuad->setSize(3.8, 3.8); $playerQuad->setSize(3.8, 3.8);
@ -324,7 +324,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
if ($this->maniaControl->getAuthenticationManager()->checkPermission($player, PlayerActions::SETTING_PERMISSION_FORCE_PLAYER_TEAM)) { if ($this->maniaControl->getAuthenticationManager()->checkPermission($player, PlayerActions::SETTING_PERMISSION_FORCE_PLAYER_TEAM)) {
// Force to Red-Team Quad // Force to Red-Team Quad
$redQuad = new Quad_Emblems(); $redQuad = new Quad_Emblems();
$playerFrame->add($redQuad); $playerFrame->addChild($redQuad);
$redQuad->setX($posX + 145); $redQuad->setX($posX + 145);
$redQuad->setZ(0.1); $redQuad->setZ(0.1);
$redQuad->setSize(3.8, 3.8); $redQuad->setSize(3.8, 3.8);
@ -337,7 +337,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Force to Blue-Team Quad // Force to Blue-Team Quad
$blueQuad = new Quad_Emblems(); $blueQuad = new Quad_Emblems();
$playerFrame->add($blueQuad); $playerFrame->addChild($blueQuad);
$blueQuad->setX($posX + 141); $blueQuad->setX($posX + 141);
$blueQuad->setZ(0.1); $blueQuad->setZ(0.1);
$blueQuad->setSize(3.8, 3.8); $blueQuad->setSize(3.8, 3.8);
@ -351,7 +351,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
} else if ($this->maniaControl->getPluginManager()->isPluginActive(self::DEFAULT_CUSTOM_VOTE_PLUGIN)) { } else if ($this->maniaControl->getPluginManager()->isPluginActive(self::DEFAULT_CUSTOM_VOTE_PLUGIN)) {
// Kick Player Vote // Kick Player Vote
$kickQuad = new Quad_UIConstruction_Buttons(); $kickQuad = new Quad_UIConstruction_Buttons();
$playerFrame->add($kickQuad); $playerFrame->addChild($kickQuad);
$kickQuad->setX($posX + 141); $kickQuad->setX($posX + 141);
$kickQuad->setZ(0.1); $kickQuad->setZ(0.1);
$kickQuad->setSize(3.8, 3.8); $kickQuad->setSize(3.8, 3.8);
@ -365,7 +365,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
if ($this->maniaControl->getAuthenticationManager()->checkPermission($player, PlayerActions::SETTING_PERMISSION_FORCE_PLAYER_PLAY)) { if ($this->maniaControl->getAuthenticationManager()->checkPermission($player, PlayerActions::SETTING_PERMISSION_FORCE_PLAYER_PLAY)) {
// Force to Play // Force to Play
$playQuad = new Quad_Emblems(); $playQuad = new Quad_Emblems();
$playerFrame->add($playQuad); $playerFrame->addChild($playQuad);
$playQuad->setX($posX + 143); $playQuad->setX($posX + 143);
$playQuad->setZ(0.1); $playQuad->setZ(0.1);
$playQuad->setSize(3.8, 3.8); $playQuad->setSize(3.8, 3.8);
@ -380,7 +380,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
if ($this->maniaControl->getAuthenticationManager()->checkPermission($player, PlayerActions::SETTING_PERMISSION_FORCE_PLAYER_SPEC)) { if ($this->maniaControl->getAuthenticationManager()->checkPermission($player, PlayerActions::SETTING_PERMISSION_FORCE_PLAYER_SPEC)) {
// Force to Spectator Quad // Force to Spectator Quad
$spectatorQuad = new Quad_BgRaceScore2(); $spectatorQuad = new Quad_BgRaceScore2();
$playerFrame->add($spectatorQuad); $playerFrame->addChild($spectatorQuad);
$spectatorQuad->setX($posX + 137); $spectatorQuad->setX($posX + 137);
$spectatorQuad->setZ(0.1); $spectatorQuad->setZ(0.1);
$spectatorQuad->setSize(3.8, 3.8); $spectatorQuad->setSize(3.8, 3.8);
@ -393,7 +393,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
} else if ($this->maniaControl->getPluginManager()->isPluginActive(self::DEFAULT_CUSTOM_VOTE_PLUGIN)) { } else if ($this->maniaControl->getPluginManager()->isPluginActive(self::DEFAULT_CUSTOM_VOTE_PLUGIN)) {
// Force to Spectator Quad // Force to Spectator Quad
$spectatorQuad = new Quad_BgRaceScore2(); $spectatorQuad = new Quad_BgRaceScore2();
$playerFrame->add($spectatorQuad); $playerFrame->addChild($spectatorQuad);
$spectatorQuad->setX($posX + 137); $spectatorQuad->setX($posX + 137);
$spectatorQuad->setZ(0.1); $spectatorQuad->setZ(0.1);
$spectatorQuad->setSize(3.8, 3.8); $spectatorQuad->setSize(3.8, 3.8);
@ -413,7 +413,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
$listShownValue = $this->playersListShown[$player->login]; $listShownValue = $this->playersListShown[$player->login];
if ($listShownValue && $listShownValue !== self::SHOWN_MAIN_WINDOW) { if ($listShownValue && $listShownValue !== self::SHOWN_MAIN_WINDOW) {
$frame = $this->showAdvancedPlayerWidget($player, $listShownValue); $frame = $this->showAdvancedPlayerWidget($player, $listShownValue);
$maniaLink->add($frame); $manialink->addChild($frame);
} }
// Render and display xml // Render and display xml
@ -449,7 +449,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Add Close Quad (X) // Add Close Quad (X)
$closeQuad = new Quad_Icons64x64_1(); $closeQuad = new Quad_Icons64x64_1();
$frame->add($closeQuad); $frame->addChild($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($closeQuad::SUBSTYLE_QuitRace); $closeQuad->setSubStyle($closeQuad::SUBSTYLE_QuitRace);
@ -457,23 +457,23 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Background Quad // Background Quad
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setSize($width, $height); $backgroundQuad->setSize($width, $height);
$backgroundQuad->setImage('https://dl.dropboxusercontent.com/u/105352981/Stuff/CAM%20SM%20BORDER%20PNG.png'); //TODO just a test $backgroundQuad->setImageUrl('https://dl.dropboxusercontent.com/u/105352981/Stuff/CAM%20SM%20BORDER%20PNG.png'); //TODO just a test
//$backgroundQuad->setStyles($quadStyle, $quadSubstyle); //$backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$backgroundQuad->setZ(-0.3); $backgroundQuad->setZ(-0.3);
// Background Quad // Background Quad
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setSize($width - 2, $height - 2); $backgroundQuad->setSize($width - 2, $height - 2);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$backgroundQuad->setZ(-0.4); $backgroundQuad->setZ(-0.4);
// Show headline // Show headline
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setHAlign($label::LEFT); $label->setHorizontalAlign($label::LEFT);
$label->setX(-$width / 2 + 5); $label->setX(-$width / 2 + 5);
$label->setY($height / 2 - 5); $label->setY($height / 2 - 5);
$label->setStyle($label::STYLE_TextCardSmall); $label->setStyle($label::STYLE_TextCardSmall);
@ -483,8 +483,8 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Show Nickname // Show Nickname
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setHAlign($label::LEFT); $label->setHorizontalAlign($label::LEFT);
$label->setX(0); $label->setX(0);
$label->setY($height / 2 - 8); $label->setY($height / 2 - 8);
$label->setStyle($label::STYLE_TextCardSmall); $label->setStyle($label::STYLE_TextCardSmall);
@ -495,14 +495,14 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Mute Player // Mute Player
$posY = $height / 2 - 14; $posY = $height / 2 - 14;
$quad = new Quad_BgsPlayerCard(); $quad = new Quad_BgsPlayerCard();
$frame->add($quad); $frame->addChild($quad);
$quad->setX(0); $quad->setX(0);
$quad->setY($posY); $quad->setY($posY);
$quad->setSubStyle($quad::SUBSTYLE_BgPlayerCardBig); $quad->setSubStyle($quad::SUBSTYLE_BgPlayerCardBig);
$quad->setSize($quadWidth, 5); $quad->setSize($quadWidth, 5);
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setX(0); $label->setX(0);
$label->setY($posY); $label->setY($posY);
$label->setStyle($label::STYLE_TextCardSmall); $label->setStyle($label::STYLE_TextCardSmall);
@ -520,12 +520,12 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Warn Player // Warn Player
$posY -= 5; $posY -= 5;
$quad = clone $quad; $quad = clone $quad;
$frame->add($quad); $frame->addChild($quad);
$quad->setY($posY); $quad->setY($posY);
$quad->setAction(self::ACTION_WARN_PLAYER . '.' . $login); $quad->setAction(self::ACTION_WARN_PLAYER . '.' . $login);
$label = clone $label; $label = clone $label;
$frame->add($label); $frame->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setText('Warn'); $label->setText('Warn');
$label->setTextColor($textColor); $label->setTextColor($textColor);
@ -534,12 +534,12 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Show Kick // Show Kick
$quad = clone $quad; $quad = clone $quad;
$frame->add($quad); $frame->addChild($quad);
$quad->setY($posY); $quad->setY($posY);
$quad->setAction(self::ACTION_KICK_PLAYER . '.' . $login); $quad->setAction(self::ACTION_KICK_PLAYER . '.' . $login);
$label = clone $label; $label = clone $label;
$frame->add($label); $frame->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setText('Kick'); $label->setText('Kick');
$label->setTextColor('f90'); $label->setTextColor('f90');
@ -547,12 +547,12 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
$posY -= 5; $posY -= 5;
// Show Ban // Show Ban
$quad = clone $quad; $quad = clone $quad;
$frame->add($quad); $frame->addChild($quad);
$quad->setY($posY); $quad->setY($posY);
$quad->setAction(self::ACTION_BAN_PLAYER . '.' . $login); $quad->setAction(self::ACTION_BAN_PLAYER . '.' . $login);
$label = clone $label; $label = clone $label;
$frame->add($label); $frame->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setText('Ban'); $label->setText('Ban');
$label->setTextColor('700'); $label->setTextColor('700');
@ -560,12 +560,12 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
$posY -= 10; $posY -= 10;
// Show Add as Master-Admin // Show Add as Master-Admin
$quad = clone $quad; $quad = clone $quad;
$frame->add($quad); $frame->addChild($quad);
$quad->setY($posY); $quad->setY($posY);
$quad->setAction(self::ACTION_ADD_AS_MASTER . '.' . $login); $quad->setAction(self::ACTION_ADD_AS_MASTER . '.' . $login);
$label = clone $label; $label = clone $label;
$frame->add($label); $frame->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setText('Set SuperAdmin'); $label->setText('Set SuperAdmin');
$label->setTextColor($textColor); $label->setTextColor($textColor);
@ -573,12 +573,12 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
$posY -= 5; $posY -= 5;
// Show Add as Admin // Show Add as Admin
$quad = clone $quad; $quad = clone $quad;
$frame->add($quad); $frame->addChild($quad);
$quad->setY($posY); $quad->setY($posY);
$quad->setAction(self::ACTION_ADD_AS_ADMIN . '.' . $login); $quad->setAction(self::ACTION_ADD_AS_ADMIN . '.' . $login);
$label = clone $label; $label = clone $label;
$frame->add($label); $frame->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setText('Set Admin'); $label->setText('Set Admin');
$label->setTextColor($textColor); $label->setTextColor($textColor);
@ -586,12 +586,12 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
$posY -= 5; $posY -= 5;
// Show Add as Moderator // Show Add as Moderator
$quad = clone $quad; $quad = clone $quad;
$frame->add($quad); $frame->addChild($quad);
$quad->setY($posY); $quad->setY($posY);
$quad->setAction(self::ACTION_ADD_AS_MOD . '.' . $login); $quad->setAction(self::ACTION_ADD_AS_MOD . '.' . $login);
$label = clone $label; $label = clone $label;
$frame->add($label); $frame->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setText('Set Moderator'); $label->setText('Set Moderator');
$label->setTextColor($textColor); $label->setTextColor($textColor);
@ -602,12 +602,12 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
$posY -= 5; $posY -= 5;
// Revoke Rights // Revoke Rights
$quad = clone $quad; $quad = clone $quad;
$frame->add($quad); $frame->addChild($quad);
$quad->setY($posY); $quad->setY($posY);
$quad->setAction(self::ACTION_REVOKE_RIGHTS . '.' . $login); $quad->setAction(self::ACTION_REVOKE_RIGHTS . '.' . $login);
$label = clone $label; $label = clone $label;
$frame->add($label); $frame->addChild($label);
$label->setY($posY); $label->setY($posY);
$label->setText('Revoke Rights'); $label->setText('Revoke Rights');
$label->setTextColor('700'); $label->setTextColor('700');

View File

@ -82,37 +82,36 @@ class InstallMenu implements ConfiguratorMenu, ManialinkPageAnswerListener {
if (!is_array($pluginList)) { if (!is_array($pluginList)) {
// Error text // Error text
$errorFrame = $this->getErrorFrame(); $errorFrame = $this->getErrorFrame();
$frame->add($errorFrame); $frame->addChild($errorFrame);
} else if (empty($pluginList)) { } else if (empty($pluginList)) {
// Empty text // Empty text
$emptyFrame = $this->getEmptyFrame(); $emptyFrame = $this->getEmptyFrame();
$frame->add($emptyFrame); $frame->addChild($emptyFrame);
} else { } else {
// Build plugin list // Build plugin list
// Pagers // Pagers
$pagerPrev = new Quad_Icons64x64_1(); $pagerPrev = new Quad_Icons64x64_1();
$frame->add($pagerPrev); $frame->addChild($pagerPrev);
$pagerPrev->setPosition($width * 0.39, $height * -0.44, 2)->setSize($pagerSize, $pagerSize)->setSubStyle($pagerPrev::SUBSTYLE_ArrowPrev); $pagerPrev->setPosition($width * 0.39, $height * -0.44, 2)->setSize($pagerSize, $pagerSize)->setSubStyle($pagerPrev::SUBSTYLE_ArrowPrev);
$pagerNext = clone $pagerPrev; $pagerNext = clone $pagerPrev;
$frame->add($pagerNext); $frame->addChild($pagerNext);
$pagerNext->setX($width * 0.45); $pagerNext->setX($width * 0.45);
$pageCountLabel = new Label_Text(); $pageCountLabel = new Label_Text();
$frame->add($pageCountLabel); $frame->addChild($pageCountLabel);
$pageCountLabel->setHAlign($pageCountLabel::RIGHT)->setPosition($width * 0.35, $height * -0.44, 1)->setStyle($pageCountLabel::STYLE_TextTitle1)->setTextSize(2); $pageCountLabel->setHorizontalAlign($pageCountLabel::RIGHT)->setPosition($width * 0.35, $height * -0.44, 1)->setStyle($pageCountLabel::STYLE_TextTitle1)->setTextSize(2);
$paging->addButtonControl($pagerNext)->addButtonControl($pagerPrev)->setLabel($pageCountLabel); $paging->addButtonControl($pagerNext)->addButtonControl($pagerPrev)->setLabel($pageCountLabel);
// Info tooltip // Info tooltip
$infoTooltipLabel = new Label(); $infoTooltipLabel = new Label();
$frame->add($infoTooltipLabel); $frame->addChild($infoTooltipLabel);
$infoTooltipLabel->setAlign($infoTooltipLabel::LEFT, $infoTooltipLabel::TOP)->setPosition($width * -0.45, $height * -0.22)->setSize($width * 0.7, $entryHeight)->setTextSize(1)->setTranslate(true)->setVisible(false)->setAutoNewLine(true)->setMaxLines(5); $infoTooltipLabel->setAlign($infoTooltipLabel::LEFT, $infoTooltipLabel::TOP)->setPosition($width * -0.45, $height * -0.22)->setSize($width * 0.7, $entryHeight)->setTextSize(1)->setTranslate(true)->setVisible(false)->setAutoNewLine(true)->setMaxLines(5);
// List plugins // List plugins
foreach ($pluginList as $plugin) { foreach ($pluginList as $plugin) {
if ($this->maniaControl->getPluginManager()->isPluginIdInstalled($plugin->id) if ($this->maniaControl->getPluginManager()->isPluginIdInstalled($plugin->id)) {
) {
// Already installed -> Skip // Already installed -> Skip
continue; continue;
} }
@ -120,27 +119,28 @@ class InstallMenu implements ConfiguratorMenu, ManialinkPageAnswerListener {
if ($index % 10 === 0) { if ($index % 10 === 0) {
// New page // New page
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$paging->addPageControl($pageFrame); $paging->addPageControl($pageFrame);
$posY = $height * 0.41; $posY = $height * 0.41;
} }
$pluginFrame = new Frame(); $pluginFrame = new Frame();
$pageFrame->add($pluginFrame); $pageFrame->addChild($pluginFrame);
$pluginFrame->setY($posY); $pluginFrame->setY($posY);
$nameLabel = new Label_Text(); $nameLabel = new Label_Text();
$pluginFrame->add($nameLabel); $pluginFrame->addChild($nameLabel);
$nameLabel->setHAlign($nameLabel::LEFT)->setX($width * -0.46)->setSize($width * 0.62, $entryHeight)->setStyle($nameLabel::STYLE_TextCardSmall)->setTextSize(2)->setText($plugin->name); $nameLabel->setHorizontalAlign($nameLabel::LEFT)->setX($width * -0.46)->setSize($width * 0.62, $entryHeight)->setStyle($nameLabel::STYLE_TextCardSmall)->setTextSize(2)->setText($plugin->name);
$description = "Author: {$plugin->author}\nVersion: {$plugin->currentVersion->version}\nDesc: {$plugin->description}"; $description = "Author: {$plugin->author}\nVersion: {$plugin->currentVersion->version}\nDesc: {$plugin->description}";
$infoTooltipLabel->setLineSpacing(1);
$nameLabel->addTooltipLabelFeature($infoTooltipLabel, $description); $nameLabel->addTooltipLabelFeature($infoTooltipLabel, $description);
if (!$this->isPluginCompatible($plugin)) { if (!$this->isPluginCompatible($plugin)) {
// Incompatibility label // Incompatibility label
$infoLabel = new Label_Text(); $infoLabel = new Label_Text();
$pluginFrame->add($infoLabel); $pluginFrame->addChild($infoLabel);
$infoLabel->setHAlign($infoLabel::RIGHT)->setX($width * 0.47)->setSize($width * 0.33, $entryHeight)->setTextSize(1)->setTextColor('f30'); $infoLabel->setHorizontalAlign($infoLabel::RIGHT)->setX($width * 0.47)->setSize($width * 0.33, $entryHeight)->setTextSize(1)->setTextColor('f30');
if ($plugin->currentVersion->min_mc_version > ManiaControl::VERSION) { if ($plugin->currentVersion->min_mc_version > ManiaControl::VERSION) {
$infoLabel->setText("Needs at least MC-Version '{$plugin->currentVersion->min_mc_version}'"); $infoLabel->setText("Needs at least MC-Version '{$plugin->currentVersion->min_mc_version}'");
} else { } else {
@ -149,14 +149,14 @@ class InstallMenu implements ConfiguratorMenu, ManialinkPageAnswerListener {
} else { } else {
// Install button // Install button
$installButton = new Label_Button(); $installButton = new Label_Button();
$pluginFrame->add($installButton); $pluginFrame->addChild($installButton);
$installButton->setHAlign($installButton::RIGHT)->setX($width * 0.47)->setStyle($installButton::STYLE_CardButtonSmall)->setText('Install')->setTranslate(true)->setAction(self::ACTION_PREFIX_INSTALL_PLUGIN . $plugin->id); $installButton->setHorizontalAlign($installButton::RIGHT)->setX($width * 0.47)->setStyle($installButton::STYLE_CardButtonSmall)->setText('Install')->setTranslate(true)->setAction(self::ACTION_PREFIX_INSTALL_PLUGIN . $plugin->id);
} }
if ($plugin->currentVersion->verified > 0) { if ($plugin->currentVersion->verified > 0) {
// Suggested quad // Suggested quad
$suggestedQuad = new Quad_Icons64x64_1(); $suggestedQuad = new Quad_Icons64x64_1();
$pluginFrame->add($suggestedQuad); $pluginFrame->addChild($suggestedQuad);
$suggestedQuad->setPosition($width * 0.45, $entryHeight * 0.12, 2)->setSize(4, 4)->setSubStyle($suggestedQuad::SUBSTYLE_StateSuggested); $suggestedQuad->setPosition($width * 0.45, $entryHeight * 0.12, 2)->setSize(4, 4)->setSubStyle($suggestedQuad::SUBSTYLE_StateSuggested);
} }
@ -177,11 +177,11 @@ class InstallMenu implements ConfiguratorMenu, ManialinkPageAnswerListener {
$frame = new Frame(); $frame = new Frame();
$infoLabel = new Label_Text(); $infoLabel = new Label_Text();
$frame->add($infoLabel); $frame->addChild($infoLabel);
$infoLabel->setVAlign($infoLabel::BOTTOM)->setY(2)->setSize(100, 25)->setTextColor('f30')->setTranslate(true)->setText('An error occurred. Please try again later.'); $infoLabel->setVerticalAlign($infoLabel::BOTTOM)->setY(2)->setSize(100, 25)->setTextColor('f30')->setTranslate(true)->setText('An error occurred. Please try again later.');
$refreshQuad = new Quad_Icons64x64_1(); $refreshQuad = new Quad_Icons64x64_1();
$frame->add($refreshQuad); $frame->addChild($refreshQuad);
$refreshQuad->setY(-4)->setSize(8, 8)->setSubStyle($refreshQuad::SUBSTYLE_Refresh)->setAction(self::ACTION_REFRESH_LIST); $refreshQuad->setY(-4)->setSize(8, 8)->setSubStyle($refreshQuad::SUBSTYLE_Refresh)->setAction(self::ACTION_REFRESH_LIST);
return $frame; return $frame;
@ -196,7 +196,7 @@ class InstallMenu implements ConfiguratorMenu, ManialinkPageAnswerListener {
$frame = new Frame(); $frame = new Frame();
$infoLabel = new Label_Text(); $infoLabel = new Label_Text();
$frame->add($infoLabel); $frame->addChild($infoLabel);
$infoLabel->setSize(100, 50)->setTextColor('0f3')->setTranslate(true)->setText('No other plugins available.'); $infoLabel->setSize(100, 50)->setTextColor('0f3')->setTranslate(true)->setText('No other plugins available.');
return $frame; return $frame;

View File

@ -103,13 +103,13 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
// Pagers // Pagers
$pagerPrev = new Quad_Icons64x64_1(); $pagerPrev = new Quad_Icons64x64_1();
$frame->add($pagerPrev); $frame->addChild($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(Quad_Icons64x64_1::SUBSTYLE_ArrowPrev);
$pagerNext = new Quad_Icons64x64_1(); $pagerNext = new Quad_Icons64x64_1();
$frame->add($pagerNext); $frame->addChild($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(Quad_Icons64x64_1::SUBSTYLE_ArrowNext);
@ -118,8 +118,8 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$paging->addButtonControl($pagerPrev); $paging->addButtonControl($pagerPrev);
$pageCountLabel = new Label_Text(); $pageCountLabel = new Label_Text();
$frame->add($pageCountLabel); $frame->addChild($pageCountLabel);
$pageCountLabel->setHAlign($pageCountLabel::RIGHT); $pageCountLabel->setHorizontalAlign($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);
@ -148,7 +148,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
/** @var Plugin $pluginClass */ /** @var Plugin $pluginClass */
if ($index % $pageMaxCount === 0) { if ($index % $pageMaxCount === 0) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$paging->addPageControl($pageFrame); $paging->addPageControl($pageFrame);
$posY = $height * 0.41; $posY = $height * 0.41;
} }
@ -156,11 +156,11 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$active = $this->maniaControl->getPluginManager()->isPluginActive($pluginClass); $active = $this->maniaControl->getPluginManager()->isPluginActive($pluginClass);
$pluginFrame = new Frame(); $pluginFrame = new Frame();
$pageFrame->add($pluginFrame); $pageFrame->addChild($pluginFrame);
$pluginFrame->setY($posY); $pluginFrame->setY($posY);
$activeQuad = new Quad_Icons64x64_1(); $activeQuad = new Quad_Icons64x64_1();
$pluginFrame->add($activeQuad); $pluginFrame->addChild($activeQuad);
$activeQuad->setPosition($width * -0.45, -0.1, 1); $activeQuad->setPosition($width * -0.45, -0.1, 1);
$activeQuad->setSize($entryHeight * 0.9, $entryHeight * 0.9); $activeQuad->setSize($entryHeight * 0.9, $entryHeight * 0.9);
if ($active) { if ($active) {
@ -170,8 +170,8 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
} }
$nameLabel = new Label_Text(); $nameLabel = new Label_Text();
$pluginFrame->add($nameLabel); $pluginFrame->addChild($nameLabel);
$nameLabel->setHAlign($nameLabel::LEFT); $nameLabel->setHorizontalAlign($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);
@ -179,7 +179,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$nameLabel->setText($pluginClass::getName()); $nameLabel->setText($pluginClass::getName());
$descriptionLabel = new Label(); $descriptionLabel = new Label();
$pageFrame->add($descriptionLabel); $pageFrame->addChild($descriptionLabel);
$descriptionLabel->setAlign($descriptionLabel::LEFT, $descriptionLabel::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);
@ -192,7 +192,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$nameLabel->addTooltipLabelFeature($descriptionLabel,$description); $nameLabel->addTooltipLabelFeature($descriptionLabel,$description);
$quad = new Quad_Icons128x32_1(); $quad = new Quad_Icons128x32_1();
$pluginFrame->add($quad); $pluginFrame->addChild($quad);
$quad->setSubStyle($quad::SUBSTYLE_Settings); $quad->setSubStyle($quad::SUBSTYLE_Settings);
$quad->setX(15); $quad->setX(15);
$quad->setZ(1); $quad->setZ(1);
@ -200,8 +200,8 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$quad->setAction(self::ACTION_PREFIX_SETTINGS . $pluginClass); $quad->setAction(self::ACTION_PREFIX_SETTINGS . $pluginClass);
$statusChangeButton = new Label_Button(); $statusChangeButton = new Label_Button();
$pluginFrame->add($statusChangeButton); $pluginFrame->addChild($statusChangeButton);
$statusChangeButton->setHAlign($statusChangeButton::RIGHT); $statusChangeButton->setHorizontalAlign($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) {
@ -216,7 +216,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
if ($pluginUpdates && array_key_exists($pluginClass::getId(), $pluginUpdates)) { if ($pluginUpdates && array_key_exists($pluginClass::getId(), $pluginUpdates)) {
$quadUpdate = new Quad_Icons128x128_1(); $quadUpdate = new Quad_Icons128x128_1();
$pluginFrame->add($quadUpdate); $pluginFrame->addChild($quadUpdate);
$quadUpdate->setSubStyle($quadUpdate::SUBSTYLE_ProfileVehicle); $quadUpdate->setSubStyle($quadUpdate::SUBSTYLE_ProfileVehicle);
$quadUpdate->setX(56); $quadUpdate->setX(56);
$quadUpdate->setZ(2); $quadUpdate->setZ(2);
@ -229,8 +229,8 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
if ($pluginUpdates) { if ($pluginUpdates) {
$updatePluginsButton = new Label_Button(); $updatePluginsButton = new Label_Button();
$frame->add($updatePluginsButton); $frame->addChild($updatePluginsButton);
$updatePluginsButton->setHAlign($updatePluginsButton::RIGHT); $updatePluginsButton->setHorizontalAlign($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);
@ -264,8 +264,8 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
//Headline Label //Headline Label
$headLabel = new Label_Text(); $headLabel = new Label_Text();
$frame->add($headLabel); $frame->addChild($headLabel);
$headLabel->setHAlign($headLabel::LEFT); $headLabel->setHorizontalAlign($headLabel::LEFT);
$headLabel->setPosition($width * -0.46, $height * 0.41); $headLabel->setPosition($width * -0.46, $height * 0.41);
$headLabel->setSize($width * 0.6, $settingHeight); $headLabel->setSize($width * 0.6, $settingHeight);
$headLabel->setStyle($headLabel::STYLE_TextCardSmall); $headLabel->setStyle($headLabel::STYLE_TextCardSmall);
@ -276,18 +276,18 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
foreach ($settings as $setting) { foreach ($settings as $setting) {
if ($index % $pageSettingsMaxCount === 0) { if ($index % $pageSettingsMaxCount === 0) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$paging->addPageControl($pageFrame); $paging->addPageControl($pageFrame);
$posY = $height * 0.41 - $settingHeight * 1.5; $posY = $height * 0.41 - $settingHeight * 1.5;
} }
$settingFrame = new Frame(); $settingFrame = new Frame();
$pageFrame->add($settingFrame); $pageFrame->addChild($settingFrame);
$settingFrame->setY($posY); $settingFrame->setY($posY);
$nameLabel = new Label_Text(); $nameLabel = new Label_Text();
$settingFrame->add($nameLabel); $settingFrame->addChild($nameLabel);
$nameLabel->setHAlign($nameLabel::LEFT); $nameLabel->setHorizontalAlign($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);
@ -301,7 +301,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$quad->setPosition($width * 0.33, 0, -0.01); $quad->setPosition($width * 0.33, 0, -0.01);
$quad->setSize(4, 4); $quad->setSize(4, 4);
$checkBox = new CheckBox(self::ACTION_PREFIX_SETTING . $setting->index, $setting->value, $quad); $checkBox = new CheckBox(self::ACTION_PREFIX_SETTING . $setting->index, $setting->value, $quad);
$settingFrame->add($checkBox); $settingFrame->addChild($checkBox);
} else if ($setting->type === Setting::TYPE_SET) { } else if ($setting->type === Setting::TYPE_SET) {
// SET value picker // SET value picker
$label = new Label_Text(); $label = new Label_Text();
@ -310,11 +310,11 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$label->setStyle($label::STYLE_TextValueSmall); $label->setStyle($label::STYLE_TextValueSmall);
$label->setTextSize(1); $label->setTextSize(1);
$valuePicker = new ValuePicker(self::ACTION_PREFIX_SETTING . $setting->index, $setting->set, $setting->value, $label); $valuePicker = new ValuePicker(self::ACTION_PREFIX_SETTING . $setting->index, $setting->set, $setting->value, $label);
$settingFrame->add($valuePicker); $settingFrame->addChild($valuePicker);
} else { } else {
// Value entry // Value entry
$entry = new Entry(); $entry = new Entry();
$settingFrame->add($entry); $settingFrame->addChild($entry);
$entry->setX($width * 0.33); $entry->setX($width * 0.33);
$entry->setSize($width * 0.3, $settingHeight * 0.9); $entry->setSize($width * 0.3, $settingHeight * 0.9);
$entry->setTextSize(1); $entry->setTextSize(1);
@ -329,9 +329,9 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
} }
$backButton = new Label_Button(); $backButton = new Label_Button();
$frame->add($backButton); $frame->addChild($backButton);
$backButton->setStyle($backButton::STYLE_CardMain_Quit); $backButton->setStyle($backButton::STYLE_CardMain_Quit);
$backButton->setHAlign($backButton::LEFT); $backButton->setHorizontalAlign($backButton::LEFT);
$backButton->setScale(0.75); $backButton->setScale(0.75);
$backButton->setText('Back'); $backButton->setText('Back');
$backButton->setPosition(-$width / 2 + 7, -$height / 2 + 7); $backButton->setPosition(-$width / 2 + 7, -$height / 2 + 7);

View File

@ -258,16 +258,16 @@ class ServerOptionsMenu implements CallbackListener, ConfiguratorMenu, TimerList
// Pagers // Pagers
$pagerPrev = new Quad_Icons64x64_1(); $pagerPrev = new Quad_Icons64x64_1();
$frame->add($pagerPrev); $frame->addChild($pagerPrev);
$pagerPrev->setPosition($width * 0.39, $height * -0.44, 2)->setSize($pagerSize, $pagerSize)->setSubStyle($pagerPrev::SUBSTYLE_ArrowPrev); $pagerPrev->setPosition($width * 0.39, $height * -0.44, 2)->setSize($pagerSize, $pagerSize)->setSubStyle($pagerPrev::SUBSTYLE_ArrowPrev);
$pagerNext = new Quad_Icons64x64_1(); $pagerNext = new Quad_Icons64x64_1();
$frame->add($pagerNext); $frame->addChild($pagerNext);
$pagerNext->setPosition($width * 0.45, $height * -0.44, 2)->setSize($pagerSize, $pagerSize)->setSubStyle($pagerNext::SUBSTYLE_ArrowNext); $pagerNext->setPosition($width * 0.45, $height * -0.44, 2)->setSize($pagerSize, $pagerSize)->setSubStyle($pagerNext::SUBSTYLE_ArrowNext);
$pageCountLabel = new Label_Text(); $pageCountLabel = new Label_Text();
$frame->add($pageCountLabel); $frame->addChild($pageCountLabel);
$pageCountLabel->setHAlign($pageCountLabel::RIGHT)->setPosition($width * 0.35, $height * -0.44, 1)->setStyle($pageCountLabel::STYLE_TextTitle1)->setTextSize(2); $pageCountLabel->setHorizontalAlign($pageCountLabel::RIGHT)->setPosition($width * 0.35, $height * -0.44, 1)->setStyle($pageCountLabel::STYLE_TextTitle1)->setTextSize(2);
$paging->addButtonControl($pagerNext)->addButtonControl($pagerPrev)->setLabel($pageCountLabel); $paging->addButtonControl($pagerNext)->addButtonControl($pagerPrev)->setLabel($pageCountLabel);
@ -285,29 +285,29 @@ class ServerOptionsMenu implements CallbackListener, ConfiguratorMenu, TimerList
if ($index % 13 === 0) { if ($index % 13 === 0) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$posY = $height * 0.41; $posY = $height * 0.41;
$paging->addPageControl($pageFrame); $paging->addPageControl($pageFrame);
} }
$optionsFrame = new Frame(); $optionsFrame = new Frame();
$pageFrame->add($optionsFrame); $pageFrame->addChild($optionsFrame);
$optionsFrame->setY($posY); $optionsFrame->setY($posY);
$nameLabel = new Label_Text(); $nameLabel = new Label_Text();
$optionsFrame->add($nameLabel); $optionsFrame->addChild($nameLabel);
$nameLabel->setHAlign($nameLabel::LEFT)->setX($width * -0.46)->setSize($width * 0.4, $optionHeight)->setStyle($nameLabel::STYLE_TextCardSmall)->setTextSize($labelTextSize)->setText($name)->setTextColor('fff'); $nameLabel->setHorizontalAlign($nameLabel::LEFT)->setX($width * -0.46)->setSize($width * 0.4, $optionHeight)->setStyle($nameLabel::STYLE_TextCardSmall)->setTextSize($labelTextSize)->setText($name)->setTextColor('fff');
if (is_bool($value)) { if (is_bool($value)) {
// Boolean checkbox // Boolean checkbox
$quad = new Quad(); $quad = new Quad();
$quad->setPosition($width * 0.23, 0, -0.01)->setSize(4, 4); $quad->setPosition($width * 0.23, 0, -0.01)->setSize(4, 4);
$checkBox = new CheckBox(self::ACTION_PREFIX_OPTION . $name, $value, $quad); $checkBox = new CheckBox(self::ACTION_PREFIX_OPTION . $name, $value, $quad);
$optionsFrame->add($checkBox); $optionsFrame->addChild($checkBox);
} else { } else {
// Other // Other
$entry = new Entry(); $entry = new Entry();
$optionsFrame->add($entry); $optionsFrame->addChild($entry);
$entry->setStyle(Label_Text::STYLE_TextValueSmall)->setX($width * 0.23)->setTextSize(1)->setSize($width * 0.48, $optionHeight * 0.9)->setName(self::ACTION_PREFIX_OPTION . $name)->setDefault($value); $entry->setStyle(Label_Text::STYLE_TextValueSmall)->setX($width * 0.23)->setTextSize(1)->setSize($width * 0.48, $optionHeight * 0.9)->setName(self::ACTION_PREFIX_OPTION . $name)->setDefault($value);
if ($name === 'Comment') { if ($name === 'Comment') {

View File

@ -47,14 +47,14 @@ class VoteRatiosMenu implements CallbackListener, ConfiguratorMenu, TimerListene
} }
/** /**
* @see \ManiaControl\Configurators\ConfiguratorMenu::getTitle() * @see \ManiaControl\Configurator\ConfiguratorMenu::getTitle()
*/ */
public static function getTitle() { public static function getTitle() {
return 'Vote Ratios'; return 'Vote Ratios';
} }
/** /**
* @see \ManiaControl\Configurators\ConfiguratorMenu::getMenu() * @see \ManiaControl\Configurator\ConfiguratorMenu::getMenu()
*/ */
public function getMenu($width, $height, Script $script, Player $player) { public function getMenu($width, $height, Script $script, Player $player) {
$frame = new Frame(); $frame = new Frame();
@ -66,15 +66,15 @@ class VoteRatiosMenu implements CallbackListener, ConfiguratorMenu, TimerListene
$voteRatios = $this->maniaControl->getClient()->getCallVoteRatios(); $voteRatios = $this->maniaControl->getClient()->getCallVoteRatios();
foreach ($voteRatioCommands as $voteRatioCommand => $voteRatioDescription) { foreach ($voteRatioCommands as $voteRatioCommand => $voteRatioDescription) {
$voteRatioFrame = new Frame(); $voteRatioFrame = new Frame();
$frame->add($voteRatioFrame); $frame->addChild($voteRatioFrame);
$voteRatioFrame->setY($posY); $voteRatioFrame->setY($posY);
$nameLabel = new Label_Text(); $nameLabel = new Label_Text();
$voteRatioFrame->add($nameLabel); $voteRatioFrame->addChild($nameLabel);
$nameLabel->setHAlign($nameLabel::LEFT)->setX($width * -0.46)->setSize($width * 0.7, $lineHeight)->setTextSize(2)->setTranslate(true)->setText($voteRatioDescription); $nameLabel->setHorizontalAlign($nameLabel::LEFT)->setX($width * -0.46)->setSize($width * 0.7, $lineHeight)->setTextSize(2)->setTranslate(true)->setText($voteRatioDescription);
$entry = new Entry(); $entry = new Entry();
$voteRatioFrame->add($entry); $voteRatioFrame->addChild($entry);
$entry->setX($width * 0.35)->setSize($width * 0.14, $lineHeight * 0.9)->setStyle(Label_Text::STYLE_TextValueSmall)->setTextSize($index === 0 ? 2 : 1)->setName(self::ACTION_PREFIX_VOTE_RATIO . $voteRatioCommand); $entry->setX($width * 0.35)->setSize($width * 0.14, $lineHeight * 0.9)->setStyle(Label_Text::STYLE_TextValueSmall)->setTextSize($index === 0 ? 2 : 1)->setName(self::ACTION_PREFIX_VOTE_RATIO . $voteRatioCommand);
$voteRatio = $this->getVoteRatioForCommand($voteRatios, $voteRatioCommand); $voteRatio = $this->getVoteRatioForCommand($voteRatios, $voteRatioCommand);

View File

@ -130,19 +130,19 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
// Main frame // Main frame
$frame = new Frame(); $frame = new Frame();
$maniaLink->add($frame); $maniaLink->addChild($frame);
$frame->setSize($width, $height); $frame->setSize($width, $height);
$frame->setPosition(0, 0, 10); $frame->setPosition(0, 0, 10);
// Background // Background
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setSize($width, $height); $backgroundQuad->setSize($width, $height);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
// Close Quad (X) // Close Quad (X)
$closeQuad = new Quad_Icons64x64_1(); $closeQuad = new Quad_Icons64x64_1();
$frame->add($closeQuad); $frame->addChild($closeQuad);
$closeQuad->setPosition($width * 0.483, $height * 0.467, 3); $closeQuad->setPosition($width * 0.483, $height * 0.467, 3);
$closeQuad->setSize(6, 6); $closeQuad->setSize(6, 6);
$closeQuad->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_QuitRace); $closeQuad->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_QuitRace);
@ -154,7 +154,7 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
// Predefine Description Label // Predefine Description Label
$descriptionLabel = new Label(); $descriptionLabel = new Label();
$frame->add($descriptionLabel); $frame->addChild($descriptionLabel);
$descriptionLabel->setAlign($descriptionLabel::LEFT, $descriptionLabel::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);
@ -163,7 +163,7 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
// Headline // Headline
$headFrame = new Frame(); $headFrame = new Frame();
$frame->add($headFrame); $frame->addChild($headFrame);
$headFrame->setY($posY - 5); $headFrame->setY($posY - 5);
$posX = $xStart; $posX = $xStart;
@ -221,12 +221,12 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
} }
$playerFrame = new Frame(); $playerFrame = new Frame();
$frame->add($playerFrame); $frame->addChild($playerFrame);
// Show current Player Arrow // Show current Player Arrow
if ($playerId == $player->index) { if ($playerId == $player->index) {
$currentQuad = new Quad_Icons64x64_1(); $currentQuad = new Quad_Icons64x64_1();
$playerFrame->add($currentQuad); $playerFrame->addChild($currentQuad);
$currentQuad->setX($xStart + 3.5); $currentQuad->setX($xStart + 3.5);
$currentQuad->setZ(0.2); $currentQuad->setZ(0.2);
$currentQuad->setSize(4, 4); $currentQuad->setSize(4, 4);
@ -254,8 +254,8 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
$posX = $xStart + 55; $posX = $xStart + 55;
foreach ($displayArray as $key => $array) { foreach ($displayArray as $key => $array) {
$label = new Label_Text(); $label = new Label_Text();
$playerFrame->add($label); $playerFrame->addChild($label);
$label->setHAlign($label::LEFT); $label->setHorizontalAlign($label::LEFT);
$label->setX($posX); $label->setX($posX);
$label->setStyle($label::STYLE_TextCardSmall); $label->setStyle($label::STYLE_TextCardSmall);
$label->setTextSize($textSize); $label->setTextSize($textSize);
@ -269,7 +269,7 @@ class SimpleStatsList implements ManialinkPageAnswerListener, CallbackListener,
if ($index % 2 !== 0) { if ($index % 2 !== 0) {
$lineQuad = new Quad_BgsPlayerCard(); $lineQuad = new Quad_BgsPlayerCard();
$playerFrame->add($lineQuad); $playerFrame->addChild($lineQuad);
$lineQuad->setSize($width, 4); $lineQuad->setSize($width, 4);
$lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig); $lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig);
$lineQuad->setZ(0.001); $lineQuad->setZ(0.001);

View File

@ -304,31 +304,31 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
//Custom Vote Menu Iconsframe //Custom Vote Menu Iconsframe
$frame = new Frame(); $frame = new Frame();
$maniaLink->add($frame); $maniaLink->addChild($frame);
$frame->setPosition($posX, $posY); $frame->setPosition($posX, $posY);
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setSize($width * $itemMarginFactorX, $height * $itemMarginFactorY); $backgroundQuad->setSize($width * $itemMarginFactorX, $height * $itemMarginFactorY);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$iconFrame = new Frame(); $iconFrame = new Frame();
$frame->add($iconFrame); $frame->addChild($iconFrame);
$iconFrame->setSize($itemSize, $itemSize); $iconFrame->setSize($itemSize, $itemSize);
$itemQuad = new Quad_UIConstruction_Buttons(); $itemQuad = new Quad_UIConstruction_Buttons();
$itemQuad->setSubStyle($itemQuad::SUBSTYLE_Add); $itemQuad->setSubStyle($itemQuad::SUBSTYLE_Add);
$itemQuad->setSize($itemSize, $itemSize); $itemQuad->setSize($itemSize, $itemSize);
$iconFrame->add($itemQuad); $iconFrame->addChild($itemQuad);
//Define Description Label //Define Description Label
$menuEntries = count($this->voteMenuItems); $menuEntries = count($this->voteMenuItems);
$descriptionFrame = new Frame(); $descriptionFrame = new Frame();
$maniaLink->add($descriptionFrame); $manialink->addChild($descriptionFrame);
$descriptionFrame->setPosition($posX - $menuEntries * $itemSize * 1.15 - 6, $posY); $descriptionFrame->setPosition($posX - $menuEntries * $itemSize * 1.15 - 6, $posY);
$descriptionLabel = new Label(); $descriptionLabel = new Label();
$descriptionFrame->add($descriptionLabel); $descriptionFrame->addChild($descriptionLabel);
$descriptionLabel->setAlign($descriptionLabel::RIGHT, $descriptionLabel::TOP); $descriptionLabel->setAlign($descriptionLabel::RIGHT, $descriptionLabel::TOP);
$descriptionLabel->setSize(40, 4); $descriptionLabel->setSize(40, 4);
$descriptionLabel->setTextSize(1.4); $descriptionLabel->setTextSize(1.4);
@ -336,15 +336,16 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
//Popout Frame //Popout Frame
$popoutFrame = new Frame(); $popoutFrame = new Frame();
$maniaLink->add($popoutFrame); $manialink->addChild($popoutFrame);
$popoutFrame->setPosition($posX - $itemSize * 0.5, $posY); $popoutFrame->setPosition($posX - $itemSize * 0.5, $posY);
$popoutFrame->setHAlign($popoutFrame::RIGHT); $popoutFrame->setHorizontalAlign($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->addChild($backgroundQuad);
$backgroundQuad->setHAlign($backgroundQuad::RIGHT); $backgroundQuad->setHorizontalAlign($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);
@ -356,14 +357,14 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
foreach ($menuItems as $menuItem) { foreach ($menuItems as $menuItem) {
/** @var Quad $menuQuad */ /** @var Quad $menuQuad */
$menuQuad = $menuItem[0]; $menuQuad = $menuItem[0];
$popoutFrame->add($menuQuad); $popoutFrame->addChild($menuQuad);
$menuQuad->setSize($itemSize, $itemSize); $menuQuad->setSize($itemSize, $itemSize);
$menuQuad->setX($posX); $menuQuad->setX($posX);
$menuQuad->setHAlign($menuQuad::RIGHT); $menuQuad->setHorizontalAlign($menuQuad::RIGHT);
$posX -= $itemSize * 1.05; $posX -= $itemSize * 1.05;
if ($menuItem[1]) { if ($menuItem[1]) {
$menuQuad->removeScriptFeatures(); $menuQuad->removeAllScriptFeatures();
$description = '$s' . $menuItem[1]; $description = '$s' . $menuItem[1];
$menuQuad->addTooltipLabelFeature($descriptionLabel, $description); $menuQuad->addTooltipLabelFeature($descriptionLabel, $description);
} }
@ -702,19 +703,19 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
// mainframe // mainframe
$frame = new Frame(); $frame = new Frame();
$maniaLink->add($frame); $maniaLink->addChild($frame);
$frame->setSize($width, $height); $frame->setSize($width, $height);
$frame->setPosition($posX, $posY, 30); $frame->setPosition($posX, $posY, 30);
// Background Quad // Background Quad
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setSize($width, $height); $backgroundQuad->setSize($width, $height);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
//Vote for label //Vote for label
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setY($height / 2 - 3); $label->setY($height / 2 - 3);
$label->setSize($width - 5, $height); $label->setSize($width - 5, $height);
$label->setTextSize(1.3); $label->setTextSize(1.3);
@ -722,7 +723,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
//Started by nick //Started by nick
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setY($height / 2 - 6); $label->setY($height / 2 - 6);
$label->setSize($width - 5, 2); $label->setSize($width - 5, 2);
$label->setTextSize(1); $label->setTextSize(1);
@ -731,7 +732,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
//Time Gauge //Time Gauge
$timeGauge = new Gauge(); $timeGauge = new Gauge();
$frame->add($timeGauge); $frame->addChild($timeGauge);
$timeGauge->setY(1.5); $timeGauge->setY(1.5);
$timeGauge->setSize($width * 0.95, 6); $timeGauge->setSize($width * 0.95, 6);
$timeGauge->setDrawBg(false); $timeGauge->setDrawBg(false);
@ -745,7 +746,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
//Time Left //Time Left
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setY(0); $label->setY(0);
$label->setSize($width - 5, $height); $label->setSize($width - 5, $height);
$label->setTextSize(1.1); $label->setTextSize(1.1);
@ -754,7 +755,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
//Vote Gauge //Vote Gauge
$voteGauge = new Gauge(); $voteGauge = new Gauge();
$frame->add($voteGauge); $frame->addChild($voteGauge);
$voteGauge->setY(-4); $voteGauge->setY(-4);
$voteGauge->setSize($width * 0.65, 12); $voteGauge->setSize($width * 0.65, 12);
$voteGauge->setDrawBg(false); $voteGauge->setDrawBg(false);
@ -764,7 +765,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
$posY = -4.4; $posY = -4.4;
$voteLabel = new Label(); $voteLabel = new Label();
$frame->add($voteLabel); $frame->addChild($voteLabel);
$voteLabel->setY($posY); $voteLabel->setY($posY);
$voteLabel->setSize($width * 0.65, 12); $voteLabel->setSize($width * 0.65, 12);
$voteLabel->setStyle($labelStyle); $voteLabel->setStyle($labelStyle);
@ -773,13 +774,13 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
$positiveQuad = new Quad_BgsPlayerCard(); $positiveQuad = new Quad_BgsPlayerCard();
$frame->add($positiveQuad); $frame->addChild($positiveQuad);
$positiveQuad->setPosition(-$width / 2 + 6, $posY); $positiveQuad->setPosition(-$width / 2 + 6, $posY);
$positiveQuad->setSubStyle($positiveQuad::SUBSTYLE_BgPlayerCardBig); $positiveQuad->setSubStyle($positiveQuad::SUBSTYLE_BgPlayerCardBig);
$positiveQuad->setSize(5, 5); $positiveQuad->setSize(5, 5);
$positiveLabel = new Label_Button(); $positiveLabel = new Label_Button();
$frame->add($positiveLabel); $frame->addChild($positiveLabel);
$positiveLabel->setPosition(-$width / 2 + 6, $posY); $positiveLabel->setPosition(-$width / 2 + 6, $posY);
$positiveLabel->setStyle($labelStyle); $positiveLabel->setStyle($labelStyle);
$positiveLabel->setTextSize(1); $positiveLabel->setTextSize(1);
@ -788,11 +789,11 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
$positiveLabel->setText('F1'); $positiveLabel->setText('F1');
$negativeQuad = clone $positiveQuad; $negativeQuad = clone $positiveQuad;
$frame->add($negativeQuad); $frame->addChild($negativeQuad);
$negativeQuad->setX($width / 2 - 6); $negativeQuad->setX($width / 2 - 6);
$negativeLabel = clone $positiveLabel; $negativeLabel = clone $positiveLabel;
$frame->add($negativeLabel); $frame->addChild($negativeLabel);
$negativeLabel->setX($width / 2 - 6); $negativeLabel->setX($width / 2 - 6);
$negativeLabel->setTextColor('F00'); $negativeLabel->setTextColor('F00');
$negativeLabel->setText('F2'); $negativeLabel->setText('F2');

View File

@ -476,18 +476,18 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
$manialink = new ManiaLink(self::MLID_DEDIMANIA); $manialink = new ManiaLink(self::MLID_DEDIMANIA);
$frame = new Frame(); $frame = new Frame();
$manialink->add($frame); $manialink->addChild($frame);
$frame->setPosition($posX, $posY); $frame->setPosition($posX, $posY);
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setVAlign($backgroundQuad::TOP); $backgroundQuad->setVerticalAlign($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);
$titleLabel = new Label(); $titleLabel = new Label();
$frame->add($titleLabel); $frame->addChild($titleLabel);
$titleLabel->setPosition(0, $lineHeight * -0.9); $titleLabel->setPosition(0, $lineHeight * -0.9);
$titleLabel->setWidth($width); $titleLabel->setWidth($width);
$titleLabel->setStyle($labelStyle); $titleLabel->setStyle($labelStyle);
@ -504,18 +504,18 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
$y = -8. - $index * $lineHeight; $y = -8. - $index * $lineHeight;
$recordFrame = new Frame(); $recordFrame = new Frame();
$frame->add($recordFrame); $frame->addChild($recordFrame);
$recordFrame->setPosition(0, $y); $recordFrame->setPosition(0, $y);
/*$backgroundQuad = new Quad(); /*$backgroundQuad = new Quad();
$recordFrame->add($backgroundQuad); $recordFrame->addChild($backgroundQuad);
$backgroundQuad->setSize($width * 1.04, $lineHeight * 1.4); $backgroundQuad->setSize($width * 1.04, $lineHeight * 1.4);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle);*/ $backgroundQuad->setStyles($quadStyle, $quadSubstyle);*/
//Rank //Rank
$rankLabel = new Label(); $rankLabel = new Label();
$recordFrame->add($rankLabel); $recordFrame->addChild($rankLabel);
$rankLabel->setHAlign($rankLabel::LEFT); $rankLabel->setHorizontalAlign($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);
@ -525,8 +525,8 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
//Name //Name
$nameLabel = new Label(); $nameLabel = new Label();
$recordFrame->add($nameLabel); $recordFrame->addChild($nameLabel);
$nameLabel->setHAlign($nameLabel::LEFT); $nameLabel->setHorizontalAlign($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);
@ -535,8 +535,8 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
//Time //Time
$timeLabel = new Label(); $timeLabel = new Label();
$recordFrame->add($timeLabel); $recordFrame->addChild($timeLabel);
$timeLabel->setHAlign($timeLabel::RIGHT); $timeLabel->setHorizontalAlign($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);
@ -1113,7 +1113,7 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
// Main frame // Main frame
$frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging); $frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging);
$maniaLink->add($frame); $maniaLink->addChild($frame);
// Start offsets // Start offsets
$posX = -$width / 2; $posX = -$width / 2;
@ -1121,11 +1121,11 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
// Predefine Description Label // Predefine Description Label
$descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel(); $descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel();
$frame->add($descriptionLabel); $frame->addChild($descriptionLabel);
// Headline // Headline
$headFrame = new Frame(); $headFrame = new Frame();
$frame->add($headFrame); $frame->addChild($headFrame);
$headFrame->setY($posY - 5); $headFrame->setY($posY - 5);
$array = array('Rank' => $posX + 5, 'Nickname' => $posX + 18, 'Login' => $posX + 70, 'Time' => $posX + 101); $array = array('Rank' => $posX + 5, 'Nickname' => $posX + 18, 'Login' => $posX + 70, 'Time' => $posX + 101);
$this->maniaControl->getManialinkManager()->labelLine($headFrame, $array); $this->maniaControl->getManialinkManager()->labelLine($headFrame, $array);
@ -1137,17 +1137,17 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
foreach ($records as $listRecord) { foreach ($records as $listRecord) {
if ($index % 15 === 0) { if ($index % 15 === 0) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$posY = $height / 2 - 10; $posY = $height / 2 - 10;
$paging->addPage($pageFrame); $paging->addPage($pageFrame);
} }
$recordFrame = new Frame(); $recordFrame = new Frame();
$pageFrame->add($recordFrame); $pageFrame->addChild($recordFrame);
if ($index % 2 !== 0) { if ($index % 2 !== 0) {
$lineQuad = new Quad_BgsPlayerCard(); $lineQuad = new Quad_BgsPlayerCard();
$recordFrame->add($lineQuad); $recordFrame->addChild($lineQuad);
$lineQuad->setSize($width, 4); $lineQuad->setSize($width, 4);
$lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig); $lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig);
$lineQuad->setZ(0.001); $lineQuad->setZ(0.001);

View File

@ -170,50 +170,50 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
// Donate Menu Icon Frame // Donate Menu Icon Frame
$frame = new Frame(); $frame = new Frame();
$maniaLink->add($frame); $maniaLink->addChild($frame);
$frame->setPosition($posX, $posY); $frame->setPosition($posX, $posY);
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setSize($width * $itemMarginFactorX, $height * $itemMarginFactorY); $backgroundQuad->setSize($width * $itemMarginFactorX, $height * $itemMarginFactorY);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$iconFrame = new Frame(); $iconFrame = new Frame();
$frame->add($iconFrame); $frame->addChild($iconFrame);
$iconFrame->setSize($itemSize, $itemSize); $iconFrame->setSize($itemSize, $itemSize);
$itemQuad = new Quad_BgRaceScore2(); $itemQuad = new Quad_BgRaceScore2();
$itemQuad->setSubStyle($itemQuad::SUBSTYLE_Points); $itemQuad->setSubStyle($itemQuad::SUBSTYLE_Points);
$itemQuad->setSize($itemSize, $itemSize); $itemQuad->setSize($itemSize, $itemSize);
$iconFrame->add($itemQuad); $iconFrame->addChild($itemQuad);
$valueArray = explode(',', $values); $valueArray = explode(',', $values);
// Values Menu // Values Menu
$popoutFrame = new Frame(); $popoutFrame = new Frame();
$maniaLink->add($popoutFrame); $manialink->addChild($popoutFrame);
$popoutFrame->setPosition($posX - $itemSize * 0.5, $posY); $popoutFrame->setPosition($posX - $itemSize * 0.5, $posY);
$popoutFrame->setHAlign($popoutFrame::RIGHT); $popoutFrame->setHorizontalAlign($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->addChild($quad);
$quad->setHAlign($quad::RIGHT); $quad->setHorizontalAlign($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);
$popoutFrame->add($quad); $popoutFrame->addChild($quad);
$itemQuad->addToggleFeature($popoutFrame); $itemQuad->addToggleFeature($popoutFrame);
// Description Label // Description Label
$descriptionFrame = new Frame(); $descriptionFrame = new Frame();
$maniaLink->add($descriptionFrame); $manialink->addChild($descriptionFrame);
$descriptionFrame->setPosition($posX - 50, $posY - 5); $descriptionFrame->setPosition($posX - 50, $posY - 5);
$descriptionFrame->setHAlign($descriptionFrame::RIGHT); $descriptionFrame->setHorizontalAlign($descriptionFrame::RIGHT);
$descriptionLabel = new Label(); $descriptionLabel = new Label();
$descriptionFrame->add($descriptionLabel); $descriptionFrame->addChild($descriptionLabel);
$descriptionLabel->setAlign($descriptionLabel::LEFT, $descriptionLabel::TOP); $descriptionLabel->setAlign($descriptionLabel::LEFT, $descriptionLabel::TOP);
$descriptionLabel->setSize(40, 4); $descriptionLabel->setSize(40, 4);
$descriptionLabel->setTextSize(2); $descriptionLabel->setTextSize(2);
@ -224,9 +224,9 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
$posX = -2; $posX = -2;
foreach (array_reverse($valueArray) as $value) { foreach (array_reverse($valueArray) as $value) {
$label = new Label_Text(); $label = new Label_Text();
$popoutFrame->add($label); $popoutFrame->addChild($label);
$label->setX($posX); $label->setX($posX);
$label->setHAlign($label::RIGHT); $label->setHorizontalAlign($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);
@ -478,7 +478,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
// Main frame // Main frame
$frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging); $frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging);
$maniaLink->add($frame); $maniaLink->addChild($frame);
// Start offsets // Start offsets
$posX = -$width / 2; $posX = -$width / 2;
@ -486,11 +486,11 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
//Predefine description Label //Predefine description Label
$descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel(); $descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel();
$frame->add($descriptionLabel); $frame->addChild($descriptionLabel);
// Headline // Headline
$headFrame = new Frame(); $headFrame = new Frame();
$frame->add($headFrame); $frame->addChild($headFrame);
$headFrame->setY($posY - 5); $headFrame->setY($posY - 5);
$array = array('$oId' => $posX + 5, '$oNickname' => $posX + 18, '$oLogin' => $posX + 70, '$oDonated planets' => $posX + 110); $array = array('$oId' => $posX + 5, '$oNickname' => $posX + 18, '$oLogin' => $posX + 70, '$oDonated planets' => $posX + 110);
$this->maniaControl->getManialinkManager()->labelLine($headFrame, $array); $this->maniaControl->getManialinkManager()->labelLine($headFrame, $array);
@ -502,18 +502,18 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
foreach ($stats as $playerIndex => $donations) { foreach ($stats as $playerIndex => $donations) {
if ($index % 15 === 1) { if ($index % 15 === 1) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$posY = $height / 2 - 10; $posY = $height / 2 - 10;
$paging->addPage($pageFrame); $paging->addPage($pageFrame);
} }
$playerFrame = new Frame(); $playerFrame = new Frame();
$pageFrame->add($playerFrame); $pageFrame->addChild($playerFrame);
$playerFrame->setY($posY); $playerFrame->setY($posY);
if ($index % 2 !== 0) { if ($index % 2 !== 0) {
$lineQuad = new Quad_BgsPlayerCard(); $lineQuad = new Quad_BgsPlayerCard();
$playerFrame->add($lineQuad); $playerFrame->addChild($lineQuad);
$lineQuad->setSize($width, 4); $lineQuad->setSize($width, 4);
$lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig); $lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig);
$lineQuad->setZ(0.001); $lineQuad->setZ(0.001);

View File

@ -922,17 +922,17 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
$manialink = new ManiaLink(self::MLID_KARMA); $manialink = new ManiaLink(self::MLID_KARMA);
$frame = new Frame(); $frame = new Frame();
$manialink->add($frame); $manialink->addChild($frame);
$frame->setPosition($posX, $posY); $frame->setPosition($posX, $posY);
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setY($height * 0.15); $backgroundQuad->setY($height * 0.15);
$backgroundQuad->setSize($width, $height); $backgroundQuad->setSize($width, $height);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$titleLabel = new Label(); $titleLabel = new Label();
$frame->add($titleLabel); $frame->addChild($titleLabel);
$titleLabel->setY($height * 0.36); $titleLabel->setY($height * 0.36);
$titleLabel->setWidth($width * 0.85); $titleLabel->setWidth($width * 0.85);
$titleLabel->setStyle($labelStyle); $titleLabel->setStyle($labelStyle);
@ -942,13 +942,13 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
$titleLabel->setText($title); $titleLabel->setText($title);
$karmaGauge = new Gauge(); $karmaGauge = new Gauge();
$frame->add($karmaGauge); $frame->addChild($karmaGauge);
$karmaGauge->setSize($width * 0.95, $height * 0.92); $karmaGauge->setSize($width * 0.95, $height * 0.92);
$karmaGauge->setDrawBg(false); $karmaGauge->setDrawBackground(false);
$manialink->karmaGauge = $karmaGauge; $manialink->karmaGauge = $karmaGauge;
$karmaLabel = new Label(); $karmaLabel = new Label();
$frame->add($karmaLabel); $frame->addChild($karmaLabel);
$karmaLabel->setPosition(0, -0.4, 1); $karmaLabel->setPosition(0, -0.4, 1);
$karmaLabel->setSize($width * 0.9, $height * 0.9); $karmaLabel->setSize($width * 0.9, $height * 0.9);
$karmaLabel->setStyle($labelStyle); $karmaLabel->setStyle($labelStyle);
@ -956,7 +956,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
$manialink->karmaLabel = $karmaLabel; $manialink->karmaLabel = $karmaLabel;
$votesFrame = new Frame(); $votesFrame = new Frame();
$frame->add($votesFrame); $frame->addChild($votesFrame);
$manialink->votesFrame = $votesFrame; $manialink->votesFrame = $votesFrame;
$this->manialink = $manialink; $this->manialink = $manialink;

View File

@ -233,12 +233,12 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
$manialink = new ManiaLink(self::MLID_RECORDS); $manialink = new ManiaLink(self::MLID_RECORDS);
$frame = new Frame(); $frame = new Frame();
$manialink->add($frame); $manialink->addChild($frame);
$frame->setPosition($posX, $posY); $frame->setPosition($posX, $posY);
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setVAlign($backgroundQuad::TOP); $backgroundQuad->setVerticalAlign($backgroundQuad::TOP);
$adjustOuterBorder = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_ADJUST_OUTER_BORDER); $adjustOuterBorder = $this->maniaControl->getSettingManager()->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);
@ -246,7 +246,7 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
$backgroundQuad->setAction(self::ACTION_SHOW_RECORDSLIST); $backgroundQuad->setAction(self::ACTION_SHOW_RECORDSLIST);
$titleLabel = new Label(); $titleLabel = new Label();
$frame->add($titleLabel); $frame->addChild($titleLabel);
$titleLabel->setPosition(0, $lineHeight * -0.9); $titleLabel->setPosition(0, $lineHeight * -0.9);
$titleLabel->setWidth($width); $titleLabel->setWidth($width);
$titleLabel->setStyle($labelStyle); $titleLabel->setStyle($labelStyle);
@ -263,16 +263,16 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
$y = -8. - $index * $lineHeight; $y = -8. - $index * $lineHeight;
$recordFrame = new Frame(); $recordFrame = new Frame();
$frame->add($recordFrame); $frame->addChild($recordFrame);
$recordFrame->setPosition(0, $y); $recordFrame->setPosition(0, $y);
/* /*
* $backgroundQuad = new Quad(); $recordFrame->add($backgroundQuad); $backgroundQuad->setSize($width * 1.04, $lineHeight * 1.4); $backgroundQuad->setStyles($quadStyle, $quadSubstyle); * $backgroundQuad = new Quad(); $recordFrame->addChild($backgroundQuad); $backgroundQuad->setSize($width * 1.04, $lineHeight * 1.4); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
*/ */
$rankLabel = new Label(); $rankLabel = new Label();
$recordFrame->add($rankLabel); $recordFrame->addChild($rankLabel);
$rankLabel->setHAlign($rankLabel::LEFT); $rankLabel->setHorizontalAlign($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);
@ -281,8 +281,8 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
$rankLabel->setTextEmboss(true); $rankLabel->setTextEmboss(true);
$nameLabel = new Label(); $nameLabel = new Label();
$recordFrame->add($nameLabel); $recordFrame->addChild($nameLabel);
$nameLabel->setHAlign($nameLabel::LEFT); $nameLabel->setHorizontalAlign($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);
@ -290,8 +290,8 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
$nameLabel->setTextEmboss(true); $nameLabel->setTextEmboss(true);
$timeLabel = new Label(); $timeLabel = new Label();
$recordFrame->add($timeLabel); $recordFrame->addChild($timeLabel);
$timeLabel->setHAlign($timeLabel::RIGHT); $timeLabel->setHorizontalAlign($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);
@ -566,7 +566,7 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
// Main frame // Main frame
$frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging); $frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging);
$maniaLink->add($frame); $maniaLink->addChild($frame);
// Start offsets // Start offsets
$posX = -$width / 2; $posX = -$width / 2;
@ -574,11 +574,11 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
// Predefine Description Label // Predefine Description Label
$descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel(); $descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel();
$frame->add($descriptionLabel); $frame->addChild($descriptionLabel);
// Headline // Headline
$headFrame = new Frame(); $headFrame = new Frame();
$frame->add($headFrame); $frame->addChild($headFrame);
$headFrame->setY($posY - 5); $headFrame->setY($posY - 5);
$array = array('Rank' => $posX + 5, 'Nickname' => $posX + 18, 'Login' => $posX + 70, 'Time' => $posX + 101); $array = array('Rank' => $posX + 5, 'Nickname' => $posX + 18, 'Login' => $posX + 70, 'Time' => $posX + 101);
$this->maniaControl->getManialinkManager()->labelLine($headFrame, $array); $this->maniaControl->getManialinkManager()->labelLine($headFrame, $array);
@ -590,17 +590,17 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
foreach ($records as $listRecord) { foreach ($records as $listRecord) {
if ($index % 15 === 0) { if ($index % 15 === 0) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$posY = $height / 2 - 10; $posY = $height / 2 - 10;
$paging->addPage($pageFrame); $paging->addPage($pageFrame);
} }
$recordFrame = new Frame(); $recordFrame = new Frame();
$pageFrame->add($recordFrame); $pageFrame->addChild($recordFrame);
if ($index % 2 !== 0) { if ($index % 2 !== 0) {
$lineQuad = new Quad_BgsPlayerCard(); $lineQuad = new Quad_BgsPlayerCard();
$recordFrame->add($lineQuad); $recordFrame->addChild($lineQuad);
$lineQuad->setSize($width, 4); $lineQuad->setSize($width, 4);
$lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig); $lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig);
$lineQuad->setZ(0.001); $lineQuad->setZ(0.001);

View File

@ -493,7 +493,7 @@ class ServerRankingPlugin implements Plugin, CallbackListener, CommandListener {
// Main frame // Main frame
$frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging); $frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging);
$maniaLink->add($frame); $maniaLink->addChild($frame);
// Start offsets // Start offsets
$posX = -$width / 2; $posX = -$width / 2;
@ -501,11 +501,11 @@ class ServerRankingPlugin implements Plugin, CallbackListener, CommandListener {
//Predefine description Label //Predefine description Label
$descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel(); $descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel();
$frame->add($descriptionLabel); $frame->addChild($descriptionLabel);
// Headline // Headline
$headFrame = new Frame(); $headFrame = new Frame();
$frame->add($headFrame); $frame->addChild($headFrame);
$headFrame->setY($posY - 5); $headFrame->setY($posY - 5);
$array = array('$oRank' => $posX + 5, '$oNickname' => $posX + 18, '$oAverage' => $posX + 70); $array = array('$oRank' => $posX + 5, '$oNickname' => $posX + 18, '$oAverage' => $posX + 70);
$this->maniaControl->getManialinkManager()->labelLine($headFrame, $array); $this->maniaControl->getManialinkManager()->labelLine($headFrame, $array);
@ -517,18 +517,18 @@ class ServerRankingPlugin implements Plugin, CallbackListener, CommandListener {
while ($rankedPlayer = $result->fetch_object()) { while ($rankedPlayer = $result->fetch_object()) {
if ($index % 15 === 1) { if ($index % 15 === 1) {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->addChild($pageFrame);
$posY = $height / 2 - 10; $posY = $height / 2 - 10;
$paging->addPage($pageFrame); $paging->addPage($pageFrame);
} }
$playerFrame = new Frame(); $playerFrame = new Frame();
$pageFrame->add($playerFrame); $pageFrame->addChild($playerFrame);
$playerFrame->setY($posY); $playerFrame->setY($posY);
if ($index % 2 !== 0) { if ($index % 2 !== 0) {
$lineQuad = new Quad_BgsPlayerCard(); $lineQuad = new Quad_BgsPlayerCard();
$playerFrame->add($lineQuad); $playerFrame->addChild($lineQuad);
$lineQuad->setSize($width, 4); $lineQuad->setSize($width, 4);
$lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig); $lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig);
$lineQuad->setZ(0.001); $lineQuad->setZ(0.001);

View File

@ -169,17 +169,14 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
*/ */
private function displayWidgets() { private function displayWidgets() {
// Display Map Widget // Display Map Widget
if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MAP_WIDGET_ACTIVATED) if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MAP_WIDGET_ACTIVATED)) {
) {
$this->maniaControl->getClient()->triggerModeScriptEvent("Siege_SetProgressionLayerPosition", array("160.", "-67.", "0.")); $this->maniaControl->getClient()->triggerModeScriptEvent("Siege_SetProgressionLayerPosition", array("160.", "-67.", "0."));
$this->displayMapWidget(); $this->displayMapWidget();
} }
if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_CLOCK_WIDGET_ACTIVATED) if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_CLOCK_WIDGET_ACTIVATED)) {
) {
$this->displayClockWidget(); $this->displayClockWidget();
} }
if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_SERVERINFO_WIDGET_ACTIVATED) if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_SERVERINFO_WIDGET_ACTIVATED)) {
) {
$this->displayServerInfoWidget(); $this->displayServerInfoWidget();
} }
} }
@ -203,13 +200,13 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
// mainframe // mainframe
$frame = new Frame(); $frame = new Frame();
$maniaLink->add($frame); $maniaLink->addChild($frame);
$frame->setSize($width, $height); $frame->setSize($width, $height);
$frame->setPosition($posX, $posY); $frame->setPosition($posX, $posY);
// Background Quad // Background Quad
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setSize($width, $height); $backgroundQuad->setSize($width, $height);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
//$backgroundQuad->addMapInfoFeature(); //$backgroundQuad->addMapInfoFeature();
@ -217,7 +214,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$map = $this->maniaControl->getMapManager()->getCurrentMap(); $map = $this->maniaControl->getMapManager()->getCurrentMap();
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setPosition(0, 1.5, 0.2); $label->setPosition(0, 1.5, 0.2);
$label->setTextSize(1.3); $label->setTextSize(1.3);
$label->setText(Formatter::stripDirtyCodes($map->name)); $label->setText(Formatter::stripDirtyCodes($map->name));
@ -225,7 +222,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$label->setSize($width - 5, $height); $label->setSize($width - 5, $height);
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setPosition(0, -1.4, 0.2); $label->setPosition(0, -1.4, 0.2);
$label->setTextSize(1); $label->setTextSize(1);
$label->setScale(0.8); $label->setScale(0.8);
@ -235,9 +232,9 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
if (isset($map->mx->pageurl)) { if (isset($map->mx->pageurl)) {
$quad = new Quad(); $quad = new Quad();
$frame->add($quad); $frame->addChild($quad);
$quad->setImageFocus($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON_MOVER)); $quad->setImageFocusUrl($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON_MOVER));
$quad->setImage($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON)); $quad->setImageUrl($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON));
$quad->setPosition(-$width / 2 + 4, -1.5, -0.5); $quad->setPosition(-$width / 2 + 4, -1.5, -0.5);
$quad->setSize(4, 4); $quad->setSize(4, 4);
$quad->setUrl($map->mx->pageurl); $quad->setUrl($map->mx->pageurl);
@ -264,20 +261,20 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
// mainframe // mainframe
$frame = new Frame(); $frame = new Frame();
$maniaLink->add($frame); $maniaLink->addChild($frame);
$frame->setSize($width, $height); $frame->setSize($width, $height);
$frame->setPosition($posX, $posY); $frame->setPosition($posX, $posY);
// Background Quad // Background Quad
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setSize($width, $height); $backgroundQuad->setSize($width, $height);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setPosition(0, 1.5, 0.2); $label->setPosition(0, 1.5, 0.2);
$label->setVAlign($label::TOP); $label->setVerticalAlign($label::TOP);
$label->setTextSize(1); $label->setTextSize(1);
$label->setTextColor('fff'); $label->setTextColor('fff');
$label->addClockFeature(false); $label->addClockFeature(false);
@ -303,13 +300,13 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
// mainframe // mainframe
$frame = new Frame(); $frame = new Frame();
$maniaLink->add($frame); $maniaLink->addChild($frame);
$frame->setSize($width, $height); $frame->setSize($width, $height);
$frame->setPosition($posX, $posY); $frame->setPosition($posX, $posY);
// Background Quad // Background Quad
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setSize($width, $height); $backgroundQuad->setSize($width, $height);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
@ -322,7 +319,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$maxSpectators = $this->maniaControl->getClient()->getMaxSpectators(); $maxSpectators = $this->maniaControl->getClient()->getMaxSpectators();
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setPosition(0, 1.5, 0.2); $label->setPosition(0, 1.5, 0.2);
$label->setSize($width - 5, $height); $label->setSize($width - 5, $height);
$label->setTextSize(1.3); $label->setTextSize(1.3);
@ -332,39 +329,39 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
// Player Quad / Label // Player Quad / Label
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setPosition(-$width / 2 + 9, -1.5, 0.2); $label->setPosition(-$width / 2 + 9, -1.5, 0.2);
$label->setHAlign($label::LEFT); $label->setHorizontalAlign($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->addChild($quad);
$quad->setSubStyle($quad::SUBSTYLE_Multiplayer); $quad->setSubStyle($quad::SUBSTYLE_Multiplayer);
$quad->setPosition(-$width / 2 + 7, -1.6, 0.2); $quad->setPosition(-$width / 2 + 7, -1.6, 0.2);
$quad->setSize(2.5, 2.5); $quad->setSize(2.5, 2.5);
// Spectator Quad / Label // Spectator Quad / Label
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setPosition(2, -1.5, 0.2); $label->setPosition(2, -1.5, 0.2);
$label->setHAlign($label::LEFT); $label->setHorizontalAlign($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->addChild($quad);
$quad->setSubStyle($quad::SUBSTYLE_Camera); $quad->setSubStyle($quad::SUBSTYLE_Camera);
$quad->setPosition(0, -1.6, 0.2); $quad->setPosition(0, -1.6, 0.2);
$quad->setSize(3.3, 2.5); $quad->setSize(3.3, 2.5);
// Favorite quad // Favorite quad
$quad = new Quad_Icons64x64_1(); $quad = new Quad_Icons64x64_1();
$frame->add($quad); $frame->addChild($quad);
$quad->setSubStyle($quad::SUBSTYLE_StateFavourite); $quad->setSubStyle($quad::SUBSTYLE_StateFavourite);
$quad->setPosition($width / 2 - 4, -1.5, -0.5); $quad->setPosition($width / 2 - 4, -1.5, -0.5);
$quad->setSize(3, 3); $quad->setSize(3, 3);
@ -400,8 +397,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
* Handle Begin Map Callback * Handle Begin Map Callback
*/ */
public function handleOnBeginMap() { public function handleOnBeginMap() {
if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MAP_WIDGET_ACTIVATED) if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MAP_WIDGET_ACTIVATED)) {
) {
$this->displayMapWidget(); $this->displayMapWidget();
} }
$this->closeWidget(self::MLID_NEXTMAP_WIDGET); $this->closeWidget(self::MLID_NEXTMAP_WIDGET);
@ -411,8 +407,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
* Handle End Map Callback * Handle End Map Callback
*/ */
public function handleOnEndMap() { public function handleOnEndMap() {
if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_NEXTMAP_WIDGET_ACTIVATED) if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_NEXTMAP_WIDGET_ACTIVATED)) {
) {
$this->displayNextMapWidget(); $this->displayNextMapWidget();
} }
} }
@ -435,13 +430,13 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
// mainframe // mainframe
$frame = new Frame(); $frame = new Frame();
$maniaLink->add($frame); $maniaLink->addChild($frame);
$frame->setSize($width, $height); $frame->setSize($width, $height);
$frame->setPosition($posX, $posY); $frame->setPosition($posX, $posY);
// Background Quad // Background Quad
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->addChild($backgroundQuad);
$backgroundQuad->setSize($width, $height); $backgroundQuad->setSize($width, $height);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
@ -470,7 +465,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
} }
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setPosition(0, $height / 2 - 2.3, 0.2); $label->setPosition(0, $height / 2 - 2.3, 0.2);
$label->setTextSize(1); $label->setTextSize(1);
$label->setText('Next Map'); $label->setText('Next Map');
@ -478,7 +473,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$label->setStyle($labelStyle); $label->setStyle($labelStyle);
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setPosition(0, $height / 2 - 5.5, 0.2); $label->setPosition(0, $height / 2 - 5.5, 0.2);
$label->setTextSize(1.3); $label->setTextSize(1.3);
$label->setText($name); $label->setText($name);
@ -486,7 +481,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
$label->setSize($width - 5, $height); $label->setSize($width - 5, $height);
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setPosition(0, -$height / 2 + 4); $label->setPosition(0, -$height / 2 + 4);
$label->setZ(0.2); $label->setZ(0.2);
$label->setTextSize(1); $label->setTextSize(1);
@ -496,7 +491,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
if ($requester) { if ($requester) {
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->addChild($label);
$label->setPosition(0, -$height / 2 + 2, 0.2); $label->setPosition(0, -$height / 2 + 2, 0.2);
$label->setTextSize(1); $label->setTextSize(1);
$label->setScale(0.7); $label->setScale(0.7);
@ -516,16 +511,13 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
*/ */
public function handlePlayerConnect(Player $player) { public function handlePlayerConnect(Player $player) {
// Display Map Widget // Display Map Widget
if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MAP_WIDGET_ACTIVATED) if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MAP_WIDGET_ACTIVATED)) {
) {
$this->displayMapWidget($player->login); $this->displayMapWidget($player->login);
} }
if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_CLOCK_WIDGET_ACTIVATED) if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_CLOCK_WIDGET_ACTIVATED)) {
) {
$this->displayClockWidget($player->login); $this->displayClockWidget($player->login);
} }
if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_SERVERINFO_WIDGET_ACTIVATED) if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_SERVERINFO_WIDGET_ACTIVATED)) {
) {
$this->displayServerInfoWidget(); $this->displayServerInfoWidget();
} }
} }
@ -545,8 +537,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
* Update Widget on certain callbacks * Update Widget on certain callbacks
*/ */
public function updateWidgets() { public function updateWidgets() {
if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_SERVERINFO_WIDGET_ACTIVATED) if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_SERVERINFO_WIDGET_ACTIVATED)) {
) {
$this->displayServerInfoWidget(); $this->displayServerInfoWidget();
} }
} }