host mx icon on maniacontrol homepage
This commit is contained in:
parent
ec018f97f5
commit
05f487aafa
@ -65,6 +65,7 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
|||||||
* Private Properties
|
* Private Properties
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @var maniaControl $maniaControl
|
* @var maniaControl $maniaControl
|
||||||
*/
|
*/
|
||||||
private $maniaControl = null;
|
private $maniaControl = null;
|
||||||
@ -175,13 +176,13 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
|||||||
*/
|
*/
|
||||||
public function handleOnInit(array $callback) {
|
public function handleOnInit(array $callback) {
|
||||||
// Display Map Widget
|
// Display Map Widget
|
||||||
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_MAP_WIDGET_ACTIVATED)) {
|
if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_MAP_WIDGET_ACTIVATED)) {
|
||||||
$this->displayMapWidget();
|
$this->displayMapWidget();
|
||||||
}
|
}
|
||||||
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_CLOCK_WIDGET_ACTIVATED)) {
|
if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_CLOCK_WIDGET_ACTIVATED)) {
|
||||||
$this->displayClockWidget();
|
$this->displayClockWidget();
|
||||||
}
|
}
|
||||||
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_SERVERINFO_WIDGET_ACTIVATED)) {
|
if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_SERVERINFO_WIDGET_ACTIVATED)) {
|
||||||
$this->displayServerInfoWidget();
|
$this->displayServerInfoWidget();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -240,11 +241,10 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
|||||||
$label->setText($map->authorLogin);
|
$label->setText($map->authorLogin);
|
||||||
$label->setTextColor("FFF");
|
$label->setTextColor("FFF");
|
||||||
|
|
||||||
if(isset($map->mx->pageurl)) {
|
if (isset($map->mx->pageurl)) {
|
||||||
$quad = new Quad();
|
$quad = new Quad();
|
||||||
$frame->add($quad);
|
$frame->add($quad);
|
||||||
$quad->setImage("http://wiki.maniaplanet.com/pool/images/b/bf/ManiaExchange_logo.png"); // TODO include image into
|
$quad->setImage("http://images.maniacontrol.com/icons/ManiaExchange.png");
|
||||||
// maniacontrol
|
|
||||||
$quad->setPosition(-$width / 2 + 4, -1.5, -0.5);
|
$quad->setPosition(-$width / 2 + 4, -1.5, -0.5);
|
||||||
$quad->setSize(4, 4);
|
$quad->setSize(4, 4);
|
||||||
$quad->setHAlign(Control::CENTER);
|
$quad->setHAlign(Control::CENTER);
|
||||||
@ -339,17 +339,18 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
|||||||
$playerCount = 0;
|
$playerCount = 0;
|
||||||
$spectatorCount = 0;
|
$spectatorCount = 0;
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @var Player $player
|
* @var Player $player
|
||||||
*/
|
*/
|
||||||
foreach ($players as $player) {
|
foreach ($players as $player) {
|
||||||
if($player->isSpectator) {
|
if ($player->isSpectator) {
|
||||||
$spectatorCount++;
|
$spectatorCount++;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$playerCount++;
|
$playerCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$label = new Label_Text();
|
$label = new Label_Text();
|
||||||
$frame->add($label);
|
$frame->add($label);
|
||||||
$label->setPosition(0, 1.5, 0.2);
|
$label->setPosition(0, 1.5, 0.2);
|
||||||
@ -415,7 +416,7 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
|||||||
*/
|
*/
|
||||||
public function handleOnBeginMap(array $callback) {
|
public function handleOnBeginMap(array $callback) {
|
||||||
// Display Map Widget
|
// Display Map Widget
|
||||||
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_MAP_WIDGET_ACTIVATED)) {
|
if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_MAP_WIDGET_ACTIVATED)) {
|
||||||
$this->displayMapWidget();
|
$this->displayMapWidget();
|
||||||
}
|
}
|
||||||
$this->closeWidget(self::MLID_NEXTMAPWIDGET);
|
$this->closeWidget(self::MLID_NEXTMAPWIDGET);
|
||||||
@ -439,7 +440,7 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
|||||||
*/
|
*/
|
||||||
public function handleOnEndMap(array $callback) {
|
public function handleOnEndMap(array $callback) {
|
||||||
// Display Map Widget
|
// Display Map Widget
|
||||||
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_NEXTMAP_WIDGET_ACTIVATED)) {
|
if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_NEXTMAP_WIDGET_ACTIVATED)) {
|
||||||
$this->displayNextMapWidget();
|
$this->displayNextMapWidget();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -476,16 +477,18 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
|||||||
$queuedMap = $this->maniaControl->mapManager->mapQueue->getNextMap();
|
$queuedMap = $this->maniaControl->mapManager->mapQueue->getNextMap();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @var Player $requester
|
* @var Player $requester
|
||||||
*/
|
*/
|
||||||
$requester = null;
|
$requester = null;
|
||||||
// if the nextmap is not a queued map, get it from map info
|
// if the nextmap is not a queued map, get it from map info
|
||||||
if($queuedMap == null) {
|
if ($queuedMap == null) {
|
||||||
$this->maniaControl->client->query("GetNextMapInfo");
|
$this->maniaControl->client->query("GetNextMapInfo");
|
||||||
$map = $this->maniaControl->client->getResponse();
|
$map = $this->maniaControl->client->getResponse();
|
||||||
$name = $map['Name'];
|
$name = $map['Name'];
|
||||||
$author = $map['Author'];
|
$author = $map['Author'];
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$requester = $queuedMap[0];
|
$requester = $queuedMap[0];
|
||||||
$map = $queuedMap[1];
|
$map = $queuedMap[1];
|
||||||
$name = $map->name;
|
$name = $map->name;
|
||||||
@ -525,7 +528,7 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
|||||||
$label->setText($author);
|
$label->setText($author);
|
||||||
$label->setTextColor("FFF");
|
$label->setTextColor("FFF");
|
||||||
|
|
||||||
if($requester != null) {
|
if ($requester != null) {
|
||||||
$label = new Label_Text();
|
$label = new Label_Text();
|
||||||
$frame->add($label);
|
$frame->add($label);
|
||||||
$label->setX(0);
|
$label->setX(0);
|
||||||
@ -552,13 +555,13 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
|||||||
public function handlePlayerConnect(array $callback) {
|
public function handlePlayerConnect(array $callback) {
|
||||||
$player = $callback[1];
|
$player = $callback[1];
|
||||||
// Display Map Widget
|
// Display Map Widget
|
||||||
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_MAP_WIDGET_ACTIVATED)) {
|
if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_MAP_WIDGET_ACTIVATED)) {
|
||||||
$this->displayMapWidget($player->login);
|
$this->displayMapWidget($player->login);
|
||||||
}
|
}
|
||||||
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_CLOCK_WIDGET_ACTIVATED)) {
|
if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_CLOCK_WIDGET_ACTIVATED)) {
|
||||||
$this->displayClockWidget($player->login);
|
$this->displayClockWidget($player->login);
|
||||||
}
|
}
|
||||||
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_SERVERINFO_WIDGET_ACTIVATED)) {
|
if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_SERVERINFO_WIDGET_ACTIVATED)) {
|
||||||
$this->displayServerInfoWidget($player->login);
|
$this->displayServerInfoWidget($player->login);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -569,7 +572,7 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
|||||||
* @param array $callback
|
* @param array $callback
|
||||||
*/
|
*/
|
||||||
public function handleEveryMinute(array $callback) {
|
public function handleEveryMinute(array $callback) {
|
||||||
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_CLOCK_WIDGET_ACTIVATED)) {
|
if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_CLOCK_WIDGET_ACTIVATED)) {
|
||||||
$this->displayClockWidget();
|
$this->displayClockWidget();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user