Add compatibility with php 8.2
This commit is contained in:
@ -40,11 +40,11 @@ class OnRespawnStructure extends BasePlayerTimeStructure {
|
||||
$this->numberOfRespawns = (int) $jsonObj->nbrespawns;
|
||||
$this->raceTime = (int) $jsonObj->racetime;
|
||||
$this->lapTime = (int) $jsonObj->laptime;
|
||||
$this->stuntsScore = $jsonObj->stuntsscore;
|
||||
if (isset($jsonObj->stuntsscore)) $this->stuntsScore = $jsonObj->stuntsscore;
|
||||
$this->checkPointInRace = (int) $jsonObj->checkpointinrace;
|
||||
$this->checkPointInLap = (int) $jsonObj->checkpointinlap;
|
||||
$this->speed = $jsonObj->speed;
|
||||
$this->distance = $jsonObj->distance;
|
||||
if (isset($jsonObj->distance)) $this->distance = $jsonObj->distance;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -48,6 +48,8 @@ class ElementBuilder {
|
||||
/**
|
||||
* Private Properties
|
||||
*/
|
||||
/** @var ManiaControl $maniaControl */
|
||||
private $maniaControl = null;
|
||||
/** @var array $actions */
|
||||
private $actions = array();
|
||||
/** @var array $columns */
|
||||
@ -173,6 +175,7 @@ class ElementBuilder {
|
||||
* @param float $textSize
|
||||
*/
|
||||
public function buildKarmaGauge($map, $width, $height, $textSize = 0.9) {
|
||||
/** @var \MCTeam\KarmaPlugin $karmaPlugin */
|
||||
$karmaPlugin = $this->maniaControl->getPluginManager()->getPlugin(self::DEFAULT_KARMA_PLUGIN);
|
||||
if (!$karmaPlugin) {
|
||||
return null;
|
||||
|
@ -88,9 +88,13 @@ class Map implements Dumpable, UsageInformationAble {
|
||||
$this->nbCheckpoints = $mpMap->nbCheckpoints;
|
||||
$this->nbLaps = $mpMap->nbLaps;
|
||||
|
||||
$this->authorNick = $mpMap->authorNickname;
|
||||
|
||||
$player = $this->maniaControl->getPlayerManager()->getPlayer($this->authorLogin);
|
||||
if ($player) {
|
||||
$this->authorNick = $player->nickname;
|
||||
} else if ($mpMap->authorNickname !== "") {
|
||||
$this->authorNick = $mpMap->authorNickname;
|
||||
} else {
|
||||
$this->authorNick = $this->authorLogin;
|
||||
}
|
||||
|
@ -32,6 +32,14 @@ class PlayerDetailed {
|
||||
/** @var ManiaControl $maniaControl */
|
||||
private $maniaControl = null;
|
||||
|
||||
private $width;
|
||||
private $height;
|
||||
|
||||
private $contentY;
|
||||
private $infoColWidth;
|
||||
private $margin;
|
||||
private $padding;
|
||||
|
||||
/**
|
||||
* Create a new Player Detailed Instance
|
||||
*
|
||||
@ -43,8 +51,6 @@ class PlayerDetailed {
|
||||
// Settings
|
||||
$this->width = $this->maniaControl->getManialinkManager()->getStyleManager()->getListWidgetsWidth();
|
||||
$this->height = $this->maniaControl->getManialinkManager()->getStyleManager()->getListWidgetsHeight();
|
||||
$this->quadStyle = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultMainWindowStyle();
|
||||
$this->quadSubstyle = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultMainWindowSubStyle();
|
||||
|
||||
//Class variables
|
||||
$this->contentY = $this->height / 2 - 15;
|
||||
|
@ -42,6 +42,7 @@ class Setting implements UsageInformationAble {
|
||||
public $fetchTime = null;
|
||||
public $description = null;
|
||||
public $priority = null;
|
||||
public $changed = null;
|
||||
|
||||
/**
|
||||
* Construct a new setting instance
|
||||
|
Reference in New Issue
Block a user