From 95d55836de802b53cc6265fe65e63d61ac495959 Mon Sep 17 00:00:00 2001 From: Jocy Date: Tue, 28 Mar 2017 16:44:41 +0200 Subject: [PATCH] Fixed Adminmenu, Playermenu Corrected background size of Donation menu and customvotes menu Fixed bug directory browser and removed the default value for tooltip (was always shown) --- core/Admin/ActionsMenu.php | 10 ++++------ core/Maps/DirectoryBrowser.php | 4 ++-- plugins/MCTeam/CustomVotesPlugin.php | 2 +- plugins/MCTeam/DonationPlugin.php | 30 +++++++++++----------------- 4 files changed, 19 insertions(+), 27 deletions(-) diff --git a/core/Admin/ActionsMenu.php b/core/Admin/ActionsMenu.php index 7b6fbd90..06c2b06c 100644 --- a/core/Admin/ActionsMenu.php +++ b/core/Admin/ActionsMenu.php @@ -156,7 +156,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener, Usag // Admin Menu Description $descriptionLabel = new Label(); $manialink->addChild($descriptionLabel); - $descriptionLabel->setPosition($posX - count($this->adminMenuItems) * $itemSize * 1.15 - 6, $posY); + $descriptionLabel->setPosition($posX - count($this->adminMenuItems) * $itemSize * 1.05 - 5, $posY); $descriptionLabel->setAlign($descriptionLabel::RIGHT, $descriptionLabel::TOP); $descriptionLabel->setSize(40, 4); $descriptionLabel->setTextSize(1.4); @@ -167,14 +167,13 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener, Usag $manialink->addChild($popoutFrame); $popoutFrame->setPosition($posX - $itemSize * 0.5, $posY); $popoutFrame->setHorizontalAlign($popoutFrame::RIGHT); - $popoutFrame->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY); $popoutFrame->setVisible(false); $backgroundQuad = new Quad(); $popoutFrame->addChild($backgroundQuad); $backgroundQuad->setHorizontalAlign($backgroundQuad::RIGHT); $backgroundQuad->setStyles($quadStyle, $quadSubstyle); - $backgroundQuad->setSize(count($this->adminMenuItems) * $itemSize * 1.15 + 2, $itemSize * $itemMarginFactorY); + $backgroundQuad->setSize(count($this->adminMenuItems) * $itemSize * 1.05 + 2 , $itemSize * $itemMarginFactorY); $itemQuad->addToggleFeature($popoutFrame); @@ -220,7 +219,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener, Usag // Player Menu Description $descriptionLabel = new Label(); $manialink->addChild($descriptionLabel); - $descriptionLabel->setPosition($posX - count($this->playerMenuItems) * $itemSize * 1.15 - 6, $posY - $itemSize * $itemMarginFactorY); + $descriptionLabel->setPosition($posX - count($this->playerMenuItems) * $itemSize * 1.05 - 5, $posY - $itemSize * $itemMarginFactorY); $descriptionLabel->setAlign($descriptionLabel::RIGHT, $descriptionLabel::TOP); $descriptionLabel->setSize(40, 4); $descriptionLabel->setTextSize(1.4); @@ -231,14 +230,13 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener, Usag $manialink->addChild($popoutFrame); $popoutFrame->setPosition($posX - $itemSize * 0.5, $posY - $itemSize * $itemMarginFactorY); $popoutFrame->setHorizontalAlign($popoutFrame::RIGHT); - $popoutFrame->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY); $popoutFrame->setVisible(false); $backgroundQuad = new Quad(); $popoutFrame->addChild($backgroundQuad); $backgroundQuad->setHorizontalAlign($backgroundQuad::RIGHT); $backgroundQuad->setStyles($quadStyle, $quadSubstyle); - $backgroundQuad->setSize(count($this->playerMenuItems) * $itemSize * 1.15 + 2, $itemSize * $itemMarginFactorY); + $backgroundQuad->setSize(count($this->playerMenuItems) * $itemSize * 1.05 + 2, $itemSize * $itemMarginFactorY); $itemQuad->addToggleFeature($popoutFrame); diff --git a/core/Maps/DirectoryBrowser.php b/core/Maps/DirectoryBrowser.php index 76904651..4fed78f8 100644 --- a/core/Maps/DirectoryBrowser.php +++ b/core/Maps/DirectoryBrowser.php @@ -157,7 +157,7 @@ class DirectoryBrowser implements ManialinkPageAnswerListener { $tooltipLabel = new Label(); $frame->addChild($tooltipLabel); - $tooltipLabel->setPosition($width * -0.48, $height * -0.44)->setSize($width * 0.8, 5)->setHorizontalAlign($tooltipLabel::LEFT)->setTextSize(1)->setText('tooltip'); + $tooltipLabel->setPosition($width * -0.48, $height * -0.44)->setSize($width * 0.8, 5)->setHorizontalAlign($tooltipLabel::LEFT)->setTextSize(1); $mapFiles = $this->scanMapFiles($folderPath); @@ -178,7 +178,7 @@ class DirectoryBrowser implements ManialinkPageAnswerListener { $pageFrame = new Frame(); $frame->addChild($pageFrame); $posY = $height / 2 - 10; - $paging->addPage($pageFrame); + $paging->addPageControl($pageFrame); } // Map Frame diff --git a/plugins/MCTeam/CustomVotesPlugin.php b/plugins/MCTeam/CustomVotesPlugin.php index 492e9551..ba6b69c7 100644 --- a/plugins/MCTeam/CustomVotesPlugin.php +++ b/plugins/MCTeam/CustomVotesPlugin.php @@ -347,7 +347,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP $popoutFrame->addChild($backgroundQuad); $backgroundQuad->setHorizontalAlign($backgroundQuad::RIGHT); $backgroundQuad->setStyles($quadStyle, $quadSubstyle); - $backgroundQuad->setSize($menuEntries * $itemSize * 1.15 + 2, $itemSize * $itemMarginFactorY); + $backgroundQuad->setSize($menuEntries * $itemSize * 1.05 + 2, $itemSize * $itemMarginFactorY); $itemQuad->addToggleFeature($popoutFrame); diff --git a/plugins/MCTeam/DonationPlugin.php b/plugins/MCTeam/DonationPlugin.php index d1de33d1..6d487398 100644 --- a/plugins/MCTeam/DonationPlugin.php +++ b/plugins/MCTeam/DonationPlugin.php @@ -135,8 +135,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin { * Display the widget */ public function displayWidget() { - if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_DONATE_WIDGET_ACTIVATED) - ) { + if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_DONATE_WIDGET_ACTIVATED)) { $this->displayDonateWidget(); } } @@ -159,8 +158,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin { $itemMarginFactorY = 1.2; //If game is shootmania lower the icons position by 20 - if ($this->maniaControl->getMapManager()->getCurrentMap()->getGame() === 'sm' - ) { + if ($this->maniaControl->getMapManager()->getCurrentMap()->getGame() === 'sm') { $posY -= $shootManiaOffset; } @@ -194,16 +192,8 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin { $maniaLink->addChild($popoutFrame); $popoutFrame->setPosition($posX - $itemSize * 0.5, $posY); $popoutFrame->setHorizontalAlign($popoutFrame::RIGHT); - $popoutFrame->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY); $popoutFrame->setVisible(false); - $quad = new Quad(); - $popoutFrame->addChild($quad); - $quad->setHorizontalAlign($quad::RIGHT); - $quad->setStyles($quadStyle, $quadSubstyle); - $quad->setSize(strlen($values) * 2 + count($valueArray) * 1, $itemSize * $itemMarginFactorY); - - $popoutFrame->addChild($quad); $itemQuad->addToggleFeature($popoutFrame); // Description Label @@ -237,6 +227,13 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin { $posX -= strlen($value) * 2 + 1.7; } + //Popout background + $quad = new Quad(); + $popoutFrame->addChild($quad); + $quad->setHorizontalAlign($quad::RIGHT); + $quad->setStyles($quadStyle, $quadSubstyle); + $quad->setSize((2 - $posX), $itemSize * $itemMarginFactorY); + // Send manialink $this->maniaControl->getManialinkManager()->sendManialink($maniaLink, $login); } @@ -328,8 +325,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin { */ public function handlePlayerConnect(Player $player) { // Display Map Widget - if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_DONATE_WIDGET_ACTIVATED) - ) { + if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_DONATE_WIDGET_ACTIVATED)) { $this->displayDonateWidget($player->login); } } @@ -381,8 +377,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin { * @param Player $player */ public function command_Pay(array $chatCallback, Player $player) { - if (!$this->maniaControl->getAuthenticationManager()->checkRight($player, AuthenticationManager::AUTH_LEVEL_SUPERADMIN) - ) { + if (!$this->maniaControl->getAuthenticationManager()->checkRight($player, AuthenticationManager::AUTH_LEVEL_SUPERADMIN)) { $this->maniaControl->getAuthenticationManager()->sendNotAllowed($player); return; } @@ -439,8 +434,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin { * @param Player $player */ public function command_GetPlanets(array $chatCallback, Player $player) { - if (!$this->maniaControl->getAuthenticationManager()->checkRight($player, AuthenticationManager::AUTH_LEVEL_ADMIN) - ) { + if (!$this->maniaControl->getAuthenticationManager()->checkRight($player, AuthenticationManager::AUTH_LEVEL_ADMIN)) { $this->maniaControl->getAuthenticationManager()->sendNotAllowed($player); return; }