From 0675ed66e41bf680c7b134a150d46c652e8dd0de Mon Sep 17 00:00:00 2001 From: kremsy Date: Thu, 9 Jan 2014 19:29:25 +0100 Subject: [PATCH] multiple maptypes support --- application/core/Configurators/Configurator.php | 1 + .../core/ManiaExchange/ManiaExchangeInfoSearcher.php | 9 ++++----- application/core/Maps/MapList.php | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/application/core/Configurators/Configurator.php b/application/core/Configurators/Configurator.php index b36094fe..402603a6 100644 --- a/application/core/Configurators/Configurator.php +++ b/application/core/Configurators/Configurator.php @@ -241,6 +241,7 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn $frame = new Frame(); $manialink->add($frame); $frame->setPosition($menuPosX, $menuPosY); + $frame->setZ(10); $backgroundQuad = new Quad(); $frame->add($backgroundQuad); diff --git a/application/core/ManiaExchange/ManiaExchangeInfoSearcher.php b/application/core/ManiaExchange/ManiaExchangeInfoSearcher.php index 14efc7a0..85d17ecb 100644 --- a/application/core/ManiaExchange/ManiaExchangeInfoSearcher.php +++ b/application/core/ManiaExchange/ManiaExchangeInfoSearcher.php @@ -63,8 +63,7 @@ class ManiaExchangeInfoSearcher { $this->maniaControl->client->query('GetModeScriptInfo'); $scriptInfos = $this->maniaControl->client->getResponse(); - $mapTypes = $scriptInfos["CompatibleMapTypes"]; - $mapTypeArray = explode(",", $mapTypes); + $mapTypes = $scriptInfos["CompatibleMapTypes"]; // compile search URL $url = 'http://' . $titlePrefix . '.mania-exchange.com/tracksearch?api=on'; @@ -81,11 +80,11 @@ class ManiaExchangeInfoSearcher { $url .= '&priord=' . $searchOrder; $url .= '&limit=' . $maxMapsReturned; - $url .= '&mtype=' . $mapTypeArray[0]; + $url .= '&mtype=' . $mapTypes; - // $mapInfo = FileUtil::loadFile($url, "application/json"); //TODO use mp fileutil + // $mapInfo = FileUtil::loadFile($url, "application/json"); //TODO use mc fileutil $mapInfo = $this->get_file($url); - + //TODO errors /*if ($file === false) { $this->error = 'Connection or response error on ' . $url; diff --git a/application/core/Maps/MapList.php b/application/core/Maps/MapList.php index 8ab16764..1be9a582 100644 --- a/application/core/Maps/MapList.php +++ b/application/core/Maps/MapList.php @@ -240,13 +240,14 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener { $script->addTooltip($addQuad, $descriptionLabel, array(Script::OPTION_TOOLTIP_TEXT => 'Add-Map: $<' . $map->name . '$>')); } - //Award + //Award Quad if($map->awards > 0) { $awardQuad = new Quad_Icons64x64_1(); $mapFrame->add($awardQuad); $awardQuad->setSize(3, 3); $awardQuad->setSubStyle($awardQuad::SUBSTYLE_OfficialRace); $awardQuad->setX($x + 93); + $awardQuad->setZ(0.01); $awardLabel = new Label_Text(); $mapFrame->add($awardLabel);