fix many PHP 8.4 compatibility issues
This commit is contained in:
@ -39,7 +39,7 @@ class RecordWidget {
|
||||
* @param \ManiaControl\Players\Player|null $player
|
||||
* @return \FML\Controls\Frame
|
||||
*/
|
||||
public function generateRecordLineFrame($record, Player $player = null) {
|
||||
public function generateRecordLineFrame($record, ?Player $player = null) {
|
||||
$width = $this->width;
|
||||
$lineHeight = $this->lineHeight;
|
||||
$largeNumberDiff = 0;
|
||||
@ -92,6 +92,7 @@ class RecordWidget {
|
||||
$recordFrame->addChild($quad);
|
||||
$quad->setStyles(Quad_Bgs1InRace::STYLE, Quad_Bgs1InRace::SUBSTYLE_BgCardList);
|
||||
$quad->setSize($width, $lineHeight);
|
||||
$quad->setZ(-1);
|
||||
}
|
||||
|
||||
return $recordFrame;
|
||||
@ -105,7 +106,7 @@ class RecordWidget {
|
||||
* @param \ManiaControl\Players\Player|null $player
|
||||
* @return \FML\Controls\Frame
|
||||
*/
|
||||
public function generateRecordsFrame($records, $limit, Player $player = null) {
|
||||
public function generateRecordsFrame($records, $limit, ?Player $player = null) {
|
||||
$lineHeight = $this->lineHeight;
|
||||
|
||||
$frame = new Frame();
|
||||
|
@ -83,7 +83,7 @@ class DedimaniaPlugin implements CallbackListener, CallQueueListener, CommandLis
|
||||
public static function prepare(ManiaControl $maniaControl) {
|
||||
$servers = $maniaControl->getServer()->getAllServers();
|
||||
foreach ($servers as $server) {
|
||||
$maniaControl->getSettingManager()->initSetting(get_class(), self::SETTING_DEDIMANIA_CODE . $server->login . '$l', '');
|
||||
$maniaControl->getSettingManager()->initSetting(get_called_class(), self::SETTING_DEDIMANIA_CODE . $server->login . '$l', '');
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,7 +156,7 @@ class DedimaniaPlugin implements CallbackListener, CallQueueListener, CommandLis
|
||||
|
||||
$this->recordWidget = new RecordWidget($this->maniaControl);
|
||||
|
||||
if ($this->maniaControl->getServer()->getGameMode() == 0) {
|
||||
if (true/*$this->maniaControl->getServer()->getGameMode() == 0*/) {
|
||||
$gameMode = $this->maniaControl->getClient()->getScriptName()['CurrentValue'];
|
||||
$this->isMultilap = ($gameMode == 'Laps.Script.txt' || $this->maniaControl->getMapManager()->getCurrentMap()->nbLaps > 0);
|
||||
$this->isRounds = ($gameMode == 'Rounds.Script.txt');
|
||||
|
@ -52,11 +52,11 @@ class DynamicPointLimitPlugin implements CallbackListener, CommandListener, Plug
|
||||
* @see \ManiaControl\Plugins\Plugin::prepare()
|
||||
*/
|
||||
public static function prepare(ManiaControl $maniaControl) {
|
||||
$maniaControl->getSettingManager()->initSetting(get_class(), self::SETTING_POINT_LIMIT_MULTIPLIER, 10);
|
||||
$maniaControl->getSettingManager()->initSetting(get_class(), self::SETTING_POINT_LIMIT_OFFSET, 0);
|
||||
$maniaControl->getSettingManager()->initSetting(get_class(), self::SETTING_MIN_POINT_LIMIT, 30);
|
||||
$maniaControl->getSettingManager()->initSetting(get_class(), self::SETTING_MAX_POINT_LIMIT, 200);
|
||||
$maniaControl->getSettingManager()->initSetting(get_class(), self::SETTING_ACCEPT_OTHER_MODES, false);
|
||||
$maniaControl->getSettingManager()->initSetting(get_called_class(), self::SETTING_POINT_LIMIT_MULTIPLIER, 10);
|
||||
$maniaControl->getSettingManager()->initSetting(get_called_class(), self::SETTING_POINT_LIMIT_OFFSET, 0);
|
||||
$maniaControl->getSettingManager()->initSetting(get_called_class(), self::SETTING_MIN_POINT_LIMIT, 30);
|
||||
$maniaControl->getSettingManager()->initSetting(get_called_class(), self::SETTING_MAX_POINT_LIMIT, 200);
|
||||
$maniaControl->getSettingManager()->initSetting(get_called_class(), self::SETTING_ACCEPT_OTHER_MODES, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -79,7 +79,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
|
||||
* @see \ManiaControl\Plugins\Plugin::prepare()
|
||||
*/
|
||||
public static function prepare(ManiaControl $maniaControl) {
|
||||
$thisClass = get_class();
|
||||
$thisClass = get_called_class();
|
||||
$maniaControl->getSettingManager()->initSetting($thisClass, self::SETTING_MX_KARMA_ACTIVATED, true);
|
||||
$maniaControl->getSettingManager()->initSetting($thisClass, self::SETTING_MX_KARMA_IMPORTING, true);
|
||||
$maniaControl->getSettingManager()->initSetting($thisClass, self::SETTING_WIDGET_DISPLAY_MX, true);
|
||||
@ -343,7 +343,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
|
||||
/**
|
||||
* Fetch the mxKarmaVotes for the current map
|
||||
*/
|
||||
public function getMxKarmaVotes(Player $player = null) {
|
||||
public function getMxKarmaVotes(?Player $player = null) {
|
||||
if (!$this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MX_KARMA_ACTIVATED)) {
|
||||
return;
|
||||
}
|
||||
@ -901,7 +901,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
|
||||
* @param Map $map
|
||||
* @param bool $forceBuild
|
||||
*/
|
||||
private function buildManialink(Map $map = null, $forceBuild = false) {
|
||||
private function buildManialink(?Map $map = null, $forceBuild = false) {
|
||||
if (!$forceBuild) {
|
||||
return;
|
||||
}
|
||||
@ -915,7 +915,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
|
||||
$quadStyle = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultQuadStyle();
|
||||
$quadSubstyle = $this->maniaControl->getManialinkManager()->getStyleManager()->getDefaultQuadSubstyle();
|
||||
|
||||
$manialink = new ManiaLink(self::MLID_KARMA);
|
||||
$manialink = new ManiaLink(self::MLID_KARMA, 3);
|
||||
|
||||
$frame = new Frame();
|
||||
$manialink->addChild($frame);
|
||||
|
Reference in New Issue
Block a user