示例#1
0
 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();
     }
 }
 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();
 }
示例#3
0
 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();
 }
示例#4
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();
 }
示例#5
0
 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();
 }
示例#6
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();}');
 }