changed direct public access of maniacontrol properties to using getter methods

This commit is contained in:
Steffen Schröder
2014-08-03 01:34:18 +02:00
parent e560919096
commit 4d3dc92ad5
64 changed files with 2337 additions and 2055 deletions

View File

@ -38,17 +38,17 @@ class HelpManager implements CommandListener, CallbackListener {
$this->maniaControl = $maniaControl;
// Callbacks
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ONINIT, $this, 'handleOnInit');
$this->maniaControl->getCallbackManager()->registerCallbackListener(Callbacks::ONINIT, $this, 'handleOnInit');
}
/**
* Handle ManiaControl OnInit Callback
*/
public function handleOnInit() {
$this->maniaControl->commandManager->registerCommandListener('help', $this, 'command_playerHelp', false, 'Shows all commands in chat.');
$this->maniaControl->commandManager->registerCommandListener('helpall', $this, 'command_playerHelpAll', false, 'Shows all commands in ManiaLink with description.');
$this->maniaControl->commandManager->registerCommandListener('help', $this, 'command_adminHelp', true, 'Shows all admin commands in chat.');
$this->maniaControl->commandManager->registerCommandListener('helpall', $this, 'command_adminHelpAll', true, 'Shows all admin commands in ManiaLink with description.');
$this->maniaControl->getCommandManager()->registerCommandListener('help', $this, 'command_playerHelp', false, 'Shows all commands in chat.');
$this->maniaControl->getCommandManager()->registerCommandListener('helpall', $this, 'command_playerHelpAll', false, 'Shows all commands in ManiaLink with description.');
$this->maniaControl->getCommandManager()->registerCommandListener('help', $this, 'command_adminHelp', true, 'Shows all admin commands in chat.');
$this->maniaControl->getCommandManager()->registerCommandListener('helpall', $this, 'command_adminHelpAll', true, 'Shows all admin commands in ManiaLink with description.');
}
/**
@ -79,7 +79,7 @@ class HelpManager implements CommandListener, CallbackListener {
$message .= $command['Name'] . ',';
}
$message = substr($message, 0, -1);
$this->maniaControl->chat->sendChat($message, $player->login);
$this->maniaControl->getChat()->sendChat($message, $player);
}
/**
@ -110,7 +110,7 @@ class HelpManager implements CommandListener, CallbackListener {
$message .= $command['Name'] . ',';
}
$message = substr($message, 0, -1);
$this->maniaControl->chat->sendChat($message, $player->login);
$this->maniaControl->getChat()->sendChat($message, $player);
}
/**
@ -161,8 +161,8 @@ class HelpManager implements CommandListener, CallbackListener {
* @param mixed $player
*/
private function showHelpAllList(array $commands, $player) {
$width = $this->maniaControl->manialinkManager->getStyleManager()->getListWidgetsWidth();
$height = $this->maniaControl->manialinkManager->getStyleManager()->getListWidgetsHeight();
$width = $this->maniaControl->getManialinkManager()->getStyleManager()->getListWidgetsWidth();
$height = $this->maniaControl->getManialinkManager()->getStyleManager()->getListWidgetsHeight();
// create manialink
$maniaLink = new ManiaLink(ManialinkManager::MAIN_MLID);
@ -171,7 +171,7 @@ class HelpManager implements CommandListener, CallbackListener {
$script->addFeature($paging);
// Main frame
$frame = $this->maniaControl->manialinkManager->getStyleManager()->getDefaultListFrame($script, $paging);
$frame = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultListFrame($script, $paging);
$maniaLink->add($frame);
// Start offsets
@ -179,7 +179,7 @@ class HelpManager implements CommandListener, CallbackListener {
$posY = $height / 2;
//Predefine description Label
$descriptionLabel = $this->maniaControl->manialinkManager->getStyleManager()->getDefaultDescriptionLabel();
$descriptionLabel = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultDescriptionLabel();
$frame->add($descriptionLabel);
// Headline
@ -187,7 +187,7 @@ class HelpManager implements CommandListener, CallbackListener {
$frame->add($headFrame);
$headFrame->setY($posY - 5);
$array = array('Command' => $posX + 5, 'Description' => $posX + 50);
$this->maniaControl->manialinkManager->labelLine($headFrame, $array);
$this->maniaControl->getManialinkManager()->labelLine($headFrame, $array);
$index = 1;
$posY -= 10;
@ -214,7 +214,7 @@ class HelpManager implements CommandListener, CallbackListener {
}
$array = array($command['Name'] => $posX + 5, $command['Description'] => $posX + 50);
$labels = $this->maniaControl->manialinkManager->labelLine($playerFrame, $array);
$labels = $this->maniaControl->getManialinkManager()->labelLine($playerFrame, $array);
$label = $labels[0];
$label->setWidth(40);
@ -224,7 +224,7 @@ class HelpManager implements CommandListener, CallbackListener {
}
// Render and display xml
$this->maniaControl->manialinkManager->displayWidget($maniaLink, $player, 'HelpAllList');
$this->maniaControl->getManialinkManager()->displayWidget($maniaLink, $player, 'HelpAllList');
}
/**