From 5926a06654c46bc7bf2097f760e6aa3b988cf43c Mon Sep 17 00:00:00 2001 From: kremsy Date: Mon, 23 Dec 2013 21:52:30 +0100 Subject: [PATCH] update widget playerlist properties --- application/core/Players/PlayerList.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/application/core/Players/PlayerList.php b/application/core/Players/PlayerList.php index 985cd926..7eae2515 100644 --- a/application/core/Players/PlayerList.php +++ b/application/core/Players/PlayerList.php @@ -69,8 +69,9 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener { 'closePlayerAdvancedWidget'); $this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERMANIALINKPAGEANSWER, $this, 'handleManialinkPageAnswer'); - $this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERINFOCHANGED, $this, 'playerInfoChanged'); - + $this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERINFOCHANGED, $this, 'updateWidget'); + $this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERCONNECT, $this, 'updateWidget'); + $this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERDISCONNECT, $this, 'updateWidget'); //settings $this->width = 150; $this->height = 80; @@ -551,10 +552,10 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener { } /** - * Reopen the widget on PlayerInfoChanged + * Reopen the widget on PlayerInfoChanged / Player Connect and Disconnect * @param array $callback */ - public function playerInfoChanged(array $callback){ + public function updateWidget(array $callback){ foreach($this->playersListShown as $login => $shown){ if($shown == true){ $player = $this->maniaControl->playerManager->getPlayer($login);