Changed the maplist a bit and changed maps limit to avoid crash
This commit is contained in:
parent
34d0ad54fa
commit
be4d96fa22
@ -199,6 +199,12 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
/**
|
/**
|
||||||
* @var Map $map
|
* @var Map $map
|
||||||
*/
|
*/
|
||||||
|
$currentMap = $this->maniaControl->mapManager->getCurrentMap();
|
||||||
|
$mxIcon = $this->maniaControl->manialinkManager->iconManager->getIcon(IconManager::MX_ICON);
|
||||||
|
$mxIconHover = $this->maniaControl->manialinkManager->iconManager->getIcon(IconManager::MX_ICON_MOVER);
|
||||||
|
$mxIconGreen = $this->maniaControl->manialinkManager->iconManager->getIcon(IconManager::MX_ICON_GREEN);
|
||||||
|
$mxIconGreenHover = $this->maniaControl->manialinkManager->iconManager->getIcon(IconManager::MX_ICON_GREEN_MOVER);
|
||||||
|
|
||||||
foreach($mapList as $map) {
|
foreach($mapList as $map) {
|
||||||
if (!isset($pageFrame)) {
|
if (!isset($pageFrame)) {
|
||||||
$pageFrame = new Frame();
|
$pageFrame = new Frame();
|
||||||
@ -225,7 +231,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
$lineQuad->setZ(0.001);
|
$lineQuad->setZ(0.001);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->maniaControl->mapManager->getCurrentMap() === $map) {
|
if ($currentMap === $map) {
|
||||||
$currentQuad = new Quad_Icons64x64_1();
|
$currentQuad = new Quad_Icons64x64_1();
|
||||||
$mapFrame->add($currentQuad);
|
$mapFrame->add($currentQuad);
|
||||||
$currentQuad->setX($x + 3.5);
|
$currentQuad->setX($x + 3.5);
|
||||||
@ -241,8 +247,8 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
$mxQuad = new Quad();
|
$mxQuad = new Quad();
|
||||||
$mapFrame->add($mxQuad);
|
$mapFrame->add($mxQuad);
|
||||||
$mxQuad->setSize(3, 3);
|
$mxQuad->setSize(3, 3);
|
||||||
$mxQuad->setImage($this->maniaControl->manialinkManager->iconManager->getIcon(IconManager::MX_ICON));
|
$mxQuad->setImage($mxIcon);
|
||||||
$mxQuad->setImageFocus($this->maniaControl->manialinkManager->iconManager->getIcon(IconManager::MX_ICON_MOVER));
|
$mxQuad->setImageFocus($mxIconHover);
|
||||||
$mxQuad->setX($x + 65);
|
$mxQuad->setX($x + 65);
|
||||||
$mxQuad->setUrl($map->mx->pageurl);
|
$mxQuad->setUrl($map->mx->pageurl);
|
||||||
$mxQuad->setZ(0.01);
|
$mxQuad->setZ(0.01);
|
||||||
@ -252,8 +258,8 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
$mxQuad = new Quad();
|
$mxQuad = new Quad();
|
||||||
$mapFrame->add($mxQuad);
|
$mapFrame->add($mxQuad);
|
||||||
$mxQuad->setSize(3, 3);
|
$mxQuad->setSize(3, 3);
|
||||||
$mxQuad->setImage($this->maniaControl->manialinkManager->iconManager->getIcon(IconManager::MX_ICON_GREEN));
|
$mxQuad->setImage($mxIconGreen);
|
||||||
$mxQuad->setImageFocus($this->maniaControl->manialinkManager->iconManager->getIcon(IconManager::MX_ICON_GREEN_MOVER));
|
$mxQuad->setImageFocus($mxIconGreenHover);
|
||||||
$mxQuad->setX($x + 62);
|
$mxQuad->setX($x + 62);
|
||||||
$mxQuad->setUrl($map->mx->pageurl);
|
$mxQuad->setUrl($map->mx->pageurl);
|
||||||
$mxQuad->setZ(0.01);
|
$mxQuad->setZ(0.01);
|
||||||
|
@ -370,7 +370,7 @@ class MapManager implements CallbackListener {
|
|||||||
* Updates the full Map list, needed on Init, addMap and on ShuffleMaps
|
* Updates the full Map list, needed on Init, addMap and on ShuffleMaps
|
||||||
*/
|
*/
|
||||||
private function updateFullMapList() {
|
private function updateFullMapList() {
|
||||||
$maps = $this->maniaControl->client->getMapList(1000, 0);
|
$maps = $this->maniaControl->client->getMapList(150, 0);
|
||||||
$tempList = array();
|
$tempList = array();
|
||||||
foreach ($maps as $rpcMap) {
|
foreach ($maps as $rpcMap) {
|
||||||
if (array_key_exists($rpcMap->uId, $this->maps)) {
|
if (array_key_exists($rpcMap->uId, $this->maps)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user