player detailed started statistics
This commit is contained in:
parent
3e7083d377
commit
f8ba365af5
@ -42,7 +42,6 @@ class Player {
|
||||
if(!$rpcInfos) {
|
||||
return;
|
||||
}
|
||||
var_dump($rpcInfos);
|
||||
|
||||
$this->pid = $rpcInfos['PlayerId'];
|
||||
$this->login = $rpcInfos['Login'];
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user