commented tooltips to avoid crashes

This commit is contained in:
kremsy 2013-12-31 10:05:38 +01:00
parent 5447588749
commit decebc1d18
5 changed files with 26 additions and 23 deletions

View File

@ -214,6 +214,11 @@ class ScriptSettings implements ConfiguratorMenu,CallbackListener {
$newSettings[$settingName] = $setting["Value"]; $newSettings[$settingName] = $setting["Value"];
} }
//Nothing has been changed
if($chatMessage = ''){
return;
}
$success = $this->maniaControl->client->query('SetModeScriptSettings', $newSettings); $success = $this->maniaControl->client->query('SetModeScriptSettings', $newSettings);
if (!$success) { if (!$success) {
$this->maniaControl->chat->sendError('Error occurred: ' . $this->maniaControl->getClientErrorText(), $player->login); $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); $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 // log console message
$this->maniaControl->log(Formatter::stripCodes($title . ' ' . $player->nickname . ' set Scriptsettings ' . $chatMessage . '!')); $this->maniaControl->log(Formatter::stripCodes($title . ' ' . $player->nickname . ' set Scriptsettings ' . $chatMessage . '!'));

View File

@ -170,7 +170,7 @@ class Script {
$profileControl->setScriptEvents(true); $profileControl->setScriptEvents(true);
$profileControl->addClass(self::CLASS_PROFILE); $profileControl->addClass(self::CLASS_PROFILE);
if ($playerLogin) { if ($playerLogin) {
$profilControl->addClass(self::CLASS_PROFILE . '-' . $playerLogin); $profileControl->addClass(self::CLASS_PROFILE . '-' . $playerLogin);
} }
$this->profile = true; $this->profile = true;
return $this; return $this;
@ -442,4 +442,4 @@ if (Event.Control.HasClass(\"" . self::CLASS_MAPINFO . "\") {
$mainFunction = file_get_contents(__DIR__ . '/Parts/Main.txt'); $mainFunction = file_get_contents(__DIR__ . '/Parts/Main.txt');
return $mainFunction; return $mainFunction;
} }
} }

View File

@ -2,15 +2,14 @@
namespace ManiaControl\Manialinks; namespace ManiaControl\Manialinks;
use FML\CustomUI;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
use ManiaControl\Callbacks\CallbackListener; use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager; use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Players\Player; use ManiaControl\Players\Player;
use ManiaControl\Players\PlayerManager; use ManiaControl\Players\PlayerManager;
use FML\ManiaLink;
use FML\Elements\CustomUI;
use FML\Controls\Quad;
use FML\ManiaLinks;
/** /**
* Class managing the Custom UI Settings * Class managing the Custom UI Settings

View File

@ -246,8 +246,9 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$script = new Script(); $script = new Script();
$maniaLink->setScript($script); $maniaLink->setScript($script);
$tooltips = new Tooltips(); //$script->addTooltip($script::CLASS_TOOLTIPS);
$script->addFeature($tooltips); //$tooltips = new Tooltips();
//$script->addFeature($tooltips);
//Headline //Headline
$headFrame = new Frame(); $headFrame = new Frame();
@ -328,7 +329,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$jukeLabel->setTextColor("FFF"); $jukeLabel->setTextColor("FFF");
$descriptionLabel->setText("{$map->name} \$zis on Jukebox Position: {$jukedMaps[$map->uid]}"); $descriptionLabel->setText("{$map->name} \$zis on Jukebox Position: {$jukedMaps[$map->uid]}");
$tooltips->add($jukeLabel, $descriptionLabel); //$tooltips->add($jukeLabel, $descriptionLabel);
}else{ }else{
//Juke-Map-Button //Juke-Map-Button
//$jukeQuad = new Quad_Icons128x128_1(); //$jukeQuad = new Quad_Icons128x128_1();
@ -344,7 +345,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$descriptionLabel->setText("Add Map to Jukebox: {$map->name}"); $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 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->setTextSize(2);
$descriptionLabel->setVisible(false); $descriptionLabel->setVisible(false);
$descriptionLabel->setText("Remove Map: {$map->name}"); $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 if($this->maniaControl->authenticationManager->checkRight($player, AuthenticationManager::AUTH_LEVEL_OPERATOR)){ //TODO SET as setting who can add maps
//switch to map quad //switch to map quad
@ -394,7 +395,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$descriptionLabel->setTextSize(2); $descriptionLabel->setTextSize(2);
$descriptionLabel->setVisible(false); $descriptionLabel->setVisible(false);
$descriptionLabel->setText("Switch Directly to Map: {$map->name}"); $descriptionLabel->setText("Switch Directly to Map: {$map->name}");
$tooltips->add($switchToQuad, $descriptionLabel); //$tooltips->add($switchToQuad, $descriptionLabel);
} }
//Display Karma bar //Display Karma bar

View File

@ -95,8 +95,8 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener {
$script = new Script(); $script = new Script();
$maniaLink->setScript($script); $maniaLink->setScript($script);
$tooltips = new Tooltips(); //$tooltips = new Tooltips();
$script->addFeature($tooltips); //$script->addFeature($tooltips);
//mainframe //mainframe
$frame = new Frame(); $frame = new Frame();
@ -202,7 +202,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener {
$descriptionLabel->setTextSize(2); $descriptionLabel->setTextSize(2);
$descriptionLabel->setVisible(false); $descriptionLabel->setVisible(false);
$descriptionLabel->setText($listPlayer->nickname . " from " . $listPlayer->path); $descriptionLabel->setText($listPlayer->nickname . " from " . $listPlayer->path);
$tooltips->add($countryQuad, $descriptionLabel); //$tooltips->add($countryQuad, $descriptionLabel);
} }
//Level Quad //Level Quad
@ -228,7 +228,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener {
$descriptionLabel->setTextSize(2); $descriptionLabel->setTextSize(2);
$descriptionLabel->setVisible(false); $descriptionLabel->setVisible(false);
$descriptionLabel->setText($this->maniaControl->authenticationManager->getAuthLevelName($listPlayer->authLevel) . " " . $listPlayer->nickname); $descriptionLabel->setText($this->maniaControl->authenticationManager->getAuthLevelName($listPlayer->authLevel) . " " . $listPlayer->nickname);
$tooltips->add($rightQuad, $descriptionLabel); //$tooltips->add($rightQuad, $descriptionLabel);
switch($listPlayer->authLevel){ switch($listPlayer->authLevel){
case authenticationManager::AUTH_LEVEL_MASTERADMIN: $rightLabel->setText("MA"); break; case authenticationManager::AUTH_LEVEL_MASTERADMIN: $rightLabel->setText("MA"); break;
@ -260,7 +260,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener {
$descriptionLabel->setTextSize(2); $descriptionLabel->setTextSize(2);
$descriptionLabel->setVisible(false); $descriptionLabel->setVisible(false);
$descriptionLabel->setText("Advanced Player Actions on " . $listPlayer->nickname); $descriptionLabel->setText("Advanced Player Actions on " . $listPlayer->nickname);
$tooltips->add($playerQuad, $descriptionLabel); //$tooltips->add($playerQuad, $descriptionLabel);
//Force to Red-Team Quad //Force to Red-Team Quad
$redQuad = new Quad_Emblems(); $redQuad = new Quad_Emblems();
@ -280,7 +280,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener {
$descriptionLabel->setTextSize(2); $descriptionLabel->setTextSize(2);
$descriptionLabel->setVisible(false); $descriptionLabel->setVisible(false);
$descriptionLabel->setText("Force " . $listPlayer->nickname . '$z to Red Team!'); $descriptionLabel->setText("Force " . $listPlayer->nickname . '$z to Red Team!');
$tooltips->add($redQuad, $descriptionLabel); //$tooltips->add($redQuad, $descriptionLabel);
//Force to Blue-Team Quad //Force to Blue-Team Quad
$blueQuad = new Quad_Emblems(); $blueQuad = new Quad_Emblems();
@ -300,7 +300,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener {
$descriptionLabel->setTextSize(2); $descriptionLabel->setTextSize(2);
$descriptionLabel->setVisible(false); $descriptionLabel->setVisible(false);
$descriptionLabel->setText("Force " . $listPlayer->nickname . '$z to Blue Team!'); $descriptionLabel->setText("Force " . $listPlayer->nickname . '$z to Blue Team!');
$tooltips->add($blueQuad, $descriptionLabel); //$tooltips->add($blueQuad, $descriptionLabel);
//Force to Spectator Quad //Force to Spectator Quad
$spectatorQuad = new Quad_BgRaceScore2(); $spectatorQuad = new Quad_BgRaceScore2();
@ -320,7 +320,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener {
$descriptionLabel->setTextSize(2); $descriptionLabel->setTextSize(2);
$descriptionLabel->setVisible(false); $descriptionLabel->setVisible(false);
$descriptionLabel->setText("Force " . $listPlayer->nickname . '$z to Spectator!'); $descriptionLabel->setText("Force " . $listPlayer->nickname . '$z to Spectator!');
$tooltips->add($spectatorQuad, $descriptionLabel); //$tooltips->add($spectatorQuad, $descriptionLabel);
} }
$i++; $i++;
$y -= 4; $y -= 4;