diff --git a/application/core/Players/PlayerList.php b/application/core/Players/PlayerList.php index 3bb3e16b..db4069c4 100644 --- a/application/core/Players/PlayerList.php +++ b/application/core/Players/PlayerList.php @@ -131,7 +131,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener { $playerFrame->setY($y); //Team Emblem - if($listPlayer->teamId != -1){ //Show Players Team + if($listPlayer->teamId >= 0){ //Player is in a Team $redQuad = new Quad_Emblems(); //TODO rename quads $playerFrame->add($redQuad); $redQuad->setX($x + 10); @@ -141,9 +141,8 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener { switch($listPlayer->teamId){ case 0: $redQuad->setSubStyle($redQuad::SUBSTYLE_1); break; case 1: $redQuad->setSubStyle($redQuad::SUBSTYLE_2); break; - //case 2: $redQuad->setSubStyle($redQuad::SUBSTYLE_2); break; } - }else{ //player is in spec + }else if($listPlayer->isSpectator){ //Player is in Spectator Mode $neutralQuad = new Quad_BgRaceScore2(); $playerFrame->add($neutralQuad); $neutralQuad->setX($x + 10); diff --git a/application/core/Players/PlayerManager.php b/application/core/Players/PlayerManager.php index 1a148a6f..99c88584 100644 --- a/application/core/Players/PlayerManager.php +++ b/application/core/Players/PlayerManager.php @@ -159,11 +159,11 @@ class PlayerManager implements CallbackListener { * @param array $callback */ public function playerInfoChanged(array $callback){ - //TODO update other info - //TODO something on playerjoin not working here + //TODO something on playerjoin not working here (maybe because it get called before player join $player = $this->getPlayer($callback[1][0]['Login']); $player->teamId = $callback[1][0]["TeamId"]; - //var_dump($callback); + $player->isSpectator = $callback[1][0]["SpectatorStatus"]; + $player->ladderRank = $callback[1][0]["LadderRanking"]; // Trigger own callback $this->maniaControl->callbackManager->triggerCallback(self::CB_PLAYERINFOCHANGED, array(self::CB_PLAYERINFOCHANGED));