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