Send changed record with callback
This commit is contained in:
parent
c70a289bbc
commit
6429025304
@ -175,14 +175,16 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
|||||||
* @param $time
|
* @param $time
|
||||||
*/
|
*/
|
||||||
public function handle1Second($time) {
|
public function handle1Second($time) {
|
||||||
|
|
||||||
if (!$this->updateManialink) {
|
if (!$this->updateManialink) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->updateManialink = false;
|
$this->updateManialink = false;
|
||||||
|
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_WIDGET_ENABLE)) {
|
||||||
$manialink = $this->buildManialink();
|
$manialink = $this->buildManialink();
|
||||||
$this->maniaControl->manialinkManager->sendManialink($manialink);
|
$this->maniaControl->manialinkManager->sendManialink($manialink);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function handleSettingsChanged($class, $settingName, $value) {
|
public function handleSettingsChanged($class, $settingName, $value) {
|
||||||
@ -271,10 +273,11 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->updateManialink = true;
|
$this->updateManialink = true;
|
||||||
$this->maniaControl->callbackManager->triggerCallback(self::CB_LOCALRECORDS_CHANGE);
|
|
||||||
|
|
||||||
// Announce record
|
// Announce record
|
||||||
$newRecord = $this->getLocalRecord($map, $player);
|
$newRecord = $this->getLocalRecord($map, $player);
|
||||||
|
$this->maniaControl->callbackManager->triggerCallback(self::CB_LOCALRECORDS_CHANGE, array($newRecord));
|
||||||
|
|
||||||
$notifyOnlyDriver = $this->maniaControl->settingManager->getSetting($this, self::SETTING_NOTIFY_ONLY_DRIVER);
|
$notifyOnlyDriver = $this->maniaControl->settingManager->getSetting($this, self::SETTING_NOTIFY_ONLY_DRIVER);
|
||||||
$notifyOnlyBestRecords = $this->maniaControl->settingManager->getSetting($this, self::SETTING_NOTIFY_BEST_RECORDS);
|
$notifyOnlyBestRecords = $this->maniaControl->settingManager->getSetting($this, self::SETTING_NOTIFY_BEST_RECORDS);
|
||||||
if ($notifyOnlyDriver || $notifyOnlyBestRecords > 0 && $newRecord->rank > $notifyOnlyBestRecords) {
|
if ($notifyOnlyDriver || $notifyOnlyBestRecords > 0 && $newRecord->rank > $notifyOnlyBestRecords) {
|
||||||
|
Loading…
Reference in New Issue
Block a user