function onDraw() { switch ($this->state) { case static::STATE_READY: $subStyle = '0F0D'; break; case static::STATE_IN_MATCH: $subStyle = 'FF0D'; break; case static::STATE_BLOCKED: $subStyle = '000D'; break; case static::STATE_NOT_READY: $subStyle = 'F00D'; break; default: $subStyle = ''; } $this->icon->setSize(1, $this->sizeY); $this->icon->setPosition(0, -$this->sizeY / 2); $this->label->setPosition(8, -$this->sizeY / 2); $this->echelonFrame->setPosition($this->sizeX - 1, 0.5); $this->countryFlag->setPosition(2, -$this->sizeY / 2); $this->bg->setSize($this->sizeX, $this->sizeY); $this->hiddenLabel->setText($this->login); $echelon = PlayerInfo::ComputeEchelon($this->ladderPoints); $this->icon->setBgcolor($subStyle); $this->countryFlag->setImage($this->zoneFlagURL, true); $this->echelonLabel->setText($echelon); $this->echelonQuad->setImage(sprintf('file://Media/Manialinks/Common/Echelons/echelon%d.dds', $echelon), true); }
function __construct() { $this->setSize(80, 20); $ui = new Elements\Quad(80, 20); $ui->setImage('http://static.maniaplanet.com/manialinks/elite/PlayerCardBg.dds', true); $this->addComponent($ui); $this->icon = new Elements\Icons64x64_1(18.5, 18.5); $this->icon->setBgcolor('F00'); $this->icon->setAlign('left', 'center'); $this->addComponent($this->icon); $this->label = new Elements\Label(38); $this->label->setPosition(22, -2.5); $this->label->setTextSize(3); $this->label->setStyle(Elements\Label::TextRaceMessage); $this->addComponent($this->label); $this->teamLabel = new Elements\Label(25); $this->teamLabel->setPosition(27, -11.5); $this->teamLabel->setValign('center2'); $this->teamLabel->setStyle(Elements\Label::TextRaceMessage); $this->teamLabel->setTextSize(2); $this->teamLabel->setText('$o$09FLorem$z Ipsum Team'); // $this->addComponent($this->teamLabel); $this->teamIcon = new Elements\Quad(4, 4); $this->teamIcon->setValign('center'); $this->teamIcon->setPosition(22, -11.5); $this->teamIcon->setBgcolor('FF0a'); // $this->addComponent($this->teamIcon); $this->rankLabel = new Elements\Label(30); $this->rankLabel->setAlign('left', 'center2'); $this->rankLabel->setPosition(27, -17.5); $this->rankLabel->setText('-'); $this->rankLabel->setStyle(Elements\Label::TextRaceMessage); $this->rankLabel->setTextSize(1); $this->addComponent($this->rankLabel); $this->countryFlag = new Elements\Quad(4, 4); $this->countryFlag->setAlign('left', 'center'); $this->countryFlag->setPosition(22, -17.5); $this->addComponent($this->countryFlag); $frame = new \ManiaLive\Gui\Controls\Frame(72, 0); $frame->setScale(1.13); $frame->setPosZ(0.1); $this->addComponent($frame); $this->echelonQuad = new Elements\Quad(14.1551, 17.6938); $this->echelonQuad->setAlign('center', 'top'); $frame->addComponent($this->echelonQuad); $ui = new Elements\Label(15); $ui->setAlign('center', 'top'); $ui->setStyle(Elements\Label::TextRaceMessage); $ui->setPosition(-0.25, -3.6); $ui->setTextSize(0.5); $ui->setText('Echelon'); $frame->addComponent($ui); $this->echelonLabel = new Elements\Label(10, 10); $this->echelonLabel->setAlign('center', 'center'); $this->echelonLabel->setPosition(-0.25, -10.6); $this->echelonLabel->setStyle(Elements\Label::TextRaceMessageBig); $frame->addComponent($this->echelonLabel); $this->disableQuad = new Elements\Quad(80, 20); $this->disableQuad->setBgcolor('333A'); $this->disableQuad->setVisibility(false); $this->disableQuad->setPosZ(3); $this->addComponent($this->disableQuad); }