curently working on actionsmenu

This commit is contained in:
kremsy 2014-01-04 17:55:42 +01:00
parent d567007c41
commit f34fa20f36
2 changed files with 35 additions and 15 deletions

View File

@ -197,26 +197,40 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$itemQuad->setSubStyle($itemQuad::SUBSTYLE_IconPlayers); $itemQuad->setSubStyle($itemQuad::SUBSTYLE_IconPlayers);
$itemQuad->setSize($itemSize, $itemSize); $itemQuad->setSize($itemSize, $itemSize);
$iconFrame->add($itemQuad); $iconFrame->add($itemQuad);
$itemQuad->setAction(self::ACTION_OPEN_PLAYER_MENU); // $itemQuad->setAction(self::ACTION_OPEN_PLAYER_MENU);
/** TEST TOOLTIP */ /** TEST TOOLTIP */
$testf = new Frame(); $popoutFrame = new Frame();
$manialink->add($testf); $manialink->add($popoutFrame);
$testf->setPosition($posX - $itemSize * $itemMarginFactorX, $posY - $itemSize * $itemMarginFactorY); $popoutFrame->setPosition($posX - $itemSize * 0.5, $posY - $itemSize * $itemMarginFactorY);
//$testf->setHAlign(Control::RIGHT); $popoutFrame->setHAlign(Control::RIGHT);
$testf->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY); $popoutFrame->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY);
$testq = new Quad(); $testq = new Quad();
$testf->add($testq); $popoutFrame->add($testq);
//$testq->setPosition($posX - $itemSize * $itemMarginFactorX, $posY - $itemSize * $itemMarginFactorY); //$testq->setPosition($posX - $itemSize * $itemMarginFactorX, $posY - $itemSize * $itemMarginFactorY);
$testq->setHAlign(Control::CENTER); $testq->setHAlign(Control::RIGHT);
$testq->setStyles($quadStyle, $quadSubstyle); $testq->setStyles($quadStyle, $quadSubstyle);
$testq->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY); $testq->setSize(4 * $itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY);
$testf->add($testq); $popoutFrame->add($testq);
$script->addTooltip($itemQuad, $popoutFrame, Script::OPTION_TOOLTIP_STAYONCLICK);
// Add items
$x = 0.05;
foreach($this->adminMenuItems as $menuItems) {
foreach($menuItems as $menuItem) {
/** @var Quad $menuItem */
$menuItem->setSize($itemSize, $itemSize);
$popoutFrame->add($menuItem);
$menuItem->setX($x);
$menuItem->setHAlign(Control::RIGHT);
$x -= $itemSize * 1.05;
}
}
$script->addTooltip($itemQuad, $testf);
/** TEST TOOLTIP */ /** TEST TOOLTIP */

View File

@ -10,6 +10,7 @@ use FML\Controls\Labels\Label_Button;
use FML\Controls\Labels\Label_Text; use FML\Controls\Labels\Label_Text;
use FML\Controls\Quad; use FML\Controls\Quad;
use FML\Controls\Quads\Quad_BgsPlayerCard; use FML\Controls\Quads\Quad_BgsPlayerCard;
use FML\Controls\Quads\Quad_Icons128x128_1;
use FML\Controls\Quads\Quad_Icons64x64_1; use FML\Controls\Quads\Quad_Icons64x64_1;
use FML\ManiaLink; use FML\ManiaLink;
use FML\Script\Script; use FML\Script\Script;
@ -78,11 +79,16 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$this->quadStyle = $this->maniaControl->manialinkManager->styleManager->getDefaultMainWindowStyle(); $this->quadStyle = $this->maniaControl->manialinkManager->styleManager->getDefaultMainWindowStyle();
$this->quadSubstyle = $this->maniaControl->manialinkManager->styleManager->getDefaultMainWindowSubStyle(); $this->quadSubstyle = $this->maniaControl->manialinkManager->styleManager->getDefaultMainWindowSubStyle();
/** @var just a test $itemQuad // @var just a test $itemQuad
* $itemQuad = new Quad(); $itemQuad = new Quad();
* $itemQuad->setStyles('Icons128x32_1', Quad_Icons128x128_1::SUBSTYLE_Create); $itemQuad->setStyles('Icons128x32_1', Quad_Icons128x128_1::SUBSTYLE_Create);
* $itemQuad->setAction(self::ACTION_ADD_MAP); $itemQuad->setAction(self::ACTION_ADD_MAP);
* $this->maniaControl->adminMenu->addMenuItem($itemQuad, 4);*/ $this->maniaControl->actionsMenu->addMenuItem($itemQuad, false, 4);
$itemQuad = new Quad();
$itemQuad->setStyles('Icons128x32_1', Quad_Icons128x128_1::SUBSTYLE_Challenge);
$itemQuad->setAction(self::ACTION_ADD_MAP);
$this->maniaControl->actionsMenu->addMenuItem($itemQuad, false, 4);
} }