|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace eXpansion\Bundle\CustomUi\Plugins\Gui; |
|
4
|
|
|
|
|
5
|
|
|
use eXpansion\Framework\Core\Model\Gui\ManialinkInterface; |
|
6
|
|
|
use eXpansion\Framework\Core\Model\Gui\Widget; |
|
7
|
|
|
use eXpansion\Framework\Core\Model\Gui\WidgetFactoryContext; |
|
8
|
|
|
use eXpansion\Framework\Core\Plugins\Gui\WidgetFactory; |
|
9
|
|
|
use eXpansion\Framework\Core\Services\Application\Dispatcher; |
|
10
|
|
|
use eXpansion\Framework\Core\Storage\PlayerStorage; |
|
11
|
|
|
use FML\Script\ScriptLabel; |
|
12
|
|
|
|
|
13
|
|
|
class CustomScoreboardWidget extends WidgetFactory |
|
14
|
|
|
{ |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* ChatHelperWidget constructor. |
|
18
|
|
|
* @param $name |
|
19
|
|
|
* @param $sizeX |
|
20
|
|
|
* @param $sizeY |
|
21
|
|
|
* @param $posX |
|
22
|
|
|
* @param $posY |
|
23
|
|
|
* @param WidgetFactoryContext $context |
|
24
|
|
|
* @param Dispatcher $dispatcher |
|
|
|
|
|
|
25
|
|
|
* @param PlayerStorage $playerStorage |
|
|
|
|
|
|
26
|
|
|
*/ |
|
27
|
|
|
public function __construct( |
|
28
|
|
|
$name, |
|
29
|
|
|
$sizeX, |
|
30
|
|
|
$sizeY, |
|
31
|
|
|
$posX, |
|
32
|
|
|
$posY, |
|
33
|
|
|
WidgetFactoryContext $context |
|
34
|
|
|
) { |
|
35
|
|
|
parent::__construct($name, $sizeX, $sizeY, $posX, $posY, $context); |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @param ManialinkInterface|Widget $manialink |
|
41
|
|
|
*/ |
|
42
|
|
|
protected function createContent(ManialinkInterface $manialink) |
|
43
|
|
|
{ |
|
44
|
|
|
parent::createContent($manialink); |
|
45
|
|
|
|
|
46
|
|
|
$manialink->getFmlManialink()->getScript()->addCustomScriptLabel(ScriptLabel::OnInit, <<<EOL |
|
47
|
|
|
ClientUI.ScoreTableOnlyManialink = True; |
|
48
|
|
|
ClientUI.ScoreTable = """ |
|
49
|
|
|
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> |
|
50
|
|
|
<manialink version="3"> |
|
51
|
|
|
<quad pos="0 50" z-index="0" size="140 20" bgcolor="FFFA" halign="center"/> |
|
52
|
|
|
</manialink> |
|
53
|
|
|
"""; |
|
54
|
|
|
|
|
55
|
|
|
EOL |
|
56
|
|
|
); |
|
57
|
|
|
|
|
58
|
|
|
|
|
59
|
|
|
|
|
60
|
|
|
|
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
|
|
64
|
|
|
} |
|
65
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.