- static getTitle() function of configurator menu interface

- removed reopenMenu() configurator function
- use more intelligent showMenu() function
This commit is contained in:
Steffen Schröder
2014-07-24 23:15:25 +02:00
parent 6138274a98
commit d531d97366
7 changed files with 40 additions and 55 deletions

View File

@ -48,6 +48,13 @@ class InstallMenu implements ConfiguratorMenu, ManialinkPageAnswerListener {
$this->maniaControl->manialinkManager->registerManialinkPageAnswerListener(self::ACTION_REFRESH_LIST, $this, 'handleRefreshListAction');
}
/**
* @see \ManiaControl\Configurators\ConfiguratorMenu::getTitle()
*/
public static function getTitle() {
return 'Install Plugins';
}
/**
* @see \ManiaControl\Configurators\ConfiguratorMenu::getMenu()
*/
@ -262,14 +269,6 @@ class InstallMenu implements ConfiguratorMenu, ManialinkPageAnswerListener {
* @param Player $player
*/
public function handleRefreshListAction(array $actionCallback, Player $player) {
$menuId = $this->maniaControl->configurator->getMenuId(self::getTitle());
$this->maniaControl->configurator->reopenMenu($player, $menuId);
}
/**
* @see \ManiaControl\Configurators\ConfiguratorMenu::getTitle()
*/
public function getTitle() {
return 'Install Plugins';
$this->maniaControl->configurator->showMenu($player, $this);
}
}

View File

@ -64,19 +64,21 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
}
/**
* Returns Back to the Plugins
* @see \ManiaControl\Configurators\ConfiguratorMenu::getTitle()
*/
public function backToPlugins($callback, Player $player) {
$player->destroyCache($this, self::CACHE_SETTING_CLASS);
$menuId = $this->maniaControl->configurator->getMenuId($this->getTitle());
$this->maniaControl->configurator->reopenMenu($player, $menuId);
public static function getTitle() {
return 'Plugins';
}
/**
* @see \ManiaControl\Configurators\ConfiguratorMenu::getTitle()
* Return back to the Plugins
*
* @param array $callback
* @param Player $player
*/
public function getTitle() {
return 'Plugins';
public function backToPlugins($callback, Player $player) {
$player->destroyCache($this, self::CACHE_SETTING_CLASS);
$this->maniaControl->configurator->showMenu($player, $this);
}
/**
@ -381,8 +383,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
}
// Reopen the Menu
$menuId = $this->maniaControl->configurator->getMenuId($this->getTitle());
$this->maniaControl->configurator->reopenMenu($player, $menuId);
$this->maniaControl->configurator->showMenu($player, $this);
}
/**
@ -417,7 +418,6 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
$this->maniaControl->chat->sendSuccess('Plugin Settings saved!', $player);
// Reopen the Menu
$menuId = $this->maniaControl->configurator->getMenuId($this->getTitle());
$this->maniaControl->configurator->reopenMenu($player, $menuId);
$this->maniaControl->configurator->showMenu($player, $this);
}
}