diff --git a/application/core/Players/Player.php b/application/core/Players/Player.php index f2948de7..8b9e4c65 100644 --- a/application/core/Players/Player.php +++ b/application/core/Players/Player.php @@ -42,7 +42,6 @@ class Player { if(!$rpcInfos) { return; } - var_dump($rpcInfos); $this->pid = $rpcInfos['PlayerId']; $this->login = $rpcInfos['Login']; diff --git a/application/core/Players/PlayerDetailed.php b/application/core/Players/PlayerDetailed.php index c31713ae..fbe1cc79 100644 --- a/application/core/Players/PlayerDetailed.php +++ b/application/core/Players/PlayerDetailed.php @@ -195,14 +195,31 @@ class PlayerDetailed { $quad = new Quad(); $frame->add($quad); - $quad->setImage('file://' . $player->avatar); + $quad->setImage('file://' . $target->avatar); $quad->setPosition($this->width / 2 - 10, $this->height / 2 - 10); $quad->setAlign(Control::RIGHT, Control::TOP); $quad->setSize(20, 20); + //Statistics + $frame->add($this->statisticsFrame($target)); // render and display xml $this->maniaControl->manialinkManager->displayWidget($maniaLink, $player); } + + public function statisticsFrame($player){ + $frame = new Frame(); + + /*$mainLabel = new Label_Text(); + $frame->add($mainLabel); + $mainLabel->setPosition(-$this->width / 2 + 50, $this->height / 2 - 10); + $mainLabel->setTextSize(1.2); + $mainLabel->setHAlign(Control::LEFT); + $mainLabel->setText("Statistics");*/ + + var_dump($this->maniaControl->statisticManager->getAllPlayerStats($player)); + + return $frame; + } } \ No newline at end of file diff --git a/application/core/Statistics/StatisticManager.php b/application/core/Statistics/StatisticManager.php index bc6152a2..aafb273f 100644 --- a/application/core/Statistics/StatisticManager.php +++ b/application/core/Statistics/StatisticManager.php @@ -116,6 +116,16 @@ class StatisticManager { } } + public function getAllPlayerStats(Player $player){ + $playerStats = array(); //TODO improve performant + foreach($this->stats as $stat){ +// $value = $this->getStatisticData($stat['name'], $player->index); + // var_dump($value); + //$playerStats[$stat] = $value; + } + + return $playerStats; + } /** * Inserts a Stat into the database * @@ -221,6 +231,7 @@ class StatisticManager { return true; } + /** * Initialize necessary database tables *