files should have the same name as their classes
who renamed this class?..
This commit is contained in:
parent
cf78a2a141
commit
5cac6b4cd1
@ -32,7 +32,7 @@ use ManiaControl\Plugins\Plugin;
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerListener, Plugin {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const ID = 7;
|
||||
@ -56,6 +56,7 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
* Private Properties
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* @var maniaControl $maniaControl
|
||||
*/
|
||||
private $maniaControl = null;
|
||||
@ -73,6 +74,7 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \ManiaControl\Plugins\Plugin::load()
|
||||
*/
|
||||
public function load(ManiaControl $maniaControl) {
|
||||
@ -107,12 +109,12 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \ManiaControl\Plugins\Plugin::unload()
|
||||
*/
|
||||
public function unload() {
|
||||
$this->maniaControl->callbackManager->unregisterCallbackListener($this);
|
||||
$this->maniaControl->timerManager->unregisterTimerListenings($this);
|
||||
unset($this->maniaControl);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -143,6 +145,7 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \ManiaControl\Plugins\Plugin::getId()
|
||||
*/
|
||||
public static function getId() {
|
||||
@ -150,6 +153,7 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \ManiaControl\Plugins\Plugin::getName()
|
||||
*/
|
||||
public static function getName() {
|
||||
@ -157,6 +161,7 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \ManiaControl\Plugins\Plugin::getVersion()
|
||||
*/
|
||||
public static function getVersion() {
|
||||
@ -164,6 +169,7 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \ManiaControl\Plugins\Plugin::getAuthor()
|
||||
*/
|
||||
public static function getAuthor() {
|
||||
@ -171,6 +177,7 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \ManiaControl\Plugins\Plugin::getDescription()
|
||||
*/
|
||||
public static function getDescription() {
|
||||
@ -201,14 +208,14 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function handleSettingsChanged($class, $settingName, $value) {
|
||||
if (!$class = get_class()) {
|
||||
return;
|
||||
}
|
||||
if ($settingName == 'Enable Local Records Widget' && $value == true) {
|
||||
$this->updateManialink = true;
|
||||
} elseif ($settingName == 'Enable Local Records Widget' && $value == false) {
|
||||
}
|
||||
elseif ($settingName == 'Enable Local Records Widget' && $value == false) {
|
||||
$ml = new ManiaLink(self::MLID_RECORDS);
|
||||
$mltext = $ml->render()->saveXML();
|
||||
$this->maniaControl->manialinkManager->sendManialink($mltext);
|
||||
@ -323,7 +330,8 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
if ($oldRecord) $oldRank = ($improvement == 'improved your') ? '' : $oldRecord->rank . '. ';
|
||||
if ($oldRecord) $message .= '$> ($<$ff0' . $oldRank . '$>$<$fff-' . Formatter::formatTime(($oldRecord->time - $newRecord->time)) . '$>)!';
|
||||
$this->maniaControl->chat->sendInformation('$3c0' . $message, $player->login);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$improvement = ((!$oldRecord || $newRecord->rank < $oldRecord->rank) ? 'gained the' : 'improved the');
|
||||
$message = '$<' . $player->nickname . '$> ' . $improvement . ' $<$ff0' . $newRecord->rank . '.$> Local Record: $<$fff' . Formatter::formatTime($newRecord->time);
|
||||
if ($oldRecord) $oldRank = ($improvement == 'improved the') ? '' : $oldRecord->rank . '. ';
|
||||
@ -348,6 +356,12 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a Player's record
|
||||
*
|
||||
* @param array $chat
|
||||
* @param Player $player
|
||||
*/
|
||||
public function deleteRecord(array $chat, Player $player) {
|
||||
if (!$this->maniaControl->authenticationManager->checkRight($player, AuthenticationManager::AUTH_LEVEL_MASTERADMIN)) {
|
||||
$this->maniaControl->authenticationManager->sendNotAllowed($player);
|
||||
@ -369,12 +383,13 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
$mysqli->query($query);
|
||||
if ($mysqli->error) {
|
||||
trigger_error($mysqli->error);
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
$this->maniaControl->callbackManager->triggerCallback(self::CB_LOCALRECORDS_CHANGED, null);
|
||||
$this->maniaControl->chat->sendInformation('Record no. $<$fff' . $recordId . '$> has been removed!');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$this->maniaControl->chat->sendError('Cannot remove record $<$fff' . $recordId . '$>, because it\'s not an integer!', $player);
|
||||
}
|
||||
}
|
||||
@ -450,7 +465,8 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
}
|
||||
|
||||
if (strlen($listRecord->nickname) < 2) $listRecord->nickname = $listRecord->login;
|
||||
$array = array($listRecord->rank => $x + 5, '$fff'.$listRecord->nickname => $x + 18, $listRecord->login => $x + 70, Formatter::formatTime($listRecord->time) => $x + 101);
|
||||
$array = array($listRecord->rank => $x + 5, '$fff' . $listRecord->nickname => $x + 18, $listRecord->login => $x + 70,
|
||||
Formatter::formatTime($listRecord->time) => $x + 101);
|
||||
$this->maniaControl->manialinkManager->labelLine($recordFrame, $array);
|
||||
|
||||
$recordFrame->setY($y);
|
||||
@ -549,10 +565,9 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
$frame->add($recordFrame);
|
||||
$recordFrame->setPosition(0, $y);
|
||||
|
||||
/*$backgroundQuad = new Quad();
|
||||
$recordFrame->add($backgroundQuad);
|
||||
$backgroundQuad->setSize($width * 1.04, $lineHeight * 1.4);
|
||||
$backgroundQuad->setStyles($quadStyle, $quadSubstyle);*/
|
||||
/*
|
||||
* $backgroundQuad = new Quad(); $recordFrame->add($backgroundQuad); $backgroundQuad->setSize($width * 1.04, $lineHeight * 1.4); $backgroundQuad->setStyles($quadStyle, $quadSubstyle);
|
||||
*/
|
||||
|
||||
$rankLabel = new Label();
|
||||
$recordFrame->add($rankLabel);
|
||||
@ -640,4 +655,3 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
return $record;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user