New SidebarMenuManager Version
This commit is contained in:
@ -19,7 +19,7 @@ use ManiaControl\Commands\CommandListener;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Manialinks\LabelLine;
|
||||
use ManiaControl\Manialinks\ManialinkManager;
|
||||
use ManiaControl\Manialinks\SidebarMenuEntryRenderable;
|
||||
use ManiaControl\Manialinks\SidebarMenuEntryListener;
|
||||
use ManiaControl\Manialinks\SidebarMenuManager;
|
||||
use ManiaControl\Players\Player;
|
||||
use ManiaControl\Players\PlayerManager;
|
||||
@ -32,7 +32,7 @@ use ManiaControl\Plugins\Plugin;
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class DonationPlugin implements CallbackListener, CommandListener, Plugin, SidebarMenuEntryRenderable {
|
||||
class DonationPlugin implements CallbackListener, CommandListener, Plugin, SidebarMenuEntryListener {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
@ -117,7 +117,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin, Sideb
|
||||
// Define player stats
|
||||
$this->maniaControl->getStatisticManager()->defineStatMetaData(self::STAT_PLAYER_DONATIONS);
|
||||
|
||||
$this->maniaControl->getManialinkManager()->getSidebarMenuManager()->addMenuEntry($this,SidebarMenuManager::ORDER_PLAYER_MENU, self::DONATIONPLUGIN_MENU_ID);
|
||||
$this->maniaControl->getManialinkManager()->getSidebarMenuManager()->addMenuEntry(SidebarMenuManager::ORDER_PLAYER_MENU + 5,self::DONATIONPLUGIN_MENU_ID,$this,'displayDonateWidget');
|
||||
|
||||
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_DONATE_WIDGET_ACTIVATED, true);
|
||||
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_DONATION_VALUES, "20,50,100,500,1000,2000");
|
||||
@ -130,6 +130,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin, Sideb
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the widget
|
||||
*/
|
||||
@ -234,7 +235,6 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin, Sideb
|
||||
*/
|
||||
public function unload() {
|
||||
$this->maniaControl->getManialinkManager()->hideManialink(self::MLID_DONATE_WIDGET);
|
||||
$this->maniaControl->getManialinkManager()->getSidebarMenuManager()->deleteMenuEntry($this,self::DONATIONPLUGIN_MENU_ID,true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -531,8 +531,4 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin, Sideb
|
||||
// Render and display xml
|
||||
$this->maniaControl->getManialinkManager()->displayWidget($maniaLink, $player, 'TopDons');
|
||||
}
|
||||
|
||||
public function renderMenuEntry() {
|
||||
$this->displayDonateWidget();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user