Made widgetposition changable in the settings

This commit is contained in:
Max Klaversma 2014-02-01 20:35:53 +01:00 committed by Steffen Schröder
parent 5ae3e43097
commit 8488ff4931

View File

@ -35,6 +35,8 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns
const ML_REMOVEFROMQUEUE = 'Queue.Remove';
const QUEUE_MAX = 'Maximum number in the queue';
const QUEUE_WIDGET_POS_X = 'X position of the widget';
const QUEUE_WIDGET_POS_Y = 'Y position of the widget';
/**
* Private properties
@ -72,6 +74,8 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns
$this->maniaControl->manialinkManager->registerManialinkPageAnswerListener(self::ML_REMOVEFROMQUEUE, $this, 'handleManiaLinkAnswerRemove');
$this->maniaControl->settingManager->initSetting($this, self::QUEUE_MAX, 8);
$this->maniaControl->settingManager->initSetting($this, self::QUEUE_WIDGET_POS_X, 0);
$this->maniaControl->settingManager->initSetting($this, self::QUEUE_WIDGET_POS_Y, -46);
foreach($this->maniaControl->playerManager->getPlayers() as $player) {
if($player->isSpectator) {
@ -355,13 +359,12 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns
$quadStyle = $this->maniaControl->manialinkManager->styleManager->getDefaultMainWindowStyle();
$quadSubstyle = $this->maniaControl->manialinkManager->styleManager->getDefaultMainWindowSubStyle();
$max_queue = $this->maniaControl->settingManager->getSetting($this, self::QUEUE_MAX);
//TODO position setting
// Main frame
$frame = new Frame();
$maniaLink->add($frame);
$frame->setSize(60, 6);
$frame->setPosition(0, -46, 0);
$frame->setPosition($this->maniaControl->settingManager->getSetting($this, self::QUEUE_WIDGET_POS_X), $this->maniaControl->settingManager->getSetting($this, self::QUEUE_WIDGET_POS_Y), 0);
// Background
$backgroundQuad = new Quad();
@ -448,8 +451,7 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns
$frame = new Frame();
$maniaLink->add($frame);
$frame->setSize(60, 6);
$frame->setPosition(0, -46, 0);
//TODO position setting
$frame->setPosition($this->maniaControl->settingManager->getSetting($this, self::QUEUE_WIDGET_POS_X), $this->maniaControl->settingManager->getSetting($this, self::QUEUE_WIDGET_POS_Y), 0);
// Background
$backgroundQuad = new Quad();