improvements on plugin load / unload
This commit is contained in:
parent
90b0579c17
commit
d173a48159
@ -134,6 +134,10 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
|
||||
* Unload the plugin and its resources
|
||||
*/
|
||||
public function unload() {
|
||||
$this->destroyVote();
|
||||
$emptyManialink = new ManiaLink(self::MLID_ICON);
|
||||
$manialinkText = $emptyManialink->render()->saveXML();
|
||||
$this->maniaControl->manialinkManager->sendManialink($manialinkText);
|
||||
$this->maniaControl->commandManager->unregisterCommandListener($this);
|
||||
unset($this->maniaControl);
|
||||
}
|
||||
@ -716,6 +720,6 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
|
||||
* @return string
|
||||
*/
|
||||
public static function getDescription() {
|
||||
return null;
|
||||
return 'Plugin offers your Custom Votes like Restart, Skip, Balance...';
|
||||
}
|
||||
}
|
@ -81,6 +81,9 @@ class KarmaPlugin implements CallbackListener, Plugin {
|
||||
* @see \ManiaControl\Plugins\Plugin::unload()
|
||||
*/
|
||||
public function unload() {
|
||||
$emptyManialink = new ManiaLink(self::MLID_KARMA);
|
||||
$manialinkText = $emptyManialink->render()->saveXML();
|
||||
$this->maniaControl->manialinkManager->sendManialink($manialinkText);
|
||||
$this->maniaControl->callbackManager->unregisterCallbackListener($this);
|
||||
unset($this->maniaControl);
|
||||
}
|
||||
|
@ -124,6 +124,10 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
||||
* Unload the plugin and its resources
|
||||
*/
|
||||
public function unload() {
|
||||
$this->closeWidget(self::MLID_CLOCKWIDGET);
|
||||
$this->closeWidget(self::MLID_SERVERINFOWIDGET);
|
||||
$this->closeWidget(self::MLID_MAPWIDGET);
|
||||
$this->closeWidget(self::MLID_NEXTMAPWIDGET);
|
||||
$this->maniaControl->callbackManager->unregisterCallbackListener($this);
|
||||
unset($this->maniaControl);
|
||||
}
|
||||
@ -584,6 +588,6 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
||||
* @return string
|
||||
*/
|
||||
public static function getDescription() {
|
||||
return null;
|
||||
return 'Plugin offers some Widgets';
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user