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"];
}
//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 . '!'));

View File

@ -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;
}
}
}

View File

@ -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

View File

@ -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

View File

@ -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;