function display() { $manialink = $this->request->createLink('/'); $ui = new \ManiaLib\Gui\Cards\Navigation\Menu(); $ui->title->setText(\ManiaHost\Config::getInstance()->appName); $ui->quitButton->setManialink($manialink); $ui->subTitle->setText('Powered by ManiaHost'); $manialink = $this->request->createLink('../select-duration/'); if ($this->response->isAvailable) { $ui->addItem(); $ui->lastItem->text->setText('Rent a server'); $ui->lastItem->setManialink($manialink); } if ($this->response->isAdmin) { $manialink = $this->request->createLinkArgList('/admin/'); $ui->addItem(Menu::BUTTONS_BOTTOM); $ui->lastItem->text->setText('Admin panel'); $ui->lastItem->icon->setSubStyle(Icons128x128_1::Options); $ui->lastItem->setManialink($manialink); } $ui->save(); $ui = new \ManiaLib\Gui\Cards\Panel(206, 10); $ui->setHalign('center'); $ui->setPosition(40, 80, 0.1); $ui->title->setText('Current rents'); $ui->save(); if (!count($this->response->rents)) { $ui = new \ManiaLib\Gui\Elements\Label(60); $ui->setStyle(\ManiaLib\Gui\Elements\Label::TextInfoMedium); $ui->setText('$000You have no rents in progress'); $ui->setPosition(-60, 55, 0.1); $ui->save(); } else { $layout = new \ManiaLib\Gui\Layouts\Column(); $layout->setMarginHeight(4); Manialink::beginFrame(-60, 60, 0.1, 1, $layout); foreach ($this->response->rents as $rent) { $remaining = $rent->rentDate + $rent->duration * 3600 - time(); $remaining = round((double) $remaining / 3600, 2); $card = new \ManiaHost\Cards\Rent(); $card->name->setText(sprintf('%s', $rent->serverOptions['Name'])); if ($rent->login) { $card->login->setText(sprintf('$oserver login$o: %s', $rent->login)); $card->setManialink('maniaplanet://#join=' . $rent->login); } else { $card->login->setText('Your server will start soon. Refresh the page to see it. If it does not start contact the admin.'); } $card->remainingTime->setText(sprintf('$oRemaining time$o: %s hours', $remaining)); $this->request->set('idRent', $rent->id); $manialink = $this->request->createLink('/rent/renew/'); $this->request->restore('idRent'); $card->renew->setText('Renew'); $card->renew->setManialink($manialink); $card->save(); } Manialink::endFrame(); $this->response->multipage->pageNavigator->setPosition(40, -60); $this->response->multipage->savePageNavigator(); } }
public function display() { $ui = new \ManiaLib\Gui\Cards\Panel(135, 135); $ui->setAlign('center', 'center'); $ui->title->setText('Welcome on ' . $this->response->manialinkName); $ui->save(); $layout = new \ManiaLib\Gui\Layouts\Column(); $layout->setMarginHeight(2); Manialink::beginFrame(0, 40, 0.1, 1, $layout); $ui = new Bullet(); $ui->setHalign('center'); $ui->bullet->setStyle(Quad::Icons128x128_1); $ui->bullet->setSubStyle(Icons128x128_1::ServersAll); $ui->title->setText(sprintf('Rent a server in 3 simple steps for %d planets per hours', $this->response->hourlyCost)); $ui->save(); $ui = new Bullet(); $ui->setHalign('center'); $ui->bullet->setStyle(Quad::Icons64x64_1); $ui->bullet->setSubStyle(Icons64x64_1::First); $ui->title->setText('Select the duration'); $ui->save(); $ui = new Bullet(); $ui->setHalign('center'); $ui->bullet->setStyle(Quad::Icons64x64_1); $ui->bullet->setSubStyle(Icons64x64_1::Second); $ui->title->setText('Configure your server'); $ui->save(); $ui = new Bullet(); $ui->setHalign('center'); $ui->bullet->setStyle(Quad::Icons64x64_1); $ui->bullet->setSubStyle(Icons64x64_1::Third); $ui->title->setText('Select the tracks'); $ui->save(); $ui = new Bullet(); $ui->setHalign('center'); $ui->bullet->setStyle(Quad::Icons128x128_1); $ui->bullet->setSubStyle(Icons128x128_1::ServersAll); $ui->title->setText('Your server is ready'); $ui->save(); Manialink::endFrame(); $manialink = $this->request->createLink('/rent/'); $ui = new Button(); $ui->setHalign('center'); $ui->setPosition(0, -55, 0.1); $ui->setStyle(Button::CardButtonMediumWide); $ui->setText('Rent a server'); $ui->setManialink($manialink); $ui->save(); }
protected function onConstruct() { $this->setLayer(\ManiaLive\Gui\Window::LAYER_CUT_SCENE); $this->background = new Elements\Quad(190, 190); $this->background->setAlign('center', 'center'); $this->background->setImage('file://Media/Manialinks/Common/Lobbies/versus-bg.dds', true); $this->addComponent($this->background); $this->label = new Elements\Label(200, 20); $this->label->setPosY(40); $this->label->setAlign('center', 'center2'); $this->label->setStyle(\ManiaLib\Gui\Elements\Label::TextRaceMessageBig); $this->label->setTextid('text'); $this->label->setId('info-label'); $this->label->setTextSize(2); $this->addComponent($this->label); $this->transferLabel = clone $this->label; $this->transferLabel->setPosY(40); $this->transferLabel->setTextColor(null); $this->transferLabel->setTextid('transferText'); $this->transferLabel->setId('transfer-label'); $this->addComponent($this->transferLabel); $this->cancelLabel = new Elements\Label(200); $this->cancelLabel->setPosY(-47); $this->cancelLabel->setAlign('center', 'center2'); $this->cancelLabel->setStyle(\ManiaLib\Gui\Elements\Label::TextRaceMessageBig); $this->cancelLabel->setTextColor('AAA'); $this->cancelLabel->setTextid('cancel'); $this->cancelLabel->setId('cancel-label'); $this->cancelLabel->setTextSize(7); $this->addComponent($this->cancelLabel); $layout = new \ManiaLib\Gui\Layouts\Column(); $layout->setMarginHeight(1); $this->team1 = new \ManiaLive\Gui\Controls\Frame(); $this->team1->setLayout($layout); $this->team1->setPosition(-45); $this->addComponent($this->team1); $this->team2 = clone $this->team1; $this->team2->setPosX(45); $this->addComponent($this->team2); }
protected function onConstruct() { $this->background = new Elements\Quad(320, 142); $this->background->setAlign('center', 'center'); $this->background->setImage('http://static.maniaplanet.com/manialinks/lobbies/background.png', true); $this->addComponent($this->background); $this->label = new Elements\Label(200, 20); $this->label->setPosY(47); $this->label->setAlign('center', 'center2'); $this->label->setStyle(\ManiaLib\Gui\Elements\Label::TextRaceMessageBig); $this->label->setTextid('text'); $this->label->setId('info-label'); $this->label->setTextSize(7); $this->addComponent($this->label); $this->transferLabel = clone $this->label; $this->transferLabel->setPosY(47); $this->transferLabel->setTextColor(null); $this->transferLabel->setTextid('transferText'); $this->transferLabel->setId('transfer-label'); $this->addComponent($this->transferLabel); $this->cancelLabel = new Elements\Label(200); $this->cancelLabel->setPosY(-47); $this->cancelLabel->setAlign('center', 'center2'); $this->cancelLabel->setStyle(\ManiaLib\Gui\Elements\Label::TextRaceMessageBig); $this->cancelLabel->setTextColor('AAA'); $this->cancelLabel->setTextid('cancel'); $this->cancelLabel->setId('cancel-label'); $this->cancelLabel->setTextSize(7); $this->addComponent($this->cancelLabel); $layout = new \ManiaLib\Gui\Layouts\Column(); $layout->setMarginHeight(2); $this->players = new \ManiaLive\Gui\Controls\Frame(); $this->players->setLayout($layout); $this->players->setPosition(0, 33); $this->addComponent($this->players); }
/** * ManiaPress: a suite to display your WordPress install directly in Maniaplanet. * * @see http://code.google.com/p/maniapress/ * @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; 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 {