multiple maptypes support

This commit is contained in:
kremsy 2014-01-09 19:29:25 +01:00
parent bd136cbf6e
commit 0675ed66e4
3 changed files with 7 additions and 6 deletions

View File

@ -241,6 +241,7 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn
$frame = new Frame(); $frame = new Frame();
$manialink->add($frame); $manialink->add($frame);
$frame->setPosition($menuPosX, $menuPosY); $frame->setPosition($menuPosX, $menuPosY);
$frame->setZ(10);
$backgroundQuad = new Quad(); $backgroundQuad = new Quad();
$frame->add($backgroundQuad); $frame->add($backgroundQuad);

View File

@ -63,8 +63,7 @@ class ManiaExchangeInfoSearcher {
$this->maniaControl->client->query('GetModeScriptInfo'); $this->maniaControl->client->query('GetModeScriptInfo');
$scriptInfos = $this->maniaControl->client->getResponse(); $scriptInfos = $this->maniaControl->client->getResponse();
$mapTypes = $scriptInfos["CompatibleMapTypes"]; $mapTypes = $scriptInfos["CompatibleMapTypes"];
$mapTypeArray = explode(",", $mapTypes);
// compile search URL // compile search URL
$url = 'http://' . $titlePrefix . '.mania-exchange.com/tracksearch?api=on'; $url = 'http://' . $titlePrefix . '.mania-exchange.com/tracksearch?api=on';
@ -81,11 +80,11 @@ class ManiaExchangeInfoSearcher {
$url .= '&priord=' . $searchOrder; $url .= '&priord=' . $searchOrder;
$url .= '&limit=' . $maxMapsReturned; $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); $mapInfo = $this->get_file($url);
//TODO errors //TODO errors
/*if ($file === false) { /*if ($file === false) {
$this->error = 'Connection or response error on ' . $url; $this->error = 'Connection or response error on ' . $url;

View File

@ -240,13 +240,14 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$script->addTooltip($addQuad, $descriptionLabel, array(Script::OPTION_TOOLTIP_TEXT => 'Add-Map: $<' . $map->name . '$>')); $script->addTooltip($addQuad, $descriptionLabel, array(Script::OPTION_TOOLTIP_TEXT => 'Add-Map: $<' . $map->name . '$>'));
} }
//Award //Award Quad
if($map->awards > 0) { if($map->awards > 0) {
$awardQuad = new Quad_Icons64x64_1(); $awardQuad = new Quad_Icons64x64_1();
$mapFrame->add($awardQuad); $mapFrame->add($awardQuad);
$awardQuad->setSize(3, 3); $awardQuad->setSize(3, 3);
$awardQuad->setSubStyle($awardQuad::SUBSTYLE_OfficialRace); $awardQuad->setSubStyle($awardQuad::SUBSTYLE_OfficialRace);
$awardQuad->setX($x + 93); $awardQuad->setX($x + 93);
$awardQuad->setZ(0.01);
$awardLabel = new Label_Text(); $awardLabel = new Label_Text();
$mapFrame->add($awardLabel); $mapFrame->add($awardLabel);