cleanup
This commit is contained in:
		
				
					committed by
					
						
						Steffen Schröder
					
				
			
			
				
	
			
			
			
						parent
						
							769147e7c7
						
					
				
				
					commit
					fc91133f77
				
			@@ -103,53 +103,27 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
 | 
			
		||||
		$width  = $this->maniaControl->manialinkManager->styleManager->getListWidgetsWidth();
 | 
			
		||||
		$height = $this->maniaControl->manialinkManager->styleManager->getListWidgetsHeight();
 | 
			
		||||
 | 
			
		||||
		// Get Maplist
 | 
			
		||||
		$mapList = $this->maniaControl->mapManager->getMaps();
 | 
			
		||||
 | 
			
		||||
		$this->mapListShown[$player->login] = true;
 | 
			
		||||
 | 
			
		||||
		$maniaLink = new ManiaLink(ManialinkManager::MAIN_MLID);
 | 
			
		||||
		$frame     = $this->maniaControl->manialinkManager->styleManager->defaultListFrame();
 | 
			
		||||
		$maniaLink->add($frame);
 | 
			
		||||
		$frame->setZ(10);
 | 
			
		||||
 | 
			
		||||
		// Create script and features
 | 
			
		||||
		$script = new Script();
 | 
			
		||||
		$maniaLink->setScript($script);
 | 
			
		||||
 | 
			
		||||
		// Pagers
 | 
			
		||||
		// Config
 | 
			
		||||
		$pagerSize = 6.;
 | 
			
		||||
		$pagesId   = 'MapListPages';
 | 
			
		||||
		// Get Maps
 | 
			
		||||
		$mapList = $this->maniaControl->mapManager->getMaps();
 | 
			
		||||
 | 
			
		||||
		$pagesId = '';
 | 
			
		||||
		if (count($mapList) > self::MAX_MAPS_PER_PAGE) {
 | 
			
		||||
			$pagerPrev = new Quad_Icons64x64_1();
 | 
			
		||||
			$frame->add($pagerPrev);
 | 
			
		||||
			$pagerPrev->setPosition($width * 0.42, $height * -0.44, 2);
 | 
			
		||||
			$pagerPrev->setSize($pagerSize, $pagerSize);
 | 
			
		||||
			$pagerPrev->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_ArrowPrev);
 | 
			
		||||
 | 
			
		||||
			$pagerNext = new Quad_Icons64x64_1();
 | 
			
		||||
			$frame->add($pagerNext);
 | 
			
		||||
			$pagerNext->setPosition($width * 0.45, $height * -0.44, 2);
 | 
			
		||||
			$pagerNext->setSize($pagerSize, $pagerSize);
 | 
			
		||||
			$pagerNext->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_ArrowNext);
 | 
			
		||||
 | 
			
		||||
			$script->addPager($pagerPrev, -1, $pagesId);
 | 
			
		||||
			$script->addPager($pagerNext, 1, $pagesId);
 | 
			
		||||
 | 
			
		||||
			$pageCountLabel = new Label_Text();
 | 
			
		||||
			$frame->add($pageCountLabel);
 | 
			
		||||
			$pageCountLabel->setHAlign(Control::RIGHT);
 | 
			
		||||
			$pageCountLabel->setPosition($width * 0.40, $height * -0.44, 1);
 | 
			
		||||
			$pageCountLabel->setStyle($pageCountLabel::STYLE_TextTitle1);
 | 
			
		||||
			$pageCountLabel->setTextSize(1.3);
 | 
			
		||||
			$script->addPageLabel($pageCountLabel, $pagesId);
 | 
			
		||||
			$pagesId = 'MapListPages';
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		//Create ManiaLink
 | 
			
		||||
		$maniaLink = new ManiaLink(ManialinkManager::MAIN_MLID);
 | 
			
		||||
		$script    = $maniaLink->getScript();
 | 
			
		||||
 | 
			
		||||
		// Main frame
 | 
			
		||||
		$frame = $this->maniaControl->manialinkManager->styleManager->defaultListFrame($script, $pagesId);
 | 
			
		||||
		$maniaLink->add($frame);
 | 
			
		||||
 | 
			
		||||
		//Admin Buttons
 | 
			
		||||
		if ($this->maniaControl->authenticationManager->checkPermission($player, MapManager::SETTING_PERMISSION_ADD_MAP)) {
 | 
			
		||||
			//Clear Jukebox
 | 
			
		||||
			//Clear Map-Queue
 | 
			
		||||
			$label = new Label_Button();
 | 
			
		||||
			$frame->add($label);
 | 
			
		||||
			$label->setText("Clear Map-Queue");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user