Skip to content

Commit 6d63c1b

Browse files
author
Matt Colman
committed
compile libs
1 parent dc9bc31 commit 6d63c1b

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

Diff for: lib/AssetLoader.js

+16-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ var _createClass = function () { function defineProperties(target, props) { for
88

99
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
1010

11-
var _phaser = require('phaser');
11+
var _isString = require('lodash/isString');
12+
13+
var _isString2 = _interopRequireDefault(_isString);
14+
15+
var _isObject = require('lodash/isObject');
16+
17+
var _isObject2 = _interopRequireDefault(_isObject);
18+
19+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1220

1321
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1422

@@ -20,8 +28,8 @@ function warn(type, key) {
2028
console.warn('phaser-manifest-loader: could not find ' + type + ' with key : ' + key);
2129
}
2230

23-
var AssetLoader = function (_Plugin) {
24-
_inherits(AssetLoader, _Plugin);
31+
var AssetLoader = function (_Phaser$Plugin) {
32+
_inherits(AssetLoader, _Phaser$Plugin);
2533

2634
function AssetLoader() {
2735
_classCallCheck(this, AssetLoader);
@@ -98,18 +106,18 @@ var AssetLoader = function (_Plugin) {
98106
key: 'loadSpriteSheet',
99107
value: function loadSpriteSheet(key, assetPostfix) {
100108
var imageUrl = void 0,
101-
jsonUrl = void 0;
109+
json = void 0;
102110
try {
103111
imageUrl = this.req('./spritesheets/' + key + assetPostfix + '.png');
104112
} catch (e) {}
105113

106114
try {
107-
jsonUrl = this.req('./spritesheets/' + key + assetPostfix + '.json');
115+
json = this.req('./spritesheets/' + key + assetPostfix + '.json');
108116
} catch (e) {}
109117

110118
if (!imageUrl) warn('spriteSheet image', key);
111-
if (!jsonUrl) warn('spriteSheet json', key);
112-
this.game.load.atlasJSONArray(key, imageUrl, jsonUrl);
119+
if (!json) warn('spriteSheet json', key);
120+
this.game.load.atlasJSONArray(key, imageUrl, (0, _isString2.default)(json) && json, (0, _isObject2.default)(json) && json);
113121
}
114122
}, {
115123
key: 'loadImage',
@@ -149,6 +157,6 @@ var AssetLoader = function (_Plugin) {
149157
}]);
150158

151159
return AssetLoader;
152-
}(_phaser.Plugin);
160+
}(Phaser.Plugin);
153161

154162
exports.default = AssetLoader;

Diff for: lib/ManifestLoader.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
66

77
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
88

9-
var _phaser = require('phaser');
10-
119
var _webfontloader = require('webfontloader');
1210

1311
var _webfontloader2 = _interopRequireDefault(_webfontloader);
@@ -24,8 +22,8 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
2422

2523
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
2624

27-
var ManifestLoader = function (_Plugin) {
28-
_inherits(ManifestLoader, _Plugin);
25+
var ManifestLoader = function (_Phaser$Plugin) {
26+
_inherits(ManifestLoader, _Phaser$Plugin);
2927

3028
function ManifestLoader() {
3129
_classCallCheck(this, ManifestLoader);
@@ -81,6 +79,6 @@ var ManifestLoader = function (_Plugin) {
8179
}]);
8280

8381
return ManifestLoader;
84-
}(_phaser.Plugin);
82+
}(Phaser.Plugin);
8583

8684
exports.default = ManifestLoader;

0 commit comments

Comments
 (0)