dedimania widget disable possability
This commit is contained in:
parent
13b57c7cdb
commit
188d906e57
@ -43,6 +43,7 @@ class Dedimania implements CallbackListener, CommandListener, TimerListener, Plu
|
|||||||
const DEDIMANIA_UPDATESERVERPLAYERS = 'dedimania.UpdateServerPlayers';
|
const DEDIMANIA_UPDATESERVERPLAYERS = 'dedimania.UpdateServerPlayers';
|
||||||
const DEDIMANIA_SETCHALLENGETIMES = 'dedimania.SetChallengeTimes';
|
const DEDIMANIA_SETCHALLENGETIMES = 'dedimania.SetChallengeTimes';
|
||||||
const DEDIMANIA_WARNINGSANDTTR2 = 'dedimania.WarningsAndTTR2';
|
const DEDIMANIA_WARNINGSANDTTR2 = 'dedimania.WarningsAndTTR2';
|
||||||
|
const SETTING_WIDGET_ENABLE = 'Enable Dedimania Widget';
|
||||||
const SETTING_WIDGET_TITLE = 'Widget Title';
|
const SETTING_WIDGET_TITLE = 'Widget Title';
|
||||||
const SETTING_WIDGET_POSX = 'Widget Position: X';
|
const SETTING_WIDGET_POSX = 'Widget Position: X';
|
||||||
const SETTING_WIDGET_POSY = 'Widget Position: Y';
|
const SETTING_WIDGET_POSY = 'Widget Position: Y';
|
||||||
@ -91,6 +92,7 @@ class Dedimania implements CallbackListener, CommandListener, TimerListener, Plu
|
|||||||
throw new \Exception("You need to activate the PHP extension xmlrpc to run this Plugin!");
|
throw new \Exception("You need to activate the PHP extension xmlrpc to run this Plugin!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_ENABLE, true);
|
||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_TITLE, 'Dedimania');
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_TITLE, 'Dedimania');
|
||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_POSX, -139);
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_POSX, -139);
|
||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_POSY, 7);
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_POSY, 7);
|
||||||
@ -172,9 +174,11 @@ class Dedimania implements CallbackListener, CommandListener, TimerListener, Plu
|
|||||||
|
|
||||||
$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);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the session is alive every minute
|
* Check if the session is alive every minute
|
||||||
@ -479,7 +483,7 @@ class Dedimania implements CallbackListener, CommandListener, TimerListener, Plu
|
|||||||
|
|
||||||
// get PlayerList
|
// get PlayerList
|
||||||
$records = $this->dedimaniaData->records;
|
$records = $this->dedimaniaData->records;
|
||||||
if(!$records) {
|
if (!$records) {
|
||||||
$this->maniaControl->chat->sendInformation('There are no Dedimania records on this map!');
|
$this->maniaControl->chat->sendInformation('There are no Dedimania records on this map!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -538,8 +542,10 @@ class Dedimania implements CallbackListener, CommandListener, TimerListener, Plu
|
|||||||
$lineQuad->setZ(0.001);
|
$lineQuad->setZ(0.001);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strlen($listRecord->nickName) < 2) $listRecord->nickName = $listRecord->login;
|
if (strlen($listRecord->nickName) < 2) {
|
||||||
$array = array($listRecord->rank => $x + 5, '$fff'.$listRecord->nickName => $x + 18, $listRecord->login => $x + 70, Formatter::formatTime($listRecord->best) => $x + 101);
|
$listRecord->nickName = $listRecord->login;
|
||||||
|
}
|
||||||
|
$array = array($listRecord->rank => $x + 5, '$fff' . $listRecord->nickName => $x + 18, $listRecord->login => $x + 70, Formatter::formatTime($listRecord->best) => $x + 101);
|
||||||
$this->maniaControl->manialinkManager->labelLine($recordFrame, $array);
|
$this->maniaControl->manialinkManager->labelLine($recordFrame, $array);
|
||||||
|
|
||||||
$recordFrame->setY($y);
|
$recordFrame->setY($y);
|
||||||
@ -566,7 +572,7 @@ class Dedimania implements CallbackListener, CommandListener, TimerListener, Plu
|
|||||||
$login = $callback[1][1];
|
$login = $callback[1][1];
|
||||||
$player = $this->maniaControl->playerManager->getPlayer($login);
|
$player = $this->maniaControl->playerManager->getPlayer($login);
|
||||||
|
|
||||||
if($actionId == self::ACTION_SHOW_DEDIRECORDSLIST) {
|
if ($actionId == self::ACTION_SHOW_DEDIRECORDSLIST) {
|
||||||
$this->showDediRecordsList(array(), $player);
|
$this->showDediRecordsList(array(), $player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -948,8 +954,11 @@ class Dedimania implements CallbackListener, CommandListener, TimerListener, Plu
|
|||||||
switch($gameMode) {
|
switch($gameMode) {
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
if($scriptName == 'Rounds' || $scriptName == 'Cup' || $scriptName == 'Team') { return 'Rounds'; }
|
if ($scriptName == 'Rounds' || $scriptName == 'Cup' || $scriptName == 'Team') {
|
||||||
else if($scriptName == 'TimeAttack' || $scriptName == 'Laps' || $scriptName == 'TeamAttack'){ return 'TA'; }
|
return 'Rounds';
|
||||||
|
} else if ($scriptName == 'TimeAttack' || $scriptName == 'Laps' || $scriptName == 'TeamAttack') {
|
||||||
|
return 'TA';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
case 3:
|
case 3:
|
||||||
|
@ -80,7 +80,7 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
|||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_WIDTH, 40.);
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_WIDTH, 40.);
|
||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_LINESCOUNT, 15);
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_LINESCOUNT, 15);
|
||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_LINEHEIGHT, 4.);
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_LINEHEIGHT, 4.);
|
||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_ENABLE, false);
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_WIDGET_ENABLE, true);
|
||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_NOTIFY_ONLY_DRIVER, false);
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_NOTIFY_ONLY_DRIVER, false);
|
||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_NOTIFY_BEST_RECORDS, -1);
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_NOTIFY_BEST_RECORDS, -1);
|
||||||
$this->maniaControl->settingManager->initSetting($this, self::SETTING_ADJUST_OUTER_BORDER, false);
|
$this->maniaControl->settingManager->initSetting($this, self::SETTING_ADJUST_OUTER_BORDER, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user