removed oninits from the plugins
This commit is contained in:
parent
30baf3e00d
commit
90b0579c17
@ -285,9 +285,6 @@ class ManiaControl implements CommandListener {
|
|||||||
public function run() {
|
public function run() {
|
||||||
$this->log('Starting ManiaControl v' . self::VERSION . '!');
|
$this->log('Starting ManiaControl v' . self::VERSION . '!');
|
||||||
|
|
||||||
// Load plugins
|
|
||||||
$this->pluginManager->loadPlugins();
|
|
||||||
|
|
||||||
// Connect to server
|
// Connect to server
|
||||||
$this->connect();
|
$this->connect();
|
||||||
|
|
||||||
@ -297,6 +294,9 @@ class ManiaControl implements CommandListener {
|
|||||||
// OnInit callback
|
// OnInit callback
|
||||||
$this->callbackManager->triggerCallback(CallbackManager::CB_MC_ONINIT, array(CallbackManager::CB_MC_ONINIT));
|
$this->callbackManager->triggerCallback(CallbackManager::CB_MC_ONINIT, array(CallbackManager::CB_MC_ONINIT));
|
||||||
|
|
||||||
|
// Load plugins
|
||||||
|
$this->pluginManager->loadPlugins();
|
||||||
|
|
||||||
// Announce ManiaControl
|
// Announce ManiaControl
|
||||||
$this->chat->sendInformation('ManiaControl v' . self::VERSION . ' successfully started!');
|
$this->chat->sendInformation('ManiaControl v' . self::VERSION . ' successfully started!');
|
||||||
|
|
||||||
|
@ -101,7 +101,6 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
|
|||||||
|
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERMANIALINKPAGEANSWER, $this, 'handleManialinkPageAnswer');
|
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERMANIALINKPAGEANSWER, $this, 'handleManialinkPageAnswer');
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(self::CB_CUSTOM_VOTE_FINISHED, $this, 'handleVoteFinished');
|
$this->maniaControl->callbackManager->registerCallbackListener(self::CB_CUSTOM_VOTE_FINISHED, $this, 'handleVoteFinished');
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_ONINIT, $this, 'handleOnInit');
|
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERJOINED, $this, 'handlePlayerConnect');
|
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERJOINED, $this, 'handlePlayerConnect');
|
||||||
|
|
||||||
//Settings
|
//Settings
|
||||||
@ -127,6 +126,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
|
|||||||
$this->defineVote("restartmap", "Restart Map");
|
$this->defineVote("restartmap", "Restart Map");
|
||||||
$this->defineVote("pausegame", "Pause Game");
|
$this->defineVote("pausegame", "Pause Game");
|
||||||
|
|
||||||
|
$this->constructMenu();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
|
|||||||
*
|
*
|
||||||
* @param array $callback
|
* @param array $callback
|
||||||
*/
|
*/
|
||||||
public function handleOnInit(array $callback) {
|
private function constructMenu() {
|
||||||
// Menu RestartMap
|
// Menu RestartMap
|
||||||
$itemQuad = new Quad_UIConstruction_Buttons();
|
$itemQuad = new Quad_UIConstruction_Buttons();
|
||||||
$itemQuad->setSubStyle($itemQuad::SUBSTYLE_Reload);
|
$itemQuad->setSubStyle($itemQuad::SUBSTYLE_Reload);
|
||||||
|
@ -66,7 +66,6 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
|
|||||||
|
|
||||||
// Register for callbacks
|
// Register for callbacks
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_BILLUPDATED, $this, 'handleBillUpdated');
|
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_BILLUPDATED, $this, 'handleBillUpdated');
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_ONINIT, $this, 'handleOnInit');
|
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERJOINED, $this, 'handlePlayerConnect');
|
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERJOINED, $this, 'handlePlayerConnect');
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERMANIALINKPAGEANSWER, $this, 'handleManialinkPageAnswer');
|
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERMANIALINKPAGEANSWER, $this, 'handleManialinkPageAnswer');
|
||||||
|
|
||||||
@ -81,6 +80,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
|
|||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_DONATION_VALUES, "20,50,100,500,1000,2000");
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_DONATION_VALUES, "20,50,100,500,1000,2000");
|
||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_MIN_AMOUNT_SHOWN, 100);
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_MIN_AMOUNT_SHOWN, 100);
|
||||||
|
|
||||||
|
$this->displayWidget();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,11 +139,11 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle ManiaControl OnInit callback
|
* Handle ManiaControl OnStartup
|
||||||
*
|
*
|
||||||
* @param array $callback
|
* @param array $callback
|
||||||
*/
|
*/
|
||||||
public function handleOnInit(array $callback) {
|
public function displayWidget() {
|
||||||
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_DONATE_WIDGET_ACTIVATED)) {
|
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_DONATE_WIDGET_ACTIVATED)) {
|
||||||
$this->displayDonateWidget();
|
$this->displayDonateWidget();
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,6 @@ class KarmaPlugin implements CallbackListener, Plugin {
|
|||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_HEIGHT, 12.);
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_HEIGHT, 12.);
|
||||||
|
|
||||||
// Register for callbacks
|
// Register for callbacks
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_ONINIT, $this, 'handleOnInit');
|
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_BEGINMAP, $this, 'handleBeginMap');
|
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_BEGINMAP, $this, 'handleBeginMap');
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_1_SECOND, $this, 'handle1Second');
|
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_1_SECOND, $this, 'handle1Second');
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERCONNECT, $this, 'handlePlayerConnect');
|
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERCONNECT, $this, 'handlePlayerConnect');
|
||||||
@ -73,6 +72,7 @@ class KarmaPlugin implements CallbackListener, Plugin {
|
|||||||
// Define player stats
|
// Define player stats
|
||||||
$this->maniaControl->statisticManager->defineStatMetaData(self::STAT_PLAYER_MAPVOTES);
|
$this->maniaControl->statisticManager->defineStatMetaData(self::STAT_PLAYER_MAPVOTES);
|
||||||
|
|
||||||
|
$this->updateManialink = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,15 +181,6 @@ class KarmaPlugin implements CallbackListener, Plugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle ManiaControl OnInit callback
|
|
||||||
*
|
|
||||||
* @param array $callback
|
|
||||||
*/
|
|
||||||
public function handleOnInit(array $callback) {
|
|
||||||
$this->updateManialink = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle BeginMap ManiaControl callback
|
* Handle BeginMap ManiaControl callback
|
||||||
*
|
*
|
||||||
|
@ -86,7 +86,6 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
|||||||
$this->maniaControl->manialinkManager->customUIManager->setChallengeInfoVisible(false);
|
$this->maniaControl->manialinkManager->customUIManager->setChallengeInfoVisible(false);
|
||||||
|
|
||||||
// Register for callbacks
|
// Register for callbacks
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_ONINIT, $this, 'handleOnInit');
|
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_BEGINMAP, $this, 'handleOnBeginMap');
|
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_BEGINMAP, $this, 'handleOnBeginMap');
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_ENDMAP, $this, 'handleOnEndMap');
|
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_ENDMAP, $this, 'handleOnEndMap');
|
||||||
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERJOINED, $this, 'handlePlayerConnect');
|
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERJOINED, $this, 'handlePlayerConnect');
|
||||||
@ -116,6 +115,8 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
|||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_CLOCK_WIDGET_POSY, 90 - 11);
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_CLOCK_WIDGET_POSY, 90 - 11);
|
||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_CLOCK_WIDGET_WIDTH, 10);
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_CLOCK_WIDGET_WIDTH, 10);
|
||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_CLOCK_WIDGET_HEIGHT, 5.5);
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_CLOCK_WIDGET_HEIGHT, 5.5);
|
||||||
|
|
||||||
|
$this->displayWidgets();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,11 +129,11 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle ManiaControl OnInit callback
|
* Displays the Widgets onLoad
|
||||||
*
|
*
|
||||||
* @param array $callback
|
* @param array $callback
|
||||||
*/
|
*/
|
||||||
public function handleOnInit(array $callback) {
|
private function displayWidgets() {
|
||||||
// Display Map Widget
|
// Display Map Widget
|
||||||
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_MAP_WIDGET_ACTIVATED)) {
|
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_MAP_WIDGET_ACTIVATED)) {
|
||||||
$this->displayMapWidget();
|
$this->displayMapWidget();
|
||||||
|
Loading…
Reference in New Issue
Block a user