player menu icon

This commit is contained in:
kremsy 2013-12-29 15:57:11 +01:00
parent 0cf58f6e28
commit cdda23cb60

View File

@ -18,7 +18,7 @@ use ManiaControl\Players\PlayerManager;
* *
* @author steeffeen & kremsy * @author steeffeen & kremsy
*/ */
class AdminMenu implements CallbackListener, ManialinkPageAnswerListener { class AdminMenu implements CallbackListener, ManialinkPageAnswerListener { //TODO rename class, its not only an admin menu
/** /**
* Constants * Constants
*/ */
@ -28,6 +28,7 @@ class AdminMenu implements CallbackListener, ManialinkPageAnswerListener {
const SETTING_MENU_ITEMSIZE = 'Menu Item Size'; const SETTING_MENU_ITEMSIZE = 'Menu Item Size';
const ACTION_OPEN_ADMIN_MEN = 'AdminMenu.OpenAdminMenu'; const ACTION_OPEN_ADMIN_MEN = 'AdminMenu.OpenAdminMenu';
const ACTION_OPEN_PLAYER_MEN = 'AdminMenu.OpenPlayerMenu';
/** /**
* Private properties * Private properties
@ -133,6 +134,7 @@ class AdminMenu implements CallbackListener, ManialinkPageAnswerListener {
$manialink = new ManiaLink(self::MLID_MENU); $manialink = new ManiaLink(self::MLID_MENU);
//Player Menu Icon Frame
$frame = new Frame(); $frame = new Frame();
$manialink->add($frame); $manialink->add($frame);
$frame->setPosition($posX, $posY); $frame->setPosition($posX, $posY);
@ -142,15 +144,36 @@ class AdminMenu implements CallbackListener, ManialinkPageAnswerListener {
$backgroundQuad->setSize($itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY); $backgroundQuad->setSize($itemSize * $itemMarginFactorX, $itemSize * $itemMarginFactorY);
$backgroundQuad->setStyles($quadStyle, $quadSubstyle); $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(); $iconFrame = new Frame();
$frame->add($iconFrame); $frame->add($iconFrame);
$iconFrame->setSize($itemSize, $itemSize); $iconFrame->setSize($itemSize, $itemSize);
$itemQuad = new Quad_Icons128x128_1(); $itemQuad = new Quad_Icons128x128_1();
$itemQuad->setSubStyle($itemQuad::SUBSTYLE_Options); $itemQuad->setSubStyle($itemQuad::SUBSTYLE_Custom);
$itemQuad->setSize($itemSize, $itemSize); $itemQuad->setSize($itemSize, $itemSize);
$iconFrame->add($itemQuad); $iconFrame->add($itemQuad);
$itemQuad->setAction(self::ACTION_OPEN_ADMIN_MEN); $itemQuad->setAction(self::ACTION_OPEN_PLAYER_MEN);
$this->manialink = $manialink; $this->manialink = $manialink;