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

View File

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

View File

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

View File

@ -156,7 +156,7 @@ class HelpManager implements CommandListener, CallbackListener {
// Main frame
$frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging);
$maniaLink->add($frame);
$maniaLink->addChild($frame);
// Start offsets
$posX = -$width / 2;
@ -164,11 +164,11 @@ class HelpManager implements CommandListener, CallbackListener {
//Predefine description Label
$descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel();
$frame->add($descriptionLabel);
$frame->addChild($descriptionLabel);
// Headline
$headFrame = new Frame();
$frame->add($headFrame);
$frame->addChild($headFrame);
$headFrame->setY($posY - 5);
$array = array('Command' => $posX + 5, 'Description' => $posX + 50);
$this->maniaControl->getManialinkManager()->labelLine($headFrame, $array);
@ -180,18 +180,18 @@ class HelpManager implements CommandListener, CallbackListener {
foreach ($commands as $command) {
if ($index % 15 === 1) {
$pageFrame = new Frame();
$frame->add($pageFrame);
$frame->addChild($pageFrame);
$posY = $height / 2 - 10;
$paging->addPage($pageFrame);
$paging->addPage($pageFrame); //TODO @Jocy
}
$playerFrame = new Frame();
$pageFrame->add($playerFrame);
$pageFrame->addChild($playerFrame);
$playerFrame->setY($posY);
if ($index % 2 !== 0) {
$lineQuad = new Quad_BgsPlayerCard();
$playerFrame->add($lineQuad);
$playerFrame->addChild($lineQuad);
$lineQuad->setSize($width, 4);
$lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig);
$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_UIConstruction_Buttons;
use FML\ManiaLink;
use FML\Script\Script;
use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
@ -198,25 +197,25 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn
$manialink = new ManiaLink(ManialinkManager::MAIN_MLID);
$frame = new Frame();
$manialink->add($frame);
$manialink->addChild($frame);
$frame->setPosition($menuPosX, $menuPosY, ManialinkManager::MAIN_MANIALINK_Z_VALUE);
$backgroundQuad = new Quad();
$frame->add($backgroundQuad);
$frame->addChild($backgroundQuad);
$backgroundQuad->setZ(-1)->setSize($menuWidth, $menuHeight)->setStyles($quadStyle, $quadSubstyle);
$menuItemsFrame = new Frame();
$frame->add($menuItemsFrame);
$frame->addChild($menuItemsFrame);
$menuItemsFrame->setX($menuWidth * -0.5 + $menuListWidth * 0.5);
$menuItemsFrame->setZ(-1);
$itemsBackgroundQuad = new Quad();
$menuItemsFrame->add($itemsBackgroundQuad);
$menuItemsFrame->addChild($itemsBackgroundQuad);
$backgroundQuad->setZ(-1);
$itemsBackgroundQuad->setSize($menuListWidth, $menuHeight)->setStyles($quadStyle, $quadSubstyle);
$menusFrame = new Frame();
$frame->add($menusFrame);
$frame->addChild($menusFrame);
$menusFrame->setX($menuWidth * -0.5 + $menuListWidth + $subMenuWidth * 0.5);
// Create script and features
@ -227,7 +226,7 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn
foreach ($this->menus as $menu) {
// Add title
$menuItemLabel = new Label_Text();
$frame->add($menuItemLabel);
$frame->addChild($menuItemLabel);
$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);
@ -235,7 +234,7 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn
if ($menuId === $menuIdShown) {
$menuControl = $menu->getMenu($subMenuWidth, $subMenuHeight, $script, $player);
if ($menuControl) {
$menusFrame->add($menuControl);
$menusFrame->addChild($menuControl);
} else {
$this->maniaControl->getChat()->sendError('Error loading Menu!', $player);
}
@ -247,17 +246,17 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn
// Add Close Quad (X)
$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);
// Add close button
$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);
// Add save button
$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);
return $manialink;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -170,27 +170,27 @@ class StyleManager {
// Background Quad
$backgroundQuad = new Quad();
$frame->add($backgroundQuad);
$frame->addChild($backgroundQuad);
$backgroundQuad->setZ(-2)->setSize($width, $height)->setStyles($quadStyle, $quadSubstyle);
// Add Close Quad (X)
$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);
if ($script) {
$pagerSize = 6.;
$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);
$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);
$pageCountLabel = new Label_Text();
$frame->add($pageCountLabel);
$pageCountLabel->setHAlign($pageCountLabel::RIGHT)->setPosition($width * 0.40, $height * -0.44, 1)->setStyle($pageCountLabel::STYLE_TextTitle1)->setTextSize(1.3);
$frame->addChild($pageCountLabel);
$pageCountLabel->setHorizontalAlign($pageCountLabel::RIGHT)->setPosition($width * 0.40, $height * -0.44, 1)->setStyle($pageCountLabel::STYLE_TextTitle1)->setTextSize(1.3);
if ($paging) {
$paging->addButtonControl($pagerNext)->addButtonControl($pagerPrev)->setLabel($pageCountLabel);

View File

@ -128,7 +128,7 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
$paging = new Paging();
$script->addFeature($paging);
$frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging);
$maniaLink->add($frame);
$maniaLink->addChild($frame);
$width = $this->maniaControl->getManialinkManager()->getStyleManager()->getListWidgetsWidth();
$height = $this->maniaControl->getManialinkManager()->getStyleManager()->getListWidgetsHeight();
@ -137,11 +137,11 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
$pageFrame = null;
$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);
$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);
if (!$isInMapsFolder) {
@ -150,21 +150,21 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
}
$directoryLabel = new Label_Text();
$frame->add($directoryLabel);
$frame->addChild($directoryLabel);
$dataFolder = $this->maniaControl->getServer()->getDirectory()->getGameDataFolder();
$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();
$frame->add($tooltipLabel);
$tooltipLabel->setPosition($width * -0.48, $height * -0.44)->setSize($width * 0.8, 5)->setHAlign($tooltipLabel::LEFT)->setTextSize(1)->setText('tooltip');
$frame->addChild($tooltipLabel);
$tooltipLabel->setPosition($width * -0.48, $height * -0.44)->setSize($width * 0.8, 5)->setHorizontalAlign($tooltipLabel::LEFT)->setTextSize(1)->setText('tooltip');
$mapFiles = $this->scanMapFiles($folderPath);
if (is_array($mapFiles)) {
if (empty($mapFiles)) {
$emptyLabel = new Label();
$frame->add($emptyLabel);
$frame->addChild($emptyLabel);
$emptyLabel->setY(20)->setTextColor('aaa')->setText('No files found.')->setTranslate(true);
} else {
$canAddMaps = $this->maniaControl->getAuthenticationManager()->checkPermission($player, MapManager::SETTING_PERMISSION_ADD_MAP);
@ -176,27 +176,27 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
if ($index % 15 === 0) {
// New Page
$pageFrame = new Frame();
$frame->add($pageFrame);
$frame->addChild($pageFrame);
$posY = $height / 2 - 10;
$paging->addPage($pageFrame);
}
// Map Frame
$mapFrame = new Frame();
$pageFrame->add($mapFrame);
$pageFrame->addChild($mapFrame);
$mapFrame->setY($posY);
if ($index % 2 === 0) {
// Striped background line
$lineQuad = new Quad_BgsPlayerCard();
$mapFrame->add($lineQuad);
$mapFrame->addChild($lineQuad);
$lineQuad->setZ(-1)->setSize($width, 4)->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig);
}
// File name Label
$nameLabel = new Label_Text();
$mapFrame->add($nameLabel);
$nameLabel->setX($width * -0.48)->setSize($width * 0.79, 4)->setHAlign($nameLabel::LEFT)->setStyle($nameLabel::STYLE_TextCardRaceRank)->setTextSize(1)->setText($fileName);
$mapFrame->addChild($nameLabel);
$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)) {
// Folder
@ -208,14 +208,14 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
if ($canAddMaps) {
// 'Add' button
$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);
}
if ($canEraseMaps) {
// 'Erase' button
$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);
}
}
@ -226,7 +226,7 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
}
} else {
$errorLabel = new Label();
$frame->add($errorLabel);
$frame->addChild($errorLabel);
$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() {
// Menu Open xList
$itemQuad = new Quad();
$itemQuad->setImage($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON));
$itemQuad->setImageFocus($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON_MOVER));
$itemQuad->setImageUrl($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON));
$itemQuad->setImageFocusUrl($this->maniaControl->getManialinkManager()->getIconManager()->getIcon(IconManager::MX_ICON_MOVER));
$itemQuad->setAction(self::ACTION_OPEN_XLIST);
$this->maniaControl->getActionsMenu()->addPlayerMenuItem($itemQuad, 5, 'Open MX List');

View File

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

View File

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

View File

@ -59,160 +59,160 @@ class PlayerDetailed {
$target = $this->maniaControl->getPlayerManager()->getPlayer($targetLogin);
// Create ManiaLink
$maniaLink = new ManiaLink(ManialinkManager::MAIN_MLID);
$script = $maniaLink->getScript();
$manialink = new ManiaLink(ManialinkManager::MAIN_MLID);
$script = $manialink->getScript();
// Main frame
$frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script);
$maniaLink->add($frame);
$manialink->addChild($frame);
// Create script and features
$script = new Script();
$maniaLink->setScript($script);
$manialink->setScript($script);
$posY = $this->height / 2 - 7;
//Nation Quad
$countryQuad = new Quad();
$frame->add($countryQuad);
$countryQuad->setImage("file://ZoneFlags/Login/{$targetLogin}/country");
$frame->addChild($countryQuad);
$countryQuad->setImageUrl("file://ZoneFlags/Login/{$targetLogin}/country");
$countryQuad->setPosition(-$this->width / 2 + 10, $posY);
$countryQuad->setSize(5, 5);
$countryQuad->setZ(-0.1);
$countryQuad->setHAlign($countryQuad::LEFT);
$countryQuad->setHorizontalAlign($countryQuad::LEFT);
//Nickname
$label = new Label_Text();
$frame->add($label);
$frame->addChild($label);
$label->setPosition(-$this->width / 2 + 15, $posY);
$label->setText($target->nickname);
$label->setHAlign($label::LEFT);
$label->setHorizontalAlign($label::LEFT);
//Define MainLabel (Login)
$posY -= 8;
$mainLabel = new Label_Text();
$frame->add($mainLabel);
$frame->addChild($mainLabel);
$mainLabel->setPosition(-$this->width / 2 + 10, $posY);
$mainLabel->setTextSize(1.2);
$mainLabel->setHAlign($mainLabel::LEFT);
$mainLabel->setHorizontalAlign($mainLabel::LEFT);
$mainLabel->setText('Login: ');
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$frame->addChild($label);
$label->setY($posY);
$label->setText('Nation: ');
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$frame->addChild($label);
$label->setY($posY);
$label->setText('Province: ');
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$frame->addChild($label);
$label->setY($posY);
$label->setText('Authorization: ');
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$frame->addChild($label);
$label->setY($posY);
$label->setText("Ladder Rank:");
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$frame->addChild($label);
$label->setY($posY);
$label->setText('Ladder Score: ');
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$frame->addChild($label);
$label->setY($posY);
$label->setText('Inscribed Zone: ');
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$frame->addChild($label);
$label->setY($posY);
$label->setText('Avatar');
//Login
$posY = $this->height / 2 - 15;
$mainLabel = new Label_Text();
$frame->add($mainLabel);
$frame->addChild($mainLabel);
$mainLabel->setPosition(-$this->width / 2 + 30, $posY);
$mainLabel->setText($target->login);
$mainLabel->setTextSize(1.2);
$mainLabel->setHAlign($mainLabel::LEFT);
$mainLabel->setHorizontalAlign($mainLabel::LEFT);
//Country
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$frame->addChild($label);
$label->setY($posY);
$label->setText($target->getCountry());
//Province
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$frame->addChild($label);
$label->setY($posY);
$label->setText($target->getProvince());
//AuthLevel
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$frame->addChild($label);
$label->setY($posY);
$label->setText($this->maniaControl->getAuthenticationManager()->getAuthLevelName($target->authLevel));
//LadderRank
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$frame->addChild($label);
$label->setY($posY);
$label->setText($target->ladderRank);
//LadderScore
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$frame->addChild($label);
$label->setY($posY);
$label->setText(round($target->ladderScore, 2));
//Played Since
$posY -= 5;
$label = clone $mainLabel;
$frame->add($label);
$frame->addChild($label);
$label->setY($posY);
$label->setText(date('d M Y', time() - 3600 * 24 * $target->daysSinceZoneInscription));
$quad = new Quad();
$frame->add($quad);
$quad->setImage('file://Avatars/' . $targetLogin . "/default");
$frame->addChild($quad);
$quad->setImageUrl('file://Avatars/' . $targetLogin . "/default");
$quad->setPosition(-$this->width / 2 + 50, -$this->height / 2 + 34);
$quad->setAlign($quad::RIGHT, $quad::TOP);
$quad->setSize(20, 20);
//Statistics
$frame->add($this->statisticsFrame($target));
$frame->addChild($this->statisticsFrame($target));
$quad = new Label_Button();
$frame->add($quad);
$frame->addChild($quad);
$quad->setStyle($quad::STYLE_CardMain_Quit);
$quad->setHAlign($quad::LEFT);
$quad->setHorizontalAlign($quad::LEFT);
$quad->setScale(0.75);
$quad->setText('Back');
$quad->setPosition(-$this->width / 2 + 7, -$this->height / 2 + 7);
$quad->setAction(PlayerCommands::ACTION_OPEN_PLAYERLIST);
// 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) {
$lineQuad = new Quad_BgsPlayerCard();
$frame->add($lineQuad);
$frame->addChild($lineQuad);
$lineQuad->setSize(49, 4);
$lineQuad->setSubStyle($lineQuad::SUBSTYLE_BgPlayerCardBig);
$lineQuad->setPosition($posX, $posY, 0.001);
$lineQuad->setHAlign($lineQuad::LEFT);
$lineQuad->setHorizontalAlign($lineQuad::LEFT);
}
$label = new Label_Text();
$frame->add($label);
$frame->addChild($label);
$label->setPosition($posX + 4, $posY);
$label->setText($statProperties->name);
$label->setHAlign($label::LEFT);
$label->setHorizontalAlign($label::LEFT);
$label->setTextSize(1.5);
$label = new Label_Text();
$frame->add($label);
$frame->addChild($label);
$label->setPosition($posX + 40, $posY);
$label->setText($value);
$label->setTextSize(1.5);

View File

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

View File

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

View File

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

View File

@ -258,16 +258,16 @@ class ServerOptionsMenu implements CallbackListener, ConfiguratorMenu, TimerList
// Pagers
$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);
$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);
$pageCountLabel = new Label_Text();
$frame->add($pageCountLabel);
$pageCountLabel->setHAlign($pageCountLabel::RIGHT)->setPosition($width * 0.35, $height * -0.44, 1)->setStyle($pageCountLabel::STYLE_TextTitle1)->setTextSize(2);
$frame->addChild($pageCountLabel);
$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);
@ -285,29 +285,29 @@ class ServerOptionsMenu implements CallbackListener, ConfiguratorMenu, TimerList
if ($index % 13 === 0) {
$pageFrame = new Frame();
$frame->add($pageFrame);
$frame->addChild($pageFrame);
$posY = $height * 0.41;
$paging->addPageControl($pageFrame);
}
$optionsFrame = new Frame();
$pageFrame->add($optionsFrame);
$pageFrame->addChild($optionsFrame);
$optionsFrame->setY($posY);
$nameLabel = new Label_Text();
$optionsFrame->add($nameLabel);
$nameLabel->setHAlign($nameLabel::LEFT)->setX($width * -0.46)->setSize($width * 0.4, $optionHeight)->setStyle($nameLabel::STYLE_TextCardSmall)->setTextSize($labelTextSize)->setText($name)->setTextColor('fff');
$optionsFrame->addChild($nameLabel);
$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)) {
// Boolean checkbox
$quad = new Quad();
$quad->setPosition($width * 0.23, 0, -0.01)->setSize(4, 4);
$checkBox = new CheckBox(self::ACTION_PREFIX_OPTION . $name, $value, $quad);
$optionsFrame->add($checkBox);
$optionsFrame->addChild($checkBox);
} else {
// Other
$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);
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() {
return 'Vote Ratios';
}
/**
* @see \ManiaControl\Configurators\ConfiguratorMenu::getMenu()
* @see \ManiaControl\Configurator\ConfiguratorMenu::getMenu()
*/
public function getMenu($width, $height, Script $script, Player $player) {
$frame = new Frame();
@ -66,15 +66,15 @@ class VoteRatiosMenu implements CallbackListener, ConfiguratorMenu, TimerListene
$voteRatios = $this->maniaControl->getClient()->getCallVoteRatios();
foreach ($voteRatioCommands as $voteRatioCommand => $voteRatioDescription) {
$voteRatioFrame = new Frame();
$frame->add($voteRatioFrame);
$frame->addChild($voteRatioFrame);
$voteRatioFrame->setY($posY);
$nameLabel = new Label_Text();
$voteRatioFrame->add($nameLabel);
$nameLabel->setHAlign($nameLabel::LEFT)->setX($width * -0.46)->setSize($width * 0.7, $lineHeight)->setTextSize(2)->setTranslate(true)->setText($voteRatioDescription);
$voteRatioFrame->addChild($nameLabel);
$nameLabel->setHorizontalAlign($nameLabel::LEFT)->setX($width * -0.46)->setSize($width * 0.7, $lineHeight)->setTextSize(2)->setTranslate(true)->setText($voteRatioDescription);
$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);
$voteRatio = $this->getVoteRatioForCommand($voteRatios, $voteRatioCommand);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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