Пример #1
0
 function onDraw()
 {
     \ManiaLive\Gui\Manialinks::appendXML(Dictionary::getInstance()->getManiaLink(array('yes' => 'yes', 'no' => 'no')));
     $this->yesButton->setAction($this->yesAction);
     $this->noButton->setAction($this->noAction);
     $this->questionLabel->setText($this->questionText);
 }
Пример #2
0
 protected function preFilter()
 {
     if (!$this->isSelected && $this->text->getText()) {
         $this->text->setText(self::$unselectedTextStyle . $this->text->getText());
     }
     $this->text->addLink($this);
     $this->icon->addLink($this);
 }
Пример #3
0
 function onDraw()
 {
     switch ($this->state) {
         case static::STATE_READY:
             $subStyle = '0F0D';
             break;
         case static::STATE_IN_MATCH:
             $subStyle = 'FF0D';
             break;
         case static::STATE_BLOCKED:
             $subStyle = '000D';
             break;
         case static::STATE_NOT_READY:
             $subStyle = 'F00D';
             break;
         default:
             $subStyle = '';
     }
     $this->icon->setSize(1, $this->sizeY);
     $this->icon->setPosition(0, -$this->sizeY / 2);
     $this->label->setPosition(8, -$this->sizeY / 2);
     $this->echelonFrame->setPosition($this->sizeX - 1, 0.5);
     $this->countryFlag->setPosition(2, -$this->sizeY / 2);
     $this->bg->setSize($this->sizeX, $this->sizeY);
     $this->hiddenLabel->setText($this->login);
     $echelon = PlayerInfo::ComputeEchelon($this->ladderPoints);
     $this->icon->setBgcolor($subStyle);
     $this->countryFlag->setImage($this->zoneFlagURL, true);
     $this->echelonLabel->setText($echelon);
     $this->echelonQuad->setImage(sprintf('file://Media/Manialinks/Common/Echelons/echelon%d.dds', $echelon), true);
 }
Пример #4
0
 function __construct()
 {
     $this->setTitle('Memory Graph');
     $this->memoryLimit = intval(str_replace('M', 1024 * 1024, ini_get('memory_limit')));
     if ($this->memoryLimit == -1) {
         $this->memoryLimit = Profiler::MEM_DEFAULT;
     }
     $this->barsFrame = new Frame();
     $this->barsFrame->setLayout(new Line());
     $this->addComponent($this->barsFrame);
     $this->linesFrame = new Frame();
     $this->addComponent($this->linesFrame);
     $heightStep = ($this->sizeY - 6) / 4;
     for ($i = 1; $i <= 4; ++$i) {
         $ui = new Frame();
         $ui->setPosition(0, $i * $heightStep);
         $line = new Quad();
         $line->setBgcolor('fff');
         $line->setSize($this->sizeX - 2, 0.2);
         $ui->addComponent($line);
         $text = new Label();
         $text->setText('$fff0% of total');
         $text->setPosition(3, 3.5);
         $ui->addComponent($text);
         $this->linesFrame->addComponent($ui);
         $this->lines[] = array($line, $text, $ui);
     }
     Dispatcher::register(MonitorEvent::getClass(), $this, MonitorEvent::ON_NEW_MEMORY_VALUE);
 }
 function __construct()
 {
     $this->setTitle('Speed Graph');
     $this->barsFrame = new Frame(1, 1 - $this->sizeY, new Line());
     $this->addComponent($this->barsFrame);
     $this->criticalLineFrame = new Frame(0, 1 + self::RESPONSE_MINIMAL * ($this->sizeY - 6) / self::RESPONSE_OPTIMAL - $this->sizeY);
     $text = new Label(75, 3);
     $text->setTextColor('fff');
     $text->setText('Critical Response Time (1/' . self::RESPONSE_MINIMAL . ' Second)');
     $text->setPosition(3, 3.5);
     $text->setTextSize(2);
     $this->criticalLineFrame->addComponent($text);
     $this->criticalLine = new Quad($this->sizeX - 2, 0.2);
     $this->criticalLine->setBgcolor('a00');
     $this->criticalLine->setPosX(1);
     $this->criticalLine->setValign('center');
     $this->criticalLineFrame->addComponent($this->criticalLine);
     $this->addComponent($this->criticalLineFrame);
     $this->optimalLineFrame = new Frame(0, -5);
     $text = new Label(75, 3);
     $text->setTextColor('fff');
     $text->setText('Optimal Response Time (1/' . self::RESPONSE_OPTIMAL . ' Second)');
     $text->setPosition(3, 3.5);
     $text->setTextSize(2);
     $this->optimalLineFrame->addComponent($text);
     $this->optimalLine = new Quad($this->sizeX - 2, 0.2);
     $this->optimalLine->setBgcolor('0a0');
     $this->optimalLine->setPosX(1);
     $this->optimalLine->setValign('bottom');
     $this->optimalLineFrame->addComponent($this->optimalLine);
     $this->addComponent($this->optimalLineFrame);
     Dispatcher::register(MonitorEvent::getClass(), $this, MonitorEvent::ON_NEW_CPU_VALUE);
 }
Пример #6
0
 function __construct()
 {
     $this->setTitle('Network Graph');
     $this->barsFrame = new Frame();
     $this->barsFrame->setLayout(new Line());
     $this->addComponent($this->barsFrame);
     $this->linesFrame = new Frame();
     $this->addComponent($this->linesFrame);
     $heightStep = ($this->sizeY - 6) / 4;
     for ($i = 1; $i <= 4; ++$i) {
         $ui = new Frame();
         $ui->setPosition(0, $i * $heightStep);
         $line = new Quad();
         $line->setBgcolor('fff');
         $line->setSize($this->sizeX - 2, 0.2);
         $ui->addComponent($line);
         $text = new Label();
         $text->setText('$fff0 kb/s');
         $text->setPosition(3, 3.5);
         $ui->addComponent($text);
         $this->linesFrame->addComponent($ui);
         $this->lines[] = array($line, $text, $ui);
     }
     Dispatcher::register(MonitorEvent::getClass(), $this, MonitorEvent::ON_NEW_NETWORK_VALUE);
 }
Пример #7
0
 protected function preFilter()
 {
     $this->subTitle->setText('$o$999' . $this->subTitle->getText());
     if ($this->showQuitButton) {
         $this->quitButton->text->setText('$09f' . $this->quitButton->text->getText());
         $this->quitButton->text->setPosX($this->quitButton->text->getPosX() - 1);
         $this->addCardElement($this->quitButton);
     }
 }
Пример #8
0
 function preFilter()
 {
     foreach ($this->data as $data) {
         $ui = new Label($this->sizeX - $this->cardElementsPosX * 2, 6);
         $ui->setText(self::formatLine(Arrays::get($data, 0, ''), Arrays::get($data, 1, '')));
         $this->addCardElement($ui);
     }
     $this->setSizeY($this->sizeY + count($this->data) * 6 + 6);
 }
Пример #9
0
 function display()
 {
     $ui = new \ManiaLib\Gui\Cards\Navigation\Menu();
     $ui->title->setText(\ManiaHost\Config::getInstance()->appName);
     $ui->subTitle->setText('Powered by ManiaHost');
     $manialink = $this->request->createLinkArgList('../');
     $ui->quitButton->text->setText('Back');
     $ui->quitButton->setManialink($manialink);
     $ui->save();
     $ui = new \ManiaLib\Gui\Cards\Panel(90, 70);
     $ui->title->setText('Duration');
     $ui->titleBg->setSubStyle(Bgs1::BgTitle3_5);
     $ui->setPosX(-5);
     $ui->setValign('center');
     $ui->save();
     Manialink::beginFrame(40, 7, 0.1);
     $ui = new Label(85);
     $ui->setHalign('center');
     $ui->setStyle(Label::TextTips);
     $ui->enableAutonewline();
     $ui->setText('How long do you want to rent server?');
     $ui->save();
     $ui = new Label(25);
     $ui->setAlign('right', 'bottom');
     $ui->setStyle(Label::TextInfoSmall);
     $ui->setPosition(-2, -14);
     $ui->setText('Days');
     $ui->save();
     $ui = new Entry(10, 4.5);
     $ui->setValign('bottom');
     $ui->setPosition(2, -14);
     $ui->setName('days');
     $ui->save();
     $this->request->set('days', 'days');
     $ui = new Label(25);
     $ui->setAlign('right', 'bottom');
     $ui->setStyle(Label::TextInfoSmall);
     $ui->setPosition(-2, -23);
     $ui->setText('Hours');
     $ui->save();
     $ui = new Entry(10, 4.5);
     $ui->setValign('bottom');
     $ui->setPosition(2, -23);
     $ui->setName('hours');
     $ui->save();
     $this->request->set('hours', 'hours');
     $manialink = $this->request->createLink('../rent-server/');
     $ui = new Button();
     $ui->setHalign('center');
     $ui->setPosY(-30);
     $ui->setStyle(Button::CardButtonMediumWide);
     $ui->setText('Go to configuration');
     $ui->setManialink($manialink);
     $ui->save();
     Manialink::endFrame();
 }
 function onDraw()
 {
     $this->icon->setImage($this->avatarUrl, true);
     $this->icon->setPosition(0.75, -10);
     $this->label->setText($this->nickname);
     $this->rankLabel->setText(sprintf('%s: %d', $this->zone, $this->rank));
     $this->countryFlag->setImage($this->countryFlagUrl, true);
     $this->echelonQuad->setImage(sprintf('file://Media/Manialinks/Common/Echelons/echelon%d.dds', $this->echelon), true);
     $this->echelonLabel->setText($this->echelon);
 }
Пример #11
0
 protected function onConstruct()
 {
     $ui = new Bgs1InRace(40, 5.5);
     $ui->setSubStyle(Bgs1InRace::BgCardList);
     $ui->setHalign('center');
     $this->addComponent($ui);
     $ui = new Label(38, 5);
     $ui->setStyle(Label::TrackerTextBig);
     $ui->setHalign('center');
     $ui->setPosition(0, -1);
     $ui->setText('Free spot. Have fun !');
     $this->addComponent($ui);
     $this->setPosition(Config::getInstance()->posX, Config::getInstance()->posY - 29.5);
 }
Пример #12
0
 function __construct($name = '', $sizeX = 30, $sizeY = 6)
 {
     $this->sizeX = $sizeX;
     $this->sizeY = $sizeY;
     $this->background = new Bgs1($sizeX, $sizeY);
     $this->background->setSubStyle(Bgs1::NavButtonBlink);
     $this->addComponent($this->background);
     $label = new Label();
     $label->setStyle(Label::TextCardSmallScores2Rank);
     $label->setAlign('left', 'center2');
     $label->setPosition(1, -$sizeY / 2);
     $label->setText('$i' . $name);
     $this->addComponent($label);
 }
Пример #13
0
 function __construct($modeName, $subStyle)
 {
     $this->setSize(20, 20);
     $this->background = new Bgs1InRace(20, 20);
     $this->addComponent($this->background);
     $ui = new Label(20);
     $ui->setText($modeName);
     $ui->setPosition(10, -1);
     $ui->setHalign('center');
     $this->addComponent($ui);
     $ui = new Icons128x32_1(13);
     $ui->setAlign('center', 'center');
     $ui->setPosition(10, -13);
     $ui->setSubStyle($subStyle);
     $this->addComponent($ui);
 }
Пример #14
0
 public function display()
 {
     $manialink = $this->request->createLink('/rent/');
     $ui = new \ManiaLib\Gui\Cards\Navigation\Menu();
     $ui->title->setText(\ManiaHost\Config::getInstance()->appName);
     $ui->quitButton->setManialink($manialink);
     $ui->subTitle->setText('Admin panel');
     $manialink = $this->request->createLink('/admin/');
     $ui->addItem();
     $ui->lastItem->text->setText('Incomes');
     $ui->lastItem->icon->setSubStyle(Icons128x128_1::Coppers);
     $ui->lastItem->setManialink($manialink);
     $ui->addItem();
     $ui->lastItem->text->setText('Servers Audience');
     $ui->lastItem->icon->setSubStyle(Icons128x128_1::Statistics);
     $ui->lastItem->setSelected();
     $ui->save();
     Manialink::beginFrame(32, 40);
     $ui = new Panel(100, 90);
     $ui->setHalign('center');
     +$ui->title->setText('Server list');
     $ui->save();
     $ui = new Label(100);
     $ui->setHalign('center');
     $ui->setPosition(0, -23, 0.1);
     $ui->setStyle(Label::TextTips);
     $ui->setText('Choose a server');
     $ui->save();
     $layout = new \ManiaLib\Gui\Layouts\VerticalFlow(30, 50);
     Manialink::beginFrame(-40, -30, 0.1, 1, $layout);
     foreach ($this->response->servers as $server) {
         $this->request->set('serverLogin', $server);
         $manialink = $this->request->createLink('../server-audience/');
         $this->request->restore('serverLogin');
         $ui = new Label(30, 7);
         $ui->setText($server);
         $ui->setStyle(Label::TextCardMedium);
         $ui->setManialink($manialink);
         $ui->save();
     }
     Manialink::endFrame();
     $ui = $this->response->multipage;
     $ui->pageNavigator->setPosition(0, -85, 0.1);
     $ui->savePageNavigator();
     Manialink::endFrame();
 }
Пример #15
0
 static function Add($player)
 {
     if (!isset(self::$labelsByLogin[$player->login])) {
         if (count(self::$labelsByLogin) > 0 && count(self::$labelsByLogin) % 8 == 0) {
             self::$background->setSizeX(self::$background->getSizeX() + 31);
             self::$queuedPlayers->setPosX(self::$queuedPlayers->getPosX() - 15.5);
             $separator = new Bgs1InRace(0.6, 28);
             $separator->setSubStyle(Bgs1InRace::Glow);
             $separator->setPosY(2);
             self::$columnSeparators[] = $separator;
             self::$queuedPlayers->addComponent($separator);
         }
         $ui = new Label(30, 3);
         $ui->setStyle(Label::TextPlayerCardName);
         $ui->setText($player->nickName);
         self::$labelsByLogin[$player->login] = $ui;
         self::$queuedPlayers->addComponent($ui);
         self::$queuedPlayers->redraw();
     }
 }
Пример #16
0
 static function displayErrorPage()
 {
     Manialink::load();
     Manialink::beginFrame(-70, 35, 0.1);
     $ui = new Bgs1InRace(143, 63);
     $ui->setSubStyle(Bgs1InRace::Shadow);
     $ui->save();
     $ui = new \ManiaLib\Gui\Elements\Quad(140, 60);
     $ui->setPosition(1.5, -1.5, 0.1);
     $ui->setBgcolor('fffe');
     $ui->save();
     $ui = new Label(110);
     $ui->setPosition(6, -6, 0.2);
     $ui->setStyle(Label::TextButtonMedium);
     $ui->setText('' . 'Please update maniaplanet');
     $ui->save();
     $ui = new Label(131);
     $ui->setPosition(6, -13, 0.2);
     $ui->enableAutonewline();
     $ui->setStyle(Label::TextTips);
     $ui->setText('You cannot display this content because your Maniaplanet ' . 'version is not up-to-date. Please update Maniaplanet to ' . 'the latest version. While it should be automatic, you can ' . 'find help and more information on the Maniaplanet Wiki: ');
     $ui->save();
     $ui = new Label(131);
     $ui->setAlign('center', 'center');
     $ui->setPosition(71.5, -35, 0.2);
     $ui->setStyle(Label::TextChallengeNameMedalNone);
     $ui->setUrl('http://wiki.maniaplanet.com/en/Changelog');
     $ui->setText('wiki.maniaplanet.com/en/Changelog');
     $ui->save();
     $ui = new Label(131);
     $ui->setValign('bottom');
     $ui->setPosition(5, -57, 0.2);
     $ui->enableAutonewline();
     $ui->setStyle(Label::TextTips);
     $ui->setText('Thank you for your understanding,' . "\n" . 'Nadeo Team');
     $ui->save();
     Manialink::endFrame();
     Manialink::render();
 }
Пример #17
0
 function __construct($name = '', $sizeX = 30, $sizeY = 6)
 {
     $this->sizeX = $sizeX;
     $this->sizeY = $sizeY;
     $this->container = new Frame(-$sizeX, 0, new Column(0, 0, Column::DIRECTION_DOWN));
     $this->container->setVisibility(false);
     $this->addComponent($this->container);
     $this->background = new Bgs1();
     $this->background->setSize($sizeX, $sizeY);
     $this->background->setSubStyle(Bgs1::NavButton);
     $this->addComponent($this->background);
     $this->icon = new Icons128x128_1();
     $this->icon->setVisibility(false);
     $this->icon->setValign('center');
     $this->icon->setPosition(0.3, -$sizeY / 2);
     $this->addComponent($this->icon);
     $label = new Label();
     $label->setStyle(Label::TextCardSmallScores2Rank);
     $label->setAlign('right', 'center2');
     $label->setPosition($sizeX - 2, -$sizeY / 2);
     $label->setText($name);
     $this->addComponent($label);
 }
Пример #18
0
 function display()
 {
     Manialink::load();
     $ui = new Panel($this->width, $this->height);
     $ui->setAlign('center', 'center');
     $ui->title->setStyle(Label::TextTitleError);
     $ui->titleBg->setSubStyle(Bgs1::BgTitle2);
     $ui->title->setText('Error');
     $ui->save();
     $ui = new Label($this->width - 4);
     $ui->enableAutonewline();
     $ui->setAlign('center', 'center');
     $ui->setPosition(0, -5, 1);
     $ui->setText($this->message);
     $ui->save();
     $ui = new Button();
     $ui->setText($this->response->errorButtonMessage ?: 'Back');
     $ui->setManiazone($this->response->errorManialink ?: $this->response->backLink);
     $ui->setPosition(0, -($this->height / 2) + 12, 1);
     $ui->setHalign('center');
     $ui->save();
     Manialink::render();
 }
Пример #19
0
 function display()
 {
     Manialink::appendScript('main() {');
     $this->request->set('name', 'name');
     $this->request->set('comment', 'comment');
     $this->request->set('maxPlayer', 'maxPlayer');
     switch ($this->response->gameMode) {
         case GameInfos::GAMEMODE_ROUNDS:
             $this->request->set('roundsPointLimit', 'roundsPointLimit');
             break;
         case GameInfos::GAMEMODE_TIMEATTACK:
             $this->request->set('timeLimit', 'timeLimit');
             break;
         case GameInfos::GAMEMODE_TEAM:
             $this->request->set('teamPointLimit', 'teamPointLimit');
             break;
         case GameInfos::GAMEMODE_LAPS:
             $this->request->set('lapsTimeLimit', 'lapsTimeLimit');
             $this->request->set('lapsNumber', 'lapsNumber');
             break;
         case GameInfos::GAMEMODE_CUP:
             $this->request->set('cupPointLimit', 'cupPointLimit');
             $this->request->set('rounds', 'rounds');
             $this->request->set('winners', 'winners');
             break;
         case GameInfos::GAMEMODE_STUNTS:
             $this->request->set('timeLimit', 'timeLimit');
             break;
     }
     $this->request->set('gameMode', $this->response->gameMode);
     $this->request->set('passwordPlayer', 'passwordPlayer');
     $this->request->set('maxSpec', 'maxSpec');
     $this->request->set('passwordSpec', 'passwordSpec');
     if ($this->response->gameMode == GameInfos::GAMEMODE_CUP) {
         $this->request->set('cupWarmup', 'cupWarmup');
     } else {
         $this->request->set('defaultWarmup', 'defaultWarmup');
     }
     $this->request->set('callVoteThreshold', 'callVoteThreshold');
     $this->request->set('callVoteDuration', 'callVoteDuration');
     $this->request->set('chatTime', 'chatTime');
     $ui = new \ManiaLib\Gui\Cards\Navigation\Menu();
     $ui->title->setText(\ManiaHost\Config::getInstance()->appName);
     $ui->subTitle->setText('Powered by ManiaHost');
     $manialink = $this->request->createLink('../select-duration');
     $ui->quitButton->text->setText('Back');
     $ui->quitButton->setManialink($manialink);
     $ui->save();
     Manialink::beginFrame(0, 60);
     $ui = new \ManiaLib\Gui\Cards\Panel(85, 110);
     $ui->setAlign('center');
     $ui->titleBg->setSubStyle(Bgs1::BgTitle3_5);
     $ui->title->setText('Server parameters');
     $ui->save();
     Manialink::beginFrame(0, -24.5, 0.5);
     $ui = new Label(80);
     $ui->setHalign('center');
     $ui->setStyle(Label::TextTips);
     $ui->setText('Game Name');
     $ui->save();
     $ui = new Entry(69);
     $ui->setAlign('center', 'bottom');
     $ui->setPosY(-10.5);
     $ui->setName('name');
     $ui->setDefault($this->response->name);
     $ui->save();
     $ui = new Label(80);
     $ui->setHalign('center');
     $ui->setPosY(-12);
     $ui->setStyle(Label::TextTips);
     $ui->setText('Comment');
     $ui->save();
     $ui = new Entry(69, 18);
     $ui->setPosition(-34.5, -16);
     $ui->setName('comment');
     $ui->setDefault($this->response->comment);
     $ui->save();
     $ui = new Label(80);
     $ui->setAlign('right', 'bottom');
     $ui->setPosition(-2, -40);
     $ui->setText('Max players');
     $ui->save();
     $ui = new Entry(9, 5);
     $ui->setValign('bottom');
     $ui->setPosition(2, -40);
     $ui->setName('maxPlayer');
     $ui->setDefault($this->response->maxPlayer);
     $ui->setStyle(Label::TextValueSmall);
     $ui->save();
     $this->request->set('maxPlayer', 'maxPlayer');
     $ui = new UIConstructionSimple_Buttons(7, 7);
     $ui->setSubStyle(UIConstructionSimple_Buttons::Help);
     $ui->setValign('bottom');
     $ui->setPosition(12, -41);
     $ui->setId('maxPlayerHelp');
     $ui->setScriptEvents();
     $ui->save();
     UI::tooltip('maxPlayerHelp', sprintf('Max player allowed is %d', \ManiaHost\Config::getInstance()->maxPlayerPerServer));
     $ui = new Label(80);
     $ui->setHalign('center');
     $ui->setPosY(-44);
     $ui->setStyle(Label::TextTips);
     $ui->setText('Game mode');
     $ui->save();
     switch ($this->response->gameMode) {
         case GameInfos::GAMEMODE_ROUNDS:
             $gameModeLabel = 'Rounds';
             $ui = new Label(20);
             $ui->setHalign('right');
             $ui->setPosition(0, -59);
             $ui->setText('Point limit');
             $ui->save();
             $ui = new Entry(32, 4.5);
             $ui->setValign('bottom');
             $ui->setPosition(2, -63);
             $ui->setName('roundsPointLimit');
             $ui->setDefault($this->response->pointLimit);
             $ui->setStyle(Label::TextValueSmall);
             $ui->save();
             break;
         case GameInfos::GAMEMODE_TEAM:
             $gameModeLabel = 'Team';
             $ui = new Label(20);
             $ui->setHalign('right');
             $ui->setPosition(0, -59);
             $ui->setText('Point limit');
             $ui->save();
             $ui = new Entry(32, 4.5);
             $ui->setValign('bottom');
             $ui->setPosition(2, -63);
             $ui->setName('teamPointLimit');
             $ui->setDefault($this->response->pointLimit);
             $ui->setStyle(Label::TextValueSmall);
             $ui->save();
             break;
         case GameInfos::GAMEMODE_LAPS:
             $gameModeLabel = 'Laps';
             $ui = new Label(20);
             $ui->setHalign('right');
             $ui->setPosition(0, -59);
             $ui->setText('Time limit');
             $ui->save();
             $ui = new Entry(32, 4.5);
             $ui->setValign('bottom');
             $ui->setPosition(2, -63);
             $ui->setName('lapsTimeLimit');
             $ui->setDefault($this->response->timeLimit);
             $ui->setStyle(Label::TextValueSmall);
             $ui->save();
             $ui = new Label(40);
             $ui->setHalign('right');
             $ui->setPosition(0, -65);
             $ui->setText('Number of laps');
             $ui->save();
             $ui = new Entry(32, 4.5);
             $ui->setValign('bottom');
             $ui->setPosition(2, -69);
             $ui->setName('lapsNumber');
             $ui->setDefault($this->response->lapsNumber);
             $ui->setStyle(Label::TextValueSmall);
             $ui->save();
             break;
         case GameInfos::GAMEMODE_CUP:
             $gameModeLabel = 'Cup';
             $ui = new Label(20);
             $ui->setHalign('right');
             $ui->setPosition(0, -59);
             $ui->setText('Point limit');
             $ui->save();
             $ui = new Entry(32, 4.5);
             $ui->setValign('bottom');
             $ui->setPosition(2, -63);
             $ui->setName('cupPointLimit');
             $ui->setDefault($this->response->pointLimit);
             $ui->setStyle(Label::TextValueSmall);
             $ui->save();
             $ui = new Label(40);
             $ui->setHalign('right');
             $ui->setPosition(0, -65);
             $ui->setText('Rounds per map');
             $ui->save();
             $ui = new Entry(32, 4.5);
             $ui->setValign('bottom');
             $ui->setPosition(2, -69);
             $ui->setName('rounds');
             $ui->setDefault($this->response->rounds);
             $ui->setStyle(Label::TextValueSmall);
             $ui->save();
             $ui = new Label(40);
             $ui->setHalign('right');
             $ui->setPosition(0, -71);
             $ui->setText('Number of winners');
             $ui->save();
             $ui = new Entry(32, 4.5);
             $ui->setValign('bottom');
             $ui->setPosition(2, -75);
             $ui->setName('winners');
             $ui->setDefault($this->response->winners);
             $ui->setStyle(Label::TextValueSmall);
             $ui->save();
             break;
         case GameInfos::GAMEMODE_STUNTS:
             $gameModeLabel = 'Stunts';
             $ui = new Label(20);
             $ui->setHalign('right');
             $ui->setPosition(0, -59);
             $ui->setText('Time limit');
             $ui->save();
             $ui = new Entry(32, 4.5);
             $ui->setValign('bottom');
             $ui->setPosition(2, -63);
             $ui->setName('timeLimit');
             $ui->setDefault($this->response->timeLimit);
             $ui->setStyle(Label::TextValueSmall);
             $ui->save();
             break;
         case GameInfos::GAMEMODE_TIMEATTACK:
             $gameModeLabel = 'Time Attack';
             $ui = new Label(20);
             $ui->setHalign('right');
             $ui->setPosition(0, -59);
             $ui->setText('Time limit');
             $ui->save();
             $ui = new Entry(32, 4.5);
             $ui->setValign('bottom');
             $ui->setPosition(2, -63);
             $ui->setName('timeLimit');
             $ui->setDefault($this->response->timeLimit);
             $ui->setStyle(Label::TextValueSmall);
             $ui->save();
             break;
     }
     $manialink = $this->request->createLink('../change-mode');
     $ui = new Label(69, 5);
     $ui->setPosY(-50.5);
     $ui->setAlign('center', 'center2');
     $ui->setStyle(Label::TextValueMedium);
     $ui->setText($gameModeLabel);
     $ui->setManialink($manialink);
     $ui->save();
     $ui = new Button();
     $ui->setHalign('center');
     $ui->setPosition(0, -76, 0.1);
     $ui->setText('Advanced');
     $ui->setStyle(Button::CardButtonSmall);
     $ui->setId('advanceSwitch');
     $ui->setScriptEvents();
     $ui->save();
     Event::addListener('advanceSwitch', Event::mouseClick, array(Action::toggle, 'advancedPanel'));
     \ManiaLib\ManiaScript\Manipulation::hide('advancedPanel');
     Manialink::endFrame();
     Manialink::beginFrame(60, -20, 0.1);
     Manialink::setFrameId('advancedPanel');
     $ui = new Bgs1(83, 103);
     $ui->setSubStyle(Bgs1::BgWindow2);
     $ui->save();
     Manialink::beginFrame(46, -10, 0.5);
     $ui = new Label(40);
     $ui->setAlign('right', 'bottom');
     $ui->setText('Password (optional)');
     $ui->save();
     $ui = new Entry(32, 4.5);
     $ui->setPosition(2, 0);
     $ui->setValign('bottom');
     $ui->setName('passwordPlayer');
     $ui->setDefault($this->response->passwordPlayer);
     $ui->setStyle(Label::TextValueSmall);
     $ui->save();
     $ui = new Label(40);
     $ui->setAlign('right', 'bottom');
     $ui->setText('Max spectators');
     $ui->setPosY(-6);
     $ui->save();
     $ui = new Entry(8, 4);
     $ui->setPosition(2, -5);
     $ui->setValign('bottom');
     $ui->setName('maxSpec');
     $ui->setDefault($this->response->maxSpec);
     $ui->setStyle(Label::TextValueSmall);
     $ui->save();
     $ui = new Label(40);
     $ui->setAlign('right', 'bottom');
     $ui->setText('Spectator password (opt.)');
     $ui->setPosY(-12);
     $ui->save();
     $ui = new Entry(32, 4.5);
     $ui->setPosition(2, -12);
     $ui->setValign('bottom');
     $ui->setName('passwordSpec');
     $ui->setDefault($this->response->passwordSpec);
     $ui->setStyle(Label::TextValueSmall);
     $ui->save();
     if ($this->response->gameMode == GameInfos::GAMEMODE_ROUNDS || $this->response->gameMode == GameInfos::GAMEMODE_TEAM) {
         $ui = new Label(40);
         $ui->setAlign('right', 'bottom');
         $ui->setText('Use alternate rules');
         $ui->setPosY(-18);
         $ui->save();
         $default = $this->request->get('alternateRules', false);
         $manialink = $this->request->createLink('../change-alternate');
         $ui = new Label(10, 5);
         $ui->setAlign('center', 'center2');
         $ui->setPosition(7, -16.5);
         $ui->setText('$o' . ($default ? 'Yes' : 'No'));
         $ui->setStyle(Label::TextValueSmall);
         $ui->setFocusAreaColor1($default ? '0808' : '8008');
         $ui->setFocusAreaColor2($default ? '0B0F' : 'B00F');
         $ui->setManialink($manialink);
         $ui->save();
     }
     $ui = new Label(40);
     $ui->setAlign('right', 'bottom');
     $ui->setText('Warm-up phase duration');
     $ui->setPosY(-48);
     $ui->save();
     $ui = new Entry(15, 4.5);
     $ui->setPosition(2, -48);
     $ui->setValign('bottom');
     if ($this->response->gameMode == GameInfos::GAMEMODE_CUP) {
         $ui->setName('cupWarmup');
         $ui->setDefault($this->response->cupWarmup);
     } else {
         $ui->setName('defaultWarmup');
         $ui->setDefault($this->response->defaultWarmup);
     }
     $ui->setStyle(Label::TextValueSmall);
     $ui->save();
     $ui = new Label(40);
     $ui->setAlign('right', 'bottom');
     $ui->setText('Allow map download');
     $ui->setPosY(-53.5);
     $ui->save();
     $default = $this->request->get('allowDownload', true);
     $manialink = $this->request->createLink('../change-map-download');
     $ui = new Label(10, 5);
     $ui->setAlign('center', 'center2');
     $ui->setPosition(7, -51.5);
     $ui->setText('$o' . ($default ? 'Yes' : 'No'));
     $ui->setStyle(Label::TextValueSmall);
     $ui->setFocusAreaColor1($default ? '0808' : '8008');
     $ui->setFocusAreaColor2($default ? '0B0F' : 'B00F');
     $ui->setManialink($manialink);
     $ui->save();
     $ui = new Label(40);
     $ui->setAlign('right', 'bottom');
     $ui->setText('CallVote threshold (%)');
     $ui->setPosY(-59);
     $ui->save();
     $ui = new Entry(8, 4.5);
     $ui->setPosition(2, -59);
     $ui->setValign('bottom');
     $ui->setName('callVoteThreshold');
     $ui->setDefault($this->response->callVoteThreshold);
     $ui->setStyle(Label::TextValueSmall);
     $ui->save();
     $ui = new Label(40);
     $ui->setAlign('right', 'bottom');
     $ui->setText('CallVote timeout');
     $ui->setPosY(-65);
     $ui->save();
     $ui = new Entry(15, 4.5);
     $ui->setPosition(2, -65);
     $ui->setValign('bottom');
     $ui->setName('callVoteDuration');
     $ui->setDefault($this->response->callVoteDuration);
     $ui->setStyle(Label::TextValueSmall);
     $ui->save();
     $ui = new Label(40);
     $ui->setAlign('right', 'bottom');
     $ui->setText('Chat time');
     $ui->setPosY(-71);
     $ui->save();
     $ui = new Entry(15, 4.5);
     $ui->setPosition(2, -71);
     $ui->setValign('bottom');
     $ui->setName('chatTime');
     $ui->setDefault($this->response->chatTime);
     $ui->setStyle(Label::TextValueSmall);
     $ui->save();
     $this->request->set('chatTime', 'chatTime');
     $ui = new Label(40);
     $ui->setAlign('right', 'bottom');
     $ui->setText('Referee password (opt.)');
     $ui->setPosY(-77);
     $ui->save();
     $ui = new Entry(32, 4.5);
     $ui->setPosition(2, -77);
     $ui->setValign('bottom');
     $ui->setName('passwordReferee');
     $ui->setDefault($this->response->passwordReferee);
     $ui->setStyle(Label::TextValueSmall);
     $ui->save();
     $ui = new Label(40);
     $ui->setAlign('right', 'bottom');
     $ui->setText('Players to validate');
     $ui->setPosY(-83);
     $ui->save();
     $default = $this->request->get('refereeMode', false);
     $manialink = $this->request->createLink('../change-referees');
     $ui = new Label(15, 5);
     $ui->setAlign('left', 'center2');
     $ui->setPosition(2, -81);
     $ui->setText('$o' . ($default ? 'Top3' : 'All'));
     $ui->setStyle(Label::TextValueSmall);
     $ui->setManialink($manialink);
     $ui->save();
     Manialink::endFrame();
     Manialink::endFrame();
     $manialink = $this->request->createLink('../validate/');
     $ui = new Button();
     $ui->setHalign('center');
     $ui->setPosY(-115);
     $ui->setText('Launch');
     $ui->setManialink($manialink);
     $ui->save();
     Manialink::endFrame();
     Manialink::appendScript('manialib_main_loop();}');
 }
Пример #20
0
$ui = new \ManiaLib\Gui\Elements\BgRaceScore2(13, 13);
$ui->setPosition(25, 1.75, 0.1);
$ui->setSubStyle(\ManiaLib\Gui\Elements\BgRaceScore2::Speaking);
$ui->save();
Manialink::endFrame();
$ui = new Label(190);
$ui->setPosition(0, -12);
$ui->enableAutonewline();
$ui->setMaxline(21);
$ui->setTextColor('000');
$ui->setTextSize(2);
$ui->setText(maniapress_html_filter(get_the_content()));
$ui->save();
$ui = new \ManiaLib\Gui\Elements\Button();
$ui->setHalign('center');
$ui->setPosition(95, -105, 0.1);
$ui->setStyle(\ManiaLib\Gui\Elements\Button::CardButtonSmallWide);
$ui->setUrl(ManiaLib\Utils\URI::getCurrent());
$ui->setText('Read the full post on the Web');
$ui->save();
$categories = maniapress_get_categories(get_the_ID());
$tags = maniapress_get_tags(get_the_ID());
$metadata = sprintf('This entry was written by %s, posted on %s at %s, filed under %s and tagged %s.', get_the_author(), the_date('', '', '', false), get_the_time(), $categories, $tags);
$ui = new Label(190 / 1.25);
$ui->setScale(1.25);
$ui->setPosition(0, -115, 0);
$ui->setStyle(Label::TextButtonSmall);
$ui->setText($metadata);
$ui->enableAutonewline();
$ui->save();
Manialink::endFrame();
Пример #21
0
use ManiaLib\Gui\Manialink;
use ManiaLib\Gui\Elements\Label;
get_header();
if (have_posts()) {
    $layout = new \ManiaLib\Gui\Layouts\Column();
    $layout->setMarginHeight(1);
    Manialink::beginFrame(-95, 50, 0.2, 1, $layout);
    while (have_posts()) {
        the_post();
        get_template_part('content', get_post_format());
    }
    Manialink::endFrame();
    $next = maniapress_html_decode(\ManiaLib\Utils\Arrays::get(explode('"', get_next_posts_link()), 1));
    $prev = maniapress_html_decode(\ManiaLib\Utils\Arrays::get(explode('"', get_previous_posts_link()), 1));
    $ui = new ManiaLib\Gui\Cards\PageNavigator();
    $ui->setPosition(0, -75, 0);
    $ui->arrowNext->setManialink($next);
    $ui->arrowPrev->setManialink($prev);
    $ui->save();
} else {
    $ui = new Label(120 / 1.5);
    $ui->setScale(1.5);
    $ui->setHalign('center');
    $ui->setPosition(0, 40, 0.2);
    $ui->enableAutonewline();
    $ui->setStyle(Label::TextButtonSmall);
    $ui->setText('Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.');
    $ui->save();
}
get_sidebar();
get_footer();
Пример #22
0
 * @copyright   Copyright (c) 2011-2012 NADEO (http://www.nadeo.com)
 * @license     http://www.gnu.org/licenses/lgpl.html LGPL License 3
 * @version     $Revision$:
 * @author      $Author$:
 * @date        $Date$:
 */
use ManiaLib\Gui\Manialink;
use ManiaLib\Gui\Elements\Label;
Manialink::beginFrame(-95, 47, 0.2);
Manialink::setFrameId('post-' . get_the_ID());
$ui = new Label(190);
$ui->setScale(1.5);
$ui->setStyle(Label::TextButtonBig);
$ui->setText('$000' . maniapress_html_filter(the_title('', '', false)));
$ui->save();
$ui = new Label(190);
$ui->setPosition(0, -12);
$ui->enableAutonewline();
$ui->setMaxline(21);
$ui->setTextColor('000');
$ui->setTextSize(2);
$ui->setText(maniapress_html_filter(get_the_content()));
$ui->save();
$ui = new \ManiaLib\Gui\Elements\Button();
$ui->setHalign('center');
$ui->setPosition(95, -120, 0.1);
$ui->setStyle(\ManiaLib\Gui\Elements\Button::CardButtonSmallWide);
$ui->setUrl(ManiaLib\Utils\URI::getCurrent());
$ui->setText('View the full page on the Web');
$ui->save();
Manialink::endFrame();
Пример #23
0
 public function display()
 {
     \ManiaLib\ManiaScript\Main::begin();
     $ui = new \ManiaLib\Gui\Cards\Navigation\Menu();
     $ui->title->setText(\ManiaHost\Config::getInstance()->appName);
     $ui->subTitle->setText('Select maps');
     $manialink = $this->request->createLinkArgList('../default-maps/');
     $ui->addItem();
     $ui->lastItem->text->setText('Default maps');
     $ui->lastItem->icon->setSubStyle(\ManiaLib\Gui\Elements\Icons128x128_1::Browse);
     $ui->lastItem->setManialink($manialink);
     $manialink = $this->request->createLinkArgList('../upload/');
     $ui->addItem(\ManiaLib\Gui\Cards\Navigation\Menu::BUTTONS_BOTTOM);
     $ui->lastItem->text->setText('Upload');
     $ui->lastItem->icon->setSubStyle(\ManiaLib\Gui\Elements\Icons128x128_1::Save);
     $ui->lastItem->setManialink($manialink);
     $manialink = $this->request->createLinkArgList('../select-map/');
     $ui->quitButton->text->setText('Back');
     $ui->quitButton->setManialink($manialink);
     $ui->save();
     Manialink::beginFrame(17, 66, 0.2);
     $ui = new \ManiaLib\Gui\Cards\Panel(94, 20);
     $ui->setHalign('center');
     $ui->title->setText('Maps');
     $ui->save();
     $ui = new Label();
     $ui->setText($this->response->mapCount);
     $ui->setHalign('right');
     $ui->setPosition(43, -7, 0.1);
     $ui->save();
     Manialink::beginFrame(0, -20, 0);
     $ui = new Bgs1(90, 6);
     $ui->setSubStyle(Bgs1::BgList);
     $ui->setHalign('center');
     $ui->save();
     $manialink = $this->request->createLink();
     $ui = new Icons64x64_1(6, 6);
     $ui->setPosition(-45, 0, 0.1);
     $ui->setSubStyle(Icons64x64_1::ToolUp);
     $ui->setManialink($manialink);
     $ui->save();
     $ui = new Icons64x64_1(6, 6);
     $ui->setHalign('right');
     $ui->setPosition(45, 0, 0.1);
     $ui->setSubStyle(Icons64x64_1::Refresh);
     $ui->setManialink($manialink);
     $ui->save();
     $this->request->set('path', $this->response->path);
     $manialink = $this->request->createLink($this->response->selector);
     $this->request->delete('path');
     $ui = new Icons64x64_1(6, 6);
     $ui->setHalign('right');
     $ui->setPosition(39, 0, 0.1);
     $ui->setSubStyle(Icons64x64_1::ToolRoot);
     $ui->setManialink($manialink);
     $ui->save();
     Manialink::endFrame();
     $layout = new \ManiaLib\Gui\Layouts\Column();
     Manialink::beginFrame(-45, -30, 0.1, 1, $layout);
     foreach ($this->response->files as $file) {
         $this->request->set('filename', $file->path . DIRECTORY_SEPARATOR . $file->filename);
         $card = new \ManiaHost\Cards\File();
         if (in_array($file->path . DIRECTORY_SEPARATOR . $file->filename, $this->response->selected)) {
             $manialink = $this->request->createLink('../unselect/');
             $card->setSubStyle(Bgs1::BgCard);
         } else {
             $manialink = $this->request->createLink('../select/');
         }
         $card->setManialink($manialink);
         $card->name->setText($file->name);
         if (!in_array($file->path . $file->filename, $this->response->used)) {
             $manialink = $this->request->createLink('../delete-map');
             $card->deleteIcon->setId('delete');
             $card->deleteIcon->setScriptEvents();
             \ManiaLib\ManiaScript\UI::dialog('delete', 'Dou you want to delete this map ' . $file->name, array(\ManiaLib\ManiaScript\Action::manialink, $manialink));
         } else {
             $card->deleteIcon->setScale(0);
         }
         $card->save();
     }
     Manialink::endFrame();
     $this->response->multipage->pageNavigator->setPosition(0, -135, 0.1);
     $this->response->multipage->savePageNavigator();
     $manialink = $this->request->createLink('../checkout');
     $ui = new \ManiaLib\Gui\Elements\Button();
     $ui->setText('Play');
     $ui->setAlign('center', 'center2');
     $ui->setPosition(100, -136.25);
     $ui->setManialink($manialink);
     $ui->save();
     Manialink::endFrame();
     \ManiaLib\ManiaScript\Main::loop();
     \ManiaLib\ManiaScript\Main::end();
 }
Пример #24
0
$ui->setBgcolor(maniapress_get_option('theme-footer-bg', 'fff'));
$ui->save();
Manialink::beginFrame(10, -5.5, 0.1);
$ui = new Icons128x128_1(15);
$ui->setSubStyle(Icons128x128_1::Vehicles);
$ui->save();
$ui = new Label(100);
$ui->setPosition(17, -2.5, 0);
$ui->setScale(1.75);
$ui->setStyle(Label::TextButtonBig);
$ui->setText(maniapress_get_bloginfo('name'));
$ui->save();
$ui = new Label(150);
$ui->setPosition(17, -9, 0.1);
$ui->setStyle(Label::TextTips);
$ui->setText(maniapress_get_bloginfo('description'));
$ui->save();
Manialink::endFrame();
Manialink::beginFrame(145, -8.5, 0.1);
$ui = new \ManiaLib\Gui\Elements\Entry(40, 5);
$ui->setName('search');
$ui->setDefault(\ManiaLib\Application\Request::getInstance()->get('s'));
$ui->save();
$ui = new Icons64x64_1(6);
$ui->setPosition(41, 0.5);
$ui->setSubStyle(Icons64x64_1::Maximize);
$ui->setManialink(maniapress_get_bloginfo('url') . '?s=search');
$ui->save();
Manialink::endFrame();
$layout = new ManiaLib\Gui\Layouts\Line();
$layout->setMarginWidth(1);
    public function display()
    {
        Manialink::load();
        Manialink::appendXML(Dictionary::getInstance()->getManiaLink($this->displayedText));
        Manialink::appendScript(<<<MANIASCRIPT
#RequireContext CMlScript
#Include "MathLib" as MathLib
#Include "TextLib" as TextLib
main()
{
\tdeclare Boolean countdown = True;
\tdeclare Integer countdownTime = CurrentTime;
\tdeclare Integer countdownTimeLeft = 10;
\tdeclare CMlFrame frame  <=> (Page.MainFrame.GetFirstChild("block-quit") as CMlFrame);
\tdeclare CMlLabel label <=> (Page.MainFrame.GetFirstChild("countdown-label") as CMlLabel);
\tlabel.SetText(TextLib::ToText(countdownTimeLeft));

\twhile(True)
\t{
\t\tif(countdown && countdownTimeLeft >= 0 && CurrentTime - countdownTime > 1000)
\t\t{
\t\t\tcountdownTime = CurrentTime;
\t\t\tcountdownTimeLeft = countdownTimeLeft - 1;
\t\t\tlabel.SetText(TextLib::ToText(countdownTimeLeft));
\t\t}
\t\telse if(countdown && countdownTimeLeft <= 0)
\t\t{
\t\t\tframe.Hide();
\t\t}
\t\tyield;
\t}
}
MANIASCRIPT
);
        $frame = new \ManiaLib\Gui\Elements\Frame();
        $frame->setPosition(0, 5, 0);
        $label = new Label(170);
        $label->setAlign('center', 'center2');
        $label->setStyle(Label::TextRaceMessageBig);
        $label->setTextSize(5);
        $label->setTextColor('f00');
        $label->setTextId('text');
        $frame->add($label);
        $iconBlink = new Icons128x128_Blink(15);
        $iconBlink->setAlign('right', 'center');
        $iconBlink->setPosition(-87, 0);
        $iconBlink->setSubStyle(Icons128x128_Blink::Hard);
        $frame->add($iconBlink);
        $iconBlink = new Icons128x128_Blink(15);
        $iconBlink->setAlign('left', 'center');
        $iconBlink->setPosition(87, 0);
        $iconBlink->setSubStyle(Icons128x128_Blink::Hard);
        $frame->add($iconBlink);
        $frame->save();
        $frame = new \ManiaLib\Gui\Elements\Frame();
        $frame->setPosition(0, -6.5, 10);
        $frame->setScriptEvents();
        $frame->setId('block-quit');
        $bg = new Bgs1(180, 45);
        $bg->setSubStyle(Bgs1::BgDialogBlur);
        $bg->setAlign('center');
        $bg->setScriptEvents();
        $bg->setId('background');
        $bg->setManialink('');
        $frame->add($bg);
        $bg = new Quad(180, 45);
        $bg->setBgcolor('0008');
        $bg->setAlign('center');
        $bg->setScriptEvents();
        $frame->add($bg);
        $ui = new Label(120);
        $ui->setAlign('center');
        $ui->setPosition(0, -6, 0.1);
        $ui->setStyle(Label::TextRaceMessageBig);
        $ui->setTextSize(4);
        $ui->setTextid('available');
        $frame->add($ui);
        $ui = new Label(20);
        $ui->setId('countdown-label');
        $ui->setAlign('center');
        $ui->setPosition(0, -15, 0.1);
        $ui->setStyle(Label::TextRaceMessageBig);
        $ui->setTextSize(5);
        $ui->setText('10');
        $frame->add($ui);
        $frame->save();
        return Manialink::render(true);
    }
Пример #26
0
 /**
  * Saves the PageNavigator in the GUI objects stack
  */
 function preFilter()
 {
     // Show / hide text
     if (!$this->currentPage || !$this->pageNumber) {
         $this->showText(false);
     }
     // Auto show fast next / last
     if ($this->arrowFirst->hasLink() || $this->arrowLast->hasLink()) {
         $this->showLast();
     }
     if ($this->arrowFastNext->hasLink() || $this->arrowFastPrev->hasLink()) {
         $this->showFastNext();
     }
     // Arrow styles
     if ($this->arrowNext->hasLink()) {
         $this->arrowNext->setSubStyle($this->arrowNextStyle);
     }
     if ($this->arrowPrev->hasLink()) {
         $this->arrowPrev->setSubStyle($this->arrowPrevStyle);
     }
     if ($this->arrowNext->hasLink() && $this->arrowFastNext->hasLink()) {
         $this->arrowFastNext->setSubStyle($this->arrowFastNextStyle);
     } else {
         $this->arrowFastNext->setManialink(null);
     }
     if ($this->arrowPrev->hasLink() && $this->arrowFastPrev->hasLink()) {
         $this->arrowFastPrev->setSubStyle($this->arrowFastPrevStyle);
     } else {
         $this->arrowFastPrev->setManialink(null);
     }
     if ($this->arrowNext->hasLink() && $this->arrowLast->hasLink()) {
         $this->arrowLast->setSubStyle($this->arrowLastStyle);
     } else {
         $this->arrowLast->setManialink(null);
     }
     if ($this->arrowPrev->hasLink() && $this->arrowFirst->hasLink()) {
         $this->arrowFirst->setSubStyle($this->arrowFirstStyle);
     } else {
         $this->arrowFirst->setManialink(null);
     }
     // Text
     $this->text->setStyle(\ManiaLib\Gui\Elements\Label::TextValueSmall);
     $this->text->setText($this->currentPage . ' / ' . $this->pageNumber);
     // Positioning in relation to the center of the containing frame
     $this->text->setAlign("center", "center2");
     $this->text->setPosZ(1);
     $this->textBg->setSubStyle(\ManiaLib\Gui\Elements\Bgs1::BgPager);
     $this->textBg->setAlign('center', 'center');
     $this->textBg->setPosZ(0.5);
     $this->arrowNext->setValign("center");
     $this->arrowFastNext->setValign("center");
     $this->arrowLast->setValign("center");
     $this->arrowNext->setPosition($this->text->getSizeX() / 2 + 1, 0, 1);
     $this->arrowFastNext->setPosition($this->arrowNext->getPosX() + $this->arrowNext->getSizeX(), 0, 1);
     $this->arrowLast->setPosition($this->arrowNext->getPosX() + (int) $this->showFastNext * $this->arrowFastNext->getSizeX() + $this->arrowNext->getSizeX(), 0, 1);
     $this->arrowPrev->setAlign("right", "center");
     $this->arrowFastPrev->setAlign("right", "center");
     $this->arrowFirst->setAlign("right", "center");
     $this->arrowPrev->setPosition(-($this->text->getSizeX() / 2) - 1, 0, 1);
     $this->arrowFastPrev->setPosition($this->arrowPrev->getPosX() - $this->arrowPrev->getSizeX(), 0, 1);
     $this->arrowFirst->setPosition($this->arrowPrev->getPosX() - (int) $this->showFastNext * $this->arrowFastPrev->getSizeX() - $this->arrowPrev->getSizeX(), 0, 1);
     // Save the gui
     if ($this->showText) {
         $this->add($this->textBg);
         $this->add($this->text);
     }
     $this->add($this->arrowNext);
     $this->add($this->arrowPrev);
     if ($this->showLast) {
         $this->add($this->arrowFirst);
         $this->add($this->arrowLast);
     }
     if ($this->showFastNext) {
         $this->add($this->arrowFastNext);
         $this->add($this->arrowFastPrev);
     }
 }
Пример #27
0
 function onDraw()
 {
     $this->dico = array('playing' => 'playing', 'ready' => 'ready', 'avgWaitingHelper' => 'avgWaitingHelper', 'avgWaiting' => array('textId' => 'avgWaitingTime', 'params' => array(static::$avgWaitingTime == -1 ? "-" : static::$avgWaitingTime)), 'nPlayers' => array('textId' => 'nPlayersPlaying', 'params' => array(static::$playingPlayerCount)), 'nPlayersHelper' => array('textId' => 'nPlayersReady', 'params' => array(static::$readyPlayerCount)));
     $this->serverNameLabel->setText(static::$serverName);
     \ManiaLive\Gui\Manialinks::appendXML(Dictionary::getInstance()->getManiaLink($this->dico));
 }
Пример #28
0
 * @author      $Author$:
 * @date        $Date$:
 */
use ManiaLib\Gui\Manialink;
use ManiaLib\Gui\Elements\Label;
use ManiaLib\Gui\Elements\Icons64x64_1;
use ManiaLib\ManiaScript\UI;
use ManiaLib\ManiaScript\Action;
use ManiaLib\ManiaScript\Event;
Manialink::beginFrame(-100, -83, 0.2);
$ui = new Label(175);
$ui->setValign('center2');
$ui->setPosition(3, -3.5, 0);
$ui->setScale(0.75);
$ui->setStyle(Label::TextInfoSmall);
$ui->setText(sprintf('$<$000%s$> is proudly powered by $l[http://wordpress.org/]WordPress$l and $l[http://code.google.com/p/maniapress/]ManiaPress$l.', maniapress_get_bloginfo('name')));
$ui->save();
if (maniapress_get_option('manialink')) {
    Manialink::beginFrame(150, 1.5, 0.1);
    $params['url'] = maniapress_get_option('manialink');
    if (maniapress_get_option('manialink-name')) {
        $params['name'] = maniapress_get_option('manialink-name');
    }
    $url = 'http://maniahome.maniaplanet.com/add/?' . http_build_query($params);
    $ui = new \ManiaLib\Gui\Elements\IncludeManialink();
    $ui->setUrl($url);
    $ui->save();
    Manialink::endFrame();
}
Manialink::beginFrame(188, -1, 0.1);
$ui = new Icons64x64_1(5);