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); }
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'))); }
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->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)); }
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 ); }
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(); }
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); }
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)); }
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 onInit() { $this->setVersion('4.0.0'); $this->addDependency(new \ManiaLive\PluginHandler\Dependency('ManiaLive', '4.0.0')); $this->config = \ManiaLivePlugins\MatchMakingLobby\Config::getInstance(); //Get the Script name $script = $this->connection->getScriptName(); $this->scriptName = $this->config->script ?: preg_replace('~(?:.*?[\\\\/])?(.*?)\\.Script\\.txt~ui', '$1', $script['CurrentValue']); $this->titleIdString = $this->connection->getSystemInfo()->titleId; //Get the GUI abstraction class $guiClassName = $this->config->getGuiClassName($this->scriptName); if (!class_exists($guiClassName)) { throw new \Exception(sprintf("Can't find class %s. You should either set up the config : ManiaLivePlugins\\MatchMakingLobby\\Config.guiClassName or the script name", $guiClassName)); } $this->setGui(new $guiClassName()); //Load services $this->matchMakingService = new Services\MatchMakingService(); $this->matchMakingService->createTables(); $this->dictionary = \ManiaLivePlugins\MatchMakingLobby\Utils\Dictionary::getInstance($this->config->getDictionnary($this->scriptName)); }
function onDraw() { $this->setPosZ(3); \ManiaLive\Gui\Manialinks::appendXML(\ManiaLivePlugins\MatchMakingLobby\Utils\Dictionary::getInstance()->getManiaLink($this->dictionnary)); $this->updateItemList(); }
function onInit() { $this->setVersion('4.0.0'); $this->addDependency(new \ManiaLive\PluginHandler\Dependency('ManiaLive', '4.0.0')); //Load MatchMaker and helpers for GUI $this->config = Config::getInstance(); $this->scriptName = \ManiaLivePlugins\MatchMakingLobby\Config::getInstance()->script ?: preg_replace('~(?:.*?[\\\\/])?(.*?)\\.Script\\.txt~ui', '$1', $this->storage->gameInfos->scriptName); $matchMakerClassName = $this->config->getMatchMakerClassName($this->scriptName); if (!class_exists($matchMakerClassName)) { throw new \Exception(sprintf("Can't find class %s. You should either set up the config : ManiaLivePlugins\\MatchMakingLobby\\Config.matchMakerClassName or the script name", $matchMakerClassName)); } $guiClassName = $this->config->getGuiClassName($this->scriptName); if (!class_exists($guiClassName)) { throw new \Exception(sprintf("Can't find class %s. You should either set up the config : ManiaLivePlugins\\MatchMakingLobby\\Config.guiClassName or the script name", $guiClassName)); } $this->matchMakingService = new Services\MatchMakingService(); $this->matchMakingService->createTables(); $this->setGui(new $guiClassName()); $this->gui->lobbyBoxPosY = 45; $this->setMatchMaker($matchMakerClassName::getInstance()); $this->dictionary = \ManiaLivePlugins\MatchMakingLobby\Utils\Dictionary::getInstance($this->config->getDictionnary($this->scriptName)); $this->allyService = Services\AllyService::getInstance($this->storage->serverLogin, $this->scriptName, $this->connection->getSystemInfo()->titleId); return true; }
protected function onDraw() { \ManiaLive\Gui\Manialinks::appendXML(Dictionary::getInstance()->getManiaLink($this->dico)); }
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); }