Added search feature to map list
Enhanced mx list x values Added setY to LabelLine Renamed setPosZ to setZ (same as in FML)
This commit is contained in:
@ -27,6 +27,7 @@ class LabelLine implements UsageInformationAble {
|
||||
private $textColor = 'FFF';
|
||||
private $posZ = 0;
|
||||
private $prefix = '';
|
||||
private $posY = 0;
|
||||
|
||||
|
||||
public function __construct(Frame $frame) {
|
||||
@ -78,6 +79,7 @@ class LabelLine implements UsageInformationAble {
|
||||
$entry->setTextSize($this->textSize);
|
||||
$entry->setTextColor($this->textColor);
|
||||
$entry->setZ($this->posZ);
|
||||
$entry->setY($this->posY);
|
||||
$entry->setTextPrefix($this->prefix);
|
||||
|
||||
$this->frame->addChild($entry);
|
||||
@ -143,17 +145,31 @@ class LabelLine implements UsageInformationAble {
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getPosZ() {
|
||||
public function getZ() {
|
||||
return $this->posZ;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $posZ
|
||||
*/
|
||||
public function setPosZ($posZ) {
|
||||
public function setZ($posZ) {
|
||||
$this->posZ = $posZ;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getY() {
|
||||
return $this->posY;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $posY
|
||||
*/
|
||||
public function setY($posY) {
|
||||
$this->posY = $posY;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \FML\Controls\Labels\Label_Text[]
|
||||
*/
|
||||
|
@ -377,7 +377,7 @@ class ManialinkManager implements ManialinkPageAnswerListener, CallbackListener,
|
||||
$labelLine->setStyle($style);
|
||||
$labelLine->setTextSize($textSize);
|
||||
$labelLine->setTextColor($textColor);
|
||||
$labelLine->setPosZ($posZ);
|
||||
$labelLine->setZ($posZ);
|
||||
|
||||
/**
|
||||
* @var Label_Text $prevLabel
|
||||
|
@ -2,12 +2,15 @@
|
||||
|
||||
namespace ManiaControl\Manialinks;
|
||||
|
||||
use FML\Controls\Entry;
|
||||
use FML\Controls\Frame;
|
||||
use FML\Controls\Label;
|
||||
use FML\Controls\Labels\Label_Button;
|
||||
use FML\Controls\Labels\Label_Text;
|
||||
use FML\Controls\Quad;
|
||||
use FML\Controls\Quads\Quad_BgRaceScore2;
|
||||
use FML\Controls\Quads\Quad_Bgs1InRace;
|
||||
use FML\Controls\Quads\Quad_BgsPlayerCard;
|
||||
use FML\Controls\Quads\Quad_Icons64x64_1;
|
||||
use FML\Script\Features\Paging;
|
||||
use FML\Script\Script;
|
||||
@ -118,6 +121,68 @@ class StyleManager implements UsageInformationAble {
|
||||
return $descriptionLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the default buttons and textbox for a map search
|
||||
*
|
||||
* @param string $actionMapNameSearch
|
||||
* @param string $actionAuthorSearch
|
||||
* @return \FML\Controls\Frame
|
||||
*/
|
||||
public function getDefaultMapSearch($actionMapNameSearch, $actionAuthorSearch){
|
||||
$width = $this->getListWidgetsWidth();
|
||||
|
||||
$frame = new Frame();
|
||||
|
||||
$label = new Label_Text();
|
||||
$frame->addChild($label);
|
||||
$label->setPosition(-$width / 2 + 5, 0);
|
||||
$label->setHorizontalAlign($label::LEFT);
|
||||
$label->setTextSize(1.3);
|
||||
$label->setText('Search: ');
|
||||
|
||||
$entry = new Entry();
|
||||
$frame->addChild($entry);
|
||||
$entry->setStyle(Label_Text::STYLE_TextValueSmall);
|
||||
$entry->setHorizontalAlign($entry::LEFT);
|
||||
$entry->setPosition(-$width / 2 + 15, 0);
|
||||
$entry->setTextSize(1);
|
||||
$entry->setSize($width * 0.25, 4);
|
||||
$entry->setName('SearchString');
|
||||
|
||||
//Search for Map-Name
|
||||
$label = new Label_Button();
|
||||
$frame->addChild($label);
|
||||
$label->setPosition(-$width / 2 + 63, 0);
|
||||
$label->setText('MapName');
|
||||
$label->setTextSize(1.3);
|
||||
|
||||
$quad = new Quad_BgsPlayerCard();
|
||||
$frame->addChild($quad);
|
||||
$quad->setPosition(-$width / 2 + 63, 0);
|
||||
$quad->setSubStyle($quad::SUBSTYLE_BgPlayerCardBig);
|
||||
$quad->setSize(18, 5);
|
||||
$quad->setAction($actionMapNameSearch);
|
||||
$quad->setZ(-0.1);
|
||||
|
||||
//Search for Author
|
||||
$label = new Label_Button();
|
||||
$frame->addChild($label);
|
||||
$label->setPosition(-$width / 2 + 82, 0);
|
||||
$label->setText('Author');
|
||||
$label->setTextSize(1.3);
|
||||
|
||||
$quad = new Quad_BgsPlayerCard();
|
||||
$frame->addChild($quad);
|
||||
$quad->setPosition(-$width / 2 + 82, 0);
|
||||
$quad->setSubStyle($quad::SUBSTYLE_BgPlayerCardBig);
|
||||
$quad->setSize(18, 5);
|
||||
$quad->setAction($actionAuthorSearch);
|
||||
$quad->setZ(-0.1);
|
||||
|
||||
return $frame;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Default List Widgets Width
|
||||
*
|
||||
|
Reference in New Issue
Block a user