add copy buttons + rework some interfaces
This commit is contained in:
@@ -3,8 +3,10 @@
|
|||||||
namespace ManiaControl\Admin;
|
namespace ManiaControl\Admin;
|
||||||
|
|
||||||
use FML\Controls\Frame;
|
use FML\Controls\Frame;
|
||||||
|
use FML\Controls\Label;
|
||||||
use FML\Controls\Labels\Label_Button;
|
use FML\Controls\Labels\Label_Button;
|
||||||
use FML\Controls\Labels\Label_Text;
|
use FML\Controls\Labels\Label_Text;
|
||||||
|
use FML\Controls\Quad;
|
||||||
use FML\Controls\Quads\Quad_BgRaceScore2;
|
use FML\Controls\Quads\Quad_BgRaceScore2;
|
||||||
use FML\Controls\Quads\Quad_BgsPlayerCard;
|
use FML\Controls\Quads\Quad_BgsPlayerCard;
|
||||||
use FML\Controls\Quads\Quad_UIConstruction_Buttons;
|
use FML\Controls\Quads\Quad_UIConstruction_Buttons;
|
||||||
@@ -20,6 +22,7 @@ use ManiaControl\Manialinks\LabelLine;
|
|||||||
use ManiaControl\Manialinks\ManialinkManager;
|
use ManiaControl\Manialinks\ManialinkManager;
|
||||||
use ManiaControl\Manialinks\ManialinkPageAnswerListener;
|
use ManiaControl\Manialinks\ManialinkPageAnswerListener;
|
||||||
use ManiaControl\Players\Player;
|
use ManiaControl\Players\Player;
|
||||||
|
use ManiaControl\Utils\Formatter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Widget Class listing Authorized Players
|
* Widget Class listing Authorized Players
|
||||||
@@ -118,11 +121,14 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener, Usage
|
|||||||
$frame->addChild($headFrame);
|
$frame->addChild($headFrame);
|
||||||
$headFrame->setY($posY - 5);
|
$headFrame->setY($posY - 5);
|
||||||
|
|
||||||
|
$mainFieldWidth = (($width - 45) / 3) - 2;
|
||||||
|
|
||||||
$labelLine = new LabelLine($headFrame);
|
$labelLine = new LabelLine($headFrame);
|
||||||
$labelLine->addLabelEntryText('Id', $posX + 5);
|
$labelLine->addLabelEntryText('Id', $posX + 5);
|
||||||
$labelLine->addLabelEntryText('Nickname', $posX + 18);
|
$labelLine->addLabelEntryText('Nickname', $posX + 18);
|
||||||
$labelLine->addLabelEntryText('Login', $posX + 70);
|
$labelLine->addLabelEntryText('Login', $posX + 18 + $mainFieldWidth + 2);
|
||||||
$labelLine->addLabelEntryText('Actions', $posX + 120);
|
$labelLine->addLabelEntryText('Location', $posX + 18 + ($mainFieldWidth + 2) * 2);
|
||||||
|
$labelLine->addLabelEntryText('Actions', $posX + $width - 18);
|
||||||
$labelLine->render();
|
$labelLine->render();
|
||||||
|
|
||||||
$index = 1;
|
$index = 1;
|
||||||
@@ -151,10 +157,13 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener, Usage
|
|||||||
$lineQuad->setZ(-0.1);
|
$lineQuad->setZ(-0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$path = $admin->getProvince();
|
||||||
|
|
||||||
$labelLine = new LabelLine($playerFrame);
|
$labelLine = new LabelLine($playerFrame);
|
||||||
$labelLine->addLabelEntryText($index, $posX + 5, 13);
|
$labelLine->addLabelEntryText($index, $posX + 5, 13);
|
||||||
$labelLine->addLabelEntryText($admin->nickname, $posX + 18, 52);
|
$labelLine->addLabelEntryText($admin->nickname, $posX + 18, $mainFieldWidth - 10);
|
||||||
$labelLine->addLabelEntryText($admin->login, $posX + 70, 48);
|
$labelLine->addLabelEntryText($admin->login, $posX + 18 + $mainFieldWidth + 2, $mainFieldWidth - 6);
|
||||||
|
$labelLine->addLabelEntryText($path, $posX + 18 + ($mainFieldWidth + 2) * 2 + 5, $mainFieldWidth - 2, '', true);
|
||||||
$labelLine->render();
|
$labelLine->render();
|
||||||
|
|
||||||
// Level Quad
|
// Level Quad
|
||||||
@@ -174,6 +183,52 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener, Usage
|
|||||||
$description = $this->maniaControl->getAuthenticationManager()->getAuthLevelName($admin) . " " . $admin->nickname;
|
$description = $this->maniaControl->getAuthenticationManager()->getAuthLevelName($admin) . " " . $admin->nickname;
|
||||||
$rightLabel->addTooltipLabelFeature($descriptionLabel, $description);
|
$rightLabel->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
|
|
||||||
|
// Copy admin name
|
||||||
|
$quad = new Quad();
|
||||||
|
$playerFrame->addChild($quad);
|
||||||
|
$quad->setX($posX + 18 + $mainFieldWidth - 3);
|
||||||
|
$quad->setSize(3., 3.);
|
||||||
|
$quad->setStyle('UICommon64_1');
|
||||||
|
$quad->setSubStyle('Copy_light');
|
||||||
|
$quad->addClipboardFeature($admin->nickname);
|
||||||
|
$description = 'Copy player name';
|
||||||
|
$quad->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
|
|
||||||
|
// Trackmania.io button
|
||||||
|
$label = new Label();
|
||||||
|
$playerFrame->addChild($label);
|
||||||
|
$label->setX($posX + 18 + ($mainFieldWidth + 2) * 2 - 3);
|
||||||
|
$label->setSize(3., 3.);
|
||||||
|
$label->setText('$28d');
|
||||||
|
$label->setTextSize(.8);
|
||||||
|
$label->setAreaColor('00000000');
|
||||||
|
$label->setUrl('https://trackmania.io/#/player/'. $admin->login);
|
||||||
|
$description = 'Open player profile on Trackmania.io';
|
||||||
|
$label->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
|
|
||||||
|
// Copy admin login
|
||||||
|
$quad = new Quad();
|
||||||
|
$playerFrame->addChild($quad);
|
||||||
|
$quad->setX($posX + 18 + ($mainFieldWidth + 2) * 2 - 6);
|
||||||
|
$quad->setSize(3., 3.);
|
||||||
|
$quad->setStyle('UICommon64_1');
|
||||||
|
$quad->setSubStyle('Copy_light');
|
||||||
|
$quad->addClipboardFeature($admin->login);
|
||||||
|
$description = 'Copy player login';
|
||||||
|
$quad->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
|
|
||||||
|
$countryCode = Formatter::mapCountry($admin->getCountry());
|
||||||
|
if ($countryCode !== 'OTH') {
|
||||||
|
// Nation Quad
|
||||||
|
$countryQuad = new Quad();
|
||||||
|
$playerFrame->addChild($countryQuad);
|
||||||
|
$countryQuad->setImageUrl("file://ZoneFlags/Login/{$admin->login}/country");
|
||||||
|
$countryQuad->setX($posX + 18 + ($mainFieldWidth + 2) * 2 + 2);
|
||||||
|
$countryQuad->setSize(4, 4);
|
||||||
|
|
||||||
|
$countryQuad->addTooltipLabelFeature($descriptionLabel, '$<' . $admin->nickname . '$> from ' . $admin->path);
|
||||||
|
}
|
||||||
|
|
||||||
//Revoke Button
|
//Revoke Button
|
||||||
if ($admin->authLevel > 0
|
if ($admin->authLevel > 0
|
||||||
&& $this->maniaControl->getAuthenticationManager()->checkRight($player, $admin->authLevel + 1)
|
&& $this->maniaControl->getAuthenticationManager()->checkRight($player, $admin->authLevel + 1)
|
||||||
@@ -188,7 +243,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener, Usage
|
|||||||
$quad = new Quad_BgsPlayerCard();
|
$quad = new Quad_BgsPlayerCard();
|
||||||
$playerFrame->addChild($quad);
|
$playerFrame->addChild($quad);
|
||||||
$quad->setZ(11);
|
$quad->setZ(11);
|
||||||
$quad->setX($posX + 130);
|
$quad->setX($posX + $width - 12.5);
|
||||||
$quad->setSubStyle($quad::SUBSTYLE_BgPlayerCardBig);
|
$quad->setSubStyle($quad::SUBSTYLE_BgPlayerCardBig);
|
||||||
$quad->setSize($quadWidth, $quadHeight);
|
$quad->setSize($quadWidth, $quadHeight);
|
||||||
$quad->setAction(self::ACTION_REVOKE_RIGHTS . "." . $admin->login);
|
$quad->setAction(self::ACTION_REVOKE_RIGHTS . "." . $admin->login);
|
||||||
@@ -196,7 +251,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener, Usage
|
|||||||
//Label
|
//Label
|
||||||
$label = new Label_Button();
|
$label = new Label_Button();
|
||||||
$playerFrame->addChild($label);
|
$playerFrame->addChild($label);
|
||||||
$label->setX($posX + 130);
|
$label->setX($posX + $width - 12.5);
|
||||||
$quad->setZ(12);
|
$quad->setZ(12);
|
||||||
$label->setStyle($style);
|
$label->setStyle($style);
|
||||||
$label->setTextSize(1);
|
$label->setTextSize(1);
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
namespace ManiaControl\Commands;
|
namespace ManiaControl\Commands;
|
||||||
|
|
||||||
use FML\Controls\Frame;
|
use FML\Controls\Frame;
|
||||||
|
use FML\Controls\Quad;
|
||||||
use FML\Controls\Quads\Quad_BgsPlayerCard;
|
use FML\Controls\Quads\Quad_BgsPlayerCard;
|
||||||
use FML\Controls\Quads\Quad_UIConstruction_Buttons;
|
use FML\Controls\Quads\Quad_UIConstruction_Buttons;
|
||||||
use FML\ManiaLink;
|
use FML\ManiaLink;
|
||||||
@@ -232,7 +233,7 @@ class HelpManager implements CommandListener, CallbackListener, ManialinkPageAns
|
|||||||
|
|
||||||
$labelLine = new LabelLine($headFrame);
|
$labelLine = new LabelLine($headFrame);
|
||||||
$labelLine->addLabelEntryText('Command', $posX + 5);
|
$labelLine->addLabelEntryText('Command', $posX + 5);
|
||||||
$labelLine->addLabelEntryText('Description', $posX + 50);
|
$labelLine->addLabelEntryText('Description', $posX + 5 + $width / 3 + 5);
|
||||||
$labelLine->render();
|
$labelLine->render();
|
||||||
|
|
||||||
$index = 1;
|
$index = 1;
|
||||||
@@ -261,10 +262,27 @@ class HelpManager implements CommandListener, CallbackListener, ManialinkPageAns
|
|||||||
}
|
}
|
||||||
|
|
||||||
$labelLine = new LabelLine($playerFrame);
|
$labelLine = new LabelLine($playerFrame);
|
||||||
$labelLine->addLabelEntryText($command['Name'], $posX + 5, 45);
|
$labelLine->addLabelEntryText($command['Name'], $posX + 5, $width / 3 - 5);
|
||||||
$labelLine->addLabelEntryText($command['Description'], $posX + 50, $width / 2 - $posX + 50);
|
$labelLine->addLabelEntryText($command['Description'], $posX + 5 + $width / 3 + 5, $width / 3 * 2 - 15);
|
||||||
$labelLine->render();
|
$labelLine->render();
|
||||||
|
|
||||||
|
$clipboardValue = '/';
|
||||||
|
if ($command['IsAdminCommand']) {
|
||||||
|
$clipboardValue .= '/';
|
||||||
|
}
|
||||||
|
$clipboardValue .= explode('|', $command['Name'])[0] . ' ';
|
||||||
|
|
||||||
|
// Copy command
|
||||||
|
$playerQuad = new Quad();
|
||||||
|
$playerFrame->addChild($playerQuad);
|
||||||
|
$playerQuad->setX($posX + 5 + $width / 3);
|
||||||
|
$playerQuad->setSize(3., 3.);
|
||||||
|
$playerQuad->setStyle('UICommon64_1');
|
||||||
|
$playerQuad->setSubStyle('Copy_light');
|
||||||
|
$playerQuad->addClipboardFeature($clipboardValue);
|
||||||
|
$description = 'Copy Command';
|
||||||
|
$playerQuad->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
|
|
||||||
$posY -= 4;
|
$posY -= 4;
|
||||||
$index++;
|
$index++;
|
||||||
}
|
}
|
||||||
@@ -284,9 +302,9 @@ class HelpManager implements CommandListener, CallbackListener, ManialinkPageAns
|
|||||||
public function registerCommand($name, $adminCommand = false, $description = '', $method = '') {
|
public function registerCommand($name, $adminCommand = false, $description = '', $method = '') {
|
||||||
// TODO replace with new class Command
|
// TODO replace with new class Command
|
||||||
if ($adminCommand) {
|
if ($adminCommand) {
|
||||||
array_push($this->adminCommands, array("Name" => $name, "Description" => $description, "Method" => $method));
|
array_push($this->adminCommands, array("Name" => $name, "Description" => $description, "Method" => $method, "IsAdminCommand" => true));
|
||||||
} else {
|
} else {
|
||||||
array_push($this->playerCommands, array("Name" => $name, "Description" => $description, "Method" => $method));
|
array_push($this->playerCommands, array("Name" => $name, "Description" => $description, "Method" => $method, "IsAdminCommand" => false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -210,12 +210,15 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
$headFrame->setY($height / 2 - 5);
|
$headFrame->setY($height / 2 - 5);
|
||||||
$posX = -$width / 2;
|
$posX = -$width / 2;
|
||||||
|
|
||||||
|
$mainFieldTotalWidth = $width - 45;
|
||||||
|
|
||||||
$labelLine = new LabelLine($headFrame);
|
$labelLine = new LabelLine($headFrame);
|
||||||
$labelLine->addLabelEntryText('Id', $posX + 5);
|
$labelLine->addLabelEntryText('Id', $posX + 5);
|
||||||
$labelLine->addLabelEntryText('Mx Id', $posX + 10);
|
$labelLine->addLabelEntryText('Mx Id', $posX + 10);
|
||||||
$labelLine->addLabelEntryText('Map Name', $posX + 20);
|
$labelLine->addLabelEntryText('Map Name', $posX + 20);
|
||||||
$labelLine->addLabelEntryText('Author', $width / 2 - 56);
|
$labelLine->addLabelEntryText('Map Uid', $posX + 20 + $mainFieldTotalWidth * 0.4);
|
||||||
$labelLine->addLabelEntryText('Actions', $width / 2 - 16);
|
$labelLine->addLabelEntryText('Author', $posX + 20 + $mainFieldTotalWidth * 0.4 + $mainFieldTotalWidth * 0.35);
|
||||||
|
$labelLine->addLabelEntryText('Actions', $posX + $width - 16);
|
||||||
$labelLine->setY(-7);
|
$labelLine->setY(-7);
|
||||||
$labelLine->render();
|
$labelLine->render();
|
||||||
|
|
||||||
@@ -285,7 +288,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
$mxQuad->setSize(3, 3);
|
$mxQuad->setSize(3, 3);
|
||||||
$mxQuad->setImageUrl($mxIcon);
|
$mxQuad->setImageUrl($mxIcon);
|
||||||
$mxQuad->setImageFocusUrl($mxIconHover);
|
$mxQuad->setImageFocusUrl($mxIconHover);
|
||||||
$mxQuad->setX($width / 2 - 63);
|
$mxQuad->setX($posX + $width - 16);
|
||||||
$mxQuad->setUrl($map->mx->pageurl);
|
$mxQuad->setUrl($map->mx->pageurl);
|
||||||
$mxQuad->setZ(0.01);
|
$mxQuad->setZ(0.01);
|
||||||
$description = 'View ' . $map->getEscapedName() . ' on Mania-Exchange';
|
$description = 'View ' . $map->getEscapedName() . ' on Mania-Exchange';
|
||||||
@@ -297,7 +300,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
$mxQuad->setSize(3, 3);
|
$mxQuad->setSize(3, 3);
|
||||||
$mxQuad->setImageUrl($mxIconGreen);
|
$mxQuad->setImageUrl($mxIconGreen);
|
||||||
$mxQuad->setImageFocusUrl($mxIconGreenHover);
|
$mxQuad->setImageFocusUrl($mxIconGreenHover);
|
||||||
$mxQuad->setX($width / 2 - 60);
|
$mxQuad->setX($posX + $width - 19);
|
||||||
$mxQuad->setUrl($map->mx->pageurl);
|
$mxQuad->setUrl($map->mx->pageurl);
|
||||||
$mxQuad->setZ(0.01);
|
$mxQuad->setZ(0.01);
|
||||||
$description = 'Update for ' . $map->getEscapedName() . ' available on Mania-Exchange!';
|
$description = 'Update for ' . $map->getEscapedName() . ' available on Mania-Exchange!';
|
||||||
@@ -312,15 +315,16 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
|
|
||||||
// Display Maps
|
// Display Maps
|
||||||
$labelLine = new LabelLine($mapFrame);
|
$labelLine = new LabelLine($mapFrame);
|
||||||
$labelLine->addLabelEntryText($mapListId, $posX + 5, 5);
|
$labelLine->addLabelEntryText($mapListId, $posX + 5, 4);
|
||||||
$labelLine->addLabelEntryText($mxId, $posX + 10, 10);
|
$labelLine->addLabelEntryText($mxId, $posX + 10, 9);
|
||||||
$labelLine->addLabelEntryText(Formatter::stripDirtyCodes($map->name), $posX + 20, $width - 20 - 56 - 5);
|
$labelLine->addLabelEntryText(Formatter::stripDirtyCodes($map->name), $posX + 20, $mainFieldTotalWidth * 0.4 - 5);
|
||||||
|
$labelLine->addLabelEntryText($map->uid, $posX + 20 + $mainFieldTotalWidth * 0.4, $mainFieldTotalWidth * 0.35 - 8);
|
||||||
|
|
||||||
$label = new Label_Text();
|
$label = new Label_Text();
|
||||||
$mapFrame->addChild($label);
|
$mapFrame->addChild($label);
|
||||||
$label->setText($map->authorNick);
|
$label->setText($map->authorNick);
|
||||||
$label->setX($width / 2 - 56);
|
$label->setX($posX + 20 + $mainFieldTotalWidth * 0.4 + $mainFieldTotalWidth * 0.35);
|
||||||
$label->setSize(47, 0);
|
$label->setSize($mainFieldTotalWidth * 0.25, 0);
|
||||||
$label->setAction(MapCommands::ACTION_SHOW_AUTHOR . $map->authorLogin);
|
$label->setAction(MapCommands::ACTION_SHOW_AUTHOR . $map->authorLogin);
|
||||||
$description = 'Click to checkout all maps by $<' . $map->authorLogin . '$>!';
|
$description = 'Click to checkout all maps by $<' . $map->authorLogin . '$>!';
|
||||||
$label->addTooltipLabelFeature($descriptionLabel, $description);
|
$label->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
@@ -328,13 +332,47 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
|
|
||||||
$labelLine->render();
|
$labelLine->render();
|
||||||
|
|
||||||
|
// Copy Map Uid
|
||||||
|
$label = new Label();
|
||||||
|
$mapFrame->addChild($label);
|
||||||
|
$label->setX($posX + 20 + $mainFieldTotalWidth * 0.4 + $mainFieldTotalWidth * 0.35 - 3);
|
||||||
|
$label->setSize(3., 3.);
|
||||||
|
$label->setText('$28d');
|
||||||
|
$label->setTextSize(.8);
|
||||||
|
$label->setAreaColor('00000000');
|
||||||
|
$label->setUrl('https://trackmania.io/#/leaderboard/'. $map->uid);
|
||||||
|
$description = 'Open map leaderboard on Trackmania.io';
|
||||||
|
$label->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
|
|
||||||
|
// Copy Map Uid
|
||||||
|
$quad = new Quad();
|
||||||
|
$mapFrame->addChild($quad);
|
||||||
|
$quad->setX($posX + 20 + $mainFieldTotalWidth * 0.4 + $mainFieldTotalWidth * 0.35 - 6);
|
||||||
|
$quad->setSize(3., 3.);
|
||||||
|
$quad->setStyle('UICommon64_1');
|
||||||
|
$quad->setSubStyle('Copy_light');
|
||||||
|
$quad->addClipboardFeature($map->uid);
|
||||||
|
$description = 'Copy Map Uid';
|
||||||
|
$quad->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
|
|
||||||
|
// Copy Author Login
|
||||||
|
$quad = new Quad();
|
||||||
|
$mapFrame->addChild($quad);
|
||||||
|
$quad->setX($posX + $width - 23);
|
||||||
|
$quad->setSize(3., 3.);
|
||||||
|
$quad->setStyle('UICommon64_1');
|
||||||
|
$quad->setSubStyle('Copy_light');
|
||||||
|
$quad->addClipboardFeature($map->authorLogin);
|
||||||
|
$description = 'Copy Author login';
|
||||||
|
$quad->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
|
|
||||||
// TODO action detailed map info including mx info
|
// TODO action detailed map info including mx info
|
||||||
|
|
||||||
// Map-Queue-Map-Label
|
// Map-Queue-Map-Label
|
||||||
if (isset($queuedMaps[$map->uid])) {
|
if (isset($queuedMaps[$map->uid])) {
|
||||||
$label = new Label_Text();
|
$label = new Label_Text();
|
||||||
$mapFrame->addChild($label);
|
$mapFrame->addChild($label);
|
||||||
$label->setX($width / 2 - 13);
|
$label->setX($posX + $width - 13);
|
||||||
$label->setZ(0.2);
|
$label->setZ(0.2);
|
||||||
$label->setTextSize(1.5);
|
$label->setTextSize(1.5);
|
||||||
$label->setText($queuedMaps[$map->uid]);
|
$label->setText($queuedMaps[$map->uid]);
|
||||||
@@ -378,7 +416,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
// remove map button
|
// remove map button
|
||||||
$removeButton = new Label_Button();
|
$removeButton = new Label_Button();
|
||||||
$mapFrame->addChild($removeButton);
|
$mapFrame->addChild($removeButton);
|
||||||
$removeButton->setX($width / 2 - 5);
|
$removeButton->setX($posX + $width - 5);
|
||||||
$removeButton->setZ(0.2);
|
$removeButton->setZ(0.2);
|
||||||
$removeButton->setSize(3, 3);
|
$removeButton->setSize(3, 3);
|
||||||
$removeButton->setTextSize(1);
|
$removeButton->setTextSize(1);
|
||||||
@@ -395,7 +433,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
// Switch to button
|
// Switch to button
|
||||||
$switchLabel = new Label_Button();
|
$switchLabel = new Label_Button();
|
||||||
$mapFrame->addChild($switchLabel);
|
$mapFrame->addChild($switchLabel);
|
||||||
$switchLabel->setX($width / 2 - 9);
|
$switchLabel->setX($posX + $width - 9);
|
||||||
$switchLabel->setZ(0.2);
|
$switchLabel->setZ(0.2);
|
||||||
$switchLabel->setSize(3, 3);
|
$switchLabel->setSize(3, 3);
|
||||||
$switchLabel->setTextSize(2);
|
$switchLabel->setTextSize(2);
|
||||||
@@ -413,7 +451,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
// Switch Map Voting for Admins
|
// Switch Map Voting for Admins
|
||||||
$switchQuad = new Quad_UIConstruction_Buttons();
|
$switchQuad = new Quad_UIConstruction_Buttons();
|
||||||
$mapFrame->addChild($switchQuad);
|
$mapFrame->addChild($switchQuad);
|
||||||
$switchQuad->setX($width / 2 - 17);
|
$switchQuad->setX($posX + $width - 21);
|
||||||
$switchQuad->setZ(0.2);
|
$switchQuad->setZ(0.2);
|
||||||
$switchQuad->setSubStyle($switchQuad::SUBSTYLE_Validate_Step2);
|
$switchQuad->setSubStyle($switchQuad::SUBSTYLE_Validate_Step2);
|
||||||
$switchQuad->setSize(3.8, 3.8);
|
$switchQuad->setSize(3.8, 3.8);
|
||||||
@@ -424,7 +462,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
// Switch Map Voting for Player
|
// Switch Map Voting for Player
|
||||||
$switchLabel = new Label_Button();
|
$switchLabel = new Label_Button();
|
||||||
$mapFrame->addChild($switchLabel);
|
$mapFrame->addChild($switchLabel);
|
||||||
$switchLabel->setX($width / 2 - 7);
|
$switchLabel->setX($posX + $width - 7);
|
||||||
$switchLabel->setZ(0.2);
|
$switchLabel->setZ(0.2);
|
||||||
$switchLabel->setSize(3, 3);
|
$switchLabel->setSize(3, 3);
|
||||||
$switchLabel->setTextSize(2);
|
$switchLabel->setTextSize(2);
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
namespace ManiaControl\Players;
|
namespace ManiaControl\Players;
|
||||||
|
|
||||||
use FML\Controls\Frame;
|
use FML\Controls\Frame;
|
||||||
|
use FML\Controls\Label;
|
||||||
use FML\Controls\Labels\Label_Text;
|
use FML\Controls\Labels\Label_Text;
|
||||||
use FML\Controls\Quad;
|
use FML\Controls\Quad;
|
||||||
use FML\Controls\Quads\Quad_BgRaceScore2;
|
use FML\Controls\Quads\Quad_BgRaceScore2;
|
||||||
@@ -189,13 +190,15 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
|||||||
$frame->addChild($headFrame);
|
$frame->addChild($headFrame);
|
||||||
$headFrame->setY($posY - 5);
|
$headFrame->setY($posY - 5);
|
||||||
|
|
||||||
|
$mainFieldWidth = (($width - 30) / 3) - 2;
|
||||||
|
|
||||||
$labelLine = new LabelLine($headFrame);
|
$labelLine = new LabelLine($headFrame);
|
||||||
$labelLine->addLabelEntryText('Id', $posX + 5);
|
$labelLine->addLabelEntryText('Id', $posX + 5);
|
||||||
$labelLine->addLabelEntryText('Nickname', $posX + 18);
|
$labelLine->addLabelEntryText('Nickname', $posX + 18);
|
||||||
$labelLine->addLabelEntryText('Login', $posX + 70);
|
$labelLine->addLabelEntryText('Login', $posX + 18 + $mainFieldWidth + 2);
|
||||||
$labelLine->addLabelEntryText('Location', $posX + 101);
|
$labelLine->addLabelEntryText('Location', $posX + 18 + ($mainFieldWidth + 2) * 2);
|
||||||
if ($this->maniaControl->getAuthenticationManager()->checkRight($player, AuthenticationManager::AUTH_LEVEL_MODERATOR)) {
|
if ($this->maniaControl->getAuthenticationManager()->checkRight($player, AuthenticationManager::AUTH_LEVEL_MODERATOR)) {
|
||||||
$labelLine->addLabelEntryText('Actions', $posX + 135);
|
$labelLine->addLabelEntryText('Actions', $posX + $width - 15);
|
||||||
}
|
}
|
||||||
$labelLine->render();
|
$labelLine->render();
|
||||||
|
|
||||||
@@ -220,6 +223,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
|||||||
}
|
}
|
||||||
|
|
||||||
$path = $listPlayer->getProvince();
|
$path = $listPlayer->getProvince();
|
||||||
|
|
||||||
$playerFrame = new Frame();
|
$playerFrame = new Frame();
|
||||||
$pageFrame->addChild($playerFrame);
|
$pageFrame->addChild($playerFrame);
|
||||||
|
|
||||||
@@ -233,16 +237,16 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
|||||||
$labelLine = new LabelLine($playerFrame);
|
$labelLine = new LabelLine($playerFrame);
|
||||||
|
|
||||||
$labelLine->addLabelEntryText($playerIndex, $posX + 5, 13);
|
$labelLine->addLabelEntryText($playerIndex, $posX + 5, 13);
|
||||||
$labelLine->addLabelEntryText($listPlayer->nickname, $posX + 18, 43);
|
$labelLine->addLabelEntryText($listPlayer->nickname, $posX + 18, $mainFieldWidth - 10);
|
||||||
$labelLine->addLabelEntryText($listPlayer->login, $posX + 70, 26);
|
$labelLine->addLabelEntryText($listPlayer->login, $posX + 18 + $mainFieldWidth + 2, $mainFieldWidth - 6);
|
||||||
$labelLine->addLabelEntryText($path, $posX + 101, 27);
|
$labelLine->addLabelEntryText($path, $posX + 18 + ($mainFieldWidth + 2) * 2 + 5, $mainFieldWidth - 8);
|
||||||
|
|
||||||
$labelLine->render();
|
$labelLine->render();
|
||||||
|
|
||||||
$playerFrame->setY($posY);
|
$playerFrame->setY($posY);
|
||||||
|
|
||||||
// Show current Player Arrow
|
// Show current Player Arrow
|
||||||
if ($listPlayer->index === $player->index) {
|
if ($listPlayer->index === $player->index) {
|
||||||
$currentQuad = new Quad_Icons64x64_1();
|
$currentQuad = new Quad_Icons64x64_1();
|
||||||
$playerFrame->addChild($currentQuad);
|
$playerFrame->addChild($currentQuad);
|
||||||
$currentQuad->setX($posX + 3.5);
|
$currentQuad->setX($posX + 3.5);
|
||||||
@@ -281,7 +285,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
|||||||
$countryQuad = new Quad();
|
$countryQuad = new Quad();
|
||||||
$playerFrame->addChild($countryQuad);
|
$playerFrame->addChild($countryQuad);
|
||||||
$countryQuad->setImageUrl("file://ZoneFlags/Login/{$listPlayer->login}/country");
|
$countryQuad->setImageUrl("file://ZoneFlags/Login/{$listPlayer->login}/country");
|
||||||
$countryQuad->setX($posX + 98);
|
$countryQuad->setX($posX + 18 + ($mainFieldWidth + 2) * 2 + 2);
|
||||||
$countryQuad->setSize(4, 4);
|
$countryQuad->setSize(4, 4);
|
||||||
|
|
||||||
$countryQuad->addTooltipLabelFeature($descriptionLabel, '$<' . $listPlayer->nickname . '$> from ' . $listPlayer->path);
|
$countryQuad->addTooltipLabelFeature($descriptionLabel, '$<' . $listPlayer->nickname . '$> from ' . $listPlayer->path);
|
||||||
@@ -305,10 +309,21 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
|||||||
$description = $this->maniaControl->getAuthenticationManager()->getAuthLevelName($listPlayer) . ' ' . $listPlayer->nickname;
|
$description = $this->maniaControl->getAuthenticationManager()->getAuthLevelName($listPlayer) . ' ' . $listPlayer->nickname;
|
||||||
$rightLabel->addTooltipLabelFeature($descriptionLabel, $description);
|
$rightLabel->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
|
|
||||||
|
// Copy player name
|
||||||
|
$playerQuad = new Quad();
|
||||||
|
$playerFrame->addChild($playerQuad);
|
||||||
|
$playerQuad->setX($posX + 18 + $mainFieldWidth - 10);
|
||||||
|
$playerQuad->setSize(3., 3.);
|
||||||
|
$playerQuad->setStyle('UICommon64_1');
|
||||||
|
$playerQuad->setSubStyle('Copy_light');
|
||||||
|
$playerQuad->addClipboardFeature($listPlayer->nickname);
|
||||||
|
$description = 'Copy player name';
|
||||||
|
$playerQuad->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
|
|
||||||
// Player Statistics
|
// Player Statistics
|
||||||
$playerQuad = new Quad_Icons64x64_1();
|
$playerQuad = new Quad_Icons64x64_1();
|
||||||
$playerFrame->addChild($playerQuad);
|
$playerFrame->addChild($playerQuad);
|
||||||
$playerQuad->setX($posX + 61);
|
$playerQuad->setX($posX + 18 + $mainFieldWidth - 7);
|
||||||
$playerQuad->setSize(2.7, 2.7);
|
$playerQuad->setSize(2.7, 2.7);
|
||||||
$playerQuad->setSubStyle($playerQuad::SUBSTYLE_TrackInfo);
|
$playerQuad->setSubStyle($playerQuad::SUBSTYLE_TrackInfo);
|
||||||
$playerQuad->setAction(self::ACTION_OPEN_PLAYER_DETAILED . '.' . $listPlayer->login);
|
$playerQuad->setAction(self::ACTION_OPEN_PLAYER_DETAILED . '.' . $listPlayer->login);
|
||||||
@@ -316,32 +331,57 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
|||||||
$playerQuad->addTooltipLabelFeature($descriptionLabel, $description);
|
$playerQuad->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
|
|
||||||
// Camera Quad
|
// Camera Quad
|
||||||
$playerQuad = new Quad_UIConstruction_Buttons();
|
$playerQuad = new Quad();
|
||||||
$playerFrame->addChild($playerQuad);
|
$playerFrame->addChild($playerQuad);
|
||||||
$playerQuad->setX($posX + 64.5);
|
$playerQuad->setX($posX + 18 + $mainFieldWidth - 4);
|
||||||
$playerQuad->setSize(3.8, 3.8);
|
$playerQuad->setSize(3.8, 3.8);
|
||||||
$playerQuad->setSubStyle($playerQuad::SUBSTYLE_Camera);
|
$playerQuad->setStyle('UICommon64_1');
|
||||||
|
$playerQuad->setSubStyle('Camera_light');
|
||||||
$description = 'Spectate $<' . $listPlayer->nickname . '$>';
|
$description = 'Spectate $<' . $listPlayer->nickname . '$>';
|
||||||
$playerQuad->addTooltipLabelFeature($descriptionLabel, $description);
|
$playerQuad->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
$playerQuad->setAction(self::ACTION_SPECTATE_PLAYER . '.' . $listPlayer->login);
|
$playerQuad->setAction(self::ACTION_SPECTATE_PLAYER . '.' . $listPlayer->login);
|
||||||
|
|
||||||
// Player Profile Quad
|
// Player Profile Quad
|
||||||
$playerQuad = new Quad_UIConstruction_Buttons();
|
$playerQuad = new Quad();
|
||||||
$playerFrame->addChild($playerQuad);
|
$playerFrame->addChild($playerQuad);
|
||||||
$playerQuad->setX($posX + 68);
|
$playerQuad->setX($posX + 18 + $mainFieldWidth - 1);
|
||||||
$playerQuad->setSize(3.8, 3.8);
|
$playerQuad->setSize(3.8, 3.8);
|
||||||
$playerQuad->setSubStyle($playerQuad::SUBSTYLE_Author);
|
$playerQuad->setStyle('UICommon64_1');
|
||||||
|
$playerQuad->setSubStyle('User_light');
|
||||||
$playerQuad->addPlayerProfileFeature($listPlayer->login);
|
$playerQuad->addPlayerProfileFeature($listPlayer->login);
|
||||||
|
|
||||||
// Description Label
|
// Description Label
|
||||||
$description = 'View Player Profile of $<' . $listPlayer->nickname . '$>';
|
$description = 'View Player Profile of $<' . $listPlayer->nickname . '$>';
|
||||||
$playerQuad->addTooltipLabelFeature($descriptionLabel, $description);
|
$playerQuad->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
|
|
||||||
|
// Trackmania.io button
|
||||||
|
$label = new Label();
|
||||||
|
$playerFrame->addChild($label);
|
||||||
|
$label->setX($posX + 18 + ($mainFieldWidth + 2) * 2 - 3);
|
||||||
|
$label->setSize(3., 3.);
|
||||||
|
$label->setText('$28d');
|
||||||
|
$label->setTextSize(.8);
|
||||||
|
$label->setAreaColor('00000000');
|
||||||
|
$label->setUrl('https://trackmania.io/#/player/'. $listPlayer->login);
|
||||||
|
$description = 'Open player profile on Trackmania.io';
|
||||||
|
$label->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
|
|
||||||
|
// Copy player login
|
||||||
|
$playerQuad = new Quad();
|
||||||
|
$playerFrame->addChild($playerQuad);
|
||||||
|
$playerQuad->setX($posX + 18 + ($mainFieldWidth + 2) * 2 - 6);
|
||||||
|
$playerQuad->setSize(3., 3.);
|
||||||
|
$playerQuad->setStyle('UICommon64_1');
|
||||||
|
$playerQuad->setSubStyle('Copy_light');
|
||||||
|
$playerQuad->addClipboardFeature($listPlayer->login);
|
||||||
|
$description = 'Copy player login';
|
||||||
|
$playerQuad->addTooltipLabelFeature($descriptionLabel, $description);
|
||||||
|
|
||||||
if ($this->maniaControl->getAuthenticationManager()->checkRight($player, AuthenticationManager::AUTH_LEVEL_MODERATOR)) {
|
if ($this->maniaControl->getAuthenticationManager()->checkRight($player, AuthenticationManager::AUTH_LEVEL_MODERATOR)) {
|
||||||
// Further Player actions Quad
|
// Further Player actions Quad
|
||||||
$playerQuad = new Quad_Icons64x64_1();
|
$playerQuad = new Quad_Icons64x64_1();
|
||||||
$playerFrame->addChild($playerQuad);
|
$playerFrame->addChild($playerQuad);
|
||||||
$playerQuad->setX($posX + 132);
|
$playerQuad->setX($posX + $width - 15);
|
||||||
$playerQuad->setSize(3.8, 3.8);
|
$playerQuad->setSize(3.8, 3.8);
|
||||||
$playerQuad->setSubStyle($playerQuad::SUBSTYLE_Buddy);
|
$playerQuad->setSubStyle($playerQuad::SUBSTYLE_Buddy);
|
||||||
$playerQuad->setAction(self::ACTION_PLAYER_ADV . '.' . $listPlayer->login);
|
$playerQuad->setAction(self::ACTION_PLAYER_ADV . '.' . $listPlayer->login);
|
||||||
@@ -356,7 +396,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
|||||||
// Force to Red-Team Quad
|
// Force to Red-Team Quad
|
||||||
$redQuad = new Quad_Emblems();
|
$redQuad = new Quad_Emblems();
|
||||||
$playerFrame->addChild($redQuad);
|
$playerFrame->addChild($redQuad);
|
||||||
$redQuad->setX($posX + 144);
|
$redQuad->setX($posX + $width - 15 + 12);
|
||||||
$redQuad->setSize(3.8, 3.8);
|
$redQuad->setSize(3.8, 3.8);
|
||||||
$redQuad->setSubStyle($redQuad::SUBSTYLE_2);
|
$redQuad->setSubStyle($redQuad::SUBSTYLE_2);
|
||||||
$redQuad->setAction(self::ACTION_FORCE_RED . '.' . $listPlayer->login);
|
$redQuad->setAction(self::ACTION_FORCE_RED . '.' . $listPlayer->login);
|
||||||
@@ -368,7 +408,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
|||||||
// Force to Blue-Team Quad
|
// Force to Blue-Team Quad
|
||||||
$blueQuad = new Quad_Emblems();
|
$blueQuad = new Quad_Emblems();
|
||||||
$playerFrame->addChild($blueQuad);
|
$playerFrame->addChild($blueQuad);
|
||||||
$blueQuad->setX($posX + 140);
|
$blueQuad->setX($posX + $width - 15 + 8);
|
||||||
$blueQuad->setSize(3.8, 3.8);
|
$blueQuad->setSize(3.8, 3.8);
|
||||||
$blueQuad->setSubStyle($blueQuad::SUBSTYLE_1);
|
$blueQuad->setSubStyle($blueQuad::SUBSTYLE_1);
|
||||||
$blueQuad->setAction(self::ACTION_FORCE_BLUE . '.' . $listPlayer->login);
|
$blueQuad->setAction(self::ACTION_FORCE_BLUE . '.' . $listPlayer->login);
|
||||||
@@ -381,7 +421,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
|||||||
// Kick Player Vote
|
// Kick Player Vote
|
||||||
$kickQuad = new Quad_UIConstruction_Buttons();
|
$kickQuad = new Quad_UIConstruction_Buttons();
|
||||||
$playerFrame->addChild($kickQuad);
|
$playerFrame->addChild($kickQuad);
|
||||||
$kickQuad->setX($posX + 140);
|
$kickQuad->setX($posX + $width - 15 + 8);
|
||||||
$kickQuad->setSize(3.8, 3.8);
|
$kickQuad->setSize(3.8, 3.8);
|
||||||
$kickQuad->setSubStyle($kickQuad::SUBSTYLE_Validate_Step2);
|
$kickQuad->setSubStyle($kickQuad::SUBSTYLE_Validate_Step2);
|
||||||
$kickQuad->setAction(self::ACTION_KICK_PLAYER_VOTE . '.' . $listPlayer->login);
|
$kickQuad->setAction(self::ACTION_KICK_PLAYER_VOTE . '.' . $listPlayer->login);
|
||||||
@@ -394,7 +434,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
|||||||
// Force to Play
|
// Force to Play
|
||||||
$playQuad = new Quad_Emblems();
|
$playQuad = new Quad_Emblems();
|
||||||
$playerFrame->addChild($playQuad);
|
$playerFrame->addChild($playQuad);
|
||||||
$playQuad->setX($posX + 142);
|
$playQuad->setX($posX + $width - 15 + 8);
|
||||||
$playQuad->setSize(3.8, 3.8);
|
$playQuad->setSize(3.8, 3.8);
|
||||||
$playQuad->setSubStyle($playQuad::SUBSTYLE_2);
|
$playQuad->setSubStyle($playQuad::SUBSTYLE_2);
|
||||||
$playQuad->setAction(self::ACTION_FORCE_PLAY . '.' . $listPlayer->login);
|
$playQuad->setAction(self::ACTION_FORCE_PLAY . '.' . $listPlayer->login);
|
||||||
@@ -408,7 +448,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
|||||||
// Force to Spectator Quad
|
// Force to Spectator Quad
|
||||||
$spectatorQuad = new Quad_BgRaceScore2();
|
$spectatorQuad = new Quad_BgRaceScore2();
|
||||||
$playerFrame->addChild($spectatorQuad);
|
$playerFrame->addChild($spectatorQuad);
|
||||||
$spectatorQuad->setX($posX + 136);
|
$spectatorQuad->setX($posX + $width - 15 + 4);
|
||||||
$spectatorQuad->setSize(3.8, 3.8);
|
$spectatorQuad->setSize(3.8, 3.8);
|
||||||
$spectatorQuad->setSubStyle($spectatorQuad::SUBSTYLE_Spectator);
|
$spectatorQuad->setSubStyle($spectatorQuad::SUBSTYLE_Spectator);
|
||||||
$spectatorQuad->setAction(self::ACTION_FORCE_SPEC . '.' . $listPlayer->login);
|
$spectatorQuad->setAction(self::ACTION_FORCE_SPEC . '.' . $listPlayer->login);
|
||||||
@@ -420,7 +460,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
|||||||
// Force to Spectator Quad
|
// Force to Spectator Quad
|
||||||
$spectatorQuad = new Quad_BgRaceScore2();
|
$spectatorQuad = new Quad_BgRaceScore2();
|
||||||
$playerFrame->addChild($spectatorQuad);
|
$playerFrame->addChild($spectatorQuad);
|
||||||
$spectatorQuad->setX($posX + 136);
|
$spectatorQuad->setX($posX + $width - 15 + 4);
|
||||||
$spectatorQuad->setSize(3.8, 3.8);
|
$spectatorQuad->setSize(3.8, 3.8);
|
||||||
$spectatorQuad->setSubStyle($spectatorQuad::SUBSTYLE_Spectator);
|
$spectatorQuad->setSubStyle($spectatorQuad::SUBSTYLE_Spectator);
|
||||||
$spectatorQuad->setAction(self::ACTION_FORCE_SPEC_VOTE . '.' . $listPlayer->login);
|
$spectatorQuad->setAction(self::ACTION_FORCE_SPEC_VOTE . '.' . $listPlayer->login);
|
||||||
|
@@ -380,6 +380,15 @@ class ServerOptionsMenu implements CallbackListener, ConfiguratorMenu, TimerList
|
|||||||
}
|
}
|
||||||
}");
|
}");
|
||||||
$optionsFrame->addChild($checkBox);
|
$optionsFrame->addChild($checkBox);
|
||||||
|
|
||||||
|
// Copy player name
|
||||||
|
$quad = new Quad();
|
||||||
|
$quad->setX($width - $width * 0.3 - 7);
|
||||||
|
$quad->setSize(3., 3.);
|
||||||
|
$quad->setStyle('UICommon64_1');
|
||||||
|
$quad->setSubStyle('Copy_light');
|
||||||
|
$quad->addClipboardFeature($value);
|
||||||
|
$optionsFrame->addChild($quad);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user