Updated Donationsplugin with default tooltip

This commit is contained in:
Jocy 2017-03-29 21:08:58 +02:00
parent 6eef55df6d
commit c0e3df972d

View File

@ -199,19 +199,18 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
// Description Label // Description Label
$descriptionFrame = new Frame(); $descriptionFrame = new Frame();
$maniaLink->addChild($descriptionFrame); $maniaLink->addChild($descriptionFrame);
$descriptionFrame->setPosition($posX - 50, $posY - 5);
$descriptionFrame->setHorizontalAlign($descriptionFrame::RIGHT); $descriptionFrame->setHorizontalAlign($descriptionFrame::RIGHT);
$descriptionLabel = new Label(); $descriptionLabel = new Label();
$descriptionFrame->addChild($descriptionLabel); $descriptionFrame->addChild($descriptionLabel);
$descriptionLabel->setAlign($descriptionLabel::LEFT, $descriptionLabel::TOP); $descriptionLabel->setAlign($descriptionLabel::RIGHT, $descriptionLabel::TOP);
$descriptionLabel->setSize(40, 4); $descriptionLabel->setSize(40, 4);
$descriptionLabel->setTextSize(2); $descriptionLabel->setTextSize(1);
$descriptionLabel->setVisible(true); $descriptionLabel->setVisible(true);
$descriptionLabel->setTextColor('0f0');
// Add items // Add items
$posX = -2; $origPosX = $posX;
$posX = -2;
foreach (array_reverse($valueArray) as $value) { foreach (array_reverse($valueArray) as $value) {
$label = new Label_Text(); $label = new Label_Text();
$popoutFrame->addChild($label); $popoutFrame->addChild($label);
@ -227,6 +226,8 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
$posX -= strlen($value) * 2 + 1.7; $posX -= strlen($value) * 2 + 1.7;
} }
$descriptionFrame->setPosition($origPosX + $posX - $width + $itemMarginFactorX, $posY);
//Popout background //Popout background
$quad = new Quad(); $quad = new Quad();
$popoutFrame->addChild($quad); $popoutFrame->addChild($quad);