@urso/core 0.4.53 → 0.5.2
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/build/js/index.js +1 -1
- package/package.json +1 -1
- package/src/js/modules/objects/_info.js +1 -1
- package/src/js/modules/objects/controller.js +9 -9
- package/src/js/modules/objects/models/spine.js +6 -1
- package/src/js/modules/objects/{create.js → service.js} +2 -2
- package/src/js/modules/observer/events.js +1 -0
- package/src/js/modules/scenes/service.js +4 -1
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@ Urso.Core.Modules.Objects = {
|
|
|
2
2
|
BaseModel: require('./baseModel.js'),
|
|
3
3
|
Cache: require('./cache.js'),
|
|
4
4
|
Controller: require('./controller.js'),
|
|
5
|
-
Create: require('./create.js'),
|
|
6
5
|
Find: require('./find.js'),
|
|
7
6
|
Proxy: require('./proxy.js'),
|
|
7
|
+
Service: require('./service.js'),
|
|
8
8
|
Styles: require('./styles.js'),
|
|
9
9
|
PropertyAdapter: require('./propertyAdapter.js')
|
|
10
10
|
};
|
|
@@ -35,7 +35,7 @@ class ModulesObjectsController {
|
|
|
35
35
|
return Urso.scenes.addObject(object, parent, doNotRefreshStylesFlag);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
return this.getInstance('
|
|
38
|
+
return this.getInstance('Service').add(object, parent);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
find(selector) {
|
|
@@ -85,19 +85,19 @@ class ModulesObjectsController {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
getWorld() {
|
|
88
|
-
return this.getInstance('
|
|
88
|
+
return this.getInstance('Service').getWorld();
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
addChild(parent, child, doNotRefreshStylesFlag) {
|
|
92
|
-
this.getInstance('
|
|
92
|
+
this.getInstance('Service').addChild(parent, child, doNotRefreshStylesFlag);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
removeChild(parent, child, doNotRefreshStylesFlag) {
|
|
96
|
-
this.getInstance('
|
|
96
|
+
this.getInstance('Service').removeChild(parent, child, doNotRefreshStylesFlag);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
destroy(object, doNotRefreshStylesFlag) {
|
|
100
|
-
this.getInstance('
|
|
100
|
+
this.getInstance('Service').destroy(object, doNotRefreshStylesFlag);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
//do not use outside engine
|
|
@@ -106,19 +106,19 @@ class ModulesObjectsController {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
_updateCommonProperties(object) {
|
|
109
|
-
this.getInstance('
|
|
109
|
+
this.getInstance('Service')._updateCommonProperties(object);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
_newResolutionHandler(params) {
|
|
113
|
-
this.getInstance('
|
|
113
|
+
this.getInstance('Service').updateWorldBounds(params);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
_resetWorld() {
|
|
117
|
-
this.getInstance('
|
|
117
|
+
this.getInstance('Service').resetWorld();
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
_applyClassesToWorld() {
|
|
121
|
-
this.getInstance('
|
|
121
|
+
this.getInstance('Service').applyClassesToWorld();
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
_subscribeOnce() {
|
|
@@ -207,7 +207,6 @@ class ModulesObjectsModelsSpine extends Urso.Core.Modules.Objects.BaseModel {
|
|
|
207
207
|
return this._baseObject.spineData.findAnimation(name)
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
|
|
211
210
|
/**
|
|
212
211
|
* returns event from spineData by it's name
|
|
213
212
|
* @param {string} name
|
|
@@ -236,8 +235,14 @@ class ModulesObjectsModelsSpine extends Urso.Core.Modules.Objects.BaseModel {
|
|
|
236
235
|
|
|
237
236
|
if (this.animation.name)
|
|
238
237
|
this.play(this.animation.name, this.animation.loop);
|
|
238
|
+
|
|
239
|
+
this._baseObject.state.addListener({ event: this._eventHandler.bind(this) });
|
|
239
240
|
};
|
|
240
241
|
|
|
242
|
+
_eventHandler(entry, event) {
|
|
243
|
+
this.emit(Urso.events.MODULES_OBJECTS_SPINE_EVENT, { eventName: event.data.name, name: this.name, class: this.class });
|
|
244
|
+
}
|
|
245
|
+
|
|
241
246
|
_addToSlot(slotName, object, replaceSlotContents) {
|
|
242
247
|
const spine = this._baseObject;
|
|
243
248
|
const slotIndex = spine.spineData.slots.findIndex(({ name }) => name === slotName);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class ModulesObjectsService {
|
|
2
2
|
constructor() {
|
|
3
3
|
this.singleton = true;
|
|
4
4
|
|
|
@@ -237,4 +237,4 @@ class ModulesObjectsCreate {
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
module.exports =
|
|
240
|
+
module.exports = ModulesObjectsService;
|
|
@@ -15,6 +15,7 @@ class ModulesObserverConfig {
|
|
|
15
15
|
MODULES_OBJECTS_HIT_AREA_PRESS: 'modules.objects.hitArea.press',
|
|
16
16
|
MODULES_OBJECTS_SLIDER_HANDLE_MOVE: 'modules.objects.slider.handleMove',
|
|
17
17
|
MODULES_OBJECTS_SLIDER_HANDLE_DROP: 'modules.objects.slider.handleDrop',
|
|
18
|
+
MODULES_OBJECTS_SPINE_EVENT: 'modules.objects.spine.event',
|
|
18
19
|
MODULES_OBJECTS_TOGGLE_PRESS: 'modules.objects.toggle.press',
|
|
19
20
|
MODULES_OBJECTS_TEXTINPUT_BLUR: 'modules.objects.textinput.blur',
|
|
20
21
|
MODULES_OBJECTS_TEXTINPUT_INPUT: 'modules.objects.textinput.input',
|
|
@@ -131,8 +131,11 @@ class ModulesScenesService {
|
|
|
131
131
|
//call all components create
|
|
132
132
|
this._sceneModel.create();
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
//reset display flag
|
|
135
135
|
this._displayInProgress = false;
|
|
136
|
+
|
|
137
|
+
//emit end of display event
|
|
138
|
+
this.emit(Urso.events.MODULES_SCENES_DISPLAY_FINISHED);
|
|
136
139
|
}
|
|
137
140
|
}
|
|
138
141
|
|