fixed tooltips
This commit is contained in:
		| @@ -219,14 +219,18 @@ class Configurator implements CallbackListener, ManialinkPageAnswerListener { | |||||||
| 		$script = new Script(); | 		$script = new Script(); | ||||||
| 		$manialink->setScript($script); | 		$manialink->setScript($script); | ||||||
|  |  | ||||||
| 		$pages = new Pages(); | 		$pages = null; | ||||||
|  | 		/*$pages = new Pages(); | ||||||
| 		$script->addFeature($pages); | 		$script->addFeature($pages); | ||||||
| 		 | 		 | ||||||
| 		$tooltips = new Tooltips(); | 		$tooltips = new Tooltips(); | ||||||
| 		$script->addFeature($tooltips); | 		$script->addFeature($tooltips); | ||||||
|  |  | ||||||
| 		$menus = new Menus(); | 		$menus = new Menus(); | ||||||
| 		$script->addFeature($menus); | 		$script->addFeature($menus);*/ | ||||||
|  |  | ||||||
|  | 		//$script->addPager() | ||||||
|  |  | ||||||
|  |  | ||||||
| 		$menuRelationships = array(); | 		$menuRelationships = array(); | ||||||
| 		$menuItemY = $menuHeight * 0.42; | 		$menuItemY = $menuHeight * 0.42; | ||||||
| @@ -237,21 +241,22 @@ class Configurator implements CallbackListener, ManialinkPageAnswerListener { | |||||||
| 			$menuItemLabel->setY($menuItemY); | 			$menuItemLabel->setY($menuItemY); | ||||||
| 			$menuItemLabel->setSize($menuListWidth * 0.9, $menuItemHeight * 0.9); | 			$menuItemLabel->setSize($menuListWidth * 0.9, $menuItemHeight * 0.9); | ||||||
| 			$menuItemLabel->setStyle(Label_Text::STYLE_TextCardRaceRank); | 			$menuItemLabel->setStyle(Label_Text::STYLE_TextCardRaceRank); | ||||||
| 			$menuItemLabel->setText('$z' . $menu->getTitle() . '$z'); | 			//$menuItemLabel->setText('$z' . $menu->getTitle() . '$z'); | ||||||
| 			 | 			 | ||||||
| 			// Add menu | 			// Add menu | ||||||
| 			$menuControl = $menu->getMenu($subMenuWidth, $subMenuHeight, $pages, $tooltips); | 			$menuControl = $menu->getMenu($subMenuWidth, $subMenuHeight, $pages, $script); | ||||||
| 			if ($index > 0) { | 			if ($index > 0) { | ||||||
| 				$menuControl->setVisible(false); | 				$menuControl->setVisible(false); | ||||||
| 			} | 			} | ||||||
| 			$menusFrame->add($menuControl); | 			$menusFrame->add($menuControl); | ||||||
| 			 | 			 | ||||||
| 			// Add menu relationship | 			// Add menu relationship | ||||||
| 			array_push($menuRelationships, array($menuItemLabel, $menuControl)); | 			//array_push($menuRelationships, array($menuItemLabel, $menuControl)); | ||||||
| 			 | 			$script->addMenu($menuItemLabel, $menuControl); | ||||||
| 			$menuItemY -= $menuItemHeight * 1.1; | 			$menuItemY -= $menuItemHeight * 1.1; | ||||||
| 		} | 		} | ||||||
| 		$menus->add($menuRelationships); |  | ||||||
|  | 		//$menus->add($menuRelationships); | ||||||
| 		 | 		 | ||||||
| 		// Add Close Quad (X) | 		// Add Close Quad (X) | ||||||
| 		$closeQuad = new Quad_Icons64x64_1(); | 		$closeQuad = new Quad_Icons64x64_1(); | ||||||
|   | |||||||
| @@ -3,6 +3,7 @@ | |||||||
| namespace ManiaControl\Configurators; | namespace ManiaControl\Configurators; | ||||||
|  |  | ||||||
| use FML\Script\Pages; | use FML\Script\Pages; | ||||||
|  | use FML\Script\Script; | ||||||
| use FML\Script\Tooltips; | use FML\Script\Tooltips; | ||||||
| use ManiaControl\Players\Player; | use ManiaControl\Players\Player; | ||||||
|  |  | ||||||
| @@ -25,11 +26,12 @@ interface ConfiguratorMenu { | |||||||
| 	 * | 	 * | ||||||
| 	 * @param float              $width | 	 * @param float              $width | ||||||
| 	 * @param float              $height | 	 * @param float              $height | ||||||
| 	 * @param Pages $pages        	 | 	 * @param               $pages temp removed | ||||||
| 	 * @param Tooltips $tooltips        	 | 	 * @param \FML\Script\Script $script | ||||||
|  | 	 * @internal param \FML\Script\Tooltips $tooltips | ||||||
| 	 * @return \FML\Controls\Control | 	 * @return \FML\Controls\Control | ||||||
| 	 */ | 	 */ | ||||||
| 	public function getMenu($width, $height, Pages $pages, Tooltips $tooltips); | 	public function getMenu($width, $height, $pages, Script $script); | ||||||
|  |  | ||||||
| 	/** | 	/** | ||||||
| 	 * Save the config data | 	 * Save the config data | ||||||
|   | |||||||
| @@ -2,6 +2,7 @@ | |||||||
|  |  | ||||||
| namespace ManiaControl\Configurators; | namespace ManiaControl\Configurators; | ||||||
|  |  | ||||||
|  | use FML\Script\Script; | ||||||
| use ManiaControl\Callbacks\CallbackListener; | use ManiaControl\Callbacks\CallbackListener; | ||||||
| use ManiaControl\Callbacks\CallbackManager; | use ManiaControl\Callbacks\CallbackManager; | ||||||
| use ManiaControl\Formatter; | use ManiaControl\Formatter; | ||||||
| @@ -58,7 +59,7 @@ class ScriptSettings implements ConfiguratorMenu,CallbackListener { | |||||||
| 	 * | 	 * | ||||||
| 	 * @see \ManiaControl\Configurators\ConfiguratorMenu::getMenu() | 	 * @see \ManiaControl\Configurators\ConfiguratorMenu::getMenu() | ||||||
| 	 */ | 	 */ | ||||||
| 	public function getMenu($width, $height, Pages $pages, Tooltips $tooltips) { | 	public function getMenu($width, $height, $pages, Script $script) { | ||||||
| 		$frame = new Frame(); | 		$frame = new Frame(); | ||||||
| 		 | 		 | ||||||
| 		$this->maniaControl->client->query('GetModeScriptInfo'); | 		$this->maniaControl->client->query('GetModeScriptInfo'); | ||||||
| @@ -171,15 +172,17 @@ class ScriptSettings implements ConfiguratorMenu,CallbackListener { | |||||||
| 			$descriptionLabel->setTranslate(true); | 			$descriptionLabel->setTranslate(true); | ||||||
| 			//$descriptionLabel->setTextPrefix('Desc: '); | 			//$descriptionLabel->setTextPrefix('Desc: '); | ||||||
| 			$descriptionLabel->setText($scriptParam['Desc']); | 			$descriptionLabel->setText($scriptParam['Desc']); | ||||||
| 			$tooltips->add($nameLabel, $descriptionLabel); | 			$script->addTooltip($nameLabel, $descriptionLabel); | ||||||
| 			 | 			 | ||||||
| 			$y -= $settingHeight; | 			$y -= $settingHeight; | ||||||
| 			if ($index % $pageMaxCount == $pageMaxCount - 1) { | 			if ($index % $pageMaxCount == $pageMaxCount - 1) { | ||||||
| 				unset($pageFrame); | 				unset($pageFrame); | ||||||
|  | 			}else{ | ||||||
|  | 				$script->addPage($pageFrame, $index, "test"); //TODO not working | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		 | 		 | ||||||
| 		$pages->add(array(-1 => $pagerPrev, 1 => $pagerNext), $pageFrames, $pageCountLabel); | 		//$pages->add(array(-1 => $pagerPrev, 1 => $pagerNext), $pageFrames, $pageCountLabel); | ||||||
| 		 | 		 | ||||||
| 		return $frame; | 		return $frame; | ||||||
| 	} | 	} | ||||||
|   | |||||||
| @@ -246,10 +246,6 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener { | |||||||
| 		$script = new Script(); | 		$script = new Script(); | ||||||
| 		$maniaLink->setScript($script); | 		$maniaLink->setScript($script); | ||||||
|  |  | ||||||
| 		//$script->addTooltip($script::CLASS_TOOLTIPS); |  | ||||||
| 		//$tooltips = new Tooltips(); |  | ||||||
| 		//$script->addFeature($tooltips); |  | ||||||
|  |  | ||||||
| 		//Headline | 		//Headline | ||||||
| 		$headFrame = new Frame(); | 		$headFrame = new Frame(); | ||||||
| 		$frame->add($headFrame); | 		$frame->add($headFrame); | ||||||
| @@ -345,7 +341,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); | 				$script->addTooltip($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 | ||||||
| @@ -371,7 +367,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); | 				$script->addTooltip($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 | ||||||
| @@ -395,7 +391,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); | 				$script->addTooltip($switchToQuad, $descriptionLabel); | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			//Display Karma bar | 			//Display Karma bar | ||||||
|   | |||||||
| @@ -95,9 +95,6 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener { | |||||||
| 		$script = new Script(); | 		$script = new Script(); | ||||||
| 		$maniaLink->setScript($script); | 		$maniaLink->setScript($script); | ||||||
|  |  | ||||||
| 		//$tooltips = new Tooltips(); |  | ||||||
| 		//$script->addFeature($tooltips); |  | ||||||
|  |  | ||||||
| 		//mainframe | 		//mainframe | ||||||
| 		$frame = new Frame(); | 		$frame = new Frame(); | ||||||
| 		$maniaLink->add($frame); | 		$maniaLink->add($frame); | ||||||
| @@ -202,7 +199,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); | 				$script->addTooltip($countryQuad, $descriptionLabel); | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			//Level Quad | 			//Level Quad | ||||||
| @@ -228,7 +225,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); | 			$script->addTooltip($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 +257,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); | 				$script->addTooltip($playerQuad, $descriptionLabel); | ||||||
|  |  | ||||||
| 				//Force to Red-Team Quad | 				//Force to Red-Team Quad | ||||||
| 				$redQuad = new Quad_Emblems(); | 				$redQuad = new Quad_Emblems(); | ||||||
| @@ -280,7 +277,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); | 				$script->addTooltip($redQuad, $descriptionLabel); | ||||||
|  |  | ||||||
| 				//Force to Blue-Team Quad | 				//Force to Blue-Team Quad | ||||||
| 				$blueQuad = new Quad_Emblems(); | 				$blueQuad = new Quad_Emblems(); | ||||||
| @@ -300,7 +297,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); | 				$script->addTooltip($blueQuad, $descriptionLabel); | ||||||
|  |  | ||||||
| 				//Force to Spectator Quad | 				//Force to Spectator Quad | ||||||
| 				$spectatorQuad = new Quad_BgRaceScore2(); | 				$spectatorQuad = new Quad_BgRaceScore2(); | ||||||
| @@ -320,7 +317,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); | 				$script->addTooltip($spectatorQuad, $descriptionLabel); | ||||||
| 			} | 			} | ||||||
| 			$i++; | 			$i++; | ||||||
| 			$y -= 4; | 			$y -= 4; | ||||||
|   | |||||||
| @@ -2,6 +2,7 @@ | |||||||
|  |  | ||||||
| namespace ManiaControl\Plugins; | namespace ManiaControl\Plugins; | ||||||
|  |  | ||||||
|  | use FML\Script\Script; | ||||||
| use ManiaControl\ManiaControl; | use ManiaControl\ManiaControl; | ||||||
| use ManiaControl\Players\Player; | use ManiaControl\Players\Player; | ||||||
| use ManiaControl\Configurators\ConfiguratorMenu; | use ManiaControl\Configurators\ConfiguratorMenu; | ||||||
| @@ -57,7 +58,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu { | |||||||
| 	 * | 	 * | ||||||
| 	 * @see \ManiaControl\Configurators\ConfiguratorMenu::getMenu() | 	 * @see \ManiaControl\Configurators\ConfiguratorMenu::getMenu() | ||||||
| 	 */ | 	 */ | ||||||
| 	public function getMenu($width, $height, Pages $pages, Tooltips $tooltips) { | 	public function getMenu($width, $height, $pages, Script $script) { | ||||||
| 		$frame = new Frame(); | 		$frame = new Frame(); | ||||||
| 		 | 		 | ||||||
| 		$pluginClasses = $this->maniaControl->pluginManager->getPluginClasses(); | 		$pluginClasses = $this->maniaControl->pluginManager->getPluginClasses(); | ||||||
| @@ -137,7 +138,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu { | |||||||
| 			$descriptionLabel->setMaxLines(5); | 			$descriptionLabel->setMaxLines(5); | ||||||
| 			$description = "Author: {$pluginClass::getAuthor()}\nVersion: {$pluginClass::getVersion()}\nDesc: {$pluginClass::getDescription()}"; | 			$description = "Author: {$pluginClass::getAuthor()}\nVersion: {$pluginClass::getVersion()}\nDesc: {$pluginClass::getDescription()}"; | ||||||
| 			$descriptionLabel->setText($description); | 			$descriptionLabel->setText($description); | ||||||
| 			$tooltips->add($nameLabel, $descriptionLabel); | 			$script->addTooltip($nameLabel, $descriptionLabel); | ||||||
| 			 | 			 | ||||||
| 			$statusChangeButton = new Label_Button(); | 			$statusChangeButton = new Label_Button(); | ||||||
| 			$pluginFrame->add($statusChangeButton); | 			$pluginFrame->add($statusChangeButton); | ||||||
| @@ -158,10 +159,14 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu { | |||||||
| 			$y -= $entryHeight; | 			$y -= $entryHeight; | ||||||
| 			if ($index % $pageMaxCount == $pageMaxCount - 1) { | 			if ($index % $pageMaxCount == $pageMaxCount - 1) { | ||||||
| 				unset($pageFrame); | 				unset($pageFrame); | ||||||
|  | 			}else{ | ||||||
|  | 				$script->addPage($pageFrame, 1, "test"); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		$pages->add(array(-1 => $pagerPrev, 1 => $pagerNext), $pageFrames, $pageCountLabel); | 	//	$script->addPager($pageFrames, 1 , $pageCountLabel); | ||||||
|  | 	//	$script->addPage(array(-1 => $pagerPrev, 1 => $pagerNext), $pageFrames, $pageCountLabel); | ||||||
|  | 		//$pages->add(array(-1 => $pagerPrev, 1 => $pagerNext), $pageFrames, $pageCountLabel); | ||||||
| 		 | 		 | ||||||
| 		return $frame; | 		return $frame; | ||||||
| 	} | 	} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user