fml update
This commit is contained in:
parent
71a19d2464
commit
11abd5ee6e
@ -12,7 +12,7 @@ use FML\Types\Scriptable;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Audio extends Control implements Playable, Scriptable {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $data = '';
|
||||
|
@ -11,7 +11,7 @@ use FML\Types\Renderable;
|
||||
* @author steeffeen
|
||||
*/
|
||||
abstract class Control implements Renderable {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const CENTER = 'center';
|
||||
@ -21,7 +21,7 @@ abstract class Control implements Renderable {
|
||||
const BOTTOM = 'bottom';
|
||||
const LEFT = 'left';
|
||||
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'control';
|
||||
|
@ -14,7 +14,7 @@ use FML\Types\TextFormatable;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Entry extends Control implements NewLineable, Scriptable, Styleable, TextFormatable {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $name = '';
|
||||
|
@ -9,7 +9,7 @@ namespace FML\Controls;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class FileEntry extends Entry {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $folder = '';
|
||||
|
@ -14,7 +14,7 @@ use FML\Elements\FrameModel;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Frame extends Control implements Container {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $children = array();
|
||||
|
@ -12,7 +12,7 @@ use FML\Stylesheet\Style3d;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Frame3d extends Frame implements Scriptable {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $style3dId = '';
|
||||
|
@ -12,7 +12,7 @@ use FML\Types\Renderable;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class FrameInstance extends Control {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $modelId = '';
|
||||
|
@ -10,9 +10,16 @@ use FML\Types\Styleable;
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
// TODO: gauge styles
|
||||
class Gauge extends Control implements Styleable {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE_BgCard = 'BgCard';
|
||||
const STYLE_EnergyBar = 'EnergyBar';
|
||||
const STYLE_ProgressBar = 'ProgressBar';
|
||||
const STYLE_ProgressBarSmall = 'ProgressBarSmall';
|
||||
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $ratio = 0.;
|
||||
|
@ -16,7 +16,7 @@ use FML\Types\TextFormatable;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Label extends Control implements Actionable, Linkable, NewLineable, Scriptable, Styleable, TextFormatable {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $text = '';
|
||||
@ -137,6 +137,14 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Actionable::getAction()
|
||||
*/
|
||||
public function getAction() {
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Actionable::setActionKey()
|
||||
@ -263,7 +271,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = parent::render($domDocument);
|
||||
if ($this->text) {
|
||||
if (strlen($this->text) > 0) {
|
||||
$xmlElement->setAttribute('text', $this->text);
|
||||
}
|
||||
if ($this->textId) {
|
||||
@ -281,7 +289,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
||||
if ($this->maxLines >= 0) {
|
||||
$xmlElement->setAttribute('maxlines', $this->maxLines);
|
||||
}
|
||||
if ($this->action) {
|
||||
if (strlen($this->action) > 0) {
|
||||
$xmlElement->setAttribute('action', $this->action);
|
||||
}
|
||||
if ($this->actionKey >= 0) {
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Label;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Label_Button extends Label {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE_CardButtonMedium = 'CardButtonMedium';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Label;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Label_Text extends Label {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE_AvatarButtonNormal = 'AvatarButtonNormal';
|
||||
@ -93,7 +93,7 @@ class Label_Text extends Label {
|
||||
* Create a new Label_Text Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Labels\Label_Button
|
||||
* @return \FML\Controls\Labels\Label_Text
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$labelText = new Label_Text($id);
|
||||
|
@ -16,7 +16,7 @@ use FML\Types\SubStyleable;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad extends Control implements Actionable, BgColorable, Linkable, Scriptable, Styleable, SubStyleable {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $image = '';
|
||||
@ -146,6 +146,14 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Actionable::getAction()
|
||||
*/
|
||||
public function getAction() {
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Actionable::setActionKey()
|
||||
@ -274,7 +282,7 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
|
||||
if (!$this->autoScale) {
|
||||
$xmlElement->setAttribute('autoscale', $this->autoScale);
|
||||
}
|
||||
if ($this->action) {
|
||||
if (strlen($this->action) > 0) {
|
||||
$xmlElement->setAttribute('action', $this->action);
|
||||
}
|
||||
if ($this->actionKey >= 0) {
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_321Go extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = '321Go';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_BgRaceScore2 extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'BgRaceScore2';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Bgs1 extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Bgs1';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Bgs1InRace extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Bgs1InRace';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_BgsChallengeMedals extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'BgsChallengeMedals';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_BgsPlayerCard extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'BgsPlayerCard';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Copilot extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Copilot';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Emblems extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Emblems';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_EnergyBar extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'EnergyBar';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Hud3dEchelons extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Hud3dEchelons';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Icons128x128_1 extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Icons128x128_1';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Icons128x128_Blink extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Icons128x128_Blink';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Icons128x32_1 extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Icons128x32_1';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Icons64x64_1 extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Icons64x64_1';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Icons64x64_2 extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Icons64x64_2';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_ManiaPlanetLogos extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'ManiaPlanetLogos';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_ManiaplanetSystem extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'ManiaplanetSystem';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_MedalsBig extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'MedalsBig';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_TitleLogos extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'TitleLogos';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_UIConstruction_Buttons extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'UIConstruction_Buttons';
|
||||
|
@ -10,7 +10,7 @@ use FML\Controls\Quad;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_UiSMSpectatorScoreBig extends Quad {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'UiSMSpectatorScoreBig';
|
||||
|
@ -12,7 +12,7 @@ use FML\Types\Scriptable;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Video extends Control implements Playable, Scriptable {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $data = '';
|
||||
|
@ -8,7 +8,7 @@ namespace FML;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class CustomUI {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $encoding = 'utf-8';
|
||||
|
@ -148,7 +148,7 @@ class Dico {
|
||||
*/
|
||||
const LANG_CHINESE = 'zh';
|
||||
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'dico';
|
||||
|
@ -13,7 +13,7 @@ use FML\Types\TextFormatable;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Format implements BgColorable, Renderable, Styleable, TextFormatable {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'format';
|
||||
|
@ -12,7 +12,7 @@ use FML\Types\Renderable;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class FrameModel implements Container, Renderable {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'framemodel';
|
||||
|
@ -10,7 +10,7 @@ use FML\Types\Renderable;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Including implements Renderable {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'include';
|
||||
|
@ -10,7 +10,7 @@ use FML\Types\Renderable;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Music implements Renderable {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'music';
|
||||
|
@ -10,7 +10,7 @@ use FML\Types\Renderable;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class SimpleScript implements Renderable {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'script';
|
||||
|
@ -25,7 +25,7 @@ use FML\ManiaCode\ViewReplay;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class ManiaCode {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $encoding = 'utf-8';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\ManiaCode;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class AddBuddy implements Element {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'add_buddy';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\ManiaCode;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class AddFavorite implements Element {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'add_favourite';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\ManiaCode;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class GetSkin implements Element {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'get_skin';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\ManiaCode;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Go_To implements Element {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'goto';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\ManiaCode;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class InstallMap implements Element {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'install_map';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\ManiaCode;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class InstallPack implements Element {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'install_pack';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\ManiaCode;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class InstallReplay implements Element {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'install_replay';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\ManiaCode;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class InstallScript implements Element {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'install_script';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\ManiaCode;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class InstallSkin implements Element {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'install_skin';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\ManiaCode;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class JoinServer implements Element {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'join_server';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\ManiaCode;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class PlayMap implements Element {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'play_map';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\ManiaCode;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class PlayReplay implements Element {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'play_replay';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\ManiaCode;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class ShowMessage implements Element {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'show_message';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\ManiaCode;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class ViewReplay implements Element {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'view_replay';
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
namespace FML;
|
||||
|
||||
use FML\Types\Renderable;
|
||||
use FML\Script\Script;
|
||||
use FML\Elements\Dico;
|
||||
use FML\Script\Script;
|
||||
use FML\Stylesheet\Stylesheet;
|
||||
use FML\Types\Renderable;
|
||||
|
||||
/**
|
||||
* Class representing a ManiaLink
|
||||
@ -13,7 +13,7 @@ use FML\Stylesheet\Stylesheet;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class ManiaLink {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const BACKGROUND_0 = '0';
|
||||
@ -21,7 +21,7 @@ class ManiaLink {
|
||||
const BACKGROUND_STATIONS = 'stations';
|
||||
const BACKGROUND_TITLE = 'title';
|
||||
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $encoding = 'utf-8';
|
||||
@ -224,16 +224,17 @@ class ManiaLink {
|
||||
if (!$isChild) {
|
||||
$domDocument->appendChild($maniaLink);
|
||||
}
|
||||
if ($this->id) {
|
||||
if (strlen($this->id) > 0) {
|
||||
$maniaLink->setAttribute('id', $this->id);
|
||||
}
|
||||
if ($this->version) {
|
||||
$maniaLink->setAttribute('version', $this->version);
|
||||
}
|
||||
if ($this->background) {
|
||||
if (strlen($this->background) > 0) {
|
||||
$maniaLink->setAttribute('background', $this->background);
|
||||
}
|
||||
if (!$this->navigable3d) {
|
||||
if ($this->navigable3d) {
|
||||
// TODO: check default value
|
||||
$maniaLink->setAttribute('navigable3d', $this->navigable3d);
|
||||
}
|
||||
if ($this->timeout) {
|
||||
|
@ -8,7 +8,7 @@ namespace FML;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class ManiaLinks {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $encoding = 'utf-8';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\Script;
|
||||
* @author steeffeen
|
||||
*/
|
||||
abstract class EUISound {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const SOUND_Bonus = 'Bonus';
|
||||
|
@ -5,6 +5,7 @@ namespace FML\Script;
|
||||
use FML\Controls\Control;
|
||||
use FML\Controls\Label;
|
||||
use FML\Types\Scriptable;
|
||||
use FML\Types\Actionable;
|
||||
|
||||
/**
|
||||
* Class representing the ManiaLink Script
|
||||
@ -12,7 +13,7 @@ use FML\Types\Scriptable;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Script {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const CLASS_TOOLTIP = 'FML_Tooltip';
|
||||
@ -26,6 +27,7 @@ class Script {
|
||||
const CLASS_SOUND = 'FML_Sound';
|
||||
const CLASS_TOGGLE = 'FML_Toggle';
|
||||
const CLASS_SPECTATE = 'FML_Spectate';
|
||||
const CLASS_PAGEACTION = 'FML_PageAction';
|
||||
const OPTION_TOOLTIP_STAYONCLICK = 'FML_StayOnClick_Tooltip';
|
||||
const OPTION_TOOLTIP_INVERT = 'FML_Invert_Tooltip';
|
||||
const OPTION_TOOLTIP_TEXT = 'FML_Text_Tooltip';
|
||||
@ -44,7 +46,7 @@ class Script {
|
||||
const FUNCTION_SETTOOLTIPTEXT = 'FML_SetTooltipText';
|
||||
const FUNCTION_TOGGLE = 'FML_Toggle';
|
||||
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'script';
|
||||
@ -60,6 +62,7 @@ class Script {
|
||||
protected $sounds = array();
|
||||
protected $toggles = false;
|
||||
protected $spectate = false;
|
||||
protected $pageActions = false;
|
||||
|
||||
/**
|
||||
* Create a new Script Object
|
||||
@ -357,6 +360,33 @@ class Script {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger an Action on Control Click
|
||||
*
|
||||
* @param Control $actionControl The Control triggering the Action
|
||||
* @param string $action (optional) The Action to trigger (if empty the Action of the Control will be triggered)
|
||||
*/
|
||||
public function addPageActionTrigger(Control $actionControl, $action = null) {
|
||||
if (!($actionControl instanceof Scriptable)) {
|
||||
trigger_error('Scriptable Control needed as ActionControl for PageActions!');
|
||||
return $this;
|
||||
}
|
||||
$action = (string) $action;
|
||||
if (strlen($action) <= 0) {
|
||||
if (!($actionControl instanceof Actionable)) {
|
||||
trigger_error('Either Action or Actionable Control needed for PageActions!');
|
||||
return $this;
|
||||
}
|
||||
$action = $actionControl->getAction();
|
||||
}
|
||||
$actionControl->setScriptEvents(true);
|
||||
$actionControl->setAction('');
|
||||
$actionControl->addClass(self::CLASS_PAGEACTION);
|
||||
$actionControl->addClass(self::CLASS_PAGEACTION . '-' . $action);
|
||||
$this->pageActions = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the Script XML Tag
|
||||
*
|
||||
@ -644,10 +674,10 @@ if (Event.Control.HasClass(\"" . self::CLASS_PAGER . "\")) {
|
||||
if (ClassParts[0] != \"" . self::CLASS_PAGER . "\") continue;
|
||||
switch (TextLib::SubText(ClassParts[1], 0, 1)) {
|
||||
case \"I\": {
|
||||
PagesId = TextLib::SubText(ClassParts[1], 1, 99);
|
||||
PagesId = TextLib::SubText(ClassParts[1], 1, TextLib::Length(ClassParts[1]));
|
||||
}
|
||||
case \"A\": {
|
||||
PagingAction = TextLib::ToInteger(TextLib::SubText(ClassParts[1], 1, 99));
|
||||
PagingAction = TextLib::ToInteger(TextLib::SubText(ClassParts[1], 1, TextLib::Length(ClassParts[1])));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -661,7 +691,7 @@ if (Event.Control.HasClass(\"" . self::CLASS_PAGER . "\")) {
|
||||
if (!PageControl.HasClass(\"" . self::CLASS_PAGE . "\")) continue;
|
||||
foreach (ControlClass in PageControl.ControlClasses) {
|
||||
if (TextLib::SubText(ControlClass, 0, {$pagesNumberPrefixLength}) != \"{$pagesNumberPrefix}\") continue;
|
||||
declare PageNumber = TextLib::ToInteger(TextLib::SubText(ControlClass, {$pagesNumberPrefixLength}, 99));
|
||||
declare PageNumber = TextLib::ToInteger(TextLib::SubText(ControlClass, {$pagesNumberPrefixLength}, TextLib::Length(ControlClass)));
|
||||
if (!FML_MinPageNumber.existskey(PagesId) || PageNumber < FML_MinPageNumber[PagesId]) {
|
||||
FML_MinPageNumber[PagesId] = PageNumber;
|
||||
}
|
||||
@ -687,7 +717,7 @@ if (Event.Control.HasClass(\"" . self::CLASS_PAGER . "\")) {
|
||||
declare PageNumber = -1;
|
||||
foreach (ControlClass in PageControl.ControlClasses) {
|
||||
if (TextLib::SubText(ControlClass, 0, {$pagesNumberPrefixLength}) != \"{$pagesNumberPrefix}\") continue;
|
||||
PageNumber = TextLib::ToInteger(TextLib::SubText(ControlClass, {$pagesNumberPrefixLength}, 99));
|
||||
PageNumber = TextLib::ToInteger(TextLib::SubText(ControlClass, {$pagesNumberPrefixLength}, TextLib::Length(ControlClass)));
|
||||
break;
|
||||
}
|
||||
PageControl.Visible = (PageNumber == FML_PageNumber[PagesId]);
|
||||
@ -841,6 +871,33 @@ if (Event.Control.HasClass(\"" . self::CLASS_SPECTATE . "\")) {
|
||||
return $spectateScript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Page Actions Labels
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getPageActionLabels() {
|
||||
if (!$this->pageActions) return '';
|
||||
$this->setInclude('TextLib', 'TextLib');
|
||||
$prefixLength = strlen(self::CLASS_PAGEACTION) + 1;
|
||||
$pageActionScript = "
|
||||
if (Event.Control.HasClass(\"" . self::CLASS_PAGEACTION . "\")) {
|
||||
declare Action = \"\";
|
||||
foreach (ControlClass in Event.Control.ControlClasses) {
|
||||
declare ClassParts = TextLib::Split(\"-\", ControlClass);
|
||||
if (ClassParts.count < 2) continue;
|
||||
if (ClassParts[0] != \"" . self::CLASS_PAGEACTION . "\") continue;
|
||||
Action = TextLib::SubText(ControlClass, {$prefixLength}, TextLib::Length(ControlClass));
|
||||
break;
|
||||
}
|
||||
if (Action != \"\") {
|
||||
TriggerPageAction(Action);
|
||||
}
|
||||
}";
|
||||
$pageActionScript = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $pageActionScript);
|
||||
return $pageActionScript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Main Function
|
||||
*
|
||||
|
@ -11,7 +11,7 @@ namespace FML\Stylesheet;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Mood {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'mood';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\Stylesheet;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Style3d {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const MODEL_Box = 'Box';
|
||||
@ -17,7 +17,7 @@ class Style3d {
|
||||
const MODEL_Title = 'Title';
|
||||
const MODEL_Window = 'Window';
|
||||
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'style3d';
|
||||
|
@ -8,7 +8,7 @@ namespace FML\Stylesheet;
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Stylesheet {
|
||||
/**
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'stylesheet';
|
||||
|
@ -8,9 +8,23 @@ namespace FML\Types;
|
||||
* @author steeffeen
|
||||
*/
|
||||
interface Actionable {
|
||||
/**
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const ACTION_0 = '0';
|
||||
const ACTION_BACK = 'back';
|
||||
const ACTION_ENTER = 'enter';
|
||||
const ACTION_HOME = 'home';
|
||||
const ACTION_MENU_SOLO = 'menu_solo';
|
||||
const ACTION_MENU_COMPETITIONS = 'menu_competitions';
|
||||
const ACTION_MENU_LOCAL = 'menu_local';
|
||||
const ACTION_MENU_INTERNET = 'menu_internet';
|
||||
const ACTION_MENU_EDITORS = 'menu_editors';
|
||||
const ACTION_MENU_PROFILE = 'menu_profile';
|
||||
const ACTION_QUIT = 'quit';
|
||||
const ACTION_QUITSERVER = 'maniaplanet:quitserver';
|
||||
const ACTION_SAVEREPLAY = 'maniaplanet:savereplay';
|
||||
const ACTION_TOGGLESPEC = 'maniaplanet:togglespec';
|
||||
const ACTIONKEY_F5 = 1;
|
||||
const ACTIONKEY_F6 = 2;
|
||||
const ACTIONKEY_F7 = 3;
|
||||
@ -20,13 +34,22 @@ interface Actionable {
|
||||
* Set Action
|
||||
*
|
||||
* @param string $action Action Name
|
||||
* @return \FML\Types\Actionable
|
||||
*/
|
||||
public function setAction($action);
|
||||
|
||||
/**
|
||||
* Get the assigned Action
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAction();
|
||||
|
||||
/**
|
||||
* Set Action Key
|
||||
*
|
||||
* @param int $actionKey Action Key Number
|
||||
* @return \FML\Types\Actionable
|
||||
*/
|
||||
public function setActionKey($actionKey);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ interface BgColorable {
|
||||
* Set Background Color
|
||||
*
|
||||
* @param string $bgColor Background Color
|
||||
* @return \FML\Types\BgColorable
|
||||
*/
|
||||
public function setBgColor($bgColor);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ interface Linkable {
|
||||
* Set Url
|
||||
*
|
||||
* @param string $url Link Url
|
||||
* @return \FML\Types\Linkable
|
||||
*/
|
||||
public function setUrl($url);
|
||||
|
||||
@ -20,6 +21,7 @@ interface Linkable {
|
||||
* Set Url Id to use from the Dico
|
||||
*
|
||||
* @param string $urlId
|
||||
* @return \FML\Types\Linkable
|
||||
*/
|
||||
public function setUrlId($urlId);
|
||||
|
||||
@ -27,6 +29,7 @@ interface Linkable {
|
||||
* Set Manialink
|
||||
*
|
||||
* @param string $manialink Manialink Name
|
||||
* @return \FML\Types\Linkable
|
||||
*/
|
||||
public function setManialink($manialink);
|
||||
|
||||
@ -34,6 +37,7 @@ interface Linkable {
|
||||
* Set Manialink Id to use from the Dico
|
||||
*
|
||||
* @param string $manialinkId Manialink Id
|
||||
* @return \FML\Types\Linkable
|
||||
*/
|
||||
public function setManialinkId($manialinkId);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ interface NewLineable {
|
||||
* Set Auto New Line
|
||||
*
|
||||
* @param bool $autoNewLine Whether the Control should insert New Lines automatically
|
||||
* @return \FML\Types\NewLineable
|
||||
*/
|
||||
public function setAutoNewLine($autoNewLine);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ interface Playable {
|
||||
* Set Data
|
||||
*
|
||||
* @param string $data Media Url
|
||||
* @return \FML\Types\Playable
|
||||
*/
|
||||
public function setData($data);
|
||||
|
||||
@ -20,6 +21,7 @@ interface Playable {
|
||||
* Set Data Id to use from the Dico
|
||||
*
|
||||
* @param string $dataId
|
||||
* @return \FML\Types\Playable
|
||||
*/
|
||||
public function setDataId($dataId);
|
||||
|
||||
@ -27,6 +29,7 @@ interface Playable {
|
||||
* Set Play
|
||||
*
|
||||
* @param bool $play Whether the Control should start playing automatically
|
||||
* @return \FML\Types\Playable
|
||||
*/
|
||||
public function setPlay($play);
|
||||
|
||||
@ -34,6 +37,7 @@ interface Playable {
|
||||
* Set Looping
|
||||
*
|
||||
* @param bool $looping Whether the Control should play looping
|
||||
* @return \FML\Types\Playable
|
||||
*/
|
||||
public function setLooping($looping);
|
||||
|
||||
@ -41,6 +45,7 @@ interface Playable {
|
||||
* Set Music
|
||||
*
|
||||
* @param bool $music Whether the Control represents Background Music
|
||||
* @return \FML\Types\Playable
|
||||
*/
|
||||
public function setMusic($music);
|
||||
|
||||
@ -48,6 +53,7 @@ interface Playable {
|
||||
* Set Volume
|
||||
*
|
||||
* @param float $volume Media Volume
|
||||
* @return \FML\Types\Playable
|
||||
*/
|
||||
public function setVolume($volume);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ interface Scriptable {
|
||||
* Set ScriptEvents
|
||||
*
|
||||
* @param bool $scriptEvents Whether Script Events should be enabled
|
||||
* @return \FML\Types\Scriptable
|
||||
*/
|
||||
public function setScriptEvents($scriptEvents);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ interface Styleable {
|
||||
* Set Style
|
||||
*
|
||||
* @param string $style Style Name
|
||||
* @return \FML\Types\Styleable
|
||||
*/
|
||||
public function setStyle($style);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ interface SubStyleable {
|
||||
* Set SubStyle
|
||||
*
|
||||
* @param string $subStyle SubStyle Name
|
||||
* @return \FML\Types\SubStyleable
|
||||
*/
|
||||
public function setSubStyle($subStyle);
|
||||
|
||||
@ -21,6 +22,7 @@ interface SubStyleable {
|
||||
*
|
||||
* @param string $style Style Name
|
||||
* @param string $subStyle SubStyle Name
|
||||
* @return \FML\Types\SubStyleable
|
||||
*/
|
||||
public function setStyles($style, $subStyle);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ interface TextFormatable {
|
||||
* Set Text Size
|
||||
*
|
||||
* @param int $textSize Text Size
|
||||
* @return \FML\Types\TextFormatable
|
||||
*/
|
||||
public function setTextSize($textSize);
|
||||
|
||||
@ -20,6 +21,7 @@ interface TextFormatable {
|
||||
* Set Text Color
|
||||
*
|
||||
* @param string $textColor Text Color
|
||||
* @return \FML\Types\TextFormatable
|
||||
*/
|
||||
public function setTextColor($textColor);
|
||||
|
||||
@ -27,6 +29,7 @@ interface TextFormatable {
|
||||
* Set Area Color
|
||||
*
|
||||
* @param string $areaColor Area Color
|
||||
* @return \FML\Types\TextFormatable
|
||||
*/
|
||||
public function setAreaColor($areaColor);
|
||||
|
||||
@ -34,6 +37,7 @@ interface TextFormatable {
|
||||
* Set Area Focus Color
|
||||
*
|
||||
* @param string $areaFocusColor Area Focus Color
|
||||
* @return \FML\Types\TextFormatable
|
||||
*/
|
||||
public function setAreaFocusColor($areaFocusColor);
|
||||
}
|
||||
|
@ -13,7 +13,9 @@ if (!defined('FML_VERSION')) {
|
||||
define('FML_VERSION', 1.0);
|
||||
}
|
||||
|
||||
// Register Autoload Function that loads FML Class Files on Demand
|
||||
/*
|
||||
* Autoload Function that loads FML Class Files on Demand
|
||||
*/
|
||||
spl_autoload_register(
|
||||
function ($className) {
|
||||
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, $className);
|
||||
|
Loading…
Reference in New Issue
Block a user