FML Update 1.4

This commit is contained in:
Steffen Schröder
2014-08-11 23:15:53 +02:00
parent 44cc71c328
commit 300d817409
50 changed files with 123 additions and 112 deletions

View File

@ -32,13 +32,13 @@ class ActionTrigger extends ScriptFeature {
* @param string $labelName (optional) Script Label name
*/
public function __construct($actionName = null, Control $control = null, $labelName = ScriptLabel::MOUSECLICK) {
if (!is_null($actionName)) {
if ($actionName !== null) {
$this->setActionName($actionName);
}
if (!is_null($control)) {
if ($control !== null) {
$this->setControl($control);
}
if (!is_null($labelName)) {
if ($labelName !== null) {
$this->setLabelName($labelName);
}
}

View File

@ -47,13 +47,13 @@ class CheckBoxFeature extends ScriptFeature {
* @param bool $default (optional) Default value
*/
public function __construct(Quad $quad = null, Entry $entry = null, $default = null) {
if (!is_null($quad)) {
if ($quad !== null) {
$this->setQuad($quad);
}
if (!is_null($entry)) {
if ($entry !== null) {
$this->setEntry($entry);
}
if (!is_null($default)) {
if ($default !== null) {
$this->setDefault($default);
}
$this->setEnabledDesign(CheckBoxDesign::defaultEnabledDesign());

View File

@ -31,7 +31,7 @@ class Clock extends ScriptFeature {
* @param bool $showFullDate (optional) Whether the date should be shown
*/
public function __construct(Label $label = null, $showSeconds = true, $showFullDate = false) {
if (!is_null($label)) {
if ($label !== null) {
$this->setLabel($label);
}
$this->setShowSeconds($showSeconds);

View File

@ -30,7 +30,7 @@ class EntrySubmit extends ScriptFeature {
* @param string $url (optional) Submit url
*/
public function __construct(Entry $entry = null, $url = null) {
if (!is_null($entry)) {
if ($entry !== null) {
$this->setEntry($entry);
}
$this->setUrl($url);

View File

@ -30,10 +30,10 @@ class KeyAction extends ScriptFeature {
* @param string $keyName (optional) Key name
*/
public function __construct($actionName = null, $keyName = null) {
if (!is_null($actionName)) {
if ($actionName !== null) {
$this->setActionName($actionName);
}
if (!is_null($keyName)) {
if ($keyName !== null) {
$this->setKeyName($keyName);
}
}
@ -105,13 +105,13 @@ class KeyAction extends ScriptFeature {
$actionName = Builder::escapeText($this->actionName, true);
$key = null;
$value = null;
if (!is_null($this->keyName)) {
if ($this->keyName !== null) {
$key = 'KeyName';
$value = $this->keyName;
} else if (!is_null($this->keyCode)) {
} else if ($this->keyCode !== null) {
$key = 'KeyCode';
$value = $this->keyCode;
} else if (!is_null($this->charPressed)) {
} else if ($this->charPressed !== null) {
$key = 'CharPressed';
$value = $this->charPressed;
}

View File

@ -26,10 +26,10 @@ class MenuElement {
* @param Control $control (optional) Toggled Menu Control
*/
public function __construct(Control $item = null, Control $control = null) {
if (!is_null($item)) {
if ($item !== null) {
$this->setItem($item);
}
if (!is_null($control)) {
if ($control !== null) {
$this->setControl($control);
}
}

View File

@ -44,7 +44,7 @@ class Paging extends ScriptFeature {
* @param Label $label (optional) Page number Label
*/
public function __construct(Label $label = null) {
if (!is_null($label)) {
if ($label !== null) {
$this->setLabel($label);
}
}
@ -57,7 +57,7 @@ class Paging extends ScriptFeature {
* @return static
*/
public function addPage(Control $pageControl, $pageNumber = null) {
if (is_null($pageNumber)) {
if ($pageNumber === null) {
$pageNumber = count($this->pages) + 1;
}
$page = new PagingPage($pageControl, $pageNumber);
@ -86,7 +86,7 @@ class Paging extends ScriptFeature {
* @return static
*/
public function addButton(Control $buttonControl, $browseAction = null) {
if (is_null($browseAction)) {
if ($browseAction === null) {
$buttonCount = count($this->buttons);
if ($buttonCount % 2 === 0) {
$browseAction = $buttonCount / 2 + 1;
@ -288,7 +288,7 @@ Void {$updatePageFunction}(Text _PagingId, Text _PageLabelId, Integer _BrowseAct
$minPage = null;
foreach ($this->pages as $page) {
$pageNumber = $page->getPageNumber();
if (is_null($minPageNumber) || $pageNumber < $minPageNumber) {
if ($minPageNumber === null || $pageNumber < $minPageNumber) {
$minPageNumber = $pageNumber;
$minPage = $page;
}
@ -306,7 +306,7 @@ Void {$updatePageFunction}(Text _PagingId, Text _PageLabelId, Integer _BrowseAct
$maxPage = null;
foreach ($this->pages as $page) {
$pageNumber = $page->getPageNumber();
if (is_null($maxPageNumber) || $pageNumber > $maxPageNumber) {
if ($maxPageNumber === null || $pageNumber > $maxPageNumber) {
$maxPageNumber = $pageNumber;
$maxPage = $page;
}

View File

@ -27,10 +27,10 @@ class PagingButton {
* @param int $browseAction (optional) Number of browsed Pages per Click
*/
public function __construct(Control $control = null, $browseAction = null) {
if (!is_null($control)) {
if ($control !== null) {
$this->setControl($control);
}
if (!is_null($browseAction)) {
if ($browseAction !== null) {
$this->setBrowseAction($browseAction);
}
}

View File

@ -26,7 +26,7 @@ class PagingPage {
* @param int $pageNumber (optional) Number of the Page
*/
public function __construct(Control $control = null, $pageNumber = 1) {
if (!is_null($control)) {
if ($control !== null) {
$this->setControl($control);
}
$this->setPageNumber($pageNumber);

View File

@ -33,7 +33,7 @@ class PlayerProfile extends ScriptFeature {
*/
public function __construct($login = null, Control $control = null, $labelName = ScriptLabel::MOUSECLICK) {
$this->setLogin($login);
if (!is_null($control)) {
if ($control !== null) {
$this->setControl($control);
}
$this->setLabelName($labelName);

View File

@ -37,10 +37,10 @@ class Toggle extends ScriptFeature {
*/
public function __construct(Control $togglingControl = null, Control $toggledControl = null, $labelName = ScriptLabel::MOUSECLICK,
$onlyShow = false, $onlyHide = false) {
if (!is_null($togglingControl)) {
if ($togglingControl !== null) {
$this->setTogglingControl($togglingControl);
}
if (!is_null($toggledControl)) {
if ($toggledControl !== null) {
$this->setToggledControl($toggledControl);
}
$this->setLabelName($labelName);

View File

@ -38,15 +38,15 @@ class Tooltip extends ScriptFeature {
* @param string $text (optional) Text to display if the TooltipControl is a Label
*/
public function __construct(Control $hoverControl = null, Control $tooltipControl = null, $stayOnClick = false, $invert = false, $text = null) {
if (!is_null($hoverControl)) {
if ($hoverControl !== null) {
$this->setHoverControl($hoverControl);
}
if (!is_null($tooltipControl)) {
if ($tooltipControl !== null) {
$this->setTooltipControl($tooltipControl);
}
$this->setStayOnClick($stayOnClick);
$this->setInvert($invert);
if (!is_null($text)) {
if ($text !== null) {
$this->setText($text);
}
}

View File

@ -68,10 +68,10 @@ class UISound extends ScriptFeature {
* @param string $labelName (optional) Script Label name
*/
public function __construct($soundName = null, Control $control = null, $variant = 0, $labelName = ScriptLabel::MOUSECLICK) {
if (!is_null($soundName)) {
if ($soundName !== null) {
$this->setSoundName($soundName);
}
if (!is_null($control)) {
if ($control !== null) {
$this->setControl($control);
}
$this->setVariant($variant);

View File

@ -44,16 +44,16 @@ class ValuePickerFeature extends ScriptFeature {
* @param string $default (optional) Default value
*/
public function __construct(Label $label = null, Entry $entry = null, array $values = array(), $default = null) {
if (!is_null($label)) {
if ($label !== null) {
$this->setLabel($label);
}
if (!is_null($entry)) {
if ($entry !== null) {
$this->setEntry($entry);
}
if (!empty($values)) {
$this->setValues($values);
}
if (!is_null($default)) {
if ($default !== null) {
$this->setDefault($default);
}
}