From 05eb8b96a7239f4fa7fe4e056d6aac6c53ebf6e7 Mon Sep 17 00:00:00 2001 From: kremsy Date: Tue, 28 Jan 2014 20:23:47 +0100 Subject: [PATCH] fix queue plugin --- application/core/Manialinks/ManialinkManager.php | 6 +++--- application/plugins/QueuePlugin.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/application/core/Manialinks/ManialinkManager.php b/application/core/Manialinks/ManialinkManager.php index 98969a5c..43bf9659 100644 --- a/application/core/Manialinks/ManialinkManager.php +++ b/application/core/Manialinks/ManialinkManager.php @@ -177,7 +177,7 @@ class ManialinkManager implements ManialinkPageAnswerListener, CallbackListener } /** - * Displays a ManiaLink Widget to a certain Player + * Displays a ManiaLink Widget to a certain Player (Should only be used on Main Widgets) * * @param mixed $maniaLink * @param Player $player @@ -186,9 +186,9 @@ class ManialinkManager implements ManialinkPageAnswerListener, CallbackListener public function displayWidget($maniaLink, Player $player, $widgetName = '') { // render and display xml $this->maniaControl->manialinkManager->sendManialink($maniaLink, $player->login); - $this->disableAltMenu($player); - if ($widgetName != '') { + if ($widgetName != '') { //TODO make check by manialinkId, getter is needed to avoid uses on non main widgets + $this->disableAltMenu($player); // Trigger callback $this->maniaControl->callbackManager->triggerCallback(self::CB_MAIN_WINDOW_OPENED, array(self::CB_MAIN_WINDOW_OPENED, $player, $widgetName)); } diff --git a/application/plugins/QueuePlugin.php b/application/plugins/QueuePlugin.php index 20c09140..f4e8015a 100644 --- a/application/plugins/QueuePlugin.php +++ b/application/plugins/QueuePlugin.php @@ -415,7 +415,7 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns $messageLabel->setText($message); $messageLabel->setStyle(Label_Text::STYLE_TextStaticSmall); - $this->maniaControl->manialinkManager->displayWidget($maniaLink, $player); + $this->maniaControl->manialinkManager->sendManialink($maniaLink, $player->login); } /** @@ -457,7 +457,7 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns $messageLabel->setText('$090You got a free spot, enjoy playing!'); $messageLabel->setStyle(Label_Text::STYLE_TextStaticSmall); - $this->maniaControl->manialinkManager->displayWidget($maniaLink, $player, 'Queue'); + $this->maniaControl->manialinkManager->sendManialink($maniaLink, $player->login); $this->showPlay[$player->login] = array('time' => time(), 'player' => $player); } @@ -468,6 +468,6 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns */ private function hideQueueWidget(Player $player) { $maniaLink = new ManiaLink(self::ML_ID); - $this->maniaControl->manialinkManager->displayWidget($maniaLink, $player, 'Queue'); + $this->maniaControl->manialinkManager->sendManialink($maniaLink, $player->login); } } \ No newline at end of file