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();
$manialink->add($frame);
$frame->setPosition($menuPosX, $menuPosY);
$frame->setZ(10);
$backgroundQuad = new Quad();
$frame->add($backgroundQuad);

View File

@ -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;

View File

@ -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);