From c04f39a05628685e2ccda757bb1b812e2bf602ee Mon Sep 17 00:00:00 2001 From: Alexander Nell Date: Sat, 25 Apr 2020 16:53:16 +0200 Subject: [PATCH] Show temporary loading screen on MX-List --- core/ManiaExchange/ManiaExchangeList.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/ManiaExchange/ManiaExchangeList.php b/core/ManiaExchange/ManiaExchangeList.php index 4b6e9fa7..ee7b5a9f 100644 --- a/core/ManiaExchange/ManiaExchangeList.php +++ b/core/ManiaExchange/ManiaExchangeList.php @@ -165,6 +165,21 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener } $this->showManiaExchangeList($maps, $player); }); + + // show temporary list to wait for Async + $labelStyle = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultLabelStyle(); + + $maniaLink = new ManiaLink(ManialinkManager::MAIN_MLID); + $frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame(); + $maniaLink->addChild($frame); + + $loadingLabel = new Label_Text(); + $frame->addChild($loadingLabel); + $loadingLabel->setStyle($labelStyle); + $loadingLabel->setText('Loading maps, please wait ...'); + $loadingLabel->setTextSize(2); + + $this->maniaControl->getManialinkManager()->sendManialink($maniaLink, $player); }