small fix

This commit is contained in:
kremsy 2013-12-19 22:29:21 +01:00
parent 557dd7b9a6
commit 27aac6842e
2 changed files with 5 additions and 6 deletions

View File

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

View File

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