From a1dfdca189bf1d2042101365859b8dd40a16a2c3 Mon Sep 17 00:00:00 2001 From: kremsy Date: Fri, 4 Jul 2014 10:12:17 +0200 Subject: [PATCH] update widget on playerinfo changed (for example when player got from player to spec) --- application/plugins/MCTeam/WidgetPlugin.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/application/plugins/MCTeam/WidgetPlugin.php b/application/plugins/MCTeam/WidgetPlugin.php index aea5c0b3..5a624ed5 100644 --- a/application/plugins/MCTeam/WidgetPlugin.php +++ b/application/plugins/MCTeam/WidgetPlugin.php @@ -127,7 +127,8 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin { $this->maniaControl->callbackManager->registerCallbackListener(Callbacks::BEGINMAP, $this, 'handleOnBeginMap'); $this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ENDMAP, $this, 'handleOnEndMap'); $this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERCONNECT, $this, 'handlePlayerConnect'); - $this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERDISCONNECT, $this, 'handlePlayerDisconnect'); + $this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERDISCONNECT, $this, 'updateWidgets'); + $this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERINFOCHANGED, $this, 'updateWidgets'); $this->maniaControl->settingManager->initSetting($this, self::SETTING_MAP_WIDGET_ACTIVATED, true); $this->maniaControl->settingManager->initSetting($this, self::SETTING_MAP_WIDGET_POSX, 160 - 20); @@ -512,9 +513,9 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin { } /** - * Handle PlayerDisconnect Callback + * Update Widget on certain callbacks */ - public function handlePlayerDisconnect() { + public function updateWidgets() { if ($this->maniaControl->settingManager->getSettingValue($this, self::SETTING_SERVERINFO_WIDGET_ACTIVATED)) { $this->displayServerInfoWidget(); }