From cdda23cb60795d1c28df8d074b24cf2babead576 Mon Sep 17 00:00:00 2001 From: kremsy Date: Sun, 29 Dec 2013 15:57:11 +0100 Subject: [PATCH] player menu icon --- application/core/Admin/AdminMenu.php | 29 +++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/application/core/Admin/AdminMenu.php b/application/core/Admin/AdminMenu.php index 9603864e..dbbddee6 100644 --- a/application/core/Admin/AdminMenu.php +++ b/application/core/Admin/AdminMenu.php @@ -18,7 +18,7 @@ use ManiaControl\Players\PlayerManager; * * @author steeffeen & kremsy */ -class AdminMenu implements CallbackListener, ManialinkPageAnswerListener { +class AdminMenu implements CallbackListener, ManialinkPageAnswerListener { //TODO rename class, its not only an admin menu /** * Constants */ @@ -28,6 +28,7 @@ class AdminMenu implements CallbackListener, ManialinkPageAnswerListener { const SETTING_MENU_ITEMSIZE = 'Menu Item Size'; const ACTION_OPEN_ADMIN_MEN = 'AdminMenu.OpenAdminMenu'; + const ACTION_OPEN_PLAYER_MEN = 'AdminMenu.OpenPlayerMenu'; /** * Private properties @@ -133,6 +134,7 @@ class AdminMenu implements CallbackListener, ManialinkPageAnswerListener { $manialink = new ManiaLink(self::MLID_MENU); + //Player Menu Icon Frame $frame = new Frame(); $manialink->add($frame); $frame->setPosition($posX, $posY); @@ -142,15 +144,36 @@ class AdminMenu implements CallbackListener, ManialinkPageAnswerListener { $backgroundQuad->setSize($itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY); $backgroundQuad->setStyles($quadStyle, $quadSubstyle); + + $iconFrame = new Frame(); + $frame->add($iconFrame); + + $iconFrame->setSize($itemSize, $itemSize); + $itemQuad = new Quad_Icons128x128_1(); + $itemQuad->setSubStyle($itemQuad::SUBSTYLE_Options); + $itemQuad->setSize($itemSize, $itemSize); + $iconFrame->add($itemQuad); + $itemQuad->setAction(self::ACTION_OPEN_ADMIN_MEN); + + //Admin Menu Icon Frame + $frame = new Frame(); + $manialink->add($frame); + $frame->setPosition($posX, $posY - $itemSize * $itemMarginFactorY); + + $backgroundQuad = new Quad(); + $frame->add($backgroundQuad); + $backgroundQuad->setSize($itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY); + $backgroundQuad->setStyles($quadStyle, $quadSubstyle); + $iconFrame = new Frame(); $frame->add($iconFrame); $iconFrame->setSize($itemSize, $itemSize); $itemQuad = new Quad_Icons128x128_1(); - $itemQuad->setSubStyle($itemQuad::SUBSTYLE_Options); + $itemQuad->setSubStyle($itemQuad::SUBSTYLE_Custom); $itemQuad->setSize($itemSize, $itemSize); $iconFrame->add($itemQuad); - $itemQuad->setAction(self::ACTION_OPEN_ADMIN_MEN); + $itemQuad->setAction(self::ACTION_OPEN_PLAYER_MEN); $this->manialink = $manialink;