@urso/core 0.6.10 → 0.6.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/build/js/index.js +1 -1
- package/package.json +1 -1
- package/src/js/components/_info.js +1 -0
- package/src/js/modules/scenes/pixiWrapper.js +1 -1
- package/src/js/modules/statesManager/action.js +10 -2
- package/src/js/modules/template/service.js +1 -1
- package/src/js/components/editor/_info.js +0 -4
- package/src/js/components/editor/api.js +0 -72
- package/src/js/components/editor/controller.js +0 -13
package/package.json
CHANGED
|
@@ -42,7 +42,7 @@ class ModulesScenesPixiWrapper {
|
|
|
42
42
|
this._createWorld();
|
|
43
43
|
|
|
44
44
|
// setup interaction
|
|
45
|
-
this.interaction = new PIXI.InteractionManager(this.renderer);
|
|
45
|
+
this.interaction = Urso.helper.recursiveGet('plugins.interaction', this.renderer) || new PIXI.InteractionManager(this.renderer);
|
|
46
46
|
|
|
47
47
|
this._loaderScene = this.getInstance('Model');
|
|
48
48
|
this._requestAnimFrame(this._loop);
|
|
@@ -3,6 +3,7 @@ class ModulesStatesManagerAction {
|
|
|
3
3
|
constructor(name) {
|
|
4
4
|
this.name = name;
|
|
5
5
|
|
|
6
|
+
this._running = false;
|
|
6
7
|
this._terminating = false;
|
|
7
8
|
this.finished = false;
|
|
8
9
|
this._onFinishCallback = false;
|
|
@@ -12,10 +13,11 @@ class ModulesStatesManagerAction {
|
|
|
12
13
|
|
|
13
14
|
//can we start this action?
|
|
14
15
|
guard() {
|
|
15
|
-
return this.getInstance('Controller').checkActionGuard(this.name);
|
|
16
|
+
return !this._running && this.getInstance('Controller').checkActionGuard(this.name);
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
run(onFinishCallback) {
|
|
20
|
+
this._running = true;
|
|
19
21
|
log(`%c action run ---> ${this.name}`, 'color: blue');
|
|
20
22
|
|
|
21
23
|
this.emit(Urso.events.MODULES_STATES_MANAGER_ACTION_START, this.name);
|
|
@@ -31,6 +33,11 @@ class ModulesStatesManagerAction {
|
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
terminate() {
|
|
36
|
+
if (!this._running) {
|
|
37
|
+
Urso.logger.warn('ModulesStatesManagerAction: action run from terminating', this.name);
|
|
38
|
+
this.run(() => { });
|
|
39
|
+
}
|
|
40
|
+
|
|
34
41
|
if (this._terminating) {
|
|
35
42
|
Urso.logger.error('ModulesStatesManagerAction: action alredy terminating', this.name);
|
|
36
43
|
return;
|
|
@@ -47,11 +54,12 @@ class ModulesStatesManagerAction {
|
|
|
47
54
|
return;
|
|
48
55
|
}
|
|
49
56
|
|
|
57
|
+
this._running = false;
|
|
50
58
|
this._terminating = false;
|
|
51
59
|
this.finished = true;
|
|
52
60
|
|
|
53
61
|
this.emit(Urso.events.MODULES_STATES_MANAGER_ACTION_FINISH, this.name);
|
|
54
|
-
|
|
62
|
+
|
|
55
63
|
log(`%c action finish <--- ${this.name}`, 'color: blue');
|
|
56
64
|
this._onFinishCallback();
|
|
57
65
|
}
|
|
@@ -87,7 +87,7 @@ class ModulesTemplateService {
|
|
|
87
87
|
let componentInstance = Urso.getInstance(path, obj.options);
|
|
88
88
|
|
|
89
89
|
if (!componentInstance) {
|
|
90
|
-
Urso.logger.error(`ModulesTemplateController Component error. Component ${obj.componentName} not found. Please check components _info.js file.`);
|
|
90
|
+
Urso.logger.error(`ModulesTemplateController Component error. Component "${obj.componentName}" not found. Please check components _info.js file.`);
|
|
91
91
|
Urso.logger.error(`To use only templates use Groups please.`);
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
class ComponentsEditorApi {
|
|
2
|
-
|
|
3
|
-
constructor() {
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
//styles
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
//assets
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* returns types list and keys to create new asset
|
|
14
|
-
* @returns { types, keys }
|
|
15
|
-
*/
|
|
16
|
-
getAssetTypes() {
|
|
17
|
-
const types = Urso.types.assets;
|
|
18
|
-
return { types, keys: this._assetsKeys };
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* get current assets list
|
|
23
|
-
* @returns {Array} assets list
|
|
24
|
-
*/
|
|
25
|
-
getCurrentAssets() {
|
|
26
|
-
const template = Urso.template.get();
|
|
27
|
-
return template.assets;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* add new asset into game
|
|
32
|
-
* @param {String} type
|
|
33
|
-
* @param {Object} fields
|
|
34
|
-
*/
|
|
35
|
-
addAsset(type, fields) {
|
|
36
|
-
//return new asset system id
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
//objects
|
|
41
|
-
getCurrentObjects() {
|
|
42
|
-
return list;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
getObjectsTypes() {
|
|
46
|
-
return list; // with fields keys
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
addObject() {
|
|
50
|
-
//return id
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
//settings
|
|
54
|
-
editObject(id, key, value) {
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
//////////////// sys
|
|
59
|
-
|
|
60
|
-
_assetsKeys = {
|
|
61
|
-
ATLAS: ['key', 'path'], // path to json file
|
|
62
|
-
BITMAPFONT: ['key', 'path'], // path to json file
|
|
63
|
-
CONTAINER: ['name'],
|
|
64
|
-
FONT: ['key', 'path'],
|
|
65
|
-
IMAGE: ['key', 'path'],
|
|
66
|
-
JSON: ['key', 'path'],
|
|
67
|
-
SPINE: ['key', 'path'], // path to json file
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
module.exports = ComponentsEditorApi;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
ComponentsBaseController = require('./../base/controller.js');
|
|
2
|
-
|
|
3
|
-
class ComponentsEditorController extends ComponentsBaseController {
|
|
4
|
-
constructor(params) {
|
|
5
|
-
super(params);
|
|
6
|
-
|
|
7
|
-
this._api = this.getInstance('Api');
|
|
8
|
-
window.api = this._api;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
module.exports = ComponentsEditorController;
|