@urso/core 0.4.11 → 0.4.15

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urso/core",
3
- "version": "0.4.11",
3
+ "version": "0.4.15",
4
4
  "description": "HTML5 game engine",
5
5
  "main": "build/js/index.js",
6
6
  "author": "Megbrimef",
@@ -31,6 +31,7 @@ class ModulesObjectsModelsButton extends Urso.Core.Modules.Objects.BaseModel {
31
31
  this.keyDownAction = Urso.helper.recursiveGet('keyDownAction', params, false);
32
32
  this.mouseOverAction = Urso.helper.recursiveGet('mouseOverAction', params, false);
33
33
  this.mouseOutAction = Urso.helper.recursiveGet('mouseOutAction', params, false);
34
+ this.noActionOnMouseOut = Urso.helper.recursiveGet('noActionOnMouseOut', params, Urso.device.desktop ? true : false);
34
35
 
35
36
  this.buttonFrames = {
36
37
  over: Urso.helper.recursiveGet('buttonFrames.over', params, false),
@@ -48,9 +49,9 @@ class ModulesObjectsModelsButton extends Urso.Core.Modules.Objects.BaseModel {
48
49
 
49
50
  if (this._isOver)
50
51
  this._changeTexture('over');
51
- else if(this._isDown)
52
+ else if (this._isDown)
52
53
  this._changeTexture('pressed');
53
- else if(this._isDisabled)
54
+ else if (this._isDisabled)
54
55
  this._changeTexture('disabled');
55
56
  else
56
57
  this._changeTexture('out');
@@ -66,6 +67,7 @@ class ModulesObjectsModelsButton extends Urso.Core.Modules.Objects.BaseModel {
66
67
  this._changeTexture('out');
67
68
 
68
69
  this._isDisabled = false;
70
+ this._baseObject.buttonMode = true;
69
71
  }
70
72
 
71
73
  disable() {
@@ -74,6 +76,7 @@ class ModulesObjectsModelsButton extends Urso.Core.Modules.Objects.BaseModel {
74
76
 
75
77
  this._changeTexture('disabled');
76
78
  this._isDisabled = true;
79
+ this._baseObject.buttonMode = false;
77
80
  }
78
81
 
79
82
  _addBaseObject() {
@@ -121,8 +124,10 @@ class ModulesObjectsModelsButton extends Urso.Core.Modules.Objects.BaseModel {
121
124
 
122
125
  this._isDown = false;
123
126
 
124
- if (this.action)
125
- this.action();
127
+ if (this.action) {
128
+ if (!this.noActionOnMouseOut || this._isOver) //if noActionOnMouseOut && mouse is out of button -> do nothing
129
+ this.action();
130
+ }
126
131
 
127
132
  if (this._isDisabled) //can be disabled after action
128
133
  return false;
@@ -15,7 +15,7 @@ class ModulesObjectsModelsTextInput extends Urso.Core.Modules.Objects.BaseModel
15
15
  this.box = Urso.helper.recursiveGet('box', params, false);
16
16
  this.numbersOnly = Urso.helper.recursiveGet('numbersOnly', params, false);
17
17
  this.allowedSymbols = Urso.helper.recursiveGet('allowedSymbols', params, false);
18
- this.substituteText = Urso.helper.recursiveGet('substituteText', params, false);
18
+ //this.substituteText = Urso.helper.recursiveGet('substituteText', params, false); //todo remove this string
19
19
  this.maxLength = Urso.helper.recursiveGet('maxLength', params, false);
20
20
  }
21
21
 
@@ -53,7 +53,7 @@ class ModulesObjectsModelsTextInput extends Urso.Core.Modules.Objects.BaseModel
53
53
 
54
54
  _addBaseObject() {
55
55
  this._baseObject = new PIXI.TextInput({ input: this.input, box: this.box });
56
- this._baseObject.substituteText = this.substituteText;
56
+ //this._baseObject.substituteText = this.substituteText; //todo remove this string
57
57
 
58
58
  if(this.maxLength)
59
59
  this._baseObject.maxLength = this.maxLength
@@ -56,6 +56,7 @@ class ModulesObjectsModelsToggle extends UrsoCoreModulesObjectsModelsButton {
56
56
  this._changeTexture(`${this.status}Out`);
57
57
 
58
58
  this._isDisabled = false;
59
+ this._baseObject.buttonMode = true;
59
60
  }
60
61
 
61
62
  disable() {
@@ -64,6 +65,7 @@ class ModulesObjectsModelsToggle extends UrsoCoreModulesObjectsModelsButton {
64
65
 
65
66
  this._changeTexture(`${this.status}Disabled`);
66
67
  this._isDisabled = true;
68
+ this._baseObject.buttonMode = false;
67
69
  }
68
70
 
69
71
  _addBaseObject() {