fix queue plugin

This commit is contained in:
kremsy 2014-01-28 20:23:47 +01:00 committed by Steffen Schröder
parent d9af2805cd
commit 05eb8b96a7
2 changed files with 6 additions and 6 deletions

View File

@ -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));
}

View File

@ -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);
}
}