From decebc1d18c42ab98819e39f5899641626d3bfb6 Mon Sep 17 00:00:00 2001 From: kremsy Date: Tue, 31 Dec 2013 10:05:38 +0100 Subject: [PATCH] commented tooltips to avoid crashes --- .../core/Configurators/ScriptSettings.php | 9 ++++++--- application/core/FML/Script/Script.php | 4 ++-- application/core/Manialinks/CustomUIManager.php | 7 +++---- application/core/Maps/MapList.php | 13 +++++++------ application/core/Players/PlayerList.php | 16 ++++++++-------- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/application/core/Configurators/ScriptSettings.php b/application/core/Configurators/ScriptSettings.php index 0298eb2d..04841c66 100644 --- a/application/core/Configurators/ScriptSettings.php +++ b/application/core/Configurators/ScriptSettings.php @@ -214,6 +214,11 @@ class ScriptSettings implements ConfiguratorMenu,CallbackListener { $newSettings[$settingName] = $setting["Value"]; } + //Nothing has been changed + if($chatMessage = ''){ + return; + } + $success = $this->maniaControl->client->query('SetModeScriptSettings', $newSettings); if (!$success) { $this->maniaControl->chat->sendError('Error occurred: ' . $this->maniaControl->getClientErrorText(), $player->login); @@ -226,9 +231,7 @@ class ScriptSettings implements ConfiguratorMenu,CallbackListener { $title = $this->maniaControl->authenticationManager->getAuthLevelName($player->authLevel); - if($chatMessage != ''){ - $this->maniaControl->chat->sendInformation('$ff0' . $title . ' $<' . $player->nickname . '$> set Scriptsettings $<' . $chatMessage . '$>!'); - } + $this->maniaControl->chat->sendInformation('$ff0' . $title . ' $<' . $player->nickname . '$> set Scriptsettings $<' . $chatMessage . '$>!'); // log console message $this->maniaControl->log(Formatter::stripCodes($title . ' ' . $player->nickname . ' set Scriptsettings ' . $chatMessage . '!')); diff --git a/application/core/FML/Script/Script.php b/application/core/FML/Script/Script.php index f4a4500e..f5b7c0b1 100644 --- a/application/core/FML/Script/Script.php +++ b/application/core/FML/Script/Script.php @@ -170,7 +170,7 @@ class Script { $profileControl->setScriptEvents(true); $profileControl->addClass(self::CLASS_PROFILE); if ($playerLogin) { - $profilControl->addClass(self::CLASS_PROFILE . '-' . $playerLogin); + $profileControl->addClass(self::CLASS_PROFILE . '-' . $playerLogin); } $this->profile = true; return $this; @@ -442,4 +442,4 @@ if (Event.Control.HasClass(\"" . self::CLASS_MAPINFO . "\") { $mainFunction = file_get_contents(__DIR__ . '/Parts/Main.txt'); return $mainFunction; } -} +} diff --git a/application/core/Manialinks/CustomUIManager.php b/application/core/Manialinks/CustomUIManager.php index 68a2e585..47afbc52 100644 --- a/application/core/Manialinks/CustomUIManager.php +++ b/application/core/Manialinks/CustomUIManager.php @@ -2,15 +2,14 @@ namespace ManiaControl\Manialinks; + +use FML\CustomUI; use ManiaControl\ManiaControl; use ManiaControl\Callbacks\CallbackListener; use ManiaControl\Callbacks\CallbackManager; use ManiaControl\Players\Player; use ManiaControl\Players\PlayerManager; -use FML\ManiaLink; -use FML\Elements\CustomUI; -use FML\Controls\Quad; -use FML\ManiaLinks; + /** * Class managing the Custom UI Settings diff --git a/application/core/Maps/MapList.php b/application/core/Maps/MapList.php index 681b3359..db83ff15 100644 --- a/application/core/Maps/MapList.php +++ b/application/core/Maps/MapList.php @@ -246,8 +246,9 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener { $script = new Script(); $maniaLink->setScript($script); - $tooltips = new Tooltips(); - $script->addFeature($tooltips); + //$script->addTooltip($script::CLASS_TOOLTIPS); + //$tooltips = new Tooltips(); + //$script->addFeature($tooltips); //Headline $headFrame = new Frame(); @@ -328,7 +329,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener { $jukeLabel->setTextColor("FFF"); $descriptionLabel->setText("{$map->name} \$zis on Jukebox Position: {$jukedMaps[$map->uid]}"); - $tooltips->add($jukeLabel, $descriptionLabel); + //$tooltips->add($jukeLabel, $descriptionLabel); }else{ //Juke-Map-Button //$jukeQuad = new Quad_Icons128x128_1(); @@ -344,7 +345,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener { $descriptionLabel->setText("Add Map to Jukebox: {$map->name}"); - $tooltips->add($jukeQuad, $descriptionLabel); + //$tooltips->add($jukeQuad, $descriptionLabel); } if($this->maniaControl->authenticationManager->checkRight($player, AuthenticationManager::AUTH_LEVEL_ADMIN)){ //TODO SET as setting who can add maps @@ -370,7 +371,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener { $descriptionLabel->setTextSize(2); $descriptionLabel->setVisible(false); $descriptionLabel->setText("Remove Map: {$map->name}"); - $tooltips->add($eraseQuad, $descriptionLabel); + //$tooltips->add($eraseQuad, $descriptionLabel); } if($this->maniaControl->authenticationManager->checkRight($player, AuthenticationManager::AUTH_LEVEL_OPERATOR)){ //TODO SET as setting who can add maps //switch to map quad @@ -394,7 +395,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener { $descriptionLabel->setTextSize(2); $descriptionLabel->setVisible(false); $descriptionLabel->setText("Switch Directly to Map: {$map->name}"); - $tooltips->add($switchToQuad, $descriptionLabel); + //$tooltips->add($switchToQuad, $descriptionLabel); } //Display Karma bar diff --git a/application/core/Players/PlayerList.php b/application/core/Players/PlayerList.php index 2d752044..2dca29b3 100644 --- a/application/core/Players/PlayerList.php +++ b/application/core/Players/PlayerList.php @@ -95,8 +95,8 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener { $script = new Script(); $maniaLink->setScript($script); - $tooltips = new Tooltips(); - $script->addFeature($tooltips); + //$tooltips = new Tooltips(); + //$script->addFeature($tooltips); //mainframe $frame = new Frame(); @@ -202,7 +202,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener { $descriptionLabel->setTextSize(2); $descriptionLabel->setVisible(false); $descriptionLabel->setText($listPlayer->nickname . " from " . $listPlayer->path); - $tooltips->add($countryQuad, $descriptionLabel); + //$tooltips->add($countryQuad, $descriptionLabel); } //Level Quad @@ -228,7 +228,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener { $descriptionLabel->setTextSize(2); $descriptionLabel->setVisible(false); $descriptionLabel->setText($this->maniaControl->authenticationManager->getAuthLevelName($listPlayer->authLevel) . " " . $listPlayer->nickname); - $tooltips->add($rightQuad, $descriptionLabel); + //$tooltips->add($rightQuad, $descriptionLabel); switch($listPlayer->authLevel){ case authenticationManager::AUTH_LEVEL_MASTERADMIN: $rightLabel->setText("MA"); break; @@ -260,7 +260,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener { $descriptionLabel->setTextSize(2); $descriptionLabel->setVisible(false); $descriptionLabel->setText("Advanced Player Actions on " . $listPlayer->nickname); - $tooltips->add($playerQuad, $descriptionLabel); + //$tooltips->add($playerQuad, $descriptionLabel); //Force to Red-Team Quad $redQuad = new Quad_Emblems(); @@ -280,7 +280,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener { $descriptionLabel->setTextSize(2); $descriptionLabel->setVisible(false); $descriptionLabel->setText("Force " . $listPlayer->nickname . '$z to Red Team!'); - $tooltips->add($redQuad, $descriptionLabel); + //$tooltips->add($redQuad, $descriptionLabel); //Force to Blue-Team Quad $blueQuad = new Quad_Emblems(); @@ -300,7 +300,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener { $descriptionLabel->setTextSize(2); $descriptionLabel->setVisible(false); $descriptionLabel->setText("Force " . $listPlayer->nickname . '$z to Blue Team!'); - $tooltips->add($blueQuad, $descriptionLabel); + //$tooltips->add($blueQuad, $descriptionLabel); //Force to Spectator Quad $spectatorQuad = new Quad_BgRaceScore2(); @@ -320,7 +320,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener { $descriptionLabel->setTextSize(2); $descriptionLabel->setVisible(false); $descriptionLabel->setText("Force " . $listPlayer->nickname . '$z to Spectator!'); - $tooltips->add($spectatorQuad, $descriptionLabel); + //$tooltips->add($spectatorQuad, $descriptionLabel); } $i++; $y -= 4;