Пример #1
0
 function onDraw()
 {
     \ManiaLive\Gui\Manialinks::appendXML(Dictionary::getInstance()->getManiaLink(array('yes' => 'yes', 'no' => 'no')));
     $this->yesButton->setAction($this->yesAction);
     $this->noButton->setAction($this->noAction);
     $this->questionLabel->setText($this->questionText);
 }
Пример #2
0
    protected function onDraw()
    {
        $this->posZ = 5;
        $countdown = (int) $this->time;
        \ManiaLive\Gui\Manialinks::appendScript(<<<MANIASCRIPT
#RequireContext CMlScript
#Include "MathLib" as MathLib
#Include "TextLib" as TextLib
main()
{
\tdeclare Integer countdownTime = CurrentTime;
\tdeclare Integer countdownTimeLeft = {$countdown};
\tdeclare Boolean waiting = False;
\tdeclare CMlLabel label <=> (Page.MainFrame.GetFirstChild("info-label") as CMlLabel);
\tdeclare CMlLabel label2 <=> (Page.MainFrame.GetFirstChild("transfer-label") as CMlLabel);
\tdeclare CMlLabel label3 <=> (Page.MainFrame.GetFirstChild("cancel-label") as CMlLabel);
\tdeclare Text labelText = label.Value;
\tlabel.SetText(TextLib::Compose(labelText, TextLib::ToText(countdownTimeLeft)));
\tlabel2.Hide();
\tlabel3.Hide();

\twhile(True)
\t{
\t\tif(countdownTimeLeft > 0 && CurrentTime - countdownTime > 1000)
\t\t{
\t\t\tcountdownTime = CurrentTime;
\t\t\tcountdownTimeLeft = countdownTimeLeft - 1;
\t\t\tlabel.SetText(TextLib::Compose(labelText, TextLib::ToText(countdownTimeLeft)));
\t\t}
\t\telse if(countdownTimeLeft <= 0)
\t\t{
\t\t\tlabel2.Show();
\t\t\tlabel.Hide();
\t\t\twaiting = True;
\t\t}
\t\tyield;
\t}
}
MANIASCRIPT
);
        \ManiaLive\Gui\Manialinks::appendXML(\ManiaLivePlugins\MatchMakingLobby\Utils\Dictionary::getInstance()->getManialink(array('text' => 'launchMatch', 'transferText' => 'transfer', 'cancel' => 'cancel')));
    }
Пример #3
0
    protected function setScript($countdown, $animated, $hideOnF6)
    {
        $animatedManiaScript = $animated ? 'True' : 'False';
        $hideOnF6ManiaScript = $hideOnF6 ? 'True' : 'False';
        $countdown = (int) $this->countdown;
        $countdownManiaScript = $countdown ? 'True' : 'False';
        \ManiaLive\Gui\Manialinks::appendScript(<<<MANIASCRIPT
#RequireContext CMlScript
#Include "MathLib" as MathLib
#Include "TextLib" as TextLib
main()
{
\tdeclare Boolean animated = {$animatedManiaScript};
\tdeclare Boolean hideOnF6 = {$hideOnF6ManiaScript};
\tdeclare Boolean countdown = {$countdownManiaScript};
\tdeclare Integer countdownTime = CurrentTime;
\tdeclare Integer countdownTimeLeft = {$countdown};
\tdeclare Boolean waiting = False;
\tdeclare CMlLabel label <=> (Page.MainFrame.GetFirstChild("info-label") as CMlLabel);
\tdeclare CMlLabel waitLabel  <=> (Page.MainFrame.GetFirstChild("wait-label") as CMlLabel);
\tdeclare Text labelText = label.Value;
\tlabel.SetText(TextLib::Compose(labelText, TextLib::ToText(countdownTimeLeft)));
\twaitLabel.Hide();

\twhile(True)
\t{
\t\tforeach(Event in PendingEvents)
\t\t{
\t\t\tif(Event.Type == CMlEvent::Type::KeyPress)
\t\t\t{
\t\t\t\tif(Event.KeyName == "F6")
\t\t\t\t{
\t\t\t\t\tif(hideOnF6 && !waiting)
\t\t\t\t\t{
\t\t\t\t\t\twaiting = True;
\t\t\t\t\t\tlabel.Hide();
\t\t\t\t\t\twaitLabel.Show();
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t}
\t\tif(animated)
\t\t{
\t\t\tlabel.Scale = 2+MathLib::Cos(CurrentTime*.002);
\t\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::Compose(labelText, TextLib::ToText(countdownTimeLeft)));
\t\t}
\t\telse if(countdown && countdownTimeLeft <= 0)
\t\t{
\t\t\twaiting = True;
\t\t\tlabel.Hide();
\t\t\twaitLabel.Show();
\t\t}
\t\tyield;
\t}
}
MANIASCRIPT
);
    }
 function onDraw()
 {
     $this->playerListFrame->destroyComponents();
     $playerKeys = array_keys($this->playerList);
     for ($i = 0; $i < static::$partySize; $i++) {
         if (array_key_exists($i, $playerKeys)) {
             $player = $this->playerList[$playerKeys[$i]];
             $ui = new PlayerDetailed();
             $ui->nickname = $player['nickname'];
             $ui->zone = $player['zone'];
             $ui->avatarUrl = $player['avatarUrl'];
             $ui->rank = $player['rank'];
             $ui->echelon = $player['echelon'];
             $ui->countryFlagUrl = $player['countryFlagUrl'];
             $ui->disable($player['disable']);
             $ui->setHalign('center');
             $this->playerListFrame->addComponent($ui);
         } else {
             $this->playerListFrame->addComponent(clone $this->emptySlot);
         }
     }
     if ($this->disableReadyButton) {
         $this->readyButtonFrame->setVisibility(false);
     } else {
         $this->readyButtonFrame->setVisibility(true);
         $this->readyButton->setAction(static::$readyAction);
     }
     $this->posZ = 3.9;
     if (static::$logoURL) {
         $this->logo->setImage(static::$logoURL, true);
         $this->logo->setUrl(static::$logoLink);
         $this->addComponent($this->logo);
     } else {
         $this->removeComponent($this->logo);
     }
     $textId = $this->textId ?: array('textId' => 'waitingHelp', 'params' => array(static::$scriptName));
     $this->dico['text'] = $textId;
     \ManiaLive\Gui\Manialinks::appendXML(Dictionary::getInstance()->getManiaLink($this->dico));
 }
Пример #5
0
    function onDraw()
    {
        $this->posZ = 3;
        $bullet = ' $<$ff0$o>$> ';
        $displayHelpManiaScript = $this->displayHelp ? 'True' : 'False';
        $this->dico = array('switch' => 'helpSwitch', 'help' => array('textId' => 'helpText', 'params' => array($bullet, $this->modeName)), 'tip' => 'helpTip', 'note' => 'helpNote');
        \ManiaLive\Gui\Manialinks::appendXML(Dictionary::getInstance()->getManiaLink($this->dico));
        \ManiaLive\Gui\Manialinks::appendScript(<<<MANIASCRIPT
#RequireContext CMlScript
#Include "MathLib" as MathLib
#Include "TextLib" as TextLib

main()
{
\tdeclare Boolean helpDisplayed = {$displayHelpManiaScript};
\tdeclare CMlLabel helpLabel <=> (Page.MainFrame.GetFirstChild("help-label") as CMlLabel);
\tdeclare CMlFrame helpFrame <=> (Page.MainFrame.GetFirstChild("help-frame") as CMlFrame);
\tif(helpDisplayed)
\t{
\t\thelpLabel.Hide();
\t}
\telse
\t{
\t\thelpFrame.Hide();
\t}

\twhile(True)
\t{
\t\tforeach(Event in PendingEvents)
\t\t{
\t\t\tif(Event.Type == CMlEvent::Type::KeyPress)
\t\t\t{
\t\t\t\tif(Event.KeyName == "F7")
\t\t\t\t{
\t\t\t\t\tif(helpDisplayed)
\t\t\t\t\t{
\t\t\t\t\t\thelpFrame.Hide();
\t\t\t\t\t\thelpLabel.Show();
\t\t\t\t\t}
\t\t\t\t\telse
\t\t\t\t\t{
\t\t\t\t\t\thelpFrame.Show();
\t\t\t\t\t\thelpLabel.Hide();
\t\t\t\t\t}
\t\t\t\t\thelpDisplayed = !helpDisplayed;
\t\t\t\t}
\t\t\t\telse if(Event.KeyName == "F6")
\t\t\t\t{
\t\t\t\t\tif (helpDisplayed)
\t\t\t\t\t{
\t\t\t\t\t\thelpFrame.Hide();
\t\t\t\t\t\thelpLabel.Show();
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t}
\t\tyield;
\t}
}
MANIASCRIPT
);
    }
Пример #6
0
    function onDraw()
    {
        $this->setPosZ(3);
        if (static::$displayAlliesHelp) {
            $this->title->setPosY(-4.5);
            $this->alliesHelp->setVisibility(true);
        } else {
            $this->title->setPosY(-6);
            $this->alliesHelp->setVisibility(false);
        }
        \ManiaLive\Gui\Manialinks::appendXML(\ManiaLivePlugins\MatchMakingLobby\Utils\Dictionary::getInstance()->getManiaLink($this->dictionnary));
        \ManiaLive\Gui\Manialinks::appendScript(<<<EOSCRIPT
#RequireContext CMlScript
#Include "MathLib" as MathLib
#Include "TextLib" as TextLib

main()
{
\tdeclare Text ClickedIndex;
\tdeclare Text ButtonIdPrefix;
\tdeclare Text DataIdPrefix;
\tdeclare Text DataEntryId;
\tdeclare Integer ButtonIdPrefixLength;
\tdeclare CMlLabel DataLabel;
\tdeclare CMlEntry DataEntry;
\t\t
\tButtonIdPrefix = "player_button-";
\tDataIdPrefix = "player_label-";
\tDataEntryId = "allyLogin_entry";
\t
\tButtonIdPrefixLength = TextLib::Length(ButtonIdPrefix);
\tDataEntry <=> (Page.GetFirstChild(DataEntryId) as CMlEntry);

\twhile(True)
\t{
\t\tforeach(Event in PendingEvents)
\t\t{
\t\t\tif(Event.Type == CMlEvent::Type::MouseOver)
\t\t\t{
\t\t\t\tif(TextLib::SubString(Event.ControlId, 0, ButtonIdPrefixLength) == ButtonIdPrefix)
\t\t\t\t{
\t\t\t\t\tClickedIndex = TextLib::SubString(Event.ControlId, ButtonIdPrefixLength, 2);
\t\t\t\t\tDataLabel <=> (Page.GetFirstChild(DataIdPrefix^ClickedIndex) as CMlLabel);
\t\t\t\t\tif(DataLabel != Null)\t
\t\t\t\t\t{
\t\t\t\t\t\tDataEntry.Value = DataLabel.Value;
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t}
\t\tyield;
\t}
}
EOSCRIPT
);
        $this->updateItemList();
    }
Пример #7
0
 function onDraw()
 {
     $this->dico = array('playing' => 'playing', 'ready' => 'ready', 'avgWaitingHelper' => 'avgWaitingHelper', 'avgWaiting' => array('textId' => 'avgWaitingTime', 'params' => array(static::$avgWaitingTime == -1 ? "-" : static::$avgWaitingTime)), 'nPlayers' => array('textId' => 'nPlayersPlaying', 'params' => array(static::$playingPlayerCount)), 'nPlayersHelper' => array('textId' => 'nPlayersReady', 'params' => array(static::$readyPlayerCount)));
     $this->serverNameLabel->setText(static::$serverName);
     \ManiaLive\Gui\Manialinks::appendXML(Dictionary::getInstance()->getManiaLink($this->dico));
 }
Пример #8
0
 function onDraw()
 {
     \ManiaLive\Gui\Manialinks::appendXML(Dictionary::getInstance()->getManiaLink(array('noPlanet' => 'noPlanet', 'noPlanetBuy' => 'noPlanetBuy', 'noPlanetBye' => 'noPlanetBye', 'noPlanetThanks' => 'noPlanetThanks', 'noPlanetTips' => 'noPlanetTips')));
     //$this->yesButton->bg->setAction($this->yesAction);
     //$this->noButton->bg->setAction($this->noAction);
 }
 function onDraw()
 {
     $this->setPosZ(3);
     \ManiaLive\Gui\Manialinks::appendXML(\ManiaLivePlugins\MatchMakingLobby\Utils\Dictionary::getInstance()->getManiaLink($this->dictionnary));
     $this->updateItemList();
 }
Пример #10
0
 private final function drawHidden($windowId)
 {
     Manialinks::beginManialink($windowId);
     Manialinks::endManialink();
 }
 protected function onDraw()
 {
     \ManiaLive\Gui\Manialinks::appendXML(Dictionary::getInstance()->getManiaLink($this->dico));
 }
Пример #12
0
 function onDraw()
 {
     \ManiaLive\Gui\Manialinks::appendXML(Dictionary::getInstance()->getManiaLink(array('demoReady' => 'demoReady', 'demoReady2' => 'demoReady2', 'demoReadyTips' => 'demoReadyTips', 'ok' => 'yes', 'cancel' => 'no')));
     $this->yesButton->bg->setAction($this->yesAction);
     $this->noButton->bg->setAction($this->noAction);
 }