2018-02-12 16:01:20 +00:00
|
|
|
/**
|
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
|
|
* @copyright 2018 Photon Storm Ltd.
|
|
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
|
|
*/
|
|
|
|
|
2018-01-12 17:09:09 +00:00
|
|
|
var Class = require('../utils/Class');
|
2016-12-06 15:15:42 +00:00
|
|
|
var CONST = require('./const');
|
2017-10-04 22:48:16 +00:00
|
|
|
var CustomSet = require('../structs/Set');
|
2018-01-12 17:09:09 +00:00
|
|
|
var EventEmitter = require('eventemitter3');
|
2018-01-19 14:47:16 +00:00
|
|
|
var FileTypesManager = require('./FileTypesManager');
|
2018-01-19 16:56:41 +00:00
|
|
|
var GetFastValue = require('../utils/object/GetFastValue');
|
2018-02-12 23:03:48 +00:00
|
|
|
var PluginManager = require('../boot/PluginManager');
|
2018-01-19 14:54:50 +00:00
|
|
|
var XHRSettings = require('./XHRSettings');
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-03-23 15:54:12 +00:00
|
|
|
/**
|
|
|
|
* @typedef {object} LinkFileObject
|
|
|
|
*
|
|
|
|
* @property {string} type - [description]
|
|
|
|
* @property {Phaser.Loader.File} fileA - [description]
|
|
|
|
* @property {Phaser.Loader.File} fileB - [description]
|
|
|
|
*/
|
|
|
|
|
2018-03-22 12:51:30 +00:00
|
|
|
/**
|
|
|
|
* @typedef {object} LoaderFileObject
|
|
|
|
*
|
|
|
|
* @property {string} key - [description]
|
|
|
|
* @property {string} type - [description]
|
|
|
|
* @property {string} [url] - [description]
|
|
|
|
* @property {string[]} [urls] - [description]
|
|
|
|
* @property {string} [textureURL] - [description]
|
|
|
|
* @property {string} [atlasURL] - [description]
|
|
|
|
* @property {string} [xmlURL] - [description]
|
|
|
|
* @property {string[]} [textureURLs] - [description]
|
|
|
|
* @property {string[]} [atlasURLs] - [description]
|
|
|
|
* @property {object} [config] - [description]
|
|
|
|
* @property {object} [json] - [description]
|
|
|
|
* @property {XHRSettingsObject} [xhrSettings] - [description]
|
|
|
|
* @property {XHRSettingsObject} [textureXhrSettings] - [description]
|
|
|
|
* @property {XHRSettingsObject} [atlasXhrSettings] - [description]
|
|
|
|
* @property {XHRSettingsObject} [xmlXhrSettings] - [description]
|
|
|
|
* @property {XHRSettingsObject} [audioXhrSettings] - [description]
|
|
|
|
* @property {XHRSettingsObject} [jsonXhrSettings] - [description]
|
|
|
|
*/
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* @classdesc
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @class LoaderPlugin
|
2018-03-28 14:04:09 +00:00
|
|
|
* @extends Phaser.Events.EventEmitter
|
2018-02-09 17:56:43 +00:00
|
|
|
* @memberOf Phaser.Loader
|
|
|
|
* @constructor
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {Phaser.Scene} scene - [description]
|
|
|
|
*/
|
2018-01-19 14:54:50 +00:00
|
|
|
var LoaderPlugin = new Class({
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-01-12 17:09:09 +00:00
|
|
|
Extends: EventEmitter,
|
|
|
|
|
2017-07-03 15:05:22 +00:00
|
|
|
initialize:
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-01-19 14:54:50 +00:00
|
|
|
function LoaderPlugin (scene)
|
2017-07-03 15:05:22 +00:00
|
|
|
{
|
2018-01-12 17:09:09 +00:00
|
|
|
EventEmitter.call(this);
|
2017-08-04 17:43:05 +00:00
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#scene
|
|
|
|
* @type {Phaser.Scene}
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-12 17:09:09 +00:00
|
|
|
this.scene = scene;
|
2017-07-03 15:05:22 +00:00
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#systems
|
|
|
|
* @type {Phaser.Scenes.Systems}
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-19 14:47:16 +00:00
|
|
|
this.systems = scene.sys;
|
|
|
|
|
2018-04-25 16:16:09 +00:00
|
|
|
/**
|
|
|
|
* A reference to the global Cache Manager.
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#cacheManager
|
|
|
|
* @type {Phaser.Cache.CacheManager}
|
|
|
|
* @since 3.7.0
|
|
|
|
*/
|
|
|
|
this.cacheManager = scene.sys.cache;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A reference to the global Texture Manager.
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#textureManager
|
|
|
|
* @type {Phaser.Textures.TextureManager}
|
|
|
|
* @since 3.7.0
|
|
|
|
*/
|
|
|
|
this.textureManager = scene.sys.textures;
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#_multilist
|
|
|
|
* @type {object}
|
|
|
|
* @private
|
|
|
|
* @default {}
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-04-28 11:32:03 +00:00
|
|
|
// this._multilist = {};
|
2018-01-19 14:47:16 +00:00
|
|
|
|
|
|
|
// Inject the available filetypes into the Loader
|
|
|
|
FileTypesManager.install(this);
|
|
|
|
|
2018-01-19 16:56:41 +00:00
|
|
|
var gameConfig = this.systems.game.config;
|
2018-01-19 17:07:38 +00:00
|
|
|
var sceneConfig = this.systems.settings.loader;
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#path
|
|
|
|
* @type {string}
|
|
|
|
* @default ''
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-19 17:07:38 +00:00
|
|
|
this.path = '';
|
2018-02-09 17:56:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#baseURL
|
|
|
|
* @type {string}
|
|
|
|
* @default ''
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-19 17:07:38 +00:00
|
|
|
this.baseURL = '';
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-01-19 17:10:23 +00:00
|
|
|
this.setBaseURL(GetFastValue(sceneConfig, 'baseURL', gameConfig.loaderBaseURL));
|
2018-02-09 17:56:43 +00:00
|
|
|
|
2018-01-19 17:07:38 +00:00
|
|
|
this.setPath(GetFastValue(sceneConfig, 'path', gameConfig.loaderPath));
|
2018-01-19 16:56:41 +00:00
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#enableParallel
|
|
|
|
* @type {boolean}
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-19 16:56:41 +00:00
|
|
|
this.enableParallel = GetFastValue(sceneConfig, 'enableParallel', gameConfig.loaderEnableParallel);
|
2018-02-09 17:56:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#maxParallelDownloads
|
|
|
|
* @type {integer}
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-19 16:56:41 +00:00
|
|
|
this.maxParallelDownloads = GetFastValue(sceneConfig, 'maxParallelDownloads', gameConfig.loaderMaxParallelDownloads);
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* xhr specific global settings (can be overridden on a per-file basis)
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#xhr
|
2018-03-21 12:03:14 +00:00
|
|
|
* @type {XHRSettingsObject}
|
2018-02-09 17:56:43 +00:00
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-19 16:56:41 +00:00
|
|
|
this.xhr = XHRSettings(
|
|
|
|
GetFastValue(sceneConfig, 'responseType', gameConfig.loaderResponseType),
|
|
|
|
GetFastValue(sceneConfig, 'async', gameConfig.loaderAsync),
|
|
|
|
GetFastValue(sceneConfig, 'user', gameConfig.loaderUser),
|
|
|
|
GetFastValue(sceneConfig, 'password', gameConfig.loaderPassword),
|
|
|
|
GetFastValue(sceneConfig, 'timeout', gameConfig.loaderTimeout)
|
|
|
|
);
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#crossOrigin
|
|
|
|
* @type {string}
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-19 16:56:41 +00:00
|
|
|
this.crossOrigin = GetFastValue(sceneConfig, 'crossOrigin', gameConfig.loaderCrossOrigin);
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#totalToLoad
|
|
|
|
* @type {number}
|
|
|
|
* @default 0
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-19 16:28:59 +00:00
|
|
|
this.totalToLoad = 0;
|
2018-02-09 17:56:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#progress
|
|
|
|
* @type {number}
|
|
|
|
* @default 0
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-19 16:28:59 +00:00
|
|
|
this.progress = 0;
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#list
|
2018-03-23 15:54:12 +00:00
|
|
|
* @type {Phaser.Structs.Set.<Phaser.Loader.File>}
|
2018-02-09 17:56:43 +00:00
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-10-04 22:48:16 +00:00
|
|
|
this.list = new CustomSet();
|
2018-02-09 17:56:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#inflight
|
2018-03-23 15:54:12 +00:00
|
|
|
* @type {Phaser.Structs.Set.<Phaser.Loader.File>}
|
2018-02-09 17:56:43 +00:00
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-10-04 22:48:16 +00:00
|
|
|
this.inflight = new CustomSet();
|
2018-02-09 17:56:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#failed
|
2018-03-23 15:54:12 +00:00
|
|
|
* @type {Phaser.Structs.Set.<Phaser.Loader.File>}
|
2018-02-09 17:56:43 +00:00
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-10-04 22:48:16 +00:00
|
|
|
this.failed = new CustomSet();
|
2018-02-09 17:56:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#queue
|
2018-03-23 15:54:12 +00:00
|
|
|
* @type {Phaser.Structs.Set.<Phaser.Loader.File>}
|
2018-02-09 17:56:43 +00:00
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-10-04 22:48:16 +00:00
|
|
|
this.queue = new CustomSet();
|
2018-02-09 17:56:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#storage
|
2018-03-23 15:54:12 +00:00
|
|
|
* @type {Phaser.Structs.Set.<(Phaser.Loader.File|LinkFileObject)>}
|
2018-02-09 17:56:43 +00:00
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-10-04 22:48:16 +00:00
|
|
|
this.storage = new CustomSet();
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Loader.LoaderPlugin#state
|
|
|
|
* @type {integer}
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-07-14 13:30:20 +00:00
|
|
|
this.state = CONST.LOADER_IDLE;
|
2018-04-13 16:12:17 +00:00
|
|
|
|
2018-04-17 11:25:45 +00:00
|
|
|
scene.sys.events.once('boot', this.boot, this);
|
2018-04-17 01:34:07 +00:00
|
|
|
scene.sys.events.on('start', this.pluginStart, this);
|
2017-07-03 15:05:22 +00:00
|
|
|
},
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-04-17 11:25:45 +00:00
|
|
|
/**
|
|
|
|
* This method is called automatically, only once, when the Scene is first created.
|
|
|
|
* Do not invoke it directly.
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#boot
|
|
|
|
* @private
|
|
|
|
* @since 3.5.1
|
|
|
|
*/
|
|
|
|
boot: function ()
|
|
|
|
{
|
|
|
|
this.systems.events.once('destroy', this.destroy, this);
|
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
2018-04-13 16:12:17 +00:00
|
|
|
* This method is called automatically by the Scene when it is starting up.
|
|
|
|
* It is responsible for creating local systems, properties and listening for Scene events.
|
|
|
|
* Do not invoke it directly.
|
2018-02-09 17:56:43 +00:00
|
|
|
*
|
2018-04-17 01:34:07 +00:00
|
|
|
* @method Phaser.Loader.LoaderPlugin#pluginStart
|
2018-04-13 16:12:17 +00:00
|
|
|
* @private
|
2018-04-17 01:34:07 +00:00
|
|
|
* @since 3.5.1
|
2018-02-09 17:56:43 +00:00
|
|
|
*/
|
2018-04-17 01:34:07 +00:00
|
|
|
pluginStart: function ()
|
2018-01-19 14:47:16 +00:00
|
|
|
{
|
2018-04-17 11:25:45 +00:00
|
|
|
this.systems.events.once('shutdown', this.shutdown, this);
|
2018-01-19 14:47:16 +00:00
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#setBaseURL
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {string} url - [description]
|
|
|
|
*
|
|
|
|
* @return {Phaser.Loader.LoaderPlugin} This Loader object.
|
|
|
|
*/
|
2018-01-19 16:28:59 +00:00
|
|
|
setBaseURL: function (url)
|
|
|
|
{
|
2018-01-19 17:28:48 +00:00
|
|
|
if (url !== '' && url.substr(-1) !== '/')
|
2018-01-19 17:10:23 +00:00
|
|
|
{
|
|
|
|
url = url.concat('/');
|
|
|
|
}
|
|
|
|
|
2018-01-19 16:28:59 +00:00
|
|
|
this.baseURL = url;
|
|
|
|
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#setPath
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {string} path - [description]
|
|
|
|
*
|
|
|
|
* @return {Phaser.Loader.LoaderPlugin} This Loader object.
|
|
|
|
*/
|
2017-08-04 15:15:00 +00:00
|
|
|
setPath: function (path)
|
|
|
|
{
|
2018-01-19 17:28:48 +00:00
|
|
|
if (path !== '' && path.substr(-1) !== '/')
|
2017-08-04 15:15:00 +00:00
|
|
|
{
|
|
|
|
path = path.concat('/');
|
|
|
|
}
|
|
|
|
|
|
|
|
this.path = path;
|
|
|
|
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
|
2018-02-13 05:54:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#setCORS
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {string} crossOrigin - [description]
|
|
|
|
*
|
|
|
|
* @return {Phaser.Loader.LoaderPlugin} This Loader object.
|
|
|
|
*/
|
|
|
|
setCORS: function (crossOrigin)
|
|
|
|
{
|
|
|
|
this.crossOrigin = crossOrigin;
|
|
|
|
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#addFile
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {Phaser.Loader.File} file - [description]
|
|
|
|
*/
|
2016-11-30 17:16:45 +00:00
|
|
|
addFile: function (file)
|
|
|
|
{
|
|
|
|
if (!this.isReady())
|
|
|
|
{
|
2018-04-28 11:32:03 +00:00
|
|
|
return;
|
2016-11-30 17:16:45 +00:00
|
|
|
}
|
|
|
|
|
2018-04-27 17:44:12 +00:00
|
|
|
if (Array.isArray(file))
|
|
|
|
{
|
|
|
|
for (var i = 0; i < file.length; i++)
|
|
|
|
{
|
|
|
|
var item = file[i];
|
|
|
|
|
|
|
|
// Does the file already exist in the cache or texture manager?
|
|
|
|
if (!item.hasCacheConflict())
|
|
|
|
{
|
|
|
|
item.path = this.path;
|
|
|
|
|
|
|
|
this.list.set(item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!file.hasCacheConflict())
|
2018-04-25 16:16:09 +00:00
|
|
|
{
|
2018-04-27 17:44:12 +00:00
|
|
|
// Does the file already exist in the cache or texture manager?
|
2018-04-25 16:16:09 +00:00
|
|
|
file.path = this.path;
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-04-25 16:16:09 +00:00
|
|
|
this.list.set(file);
|
|
|
|
}
|
2016-11-30 17:16:45 +00:00
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* Is the Loader actively loading (or processing loaded files)
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#isLoading
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @return {boolean} [description]
|
|
|
|
*/
|
2016-11-30 17:16:45 +00:00
|
|
|
isLoading: function ()
|
|
|
|
{
|
2017-07-14 13:30:20 +00:00
|
|
|
return (this.state === CONST.LOADER_LOADING || this.state === CONST.LOADER_PROCESSING);
|
2016-11-30 17:16:45 +00:00
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* Is the Loader ready to start a new load?
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#isReady
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @return {boolean} [description]
|
|
|
|
*/
|
2016-11-30 17:16:45 +00:00
|
|
|
isReady: function ()
|
|
|
|
{
|
2018-04-09 12:55:41 +00:00
|
|
|
return (this.state === CONST.LOADER_IDLE || this.state === CONST.LOADER_COMPLETE);
|
2016-11-30 17:16:45 +00:00
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#start
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2016-11-30 17:16:45 +00:00
|
|
|
start: function ()
|
|
|
|
{
|
|
|
|
if (!this.isReady())
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-01-19 16:28:59 +00:00
|
|
|
this.progress = 0;
|
|
|
|
this.totalToLoad = this.list.size;
|
|
|
|
|
2018-01-12 17:09:09 +00:00
|
|
|
this.emit('start', this);
|
2016-12-05 17:19:12 +00:00
|
|
|
|
2016-11-30 17:16:45 +00:00
|
|
|
if (this.list.size === 0)
|
|
|
|
{
|
|
|
|
this.finishedLoading();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-07-14 13:30:20 +00:00
|
|
|
this.state = CONST.LOADER_LOADING;
|
2016-11-30 17:16:45 +00:00
|
|
|
|
|
|
|
this.failed.clear();
|
|
|
|
this.inflight.clear();
|
|
|
|
this.queue.clear();
|
|
|
|
|
2016-12-08 16:21:16 +00:00
|
|
|
this.queue.debug = true;
|
|
|
|
|
2016-11-30 17:16:45 +00:00
|
|
|
this.updateProgress();
|
|
|
|
|
|
|
|
this.processLoadQueue();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#updateProgress
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2016-11-30 17:16:45 +00:00
|
|
|
updateProgress: function ()
|
|
|
|
{
|
2018-03-16 15:01:39 +00:00
|
|
|
this.progress = 1 - ((this.list.size + this.inflight.size) / this.totalToLoad);
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-01-19 16:28:59 +00:00
|
|
|
this.emit('progress', this.progress);
|
2016-11-30 17:16:45 +00:00
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#processLoadQueue
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2016-11-30 17:16:45 +00:00
|
|
|
processLoadQueue: function ()
|
|
|
|
{
|
|
|
|
this.list.each(function (file)
|
|
|
|
{
|
2018-01-19 17:53:07 +00:00
|
|
|
if (file.state === CONST.FILE_POPULATED || (file.state === CONST.FILE_PENDING && this.inflight.size < this.maxParallelDownloads))
|
2016-11-30 17:16:45 +00:00
|
|
|
{
|
2017-10-04 22:48:16 +00:00
|
|
|
this.inflight.set(file);
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2017-10-04 22:48:16 +00:00
|
|
|
this.list.delete(file);
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2017-10-04 22:48:16 +00:00
|
|
|
this.loadFile(file);
|
2016-11-30 17:16:45 +00:00
|
|
|
}
|
|
|
|
|
2017-10-04 22:48:16 +00:00
|
|
|
if (this.inflight.size === this.maxParallelDownloads)
|
2016-11-30 17:16:45 +00:00
|
|
|
{
|
|
|
|
// Tells the Set iterator to abort
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-10-04 22:48:16 +00:00
|
|
|
}, this);
|
2016-11-30 17:16:45 +00:00
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#loadFile
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {Phaser.Loader.File} file - [description]
|
|
|
|
*/
|
2016-11-30 17:16:45 +00:00
|
|
|
loadFile: function (file)
|
|
|
|
{
|
|
|
|
// If the file doesn't have its own crossOrigin set,
|
|
|
|
// we'll use the Loaders (which is undefined by default)
|
|
|
|
if (!file.crossOrigin)
|
|
|
|
{
|
|
|
|
file.crossOrigin = this.crossOrigin;
|
|
|
|
}
|
|
|
|
|
2018-01-19 19:13:27 +00:00
|
|
|
file.load(this);
|
2016-11-30 17:16:45 +00:00
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#nextFile
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {Phaser.Loader.File} previousFile - [description]
|
|
|
|
* @param {boolean} success - [description]
|
|
|
|
*/
|
2016-11-30 17:16:45 +00:00
|
|
|
nextFile: function (previousFile, success)
|
|
|
|
{
|
|
|
|
// Move the file that just loaded from the inflight list to the queue or failed Set
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2018-01-19 16:28:59 +00:00
|
|
|
this.emit('load', previousFile);
|
2016-12-12 22:35:47 +00:00
|
|
|
this.queue.set(previousFile);
|
2016-11-30 17:16:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-01-19 16:28:59 +00:00
|
|
|
this.emit('loaderror', previousFile);
|
2016-12-12 22:35:47 +00:00
|
|
|
this.failed.set(previousFile);
|
2016-11-30 17:16:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
this.inflight.delete(previousFile);
|
|
|
|
|
2018-01-19 16:28:59 +00:00
|
|
|
this.updateProgress();
|
|
|
|
|
2016-11-30 17:16:45 +00:00
|
|
|
if (this.list.size > 0)
|
|
|
|
{
|
|
|
|
this.processLoadQueue();
|
|
|
|
}
|
|
|
|
else if (this.inflight.size === 0)
|
|
|
|
{
|
|
|
|
this.finishedLoading();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#finishedLoading
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2016-11-30 17:16:45 +00:00
|
|
|
finishedLoading: function ()
|
|
|
|
{
|
2018-01-19 16:28:59 +00:00
|
|
|
if (this.state === CONST.LOADER_PROCESSING)
|
2018-01-08 16:38:56 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-01-19 16:28:59 +00:00
|
|
|
this.progress = 1;
|
|
|
|
|
2017-07-14 13:30:20 +00:00
|
|
|
this.state = CONST.LOADER_PROCESSING;
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2016-12-08 16:21:16 +00:00
|
|
|
this.storage.clear();
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-01-19 17:28:48 +00:00
|
|
|
if (this.queue.size === 0)
|
2016-11-30 17:16:45 +00:00
|
|
|
{
|
2018-01-19 17:28:48 +00:00
|
|
|
// Everything failed, so nothing to process
|
|
|
|
this.processComplete();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
this.queue.each(function (file)
|
|
|
|
{
|
|
|
|
file.onProcess(this.processUpdate.bind(this));
|
|
|
|
}, this);
|
|
|
|
}
|
2016-12-07 00:27:56 +00:00
|
|
|
},
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* Called automatically by the File when it has finished processing.
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#processUpdate
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {Phaser.Loader.File} file - [description]
|
|
|
|
*/
|
2016-12-07 00:27:56 +00:00
|
|
|
processUpdate: function (file)
|
|
|
|
{
|
2016-12-07 04:43:02 +00:00
|
|
|
// This file has failed to load, so move it to the failed Set
|
2016-12-07 01:13:17 +00:00
|
|
|
if (file.state === CONST.FILE_ERRORED)
|
|
|
|
{
|
2016-12-12 22:35:47 +00:00
|
|
|
this.failed.set(file);
|
2016-12-07 04:43:02 +00:00
|
|
|
|
|
|
|
if (file.linkFile)
|
|
|
|
{
|
2018-04-27 17:44:12 +00:00
|
|
|
file.linkFile.onFileFailed(file);
|
2016-12-07 04:43:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return this.removeFromQueue(file);
|
2016-12-07 01:13:17 +00:00
|
|
|
}
|
2016-12-07 04:43:02 +00:00
|
|
|
|
|
|
|
// If we got here, then the file loaded
|
|
|
|
|
2018-04-27 17:44:12 +00:00
|
|
|
this.storage.set(file);
|
2016-12-08 16:21:16 +00:00
|
|
|
|
2018-04-27 17:44:12 +00:00
|
|
|
this.removeFromQueue(file);
|
2016-12-07 00:27:56 +00:00
|
|
|
},
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#removeFromQueue
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {Phaser.Loader.File} file - [description]
|
|
|
|
*/
|
2016-12-08 16:21:16 +00:00
|
|
|
removeFromQueue: function (file)
|
|
|
|
{
|
|
|
|
this.queue.delete(file);
|
|
|
|
|
2017-07-14 13:30:20 +00:00
|
|
|
if (this.queue.size === 0 && this.state === CONST.LOADER_PROCESSING)
|
2016-12-08 16:21:16 +00:00
|
|
|
{
|
|
|
|
// We've processed all the files we loaded
|
|
|
|
this.processComplete();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#processComplete
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2016-12-07 00:27:56 +00:00
|
|
|
processComplete: function ()
|
|
|
|
{
|
2016-11-30 17:16:45 +00:00
|
|
|
this.list.clear();
|
|
|
|
this.inflight.clear();
|
|
|
|
this.queue.clear();
|
|
|
|
|
2017-08-04 17:43:05 +00:00
|
|
|
this.processCallback();
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2017-07-14 13:30:20 +00:00
|
|
|
this.state = CONST.LOADER_COMPLETE;
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-01-12 17:09:09 +00:00
|
|
|
this.emit('complete', this, this.storage.size, this.failed.size);
|
2016-11-30 17:16:45 +00:00
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* The Loader has finished.
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#processCallback
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-08-04 17:43:05 +00:00
|
|
|
processCallback: function ()
|
|
|
|
{
|
|
|
|
if (this.storage.size === 0)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-04-28 11:32:03 +00:00
|
|
|
/*
|
2017-08-04 17:43:05 +00:00
|
|
|
// The global Texture Manager
|
|
|
|
var cache = this.scene.sys.cache;
|
|
|
|
var textures = this.scene.sys.textures;
|
|
|
|
|
|
|
|
// Process multiatlas groups first
|
|
|
|
|
|
|
|
var file;
|
|
|
|
var fileA;
|
|
|
|
var fileB;
|
|
|
|
|
|
|
|
for (var key in this._multilist)
|
|
|
|
{
|
|
|
|
var data = [];
|
|
|
|
var images = [];
|
|
|
|
var keys = this._multilist[key];
|
|
|
|
|
|
|
|
for (var i = 0; i < keys.length; i++)
|
|
|
|
{
|
|
|
|
file = this.storage.get('key', keys[i]);
|
|
|
|
|
|
|
|
if (file)
|
|
|
|
{
|
|
|
|
if (file.type === 'image')
|
|
|
|
{
|
|
|
|
images.push(file.data);
|
|
|
|
}
|
|
|
|
else if (file.type === 'json')
|
|
|
|
{
|
|
|
|
data.push(file.data);
|
|
|
|
}
|
|
|
|
|
|
|
|
this.storage.delete(file);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Do we have everything needed?
|
|
|
|
if (images.length + data.length === keys.length)
|
|
|
|
{
|
|
|
|
// Yup, add them to the Texture Manager
|
|
|
|
|
|
|
|
// Is the data JSON Hash or JSON Array?
|
2018-02-27 13:48:45 +00:00
|
|
|
if (Array.isArray(data[0].textures) || Array.isArray(data[0].frames))
|
2017-08-04 17:43:05 +00:00
|
|
|
{
|
|
|
|
textures.addAtlasJSONArray(key, images, data);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
textures.addAtlasJSONHash(key, images, data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-04-28 11:32:03 +00:00
|
|
|
*/
|
2017-08-04 17:43:05 +00:00
|
|
|
|
|
|
|
// Process all of the files
|
|
|
|
|
|
|
|
this.storage.each(function (file)
|
|
|
|
{
|
2018-04-28 17:09:44 +00:00
|
|
|
if (file.linkFile)
|
|
|
|
{
|
|
|
|
file.linkFile.addToCache();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
file.addToCache();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2017-08-04 17:43:05 +00:00
|
|
|
switch (file.type)
|
|
|
|
{
|
2018-01-29 23:38:27 +00:00
|
|
|
case 'dataimage':
|
|
|
|
|
|
|
|
fileA = file.fileA;
|
|
|
|
fileB = file.fileB;
|
|
|
|
|
|
|
|
if (fileA.linkParent)
|
|
|
|
{
|
|
|
|
textures.addImage(fileA.key, fileA.data, fileB.data);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
textures.addImage(fileB.key, fileB.data, fileA.data);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2017-11-30 17:09:11 +00:00
|
|
|
case 'audioSprite':
|
|
|
|
|
|
|
|
var files = [ file.fileA, file.fileB ];
|
|
|
|
|
|
|
|
files.forEach(function (file)
|
|
|
|
{
|
|
|
|
cache[file.type].add(file.key, file.data);
|
|
|
|
});
|
|
|
|
|
|
|
|
break;
|
2017-08-04 17:43:05 +00:00
|
|
|
}
|
2018-04-28 17:09:44 +00:00
|
|
|
*/
|
|
|
|
|
2017-08-04 17:43:05 +00:00
|
|
|
});
|
|
|
|
|
2018-04-27 17:44:12 +00:00
|
|
|
this.emit('processcomplete', this);
|
|
|
|
|
|
|
|
// Called 'destroy' on each file in storage
|
|
|
|
this.storage.iterateLocal('destroy');
|
2017-08-04 17:43:05 +00:00
|
|
|
|
|
|
|
this.storage.clear();
|
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#saveJSON
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
2018-03-20 16:15:49 +00:00
|
|
|
* @param {*} data - [description]
|
2018-03-19 00:54:19 +00:00
|
|
|
* @param {string} [filename=file.json] - [description]
|
2018-02-09 17:56:43 +00:00
|
|
|
*
|
2018-03-19 00:54:19 +00:00
|
|
|
* @return {Phaser.Loader.LoaderPlugin} This Loader plugin.
|
2018-02-09 17:56:43 +00:00
|
|
|
*/
|
2017-10-02 21:41:52 +00:00
|
|
|
saveJSON: function (data, filename)
|
|
|
|
{
|
|
|
|
return this.save(JSON.stringify(data), filename);
|
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#save
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
2018-03-20 16:15:49 +00:00
|
|
|
* @param {*} data - [description]
|
2018-03-19 00:54:19 +00:00
|
|
|
* @param {string} [filename=file.json] - [description]
|
|
|
|
* @param {string} [filetype=application/json] - [description]
|
2018-02-09 17:56:43 +00:00
|
|
|
*
|
|
|
|
* @return {Phaser.Loader.LoaderPlugin} This Loader plugin.
|
|
|
|
*/
|
2017-10-02 21:41:52 +00:00
|
|
|
save: function (data, filename, filetype)
|
|
|
|
{
|
|
|
|
if (filename === undefined) { filename = 'file.json'; }
|
|
|
|
if (filetype === undefined) { filetype = 'application/json'; }
|
|
|
|
|
2018-01-19 14:54:50 +00:00
|
|
|
var blob = new Blob([ data ], { type: filetype });
|
2017-10-02 21:41:52 +00:00
|
|
|
|
|
|
|
var url = URL.createObjectURL(blob);
|
|
|
|
|
|
|
|
var a = document.createElement('a');
|
|
|
|
|
|
|
|
a.download = filename;
|
|
|
|
a.textContent = 'Download ' + filename;
|
|
|
|
a.href = url;
|
|
|
|
a.click();
|
|
|
|
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#reset
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2016-11-30 17:16:45 +00:00
|
|
|
reset: function ()
|
|
|
|
{
|
|
|
|
this.list.clear();
|
|
|
|
this.inflight.clear();
|
|
|
|
this.failed.clear();
|
|
|
|
this.queue.clear();
|
|
|
|
this.storage.clear();
|
|
|
|
|
2018-01-19 17:07:38 +00:00
|
|
|
var gameConfig = this.systems.game.config;
|
|
|
|
var sceneConfig = this.systems.settings.loader;
|
|
|
|
|
2018-01-19 17:10:23 +00:00
|
|
|
this.setBaseURL(GetFastValue(sceneConfig, 'baseURL', gameConfig.loaderBaseURL));
|
2018-01-19 17:07:38 +00:00
|
|
|
this.setPath(GetFastValue(sceneConfig, 'path', gameConfig.loaderPath));
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2017-07-14 13:30:20 +00:00
|
|
|
this.state = CONST.LOADER_IDLE;
|
2016-11-30 17:16:45 +00:00
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
2018-04-28 11:32:03 +00:00
|
|
|
* Called by the Scene Manager if you specify a files payload for a pre-Scene Boot.
|
|
|
|
* Takes an array of file objects.
|
2018-02-09 17:56:43 +00:00
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#loadArray
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
2018-04-28 11:32:03 +00:00
|
|
|
* @param {LoaderFileObject[]} files - An array of files to load.
|
2018-02-09 17:56:43 +00:00
|
|
|
*
|
2018-04-28 11:32:03 +00:00
|
|
|
* @return {boolean} `true` if any files were successfully added to the list, otherwise `false`.
|
2018-02-09 17:56:43 +00:00
|
|
|
*/
|
2018-01-19 19:13:27 +00:00
|
|
|
loadArray: function (files)
|
|
|
|
{
|
|
|
|
if (Array.isArray(files))
|
|
|
|
{
|
|
|
|
for (var i = 0; i < files.length; i++)
|
|
|
|
{
|
2018-04-28 11:32:03 +00:00
|
|
|
var file = files[i];
|
|
|
|
|
|
|
|
// Calls file-type methods like `atlas` or `image`
|
|
|
|
this[file.type](file);
|
2018-01-19 19:13:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return (this.list.size > 0);
|
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
2018-04-13 16:12:17 +00:00
|
|
|
* The Scene that owns this plugin is shutting down.
|
|
|
|
* We need to kill and reset all internal properties as well as stop listening to Scene events.
|
2018-02-09 17:56:43 +00:00
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#shutdown
|
2018-04-13 16:12:17 +00:00
|
|
|
* @private
|
2018-02-09 17:56:43 +00:00
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-19 14:54:50 +00:00
|
|
|
shutdown: function ()
|
|
|
|
{
|
|
|
|
this.reset();
|
2018-04-13 16:12:17 +00:00
|
|
|
|
2018-01-19 14:54:50 +00:00
|
|
|
this.state = CONST.LOADER_SHUTDOWN;
|
2018-04-13 16:12:17 +00:00
|
|
|
|
2018-04-17 11:25:45 +00:00
|
|
|
this.systems.events.off('shutdown', this.shutdown, this);
|
2018-01-19 14:54:50 +00:00
|
|
|
},
|
|
|
|
|
2018-02-09 17:56:43 +00:00
|
|
|
/**
|
2018-04-13 16:12:17 +00:00
|
|
|
* The Scene that owns this plugin is being destroyed.
|
|
|
|
* We need to shutdown and then kill off all external references.
|
2018-02-09 17:56:43 +00:00
|
|
|
*
|
|
|
|
* @method Phaser.Loader.LoaderPlugin#destroy
|
2018-04-13 16:12:17 +00:00
|
|
|
* @private
|
2018-02-09 17:56:43 +00:00
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2016-11-30 17:16:45 +00:00
|
|
|
destroy: function ()
|
|
|
|
{
|
2018-04-13 16:12:17 +00:00
|
|
|
this.shutdown();
|
|
|
|
|
2017-07-14 13:30:20 +00:00
|
|
|
this.state = CONST.LOADER_DESTROYED;
|
2018-04-13 16:12:17 +00:00
|
|
|
|
2018-04-17 01:34:07 +00:00
|
|
|
this.systems.events.off('start', this.pluginStart, this);
|
2018-04-13 16:12:17 +00:00
|
|
|
|
|
|
|
this.list = null;
|
|
|
|
this.inflight = null;
|
|
|
|
this.failed = null;
|
|
|
|
this.queue = null;
|
|
|
|
this.storage = null;
|
|
|
|
|
|
|
|
this.scene = null;
|
|
|
|
this.systems = null;
|
2018-04-25 16:16:39 +00:00
|
|
|
this.textureManager = null;
|
|
|
|
this.cacheManager = null;
|
2016-11-30 17:16:45 +00:00
|
|
|
}
|
|
|
|
|
2017-07-03 15:05:22 +00:00
|
|
|
});
|
2016-11-30 17:16:45 +00:00
|
|
|
|
2018-01-19 14:54:50 +00:00
|
|
|
PluginManager.register('Loader', LoaderPlugin, 'load');
|
2018-01-19 14:47:16 +00:00
|
|
|
|
2018-01-19 14:54:50 +00:00
|
|
|
module.exports = LoaderPlugin;
|