Exemplo n.º 1
0
    }
    $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);
$ui->setSubStyle(Icons64x64_1::ToolUp);
$ui->setScriptEvents();
$ui->setId('view-external');
//$ui->setUrl(ManiaLib\Utils\URI::getCurrent());
$ui->save();
UI::tooltip('view-external', 'Visit the Website');
Event::addListener('view-external', Event::mouseClick, array(Action::external, \ManiaLib\Utils\URI::getCurrent()));
$ui = new Icons64x64_1(5);
$ui->setPosition(5.5);
$ui->setSubStyle(Icons64x64_1::Refresh);
$ui->setScriptEvents();
$ui->setId('refresh-button');
//$ui->setManialink(ManiaLib\Utils\URI::getCurrent());
$ui->save();
UI::tooltip('refresh-button', 'Refresh');
Event::addListener('refresh-button', Event::mouseClick, array(Action::manialink, \ManiaLib\Utils\URI::getCurrent()));
Manialink::endFrame();
Manialink::endFrame();
\ManiaLib\ManiaScript\Main::loop();
\ManiaLib\ManiaScript\Main::end();
maniapress_google_analytics();
Manialink::render();
Exemplo n.º 2
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();
 }
Exemplo n.º 3
0
 * @version     $Revision$:
 * @author      $Author$:
 * @date        $Date$:
 */
use ManiaLib\Gui\Manialink;
use ManiaLib\Gui\Cards\Panel;
use ManiaLib\Gui\Elements\Label;
use ManiaLib\Gui\Elements\Quad;
use ManiaLib\Gui\Elements\Icons128x128_1;
use ManiaLib\Gui\Elements\Icons64x64_1;
use ManiaLib\Gui\Elements\UIConstructionSimple_Buttons;
Manialink::load();
$ui = new \ManiaLib\Gui\Elements\IncludeManialink();
$ui->setUrl('manialib.xml', false);
$ui->save();
\ManiaLib\ManiaScript\Main::begin();
$background = maniapress_get_option('theme-background');
$ui = new Quad(320, 180);
$ui->setAlign('center', 'center');
if ($background) {
    if (ctype_xdigit($background) && strlen($background) < 4) {
        $ui->setBgcolor($background);
    } else {
        $ui->setImage($background, true);
    }
} else {
    $ui->setImage('bg.jpg');
}
$ui->save();
$ui = new \ManiaLib\Gui\Elements\Bgs1InRace(202, 200);
$ui->setPosition(0, 0, 0.09);