function onConstruct() { $this->setLayer(\ManiaLive\Gui\Window::LAYER_CUT_SCENE); $ui = new Elements\Bgs1(320, 180); $ui->setAlign('center', 'center'); $ui->setSubStyle(Elements\Bgs1::BgDialogBlur); $this->addComponent($ui); $ui = new Elements\Bgs1(163, 63); $ui->setAlign('center', 'center'); $ui->setSubStyle(Elements\Bgs1::BgShadow); $this->addComponent($ui); $ui = new Elements\Quad(160, 60); $ui->setAlign('center', 'center'); $ui->setBgcolor('eeef'); $this->addComponent($ui); $this->questionLabel = new Elements\Label(160); $this->questionLabel->setAlign('center', 'center2'); $this->questionLabel->setPosY(5); $this->questionLabel->enableAutonewline(); $this->questionLabel->setStyle(Elements\Label::TextInfoMedium); $this->addComponent($this->questionLabel); $this->yesButton = new Elements\Button(); $this->yesButton->setAlign('left', 'bottom'); $this->yesButton->setPosition(-45, -25); $this->yesButton->setTextid('yes'); $this->addComponent($this->yesButton); $this->noButton = new Elements\Button(); $this->noButton->setAlign('right', 'bottom'); $this->noButton->setPosition(45, -25); $this->noButton->setTextid('no'); $this->addComponent($this->noButton); }
function display() { $ui = new Bgs1(320, 200); $ui->setAlign('center', 'center'); $ui->setPosition(0, 0, 14); $ui->setSubStyle(Bgs1::BgWindow1); $ui->save(); Manialink::beginFrame(0, 0, 15); $ui = new \ManiaLib\Gui\Cards\Dialogs\TwoButtons($this->response->dialog->width, $this->response->dialog->height); $ui->setAlign('center', 'center'); $ui->title->setText($this->response->dialog->title); $ui->text->setText($this->response->dialog->message); $ui->button->setText($this->response->dialog->buttonLabel); $ui->button->setManiazone($this->response->dialog->buttonManialink); if ($this->response->dialog->buttonAddplayerid) { $ui->button->addPlayerId(); } $ui->button2->setText($this->response->dialog->button2Label); $ui->button2->setManiazone($this->response->dialog->button2Manialink); if ($this->response->dialog->button2Addplayerid) { $ui->button->addPlayerId(); } $ui->save(); Manialink::endFrame(); }
protected function onConstruct() { $bullet = ' $<$ff0$o>$> '; $ui = new LegacyLabel(300); $ui->setPosition(0, -55); $ui->setStyle(LegacyLabel::TextRaceMessageBig); $ui->setTextSize(5); $ui->setHalign('center'); $ui->setId('help-label'); $ui->setTextid('switch'); $this->addComponent($ui); $frame = new Frame(); $frame->setId('help-frame'); $ui = new Bgs1(340, 60); $ui->setPosition(-170, 0, -0.1); $ui->setSubStyle(Bgs1::BgDialogBlur); $frame->addComponent($ui); $this->textLabel = new LegacyLabel(200); $this->textLabel->setPosition(-140, -10); $this->textLabel->setStyle(LegacyLabel::TextRaceMessageBig); $this->textLabel->setTextSize(5); $this->textLabel->enableAutonewline(); $this->textLabel->setId('help-label'); $this->textLabel->setTextid('help'); $frame->addComponent($this->textLabel); $allies = new Frame(80, 60); $allies->setPosition(100, -2); $ui = new LegacyLabel(70); $ui->setRelativeAlign('center'); $ui->setAlign('center'); $ui->setPosition(0, -3, 0.1); $ui->setTextid('tip'); $ui->setStyle(LegacyLabel::TextTitle3); $allies->addComponent($ui); $ui = new \ManiaLib\Gui\Elements\Quad(70, 39); $ui->setRelativeAlign('center'); $ui->setAlign('center'); $ui->setPosition(0, -9, 0.1); $ui->setImage('http://static.maniaplanet.com/manialinks/lobbies/set-as-ally.bik', true); $allies->addComponent($ui); $ui = new LegacyLabel(70); $ui->setRelativeAlign('center'); $ui->setAlign('center'); $ui->setPosition(0, -50, 0.1); $ui->setTextColor('fff'); $ui->setTextid('note'); $allies->addComponent($ui); $frame->addComponent($allies); $this->addComponent($frame); }
function __construct() { parent::__construct(70, 180); $this->setSubStyle(Bgs1::BgWindow1); $this->setPosition(-150, 90, 0.1); $this->titleBg = new Quad(70, 70); $this->titleBg->setImage(Config::getInstance()->titleBgURL, true); $this->addCardElement($this->titleBg); $this->logo = new Icons128x128_1(16); $this->logo->setPosition(4, -38, 0.1); $this->logo->setSubStyle(Icons128x128_1::Vehicles); $this->addCardElement($this->logo); $this->title = new Label(46); $this->title->setPosition(22, -41, 0.1); $this->title->setStyle(Label::TextTitle1); $this->title->setScriptEvents(); $this->addCardElement($this->title); $this->subTitle = new Label(46); $this->subTitle->setPosition(22, -47.75, 0.1); $this->subTitle->setStyle(Label::TextSubTitle1); $this->addCardElement($this->subTitle); $this->quitButton = new Button(); $this->quitButton->setPosition(-1, -163.5, 0.1); $this->quitButton->text->setText('Back'); $this->quitButton->text->setStyle(Label::TextButtonNavBack); $this->quitButton->icon->setPosition(-8.5, -0.5, 0.1); $this->quitButton->icon->setStyle(Quad::Icons128x128_1); $this->quitButton->icon->setSubStyle(Icons128x128_1::BackFocusable); $this->quitButton->icon->setSize(11, 11); }
function __construct($sizeX = 70, $sizeY = 0) { parent::__construct($sizeX, $sizeY); $this->setSubStyle(Bgs1::BgWindow2); $this->cardElementsPosX = 3; $this->cardElementsPosY = -3; $this->cardElementsLayout = new Column(); }
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); }
function __construct($sizeX = 90, $sizeY = 8) { parent::__construct($sizeX, $sizeY); $this->setSubStyle(Bgs1::BgCardChallenge); $this->name = new Label(85); $this->name->setValign('center2'); $this->name->setPosition(5, -4, 0.1); $this->addCardElement($this->name); $this->deleteIcon = new Icons64x64_1(); $this->deleteIcon->setSubStyle(Icons64x64_1::Close); $this->deleteIcon->setAlign('right', 'center'); $this->deleteIcon->setPosition($sizeX - 3, -$sizeY / 2); $this->addCardElement($this->deleteIcon); }
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); }
function __construct($sizeX = 69, $sizeY = 8.5) { parent::__construct($sizeX, $sizeY); $this->setSubStyle(\ManiaLib\Gui\Elements\Bgs1::BgEmpty); $this->cardElementsValign = 'center2'; $this->text = new \ManiaLib\Gui\Elements\Label(45); $this->text->setSizeY(0); $this->text->setValign("center"); $this->text->setPosition(8); $this->text->setStyle(\ManiaLib\Gui\Elements\Label::TextButtonNav); $this->addCardElement($this->text); $this->icon = new \ManiaLib\Gui\Elements\Icons128x128_1($this->sizeY); $this->icon->setValign("center"); $this->icon->setPosition(55, 0, 0.1); $this->addCardElement($this->icon); }
function __construct($sizeX = 200, $sizeY = 15) { parent::__construct($sizeX, $sizeY); $this->setSubStyle('BgCardOnline'); $this->login = new Label(120); $this->login->setValign('bottom'); $this->login->setPosition(5, -13, 0.1); $this->addCardElement($this->login); $this->name = new Label(180); $this->name->setPosition(5, -2, 0.1); $this->addCardElement($this->name); $this->remainingTime = new Label(60); $this->remainingTime->setHalign('right'); $this->remainingTime->setValign('bottom'); $this->remainingTime->setPosition(195, -13, 0.1); $this->addCardElement($this->remainingTime); $this->renew = new Label(60); $this->renew->setHalign('right'); $this->renew->setPosition(195, -2, 0.1); $this->addCardElement($this->renew); }
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();}'); }
function onDraw() { \ManiaLib\Gui\Manialink::appendXML(Dictionary::getInstance()->getManiaLink($this->message)); $this->bg->setVisibility($this->showBackground); $this->setScript($this->countdown, $this->animated, $this->hideOnF6); }
function onDraw() { $this->bg->setSize($this->sizeX, $this->sizeY); $this->text->setSize($this->sizeX - 5); $this->text->setPosition($this->sizeX / 2, -$this->sizeY / 2); }
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(); }
function display() { $ui = new \ManiaLib\Gui\Cards\Navigation\Menu(); $ui->title->setText(\ManiaHost\Config::getInstance()->appName); $ui->subTitle->setText('Select maps'); $manialink = $this->request->createLinkArgList('../my-maps/'); $ui->addItem(); $ui->lastItem->text->setText('My maps'); $ui->lastItem->icon->setSubStyle(\ManiaLib\Gui\Elements\Icons128x128_1::Browse); $ui->lastItem->setManialink($manialink); $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('../select-map/'); $ui->quitButton->text->setText('Back'); $ui->quitButton->setManialink($manialink); $ui->save(); Manialink::beginFrame(40, 65, 0.1); $ui = new \ManiaLib\Gui\Cards\Panel(123, 65); $ui->setHalign('center'); $ui->title->setText('Upload'); $ui->save(); $ui = new \ManiaLib\Gui\Elements\Label(115); $ui->setHalign('center'); $ui->setPosition(0, -25, 0.1); $ui->setText('Your maps will be stored until the end of your rentals'); $ui->setStyle(\ManiaLib\Gui\Elements\Label::TextTips); $ui->save(); $ui = new \ManiaLib\Gui\Elements\FileEntry(100, 6); $ui->setHalign('center'); $ui->setPosition(0, -35, 0.9); $ui->setFolder('Maps'); $ui->setName('file'); $ui->save(); $this->request->set('file', 'file'); $manialink = $this->request->createLink('../do-upload/'); $ui = new \ManiaLib\Gui\Elements\Button(); $ui->setHalign('center'); $ui->setPosition(0, -45, 0.1); $ui->setText('Send'); $ui->setManialink(sprintf('POST(%s,file)', $manialink)); $ui->save(); if ($this->response->message) { $ui = new \ManiaLib\Gui\Elements\Label(110); $ui->setHalign('center'); $ui->setPosition(0, -56, 0.1); $ui->setStyle(\ManiaLib\Gui\Elements\Label::TextTitleError); $ui->setText($this->response->message); $ui->save(); } Manialink::endFrame(); Manialink::beginFrame(40, -10, 0.1); $ui = new \ManiaLib\Gui\Cards\Panel(123, 50); $ui->setHalign('center'); $ui->title->setText('Available space'); $ui->titleBg->setSubStyle(Bgs1::BgTitle3_2); $ui->save(); $ui = new \ManiaLib\Gui\Elements\Label(80); $ui->setHalign('center'); $ui->setPosition(0, -25, 0.1); $ui->setText(sprintf('%.2fMo / 20Mo', $this->response->availableSpace / pow(2, 20))); $ui->save(); $ui = new Bgs1(100, 6); $ui->setAlign('center', 'center'); $ui->setPosition(0, -35, 0.1); $ui->setSubStyle(Bgs1::BgProgressBar); $ui->save(); $ui = new Bgs1($this->response->hRatioProgressBar * 100, 5); $ui->setValign('center'); $ui->setPosition(-50, -35, 0.2); $ui->setSubStyle(Bgs1::ProgressBar); $ui->save(); Manialink::endFrame(); }
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); }
/** * 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); } }