@urso/core 0.4.52 → 0.5.1
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/package.json
CHANGED
package/src/js/config/main.js
CHANGED
|
@@ -2,6 +2,7 @@ let ConfigMain = {
|
|
|
2
2
|
title: 'Urso', //game title
|
|
3
3
|
appVersion: 0, //app version, also used as anticache "appVersion=${appVersion}" when not 0
|
|
4
4
|
mode: "development", // development/production/testing
|
|
5
|
+
defaultLogLevel: 'ERROR,WARNING,INFO,LOG', //setup custom log level with: ?logLevel=1,2,3,4 OR ?logLevel=ERROR,WARNING,INFO,LOG
|
|
5
6
|
extendingChain: ['Urso.Core'], //chain that will be set as Urso.Game
|
|
6
7
|
defaultScene: 'play', //default scene to display
|
|
7
8
|
useBinPath: false, // use assets from bin directory
|
package/src/js/lib/logger.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
//setup custom log level with: ?logLevel=1,2,3,4 OR ?logLevel=ERROR,WARNING,INFO,LOG
|
|
2
2
|
|
|
3
|
-
const DEFAULT_LOG_LEVEL = 'ERROR,WARNING,INFO,LOG'; //also can be 0,1,2,3
|
|
4
|
-
|
|
5
3
|
const LEVELS = [
|
|
6
4
|
'ERROR',
|
|
7
5
|
'WARNING',
|
|
@@ -52,7 +50,7 @@ class LibLogger {
|
|
|
52
50
|
* setup logging levels
|
|
53
51
|
*/
|
|
54
52
|
_setupLevels() {
|
|
55
|
-
const logLevelsString = Urso.helper.parseGetParams('logLevel') ||
|
|
53
|
+
const logLevelsString = Urso.helper.parseGetParams('logLevel') || Urso.config.defaultLogLevel;
|
|
56
54
|
const logLevelsArray = logLevelsString.split(',');
|
|
57
55
|
|
|
58
56
|
for (const [index, level] of Object.entries(LEVELS)) {
|
|
@@ -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
|
+
animation.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);
|
|
@@ -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
|
|