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

@ -69,7 +69,7 @@ class CheckBox implements Renderable, ScriptFeatureable {
* @return static * @return static
*/ */
public function setEnabledDesign($style, $subStyle = null) { public function setEnabledDesign($style, $subStyle = null) {
if (is_object($style) && ($style instanceof CheckBoxDesign)) { if ($style instanceof CheckBoxDesign) {
$this->feature->setEnabledDesign($style); $this->feature->setEnabledDesign($style);
} else { } else {
$checkBoxDesign = new CheckBoxDesign($style, $subStyle); $checkBoxDesign = new CheckBoxDesign($style, $subStyle);
@ -86,7 +86,7 @@ class CheckBox implements Renderable, ScriptFeatureable {
* @return static * @return static
*/ */
public function setDisabledDesign($style, $subStyle = null) { public function setDisabledDesign($style, $subStyle = null) {
if (is_object($style) && ($style instanceof CheckBoxDesign)) { if ($style instanceof CheckBoxDesign) {
$this->feature->setDisabledDesign($style); $this->feature->setDisabledDesign($style);
} else { } else {
$checkBoxDesign = new CheckBoxDesign($style, $subStyle); $checkBoxDesign = new CheckBoxDesign($style, $subStyle);

View File

@ -71,7 +71,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* @param string $controlId (optional) Control id * @param string $controlId (optional) Control id
*/ */
public function __construct($controlId = null) { public function __construct($controlId = null) {
if (!is_null($controlId)) { if ($controlId !== null) {
$this->setId($controlId); $this->setId($controlId);
} }
} }
@ -141,7 +141,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
public function setPosition($posX, $posY, $posZ = null) { public function setPosition($posX, $posY, $posZ = null) {
$this->setX($posX); $this->setX($posX);
$this->setY($posY); $this->setY($posY);
if (!is_null($posZ)) { if ($posZ !== null) {
$this->setZ($posZ); $this->setZ($posZ);
} }
return $this; return $this;
@ -325,7 +325,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* @return static * @return static
*/ */
public function addActionTriggerFeature($actionName, $eventLabel = ScriptLabel::MOUSECLICK) { public function addActionTriggerFeature($actionName, $eventLabel = ScriptLabel::MOUSECLICK) {
if (is_object($actionName) && ($actionName instanceof ActionTrigger)) { if ($actionName instanceof ActionTrigger) {
$this->addScriptFeature($actionName); $this->addScriptFeature($actionName);
} else { } else {
$actionTrigger = new ActionTrigger($actionName, $this, $eventLabel); $actionTrigger = new ActionTrigger($actionName, $this, $eventLabel);

View File

@ -175,7 +175,7 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
if ($this->name) { if ($this->name) {
$xmlElement->setAttribute('name', $this->name); $xmlElement->setAttribute('name', $this->name);
} }
if (!is_null($this->default)) { if ($this->default !== null) {
$xmlElement->setAttribute('default', $this->default); $xmlElement->setAttribute('default', $this->default);
} else if ($this->autoComplete) { } else if ($this->autoComplete) {
$value = null; $value = null;

View File

@ -40,7 +40,7 @@ class FrameInstance extends Control {
*/ */
public function __construct($modelId = null, $controlId = null) { public function __construct($modelId = null, $controlId = null) {
parent::__construct($controlId); parent::__construct($controlId);
if (!is_null($modelId)) { if ($modelId !== null) {
$this->setModelId($modelId); $this->setModelId($modelId);
} }
} }

View File

@ -28,7 +28,6 @@ class Gauge extends Control implements Styleable {
protected $ratio = 0.; protected $ratio = 0.;
protected $grading = 1.; protected $grading = 1.;
protected $color = null; protected $color = null;
protected $rotation = 0.;
protected $centered = null; protected $centered = null;
protected $clan = null; protected $clan = null;
protected $drawBg = 1; protected $drawBg = 1;
@ -75,17 +74,6 @@ class Gauge extends Control implements Styleable {
return $this; return $this;
} }
/**
* Set rotation
*
* @param float $rotation Gauge rotation
* @return static
*/
public function setRotation($rotation) {
$this->rotation = (float)$rotation;
return $this;
}
/** /**
* Set centered * Set centered
* *
@ -152,9 +140,6 @@ class Gauge extends Control implements Styleable {
if ($this->color) { if ($this->color) {
$xmlElement->setAttribute('color', $this->color); $xmlElement->setAttribute('color', $this->color);
} }
if ($this->rotation) {
$xmlElement->setAttribute('rotation', $this->rotation);
}
if ($this->centered) { if ($this->centered) {
$xmlElement->setAttribute('centered', $this->centered); $xmlElement->setAttribute('centered', $this->centered);
} }

View File

@ -44,6 +44,7 @@ class Quad_Bgs1 extends Quad {
const SUBSTYLE_BgColorContour = 'BgColorContour'; const SUBSTYLE_BgColorContour = 'BgColorContour';
const SUBSTYLE_BgDialogBlur = 'BgDialogBlur'; const SUBSTYLE_BgDialogBlur = 'BgDialogBlur';
const SUBSTYLE_BgEmpty = 'BgEmpty'; const SUBSTYLE_BgEmpty = 'BgEmpty';
const SUBSTYLE_BgGlow2 = 'BgGlow2';
const SUBSTYLE_BgGradBottom = 'BgGradBottom'; const SUBSTYLE_BgGradBottom = 'BgGradBottom';
const SUBSTYLE_BgGradLeft = 'BgGradLeft'; const SUBSTYLE_BgGradLeft = 'BgGradLeft';
const SUBSTYLE_BgGradRight = 'BgGradRight'; const SUBSTYLE_BgGradRight = 'BgGradRight';
@ -53,11 +54,13 @@ class Quad_Bgs1 extends Quad {
const SUBSTYLE_BgIconBorder = 'BgIconBorder'; const SUBSTYLE_BgIconBorder = 'BgIconBorder';
const SUBSTYLE_BgList = 'BgList'; const SUBSTYLE_BgList = 'BgList';
const SUBSTYLE_BgListLine = 'BgListLine'; const SUBSTYLE_BgListLine = 'BgListLine';
const SUBSTYLE_BgMetalBar = 'BgMetalBar';
const SUBSTYLE_BgPager = 'BgPager'; const SUBSTYLE_BgPager = 'BgPager';
const SUBSTYLE_BgProgressBar = 'BgProgressBar'; const SUBSTYLE_BgProgressBar = 'BgProgressBar';
const SUBSTYLE_BgShadow = 'BgShadow'; const SUBSTYLE_BgShadow = 'BgShadow';
const SUBSTYLE_BgSlider = 'BgSlider'; const SUBSTYLE_BgSlider = 'BgSlider';
const SUBSTYLE_BgSystemBar = 'BgSystemBar'; const SUBSTYLE_BgSystemBar = 'BgSystemBar';
const SUBSTYLE_BgTitle = 'BgTitle';
const SUBSTYLE_BgTitle2 = 'BgTitle2'; const SUBSTYLE_BgTitle2 = 'BgTitle2';
const SUBSTYLE_BgTitle3 = 'BgTitle3'; const SUBSTYLE_BgTitle3 = 'BgTitle3';
const SUBSTYLE_BgTitle3_1 = 'BgTitle3_1'; const SUBSTYLE_BgTitle3_1 = 'BgTitle3_1';

View File

@ -44,6 +44,7 @@ class Quad_Bgs1InRace extends Quad {
const SUBSTYLE_BgColorContour = 'BgColorContour'; const SUBSTYLE_BgColorContour = 'BgColorContour';
const SUBSTYLE_BgDialogBlur = 'BgDialogBlur'; const SUBSTYLE_BgDialogBlur = 'BgDialogBlur';
const SUBSTYLE_BgEmpty = 'BgEmpty'; const SUBSTYLE_BgEmpty = 'BgEmpty';
const SUBSTYLE_BgGlow2 = 'BgGlow2';
const SUBSTYLE_BgGradBottom = 'BgGradBottom'; const SUBSTYLE_BgGradBottom = 'BgGradBottom';
const SUBSTYLE_BgGradLeft = 'BgGradLeft'; const SUBSTYLE_BgGradLeft = 'BgGradLeft';
const SUBSTYLE_BgGradRight = 'BgGradRight'; const SUBSTYLE_BgGradRight = 'BgGradRight';
@ -53,11 +54,13 @@ class Quad_Bgs1InRace extends Quad {
const SUBSTYLE_BgIconBorder = 'BgIconBorder'; const SUBSTYLE_BgIconBorder = 'BgIconBorder';
const SUBSTYLE_BgList = 'BgList'; const SUBSTYLE_BgList = 'BgList';
const SUBSTYLE_BgListLine = 'BgListLine'; const SUBSTYLE_BgListLine = 'BgListLine';
const SUBSTYLE_BgMetalBar = 'BgMetalBar';
const SUBSTYLE_BgPager = 'BgPager'; const SUBSTYLE_BgPager = 'BgPager';
const SUBSTYLE_BgProgressBar = 'BgProgressBar'; const SUBSTYLE_BgProgressBar = 'BgProgressBar';
const SUBSTYLE_BgShadow = 'BgShadow'; const SUBSTYLE_BgShadow = 'BgShadow';
const SUBSTYLE_BgSlider = 'BgSlider'; const SUBSTYLE_BgSlider = 'BgSlider';
const SUBSTYLE_BgSystemBar = 'BgSystemBar'; const SUBSTYLE_BgSystemBar = 'BgSystemBar';
const SUBSTYLE_BgTitle = 'BgTitle';
const SUBSTYLE_BgTitle2 = 'BgTitle2'; const SUBSTYLE_BgTitle2 = 'BgTitle2';
const SUBSTYLE_BgTitle3 = 'BgTitle3'; const SUBSTYLE_BgTitle3 = 'BgTitle3';
const SUBSTYLE_BgTitle3_1 = 'BgTitle3_1'; const SUBSTYLE_BgTitle3_1 = 'BgTitle3_1';

View File

@ -21,6 +21,7 @@ class Quad_BgsButtons extends Quad {
const SUBSTYLE_BgButtonMediumSelector = 'BgButtonMediumSelector'; const SUBSTYLE_BgButtonMediumSelector = 'BgButtonMediumSelector';
const SUBSTYLE_BgButtonMediumSpecial = 'BgButtonMediumSpecial'; const SUBSTYLE_BgButtonMediumSpecial = 'BgButtonMediumSpecial';
const SUBSTYLE_BgButtonSmall = 'BgButtonSmall'; const SUBSTYLE_BgButtonSmall = 'BgButtonSmall';
const SUBSTYLE_BgButtonSmall2 = 'BgButtonSmall2';
const SUBSTYLE_BgButtonXSmall = 'BgButtonXSmall'; const SUBSTYLE_BgButtonXSmall = 'BgButtonXSmall';
/* /*

View File

@ -15,7 +15,11 @@ class Quad_Icons128x32_1 extends Quad {
/* /*
* Constants * Constants
*/ */
const STYLE = 'Icons128x32_1'; const STYLE = 'Icons128x32_1';
const SUBSTYLE_ArrowUp = 'ArrowUp';
const SUBSTYLE_BgQuadWhite = 'BgQuadWhite';
// TODO: validate existence of 'close'
const SUBSTYLE_Close = 'Close';
const SUBSTYLE_Empty = 'Empty'; const SUBSTYLE_Empty = 'Empty';
const SUBSTYLE_ManiaLinkHome = 'ManiaLinkHome'; const SUBSTYLE_ManiaLinkHome = 'ManiaLinkHome';
const SUBSTYLE_ManiaLinkSwitch = 'ManiaLinkSwitch'; const SUBSTYLE_ManiaLinkSwitch = 'ManiaLinkSwitch';

View File

@ -18,6 +18,7 @@ class Quad_Icons64x64_2 extends Quad {
const STYLE = 'Icons64x64_2'; const STYLE = 'Icons64x64_2';
const SUBSTYLE_ArrowElimination = 'ArrowElimination'; const SUBSTYLE_ArrowElimination = 'ArrowElimination';
const SUBSTYLE_ArrowHit = 'ArrowHit'; const SUBSTYLE_ArrowHit = 'ArrowHit';
const SUBSTYLE_Calendar = 'Calendar';
const SUBSTYLE_Disconnected = 'Disconnected'; const SUBSTYLE_Disconnected = 'Disconnected';
const SUBSTYLE_DisconnectedLight = 'DisconnectedLight'; const SUBSTYLE_DisconnectedLight = 'DisconnectedLight';
const SUBSTYLE_LaserElimination = 'LaserElimination'; const SUBSTYLE_LaserElimination = 'LaserElimination';

View File

@ -35,6 +35,7 @@ class Quad_UIConstruction_Buttons extends Quad {
const SUBSTYLE_Down = 'Down'; const SUBSTYLE_Down = 'Down';
const SUBSTYLE_Drive = 'Drive'; const SUBSTYLE_Drive = 'Drive';
const SUBSTYLE_Erase = 'Erase'; const SUBSTYLE_Erase = 'Erase';
const SUBSTYLE_FreeItems = 'FreeItems';
const SUBSTYLE_GhostBlocks = 'GhostBlocks'; const SUBSTYLE_GhostBlocks = 'GhostBlocks';
const SUBSTYLE_Help = 'Help'; const SUBSTYLE_Help = 'Help';
const SUBSTYLE_Item = 'Item'; const SUBSTYLE_Item = 'Item';

View File

@ -150,7 +150,7 @@ class CustomUI {
} }
$settings = $this->getSettings(); $settings = $this->getSettings();
foreach ($settings as $setting => $value) { foreach ($settings as $setting => $value) {
if (is_null($value)) { if ($value === null) {
continue; continue;
} }
$xmlSubElement = $domDocument->createElement($setting); $xmlSubElement = $domDocument->createElement($setting);

View File

@ -34,7 +34,7 @@ class Including implements Renderable {
* @param string $url (optional) Include url * @param string $url (optional) Include url
*/ */
public function __construct($url = null) { public function __construct($url = null) {
if (!is_null($url)) { if ($url !== null) {
$this->setUrl($url); $this->setUrl($url);
} }
} }

View File

@ -34,7 +34,7 @@ class Music implements Renderable {
* @param string $data (optional) Media url * @param string $data (optional) Media url
*/ */
public function __construct($data = null) { public function __construct($data = null) {
if (!is_null($data)) { if ($data !== null) {
$this->setData($data); $this->setData($data);
} }
} }

View File

@ -34,7 +34,7 @@ class SimpleScript implements Renderable {
* @param string $text (optional) Script text * @param string $text (optional) Script text
*/ */
public function __construct($text = null) { public function __construct($text = null) {
if (!is_null($text)) { if ($text !== null) {
$this->setText($text); $this->setText($text);
} }
} }

View File

@ -32,7 +32,7 @@ class AddBuddy extends Element {
* @param string $login (optional) Buddy login * @param string $login (optional) Buddy login
*/ */
public function __construct($login = null) { public function __construct($login = null) {
if (!is_null($login)) { if ($login !== null) {
$this->setLogin($login); $this->setLogin($login);
} }
} }

View File

@ -34,7 +34,7 @@ class AddFavorite extends Element {
* @param string $login (optional) Server login * @param string $login (optional) Server login
*/ */
public function __construct($login = null) { public function __construct($login = null) {
if (!is_null($login)) { if ($login !== null) {
$this->setLogin($login); $this->setLogin($login);
} }
} }
@ -71,7 +71,7 @@ class AddFavorite extends Element {
*/ */
public function render(\DOMDocument $domDocument) { public function render(\DOMDocument $domDocument) {
$xmlElement = parent::render($domDocument); $xmlElement = parent::render($domDocument);
if (is_null($this->serverIp)) { if ($this->serverIp === null) {
$loginElement = $domDocument->createElement('login', $this->login); $loginElement = $domDocument->createElement('login', $this->login);
$xmlElement->appendChild($loginElement); $xmlElement->appendChild($loginElement);
} else { } else {

View File

@ -38,13 +38,13 @@ class GetSkin extends Element {
* @param string $url (optional) Skin url * @param string $url (optional) Skin url
*/ */
public function __construct($name = null, $file = null, $url = null) { public function __construct($name = null, $file = null, $url = null) {
if (!is_null($name)) { if ($name !== null) {
$this->setName($name); $this->setName($name);
} }
if (!is_null($file)) { if ($file !== null) {
$this->setFile($file); $this->setFile($file);
} }
if (!is_null($url)) { if ($url !== null) {
$this->setUrl($url); $this->setUrl($url);
} }
} }

View File

@ -32,7 +32,7 @@ class Go_To extends Element {
* @param string $link (optional) Goto link * @param string $link (optional) Goto link
*/ */
public function __construct($link = null) { public function __construct($link = null) {
if (!is_null($link)) { if ($link !== null) {
$this->setLink($link); $this->setLink($link);
} }
} }

View File

@ -37,13 +37,13 @@ class InstallMacroblock extends Element {
* @param string $url (optional) Macroblock url * @param string $url (optional) Macroblock url
*/ */
public function __construct($name = null, $file = null, $url = null) { public function __construct($name = null, $file = null, $url = null) {
if (!is_null($name)) { if ($name !== null) {
$this->setName($name); $this->setName($name);
} }
if (!is_null($file)) { if ($file !== null) {
$this->setFile($file); $this->setFile($file);
} }
if (!is_null($url)) { if ($url !== null) {
$this->setUrl($url); $this->setUrl($url);
} }
} }

View File

@ -35,10 +35,10 @@ class InstallMap extends Element {
* @param string $url (optional) Map url * @param string $url (optional) Map url
*/ */
public function __construct($name = null, $url = null) { public function __construct($name = null, $url = null) {
if (!is_null($name)) { if ($name !== null) {
$this->setName($name); $this->setName($name);
} }
if (!is_null($url)) { if ($url !== null) {
$this->setUrl($url); $this->setUrl($url);
} }
} }

View File

@ -38,13 +38,13 @@ class InstallPack extends Element {
* @param string $url (optional) Pack url * @param string $url (optional) Pack url
*/ */
public function __construct($name = null, $file = null, $url = null) { public function __construct($name = null, $file = null, $url = null) {
if (!is_null($name)) { if ($name !== null) {
$this->setName($name); $this->setName($name);
} }
if (!is_null($file)) { if ($file !== null) {
$this->setFile($file); $this->setFile($file);
} }
if (!is_null($url)) { if ($url !== null) {
$this->setUrl($url); $this->setUrl($url);
} }
} }

View File

@ -35,10 +35,10 @@ class InstallReplay extends Element {
* @param string $url (optional) Replay url * @param string $url (optional) Replay url
*/ */
public function __construct($name = null, $url = null) { public function __construct($name = null, $url = null) {
if (!is_null($name)) { if ($name!== null) {
$this->setName($name); $this->setName($name);
} }
if (!is_null($url)) { if ($url!== null) {
$this->setUrl($url); $this->setUrl($url);
} }
} }

View File

@ -38,13 +38,13 @@ class InstallScript extends Element {
* @param string $url (optional) Script url * @param string $url (optional) Script url
*/ */
public function __construct($name = null, $file = null, $url = null) { public function __construct($name = null, $file = null, $url = null) {
if (!is_null($name)) { if ($name !== null) {
$this->setName($name); $this->setName($name);
} }
if (!is_null($file)) { if ($file !== null) {
$this->setFile($file); $this->setFile($file);
} }
if (!is_null($url)) { if ($url !== null) {
$this->setUrl($url); $this->setUrl($url);
} }
} }

View File

@ -38,13 +38,13 @@ class InstallSkin extends Element {
* @param string $url (optional) Skin url * @param string $url (optional) Skin url
*/ */
public function __construct($name = null, $file = null, $url = null) { public function __construct($name = null, $file = null, $url = null) {
if (!is_null($name)) { if ($name !== null) {
$this->setName($name); $this->setName($name);
} }
if (!is_null($file)) { if ($file !== null) {
$this->setFile($file); $this->setFile($file);
} }
if (!is_null($url)) { if ($url !== null) {
$this->setUrl($url); $this->setUrl($url);
} }
} }

View File

@ -34,7 +34,7 @@ class JoinServer extends Element {
* @param string $login (optional) Server login * @param string $login (optional) Server login
*/ */
public function __construct($login = null) { public function __construct($login = null) {
if (!is_null($login)) { if ($login !== null) {
$this->setLogin($login); $this->setLogin($login);
} }
} }
@ -71,7 +71,7 @@ class JoinServer extends Element {
*/ */
public function render(\DOMDocument $domDocument) { public function render(\DOMDocument $domDocument) {
$xmlElement = parent::render($domDocument); $xmlElement = parent::render($domDocument);
if (is_null($this->serverIp)) { if ($this->serverIp === null) {
$loginElement = $domDocument->createElement('login', $this->login); $loginElement = $domDocument->createElement('login', $this->login);
$xmlElement->appendChild($loginElement); $xmlElement->appendChild($loginElement);
} else { } else {

View File

@ -35,10 +35,10 @@ class PlayMap extends Element {
* @param string $url (optional) Map url * @param string $url (optional) Map url
*/ */
public function __construct($name = null, $url = null) { public function __construct($name = null, $url = null) {
if (!is_null($name)) { if ($name !== null) {
$this->setName($name); $this->setName($name);
} }
if (!is_null($url)) { if ($url !== null) {
$this->setUrl($url); $this->setUrl($url);
} }
} }

View File

@ -35,10 +35,10 @@ class PlayReplay extends Element {
* @param string $url (optional) Replay url * @param string $url (optional) Replay url
*/ */
public function __construct($name = null, $url = null) { public function __construct($name = null, $url = null) {
if (!is_null($name)) { if ($name !== null) {
$this->setName($name); $this->setName($name);
} }
if (!is_null($url)) { if ($url !== null) {
$this->setUrl($url); $this->setUrl($url);
} }
} }

View File

@ -32,7 +32,7 @@ class ShowMessage extends Element {
* @param string $message (optional) Message text * @param string $message (optional) Message text
*/ */
public function __construct($message = null) { public function __construct($message = null) {
if (!is_null($message)) { if ($message !== null) {
$this->setMessage($message); $this->setMessage($message);
} }
} }

View File

@ -35,10 +35,10 @@ class ViewReplay extends Element {
* @param string $url (optional) Replay url * @param string $url (optional) Replay url
*/ */
public function __construct($name = null, $url = null) { public function __construct($name = null, $url = null) {
if (!is_null($name)) { if ($name !== null) {
$this->setName($name); $this->setName($name);
} }
if (!is_null($url)) { if ($url !== null) {
$this->setUrl($url); $this->setUrl($url);
} }
} }

View File

@ -48,22 +48,31 @@ class ManiaLink {
/** /**
* Create a new ManiaLink object * Create a new ManiaLink object
* *
* @param string $maniaLinkId (optional) ManiaLink id * @param string $maniaLinkId (optional) ManiaLink id
* @param string $maniaLinkName (optional) ManiaLink Name
* @return static * @return static
*/ */
public static function create($maniaLinkId = null) { public static function create($maniaLinkId = null, $maniaLinkName = null) {
return new static($maniaLinkId); return new static($maniaLinkId, $maniaLinkName);
} }
/** /**
* Construct a new ManiaLink object * Construct a new ManiaLink object
* *
* @param string $maniaLinkId (optional) ManiaLink id * @param string $maniaLinkId (optional) ManiaLink id
* @param string $maniaLinkName (optional) ManiaLink Name
*/ */
public function __construct($maniaLinkId = null) { public function __construct($maniaLinkId = null, $maniaLinkName = null) {
if (!is_null($maniaLinkId)) { if ($maniaLinkId !== null) {
$this->setId($maniaLinkId); $this->setId($maniaLinkId);
} }
if ($maniaLinkName !== false) {
if ($maniaLinkName) {
$this->setName($maniaLinkName);
} else {
$this->setName($maniaLinkId);
}
}
} }
/** /**

View File

@ -48,7 +48,7 @@ class CheckBoxDesign implements Styleable, SubStyleable {
* @param string $subStyle (optional) SubStyle name * @param string $subStyle (optional) SubStyle name
*/ */
public function __construct($style, $subStyle = null) { public function __construct($style, $subStyle = null) {
if (is_null($subStyle)) { if ($subStyle === null) {
$this->setImageUrl($style); $this->setImageUrl($style);
} else { } else {
$this->setStyle($style); $this->setStyle($style);
@ -116,7 +116,7 @@ class CheckBoxDesign implements Styleable, SubStyleable {
* @return string * @return string
*/ */
public function getDesignString($escaped = true, $addApostrophes = true) { public function getDesignString($escaped = true, $addApostrophes = true) {
if (!is_null($this->url)) { if ($this->url !== null) {
$string = $this->url; $string = $this->url;
} else { } else {
$string = $this->style . '|' . $this->subStyle;; $string = $this->style . '|' . $this->subStyle;;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -33,7 +33,7 @@ class PlayerProfile extends ScriptFeature {
*/ */
public function __construct($login = null, Control $control = null, $labelName = ScriptLabel::MOUSECLICK) { public function __construct($login = null, Control $control = null, $labelName = ScriptLabel::MOUSECLICK) {
$this->setLogin($login); $this->setLogin($login);
if (!is_null($control)) { if ($control !== null) {
$this->setControl($control); $this->setControl($control);
} }
$this->setLabelName($labelName); $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, public function __construct(Control $togglingControl = null, Control $toggledControl = null, $labelName = ScriptLabel::MOUSECLICK,
$onlyShow = false, $onlyHide = false) { $onlyShow = false, $onlyHide = false) {
if (!is_null($togglingControl)) { if ($togglingControl !== null) {
$this->setTogglingControl($togglingControl); $this->setTogglingControl($togglingControl);
} }
if (!is_null($toggledControl)) { if ($toggledControl !== null) {
$this->setToggledControl($toggledControl); $this->setToggledControl($toggledControl);
} }
$this->setLabelName($labelName); $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 * @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) { 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); $this->setHoverControl($hoverControl);
} }
if (!is_null($tooltipControl)) { if ($tooltipControl !== null) {
$this->setTooltipControl($tooltipControl); $this->setTooltipControl($tooltipControl);
} }
$this->setStayOnClick($stayOnClick); $this->setStayOnClick($stayOnClick);
$this->setInvert($invert); $this->setInvert($invert);
if (!is_null($text)) { if ($text !== null) {
$this->setText($text); $this->setText($text);
} }
} }

View File

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

View File

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

View File

@ -39,7 +39,7 @@ class Script {
* @return static * @return static
*/ */
public function setScriptInclude($file, $namespace = null) { public function setScriptInclude($file, $namespace = null) {
if (is_object($file) && ($file instanceof ScriptInclude)) { if ($file instanceof ScriptInclude) {
$scriptInclude = $file; $scriptInclude = $file;
} else { } else {
$scriptInclude = new ScriptInclude($file, $namespace); $scriptInclude = new ScriptInclude($file, $namespace);
@ -56,7 +56,7 @@ class Script {
* @return static * @return static
*/ */
public function addScriptConstant($name, $value = null) { public function addScriptConstant($name, $value = null) {
if (is_object($name) && ($name instanceof ScriptConstant)) { if ($name instanceof ScriptConstant) {
$scriptConstant = $name; $scriptConstant = $name;
} else { } else {
$scriptConstant = new ScriptConstant($name, $value); $scriptConstant = new ScriptConstant($name, $value);
@ -75,7 +75,7 @@ class Script {
* @return static * @return static
*/ */
public function addScriptFunction($name, $text = null) { public function addScriptFunction($name, $text = null) {
if (is_object($name) && ($name instanceof ScriptFunction)) { if ($name instanceof ScriptFunction) {
$scriptFunction = $name; $scriptFunction = $name;
} else { } else {
$scriptFunction = new ScriptFunction($name, $text); $scriptFunction = new ScriptFunction($name, $text);
@ -94,7 +94,7 @@ class Script {
* @return static * @return static
*/ */
public function addCustomScriptLabel($name, $text = null) { public function addCustomScriptLabel($name, $text = null) {
if (is_object($name) && ($name instanceof ScriptLabel)) { if ($name instanceof ScriptLabel) {
$scriptLabel = $name; $scriptLabel = $name;
} else { } else {
$scriptLabel = new ScriptLabel($name, $text); $scriptLabel = new ScriptLabel($name, $text);
@ -112,7 +112,7 @@ class Script {
* @return static * @return static
*/ */
public function appendGenericScriptLabel($name, $text = null, $isolated = false) { public function appendGenericScriptLabel($name, $text = null, $isolated = false) {
if (is_object($name) && ($name instanceof ScriptLabel)) { if ($name instanceof ScriptLabel) {
$scriptLabel = $name; $scriptLabel = $name;
} else { } else {
$scriptLabel = new ScriptLabel($name, $text, $isolated); $scriptLabel = new ScriptLabel($name, $text, $isolated);
@ -218,7 +218,11 @@ class Script {
*/ */
protected function getHeaderComment() { protected function getHeaderComment() {
$headerComment = '/**************************************************** $headerComment = '/****************************************************
* FancyManiaLinks v' . FML_VERSION . ' by steeffeen * * FancyManiaLinks';
if (defined('FML_VERSION')) {
$headerComment .= ' v' . FML_VERSION;
}
$headerComment .= ' by steeffeen *
* http://github.com/steeffeen/FancyManiaLinks * * http://github.com/steeffeen/FancyManiaLinks *
****************************************************/ ****************************************************/

View File

@ -53,7 +53,7 @@ class Style3d {
* @param string $styleId (optional) Style id * @param string $styleId (optional) Style id
*/ */
public function __construct($styleId = null) { public function __construct($styleId = null) {
if (!is_null($styleId)) { if ($styleId !== null) {
$this->setId($styleId); $this->setId($styleId);
} }
} }

View File

@ -20,7 +20,7 @@ class UniqueID {
*/ */
protected static $currentIndex = 0; protected static $currentIndex = 0;
/** /*
* Protected properties * Protected properties
*/ */
protected $index = null; protected $index = null;

View File

@ -4,16 +4,16 @@
* FancyManiaLinks - Automatic ManiaLink Generator Framework * FancyManiaLinks - Automatic ManiaLink Generator Framework
* *
* @author steeffeen <mail@steeffeen.com> * @author steeffeen <mail@steeffeen.com>
* @version 1.3 * @version 1.4
* @link http://github.com/steeffeen/FancyManiaLinks * @link http://github.com/steeffeen/FancyManiaLinks
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder * @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/ */
if (!defined('FML_PATH')) { if (!defined('FML_PATH')) {
define('FML_PATH', __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR); define('FML_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
} }
if (!defined('FML_VERSION')) { if (!defined('FML_VERSION')) {
define('FML_VERSION', '1.3'); define('FML_VERSION', '1.4');
} }
/* /*