small bugfix

This commit is contained in:
kremsy 2013-12-16 15:08:37 +01:00
parent 7b3d0d7420
commit 522d7e4a2a
2 changed files with 5 additions and 8 deletions

View File

@ -19,6 +19,7 @@ class MapCommands implements CommandListener {
* Private properties
*/
private $maniaControl = null;
private $mapList = null;
/**
* Create MapCommands instance
@ -38,6 +39,8 @@ class MapCommands implements CommandListener {
$this->maniaControl->commandManager->registerCommandListener('xlist', $this, 'command_xList');
$this->maniaControl->commandManager->registerCommandListener('list', $this, 'command_List');
$this->maniaControl->commandManager->registerCommandListener('maps', $this, 'command_List');
$this->mapList = new MapList($this->maniaControl);
}
/**
@ -123,8 +126,7 @@ class MapCommands implements CommandListener {
* @param Player $player
*/
public function command_List(array $chatCallback, Player $player) {
$mapList = new MapList($this->maniaControl);
$mapList->showMapList($player);
$this->mapList->showMapList($player);
}
/**
@ -133,7 +135,6 @@ class MapCommands implements CommandListener {
* @param Player $player
*/
public function command_xList(array $chatCallback, Player $player) {
$mapList = new MapList($this->maniaControl);
$mapList->showManiaExchangeList($chatCallback, $player);
$this->mapList->showManiaExchangeList($chatCallback, $player);
}
}

View File

@ -75,8 +75,6 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
* @param Player $player
*/
public function showManiaExchangeList(array $chatCallback, Player $player){
$this->maniaControl->manialinkManager->closeWidget($player);
$params = explode(' ', $chatCallback[1][2]);
$serverInfo = $this->maniaControl->server->getSystemInfo();
@ -214,8 +212,6 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
* @param Player $player
*/
public function showMapList(Player $player){
$this->maniaControl->manialinkManager->closeWidget($player);
$maniaLink = new ManiaLink(ManialinkManager::MAIN_MLID);
$frame = $this->buildMainFrame();
$maniaLink->add($frame);