SidebarMenuManager now uses the Position object instead of an array

This commit is contained in:
Jocy
2017-05-12 10:27:26 +02:00
parent 6be20432ba
commit 023581c195
4 changed files with 38 additions and 32 deletions

View File

@ -283,7 +283,7 @@ class CustomVotesPlugin implements SidebarMenuEntryRenderable, CommandListener,
//Custom Vote Menu Iconsframe
$frame = new Frame();
$maniaLink->addChild($frame);
$frame->setPosition($pos['x'], $pos['y']);
$frame->setPosition($pos->getX(), $pos->getY());
$frame->setZ(ManialinkManager::MAIN_MANIALINK_Z_VALUE);
$backgroundQuad = new Quad();
@ -304,7 +304,7 @@ class CustomVotesPlugin implements SidebarMenuEntryRenderable, CommandListener,
$menuEntries = count($this->voteMenuItems);
$descriptionFrame = new Frame();
$maniaLink->addChild($descriptionFrame);
$descriptionFrame->setPosition($pos['x'] - $menuEntries * $itemSize * 1.05 - 5, $pos['y']);
$descriptionFrame->setPosition($pos->getX() - $menuEntries * $itemSize * 1.05 - 5, $pos->getY());
$descriptionLabel = new Label();
$descriptionFrame->addChild($descriptionLabel);
@ -316,7 +316,7 @@ class CustomVotesPlugin implements SidebarMenuEntryRenderable, CommandListener,
//Popout Frame
$popoutFrame = new Frame();
$maniaLink->addChild($popoutFrame);
$popoutFrame->setPosition($pos['x'] - $itemSize * 0.5, $pos['y']);
$popoutFrame->setPosition($pos->getX() - $itemSize * 0.5, $pos->getY());
$popoutFrame->setHorizontalAlign($popoutFrame::RIGHT);
$popoutFrame->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY);
$popoutFrame->setVisible(false);
@ -350,7 +350,6 @@ class CustomVotesPlugin implements SidebarMenuEntryRenderable, CommandListener,
}
}
// Send manialink
$this->maniaControl->getManialinkManager()->sendManialink($maniaLink, $login);
}

View File

@ -159,7 +159,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin, Sideb
// Donate Menu Icon Frame
$frame = new Frame();
$maniaLink->addChild($frame);
$frame->setPosition($pos['x'], $pos['y']);
$frame->setPosition($pos->getX(), $pos->getY());
$frame->setZ(ManialinkManager::MAIN_MANIALINK_Z_VALUE);
$backgroundQuad = new Quad();