reanmed to new FML names
This commit is contained in:
@ -82,37 +82,36 @@ class InstallMenu implements ConfiguratorMenu, ManialinkPageAnswerListener {
|
||||
if (!is_array($pluginList)) {
|
||||
// Error text
|
||||
$errorFrame = $this->getErrorFrame();
|
||||
$frame->add($errorFrame);
|
||||
$frame->addChild($errorFrame);
|
||||
} else if (empty($pluginList)) {
|
||||
// Empty text
|
||||
$emptyFrame = $this->getEmptyFrame();
|
||||
$frame->add($emptyFrame);
|
||||
$frame->addChild($emptyFrame);
|
||||
} else {
|
||||
// Build plugin list
|
||||
// Pagers
|
||||
$pagerPrev = new Quad_Icons64x64_1();
|
||||
$frame->add($pagerPrev);
|
||||
$frame->addChild($pagerPrev);
|
||||
$pagerPrev->setPosition($width * 0.39, $height * -0.44, 2)->setSize($pagerSize, $pagerSize)->setSubStyle($pagerPrev::SUBSTYLE_ArrowPrev);
|
||||
|
||||
$pagerNext = clone $pagerPrev;
|
||||
$frame->add($pagerNext);
|
||||
$frame->addChild($pagerNext);
|
||||
$pagerNext->setX($width * 0.45);
|
||||
|
||||
$pageCountLabel = new Label_Text();
|
||||
$frame->add($pageCountLabel);
|
||||
$pageCountLabel->setHAlign($pageCountLabel::RIGHT)->setPosition($width * 0.35, $height * -0.44, 1)->setStyle($pageCountLabel::STYLE_TextTitle1)->setTextSize(2);
|
||||
$frame->addChild($pageCountLabel);
|
||||
$pageCountLabel->setHorizontalAlign($pageCountLabel::RIGHT)->setPosition($width * 0.35, $height * -0.44, 1)->setStyle($pageCountLabel::STYLE_TextTitle1)->setTextSize(2);
|
||||
|
||||
$paging->addButtonControl($pagerNext)->addButtonControl($pagerPrev)->setLabel($pageCountLabel);
|
||||
|
||||
// Info tooltip
|
||||
$infoTooltipLabel = new Label();
|
||||
$frame->add($infoTooltipLabel);
|
||||
$frame->addChild($infoTooltipLabel);
|
||||
$infoTooltipLabel->setAlign($infoTooltipLabel::LEFT, $infoTooltipLabel::TOP)->setPosition($width * -0.45, $height * -0.22)->setSize($width * 0.7, $entryHeight)->setTextSize(1)->setTranslate(true)->setVisible(false)->setAutoNewLine(true)->setMaxLines(5);
|
||||
|
||||
// List plugins
|
||||
foreach ($pluginList as $plugin) {
|
||||
if ($this->maniaControl->getPluginManager()->isPluginIdInstalled($plugin->id)
|
||||
) {
|
||||
if ($this->maniaControl->getPluginManager()->isPluginIdInstalled($plugin->id)) {
|
||||
// Already installed -> Skip
|
||||
continue;
|
||||
}
|
||||
@ -120,27 +119,28 @@ class InstallMenu implements ConfiguratorMenu, ManialinkPageAnswerListener {
|
||||
if ($index % 10 === 0) {
|
||||
// New page
|
||||
$pageFrame = new Frame();
|
||||
$frame->add($pageFrame);
|
||||
$frame->addChild($pageFrame);
|
||||
$paging->addPageControl($pageFrame);
|
||||
$posY = $height * 0.41;
|
||||
}
|
||||
|
||||
$pluginFrame = new Frame();
|
||||
$pageFrame->add($pluginFrame);
|
||||
$pageFrame->addChild($pluginFrame);
|
||||
$pluginFrame->setY($posY);
|
||||
|
||||
$nameLabel = new Label_Text();
|
||||
$pluginFrame->add($nameLabel);
|
||||
$nameLabel->setHAlign($nameLabel::LEFT)->setX($width * -0.46)->setSize($width * 0.62, $entryHeight)->setStyle($nameLabel::STYLE_TextCardSmall)->setTextSize(2)->setText($plugin->name);
|
||||
$pluginFrame->addChild($nameLabel);
|
||||
$nameLabel->setHorizontalAlign($nameLabel::LEFT)->setX($width * -0.46)->setSize($width * 0.62, $entryHeight)->setStyle($nameLabel::STYLE_TextCardSmall)->setTextSize(2)->setText($plugin->name);
|
||||
|
||||
$description = "Author: {$plugin->author}\nVersion: {$plugin->currentVersion->version}\nDesc: {$plugin->description}";
|
||||
$infoTooltipLabel->setLineSpacing(1);
|
||||
$nameLabel->addTooltipLabelFeature($infoTooltipLabel, $description);
|
||||
|
||||
if (!$this->isPluginCompatible($plugin)) {
|
||||
// Incompatibility label
|
||||
$infoLabel = new Label_Text();
|
||||
$pluginFrame->add($infoLabel);
|
||||
$infoLabel->setHAlign($infoLabel::RIGHT)->setX($width * 0.47)->setSize($width * 0.33, $entryHeight)->setTextSize(1)->setTextColor('f30');
|
||||
$pluginFrame->addChild($infoLabel);
|
||||
$infoLabel->setHorizontalAlign($infoLabel::RIGHT)->setX($width * 0.47)->setSize($width * 0.33, $entryHeight)->setTextSize(1)->setTextColor('f30');
|
||||
if ($plugin->currentVersion->min_mc_version > ManiaControl::VERSION) {
|
||||
$infoLabel->setText("Needs at least MC-Version '{$plugin->currentVersion->min_mc_version}'");
|
||||
} else {
|
||||
@ -149,14 +149,14 @@ class InstallMenu implements ConfiguratorMenu, ManialinkPageAnswerListener {
|
||||
} else {
|
||||
// Install button
|
||||
$installButton = new Label_Button();
|
||||
$pluginFrame->add($installButton);
|
||||
$installButton->setHAlign($installButton::RIGHT)->setX($width * 0.47)->setStyle($installButton::STYLE_CardButtonSmall)->setText('Install')->setTranslate(true)->setAction(self::ACTION_PREFIX_INSTALL_PLUGIN . $plugin->id);
|
||||
$pluginFrame->addChild($installButton);
|
||||
$installButton->setHorizontalAlign($installButton::RIGHT)->setX($width * 0.47)->setStyle($installButton::STYLE_CardButtonSmall)->setText('Install')->setTranslate(true)->setAction(self::ACTION_PREFIX_INSTALL_PLUGIN . $plugin->id);
|
||||
}
|
||||
|
||||
if ($plugin->currentVersion->verified > 0) {
|
||||
// Suggested quad
|
||||
$suggestedQuad = new Quad_Icons64x64_1();
|
||||
$pluginFrame->add($suggestedQuad);
|
||||
$pluginFrame->addChild($suggestedQuad);
|
||||
$suggestedQuad->setPosition($width * 0.45, $entryHeight * 0.12, 2)->setSize(4, 4)->setSubStyle($suggestedQuad::SUBSTYLE_StateSuggested);
|
||||
}
|
||||
|
||||
@ -177,11 +177,11 @@ class InstallMenu implements ConfiguratorMenu, ManialinkPageAnswerListener {
|
||||
$frame = new Frame();
|
||||
|
||||
$infoLabel = new Label_Text();
|
||||
$frame->add($infoLabel);
|
||||
$infoLabel->setVAlign($infoLabel::BOTTOM)->setY(2)->setSize(100, 25)->setTextColor('f30')->setTranslate(true)->setText('An error occurred. Please try again later.');
|
||||
$frame->addChild($infoLabel);
|
||||
$infoLabel->setVerticalAlign($infoLabel::BOTTOM)->setY(2)->setSize(100, 25)->setTextColor('f30')->setTranslate(true)->setText('An error occurred. Please try again later.');
|
||||
|
||||
$refreshQuad = new Quad_Icons64x64_1();
|
||||
$frame->add($refreshQuad);
|
||||
$frame->addChild($refreshQuad);
|
||||
$refreshQuad->setY(-4)->setSize(8, 8)->setSubStyle($refreshQuad::SUBSTYLE_Refresh)->setAction(self::ACTION_REFRESH_LIST);
|
||||
|
||||
return $frame;
|
||||
@ -196,7 +196,7 @@ class InstallMenu implements ConfiguratorMenu, ManialinkPageAnswerListener {
|
||||
$frame = new Frame();
|
||||
|
||||
$infoLabel = new Label_Text();
|
||||
$frame->add($infoLabel);
|
||||
$frame->addChild($infoLabel);
|
||||
$infoLabel->setSize(100, 50)->setTextColor('0f3')->setTranslate(true)->setText('No other plugins available.');
|
||||
|
||||
return $frame;
|
||||
|
@ -103,13 +103,13 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
|
||||
// Pagers
|
||||
$pagerPrev = new Quad_Icons64x64_1();
|
||||
$frame->add($pagerPrev);
|
||||
$frame->addChild($pagerPrev);
|
||||
$pagerPrev->setPosition($width * 0.39, $height * -0.44, 2);
|
||||
$pagerPrev->setSize($pagerSize, $pagerSize);
|
||||
$pagerPrev->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_ArrowPrev);
|
||||
|
||||
$pagerNext = new Quad_Icons64x64_1();
|
||||
$frame->add($pagerNext);
|
||||
$frame->addChild($pagerNext);
|
||||
$pagerNext->setPosition($width * 0.45, $height * -0.44, 2);
|
||||
$pagerNext->setSize($pagerSize, $pagerSize);
|
||||
$pagerNext->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_ArrowNext);
|
||||
@ -118,8 +118,8 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
$paging->addButtonControl($pagerPrev);
|
||||
|
||||
$pageCountLabel = new Label_Text();
|
||||
$frame->add($pageCountLabel);
|
||||
$pageCountLabel->setHAlign($pageCountLabel::RIGHT);
|
||||
$frame->addChild($pageCountLabel);
|
||||
$pageCountLabel->setHorizontalAlign($pageCountLabel::RIGHT);
|
||||
$pageCountLabel->setPosition($width * 0.35, $height * -0.44, 1);
|
||||
$pageCountLabel->setStyle($pageCountLabel::STYLE_TextTitle1);
|
||||
$pageCountLabel->setTextSize(2);
|
||||
@ -148,7 +148,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
/** @var Plugin $pluginClass */
|
||||
if ($index % $pageMaxCount === 0) {
|
||||
$pageFrame = new Frame();
|
||||
$frame->add($pageFrame);
|
||||
$frame->addChild($pageFrame);
|
||||
$paging->addPageControl($pageFrame);
|
||||
$posY = $height * 0.41;
|
||||
}
|
||||
@ -156,11 +156,11 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
$active = $this->maniaControl->getPluginManager()->isPluginActive($pluginClass);
|
||||
|
||||
$pluginFrame = new Frame();
|
||||
$pageFrame->add($pluginFrame);
|
||||
$pageFrame->addChild($pluginFrame);
|
||||
$pluginFrame->setY($posY);
|
||||
|
||||
$activeQuad = new Quad_Icons64x64_1();
|
||||
$pluginFrame->add($activeQuad);
|
||||
$pluginFrame->addChild($activeQuad);
|
||||
$activeQuad->setPosition($width * -0.45, -0.1, 1);
|
||||
$activeQuad->setSize($entryHeight * 0.9, $entryHeight * 0.9);
|
||||
if ($active) {
|
||||
@ -170,8 +170,8 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
}
|
||||
|
||||
$nameLabel = new Label_Text();
|
||||
$pluginFrame->add($nameLabel);
|
||||
$nameLabel->setHAlign($nameLabel::LEFT);
|
||||
$pluginFrame->addChild($nameLabel);
|
||||
$nameLabel->setHorizontalAlign($nameLabel::LEFT);
|
||||
$nameLabel->setX($width * -0.4);
|
||||
$nameLabel->setSize($width * 0.5, $entryHeight);
|
||||
$nameLabel->setStyle($nameLabel::STYLE_TextCardSmall);
|
||||
@ -179,7 +179,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
$nameLabel->setText($pluginClass::getName());
|
||||
|
||||
$descriptionLabel = new Label();
|
||||
$pageFrame->add($descriptionLabel);
|
||||
$pageFrame->addChild($descriptionLabel);
|
||||
$descriptionLabel->setAlign($descriptionLabel::LEFT, $descriptionLabel::TOP);
|
||||
$descriptionLabel->setPosition($width * -0.45, $height * -0.22);
|
||||
$descriptionLabel->setSize($width * 0.7, $entryHeight);
|
||||
@ -192,7 +192,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
$nameLabel->addTooltipLabelFeature($descriptionLabel,$description);
|
||||
|
||||
$quad = new Quad_Icons128x32_1();
|
||||
$pluginFrame->add($quad);
|
||||
$pluginFrame->addChild($quad);
|
||||
$quad->setSubStyle($quad::SUBSTYLE_Settings);
|
||||
$quad->setX(15);
|
||||
$quad->setZ(1);
|
||||
@ -200,8 +200,8 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
$quad->setAction(self::ACTION_PREFIX_SETTINGS . $pluginClass);
|
||||
|
||||
$statusChangeButton = new Label_Button();
|
||||
$pluginFrame->add($statusChangeButton);
|
||||
$statusChangeButton->setHAlign($statusChangeButton::RIGHT);
|
||||
$pluginFrame->addChild($statusChangeButton);
|
||||
$statusChangeButton->setHorizontalAlign($statusChangeButton::RIGHT);
|
||||
$statusChangeButton->setX($width * 0.45);
|
||||
$statusChangeButton->setStyle($statusChangeButton::STYLE_CardButtonSmall);
|
||||
if ($active) {
|
||||
@ -216,7 +216,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
|
||||
if ($pluginUpdates && array_key_exists($pluginClass::getId(), $pluginUpdates)) {
|
||||
$quadUpdate = new Quad_Icons128x128_1();
|
||||
$pluginFrame->add($quadUpdate);
|
||||
$pluginFrame->addChild($quadUpdate);
|
||||
$quadUpdate->setSubStyle($quadUpdate::SUBSTYLE_ProfileVehicle);
|
||||
$quadUpdate->setX(56);
|
||||
$quadUpdate->setZ(2);
|
||||
@ -229,8 +229,8 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
|
||||
if ($pluginUpdates) {
|
||||
$updatePluginsButton = new Label_Button();
|
||||
$frame->add($updatePluginsButton);
|
||||
$updatePluginsButton->setHAlign($updatePluginsButton::RIGHT);
|
||||
$frame->addChild($updatePluginsButton);
|
||||
$updatePluginsButton->setHorizontalAlign($updatePluginsButton::RIGHT);
|
||||
$updatePluginsButton->setPosition($width * 0.5, -29, 2);
|
||||
$updatePluginsButton->setWidth(10);
|
||||
$updatePluginsButton->setStyle($updatePluginsButton::STYLE_CardButtonSmallS);
|
||||
@ -264,8 +264,8 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
|
||||
//Headline Label
|
||||
$headLabel = new Label_Text();
|
||||
$frame->add($headLabel);
|
||||
$headLabel->setHAlign($headLabel::LEFT);
|
||||
$frame->addChild($headLabel);
|
||||
$headLabel->setHorizontalAlign($headLabel::LEFT);
|
||||
$headLabel->setPosition($width * -0.46, $height * 0.41);
|
||||
$headLabel->setSize($width * 0.6, $settingHeight);
|
||||
$headLabel->setStyle($headLabel::STYLE_TextCardSmall);
|
||||
@ -276,18 +276,18 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
foreach ($settings as $setting) {
|
||||
if ($index % $pageSettingsMaxCount === 0) {
|
||||
$pageFrame = new Frame();
|
||||
$frame->add($pageFrame);
|
||||
$frame->addChild($pageFrame);
|
||||
$paging->addPageControl($pageFrame);
|
||||
$posY = $height * 0.41 - $settingHeight * 1.5;
|
||||
}
|
||||
|
||||
$settingFrame = new Frame();
|
||||
$pageFrame->add($settingFrame);
|
||||
$pageFrame->addChild($settingFrame);
|
||||
$settingFrame->setY($posY);
|
||||
|
||||
$nameLabel = new Label_Text();
|
||||
$settingFrame->add($nameLabel);
|
||||
$nameLabel->setHAlign($nameLabel::LEFT);
|
||||
$settingFrame->addChild($nameLabel);
|
||||
$nameLabel->setHorizontalAlign($nameLabel::LEFT);
|
||||
$nameLabel->setX($width * -0.46);
|
||||
$nameLabel->setSize($width * 0.6, $settingHeight);
|
||||
$nameLabel->setStyle($nameLabel::STYLE_TextCardSmall);
|
||||
@ -301,7 +301,7 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
$quad->setPosition($width * 0.33, 0, -0.01);
|
||||
$quad->setSize(4, 4);
|
||||
$checkBox = new CheckBox(self::ACTION_PREFIX_SETTING . $setting->index, $setting->value, $quad);
|
||||
$settingFrame->add($checkBox);
|
||||
$settingFrame->addChild($checkBox);
|
||||
} else if ($setting->type === Setting::TYPE_SET) {
|
||||
// SET value picker
|
||||
$label = new Label_Text();
|
||||
@ -310,11 +310,11 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
$label->setStyle($label::STYLE_TextValueSmall);
|
||||
$label->setTextSize(1);
|
||||
$valuePicker = new ValuePicker(self::ACTION_PREFIX_SETTING . $setting->index, $setting->set, $setting->value, $label);
|
||||
$settingFrame->add($valuePicker);
|
||||
$settingFrame->addChild($valuePicker);
|
||||
} else {
|
||||
// Value entry
|
||||
$entry = new Entry();
|
||||
$settingFrame->add($entry);
|
||||
$settingFrame->addChild($entry);
|
||||
$entry->setX($width * 0.33);
|
||||
$entry->setSize($width * 0.3, $settingHeight * 0.9);
|
||||
$entry->setTextSize(1);
|
||||
@ -329,9 +329,9 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
|
||||
}
|
||||
|
||||
$backButton = new Label_Button();
|
||||
$frame->add($backButton);
|
||||
$frame->addChild($backButton);
|
||||
$backButton->setStyle($backButton::STYLE_CardMain_Quit);
|
||||
$backButton->setHAlign($backButton::LEFT);
|
||||
$backButton->setHorizontalAlign($backButton::LEFT);
|
||||
$backButton->setScale(0.75);
|
||||
$backButton->setText('Back');
|
||||
$backButton->setPosition(-$width / 2 + 7, -$height / 2 + 7);
|
||||
|
Reference in New Issue
Block a user