Пример #1
0
 protected function onConstruct()
 {
     $this->bg = new \ManiaLib\Gui\Elements\Bgs1(320, 16);
     $this->bg->setSubStyle(\ManiaLib\Gui\Elements\Bgs1::BgDialogBlur);
     $this->bg->setAlign('center', 'center2');
     $this->addComponent($this->bg);
     $this->label = new \ManiaLib\Gui\Elements\Label(240);
     $this->label->setStyle(\ManiaLib\Gui\Elements\Label::TextRaceMessageBig);
     $this->label->setTextSize(4);
     $this->label->setAlign('center', 'center2');
     $this->label->enableAutonewline();
     $this->label->setId('info-label');
     $this->label->setTextid('text');
     $this->addComponent($this->label);
     $this->label2 = new \ManiaLib\Gui\Elements\Label(240);
     $this->label2->setStyle(\ManiaLib\Gui\Elements\Label::TextRaceMessageBig);
     $this->label2->setTextSize(4);
     $this->label2->setAlign('center', 'center2');
     $this->label2->enableAutonewline();
     $this->label2->setTextid('wait');
     $this->label2->setId('wait-label');
     $this->addComponent($this->label2);
     $this->sound = new \ManiaLib\Gui\Elements\Audio();
     $this->sound->setData('http://static.maniaplanet.com/manialinks/lobbies/timer.wav', true);
     $this->sound->setPosition(200);
     $this->sound->autoPlay();
 }
Пример #2
0
 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);
 }
Пример #3
0
 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);
 }
 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);
 }
$ui->setScale(1.5);
$ui->setStyle(Label::TextButtonBig);
$ui->setText('$000' . maniapress_html_filter(the_title('', '', false)));
//
$ui->save();
Manialink::beginFrame(153, 1, 0.1);
$ui = new ManiaLib\Gui\Elements\Bgs1(30, 7);
$ui->setSubStyle(ManiaLib\Gui\Elements\Bgs1::BgList);
$ui->save();
$ui = new Label(23);
$ui->setPosition(2, -2, 0.1);
$ui->setText(maniapress_get_comments_number());
$ui->setStyle(Label::TextButtonMedium);
$ui->setUrl(ManiaLib\Utils\URI::getCurrent());
$ui->setScriptEvents();
$ui->setId('comments-count');
$ui->save();
UI::tooltip('comments-count', 'Read the comments on the Web');
$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();
    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);
    }
Пример #7
0
 function setId($id)
 {
     $this->bg->setId('player_button-' . $id);
     $this->hiddenLabel->setId('player_label-' . $id);
 }