@vived/app 4.9.0 → 4.9.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/lib/Components/HoverLabel/Controllers/HoverLabelMouse.d.ts +2 -2
- package/lib/Components/HoverLabel/Controllers/HoverLabelMouse.js +5 -5
- package/lib/Components/HoverLabel/Controllers/HoverLabelTouch.d.ts +2 -2
- package/lib/Components/HoverLabel/Controllers/HoverLabelTouch.js +5 -5
- package/lib/Components/HoverLabel/Entities/HoverLabel.d.ts +4 -24
- package/lib/Components/HoverLabel/Entities/HoverLabel.js +6 -24
- package/lib/Components/HoverLabel/PM/AllowHoverLabelPM.d.ts +2 -2
- package/lib/Components/HoverLabel/PM/AllowHoverLabelPM.js +12 -13
- package/lib/Components/HoverLabel/PM/HoverLabelPM.d.ts +2 -2
- package/lib/Components/HoverLabel/PM/HoverLabelPM.js +15 -16
- package/lib/Components/HoverLabel/UseCases/SerializeAllowHoverLabel.d.ts +1 -0
- package/lib/Components/HoverLabel/UseCases/SerializeAllowHoverLabel.js +11 -9
- package/lib/Components/HoverLabel/UseCases/ToggleAllowHoverLabel.d.ts +1 -7
- package/lib/Components/HoverLabel/UseCases/ToggleAllowHoverLabel.js +5 -5
- package/lib/Components/HoverLabel/UseCases/TryShowHoverLabel.d.ts +1 -7
- package/lib/Components/HoverLabel/UseCases/TryShowHoverLabel.js +8 -8
- package/package.json +1 -1
|
@@ -5,11 +5,11 @@ export declare abstract class HoverLabelMouse extends AppObjectController implem
|
|
|
5
5
|
pressed: boolean;
|
|
6
6
|
abstract onMove: (e: MouseInputEvent) => void;
|
|
7
7
|
}
|
|
8
|
-
export declare function makeHoverLabelMouse(appObject: AppObject):
|
|
8
|
+
export declare function makeHoverLabelMouse(appObject: AppObject): HoverLabelMouse;
|
|
9
9
|
export declare class HoverLabelMouseImp extends HoverLabelMouse {
|
|
10
10
|
readonly hoverLabelDelay = 500;
|
|
11
11
|
private currentTimeout;
|
|
12
|
-
private
|
|
12
|
+
private hoverLabelEntity?;
|
|
13
13
|
private tryShowHoverLabel?;
|
|
14
14
|
allow: (e: MouseInputEvent) => boolean;
|
|
15
15
|
onMove: (e: MouseInputEvent) => void;
|
|
@@ -27,11 +27,11 @@ class HoverLabelMouseImp extends HoverLabelMouse {
|
|
|
27
27
|
this.onMove = (e) => {
|
|
28
28
|
if (!this.allow(e))
|
|
29
29
|
return;
|
|
30
|
-
if (!this.
|
|
30
|
+
if (!this.hoverLabelEntity)
|
|
31
31
|
return;
|
|
32
32
|
if (!this.tryShowHoverLabel)
|
|
33
33
|
return;
|
|
34
|
-
this.
|
|
34
|
+
this.hoverLabelEntity.hideHoverLabel();
|
|
35
35
|
if (this.currentTimeout) {
|
|
36
36
|
clearTimeout(this.currentTimeout);
|
|
37
37
|
}
|
|
@@ -41,9 +41,9 @@ class HoverLabelMouseImp extends HoverLabelMouse {
|
|
|
41
41
|
this.currentTimeout = undefined;
|
|
42
42
|
}, this.hoverLabelDelay);
|
|
43
43
|
};
|
|
44
|
-
this.
|
|
45
|
-
if (!this.
|
|
46
|
-
this.warn("
|
|
44
|
+
this.hoverLabelEntity = this.appObject.getComponent(HoverLabel_1.HoverLabelEntity.type);
|
|
45
|
+
if (!this.hoverLabelEntity) {
|
|
46
|
+
this.warn("Serializer has been added to an App Object that does not have a HoverLabelEntity. Add the Entity first");
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
this.tryShowHoverLabel = TryShowHoverLabel_1.TryShowHoverLabel.get(this.appObjects);
|
|
@@ -6,13 +6,13 @@ export declare abstract class HoverLabelTouch extends AppObjectController implem
|
|
|
6
6
|
abstract onTouchMove(e: TouchInputEvent): void;
|
|
7
7
|
abstract onTouchEnd(e: TouchInputEvent): void;
|
|
8
8
|
}
|
|
9
|
-
export declare function makeHoverLabelTouch(appObject: AppObject):
|
|
9
|
+
export declare function makeHoverLabelTouch(appObject: AppObject): HoverLabelTouch;
|
|
10
10
|
export declare class HoverLabelTouchImp extends HoverLabelTouch {
|
|
11
11
|
readonly touchLabelDragThreshold = 15;
|
|
12
12
|
private lastPosition;
|
|
13
13
|
private startPosition;
|
|
14
14
|
private touchStarted;
|
|
15
|
-
private
|
|
15
|
+
private hoverLabelEntity?;
|
|
16
16
|
private tryShowHoverLabel?;
|
|
17
17
|
allow: (e: TouchInputEvent) => boolean;
|
|
18
18
|
onTouchStart: (e: TouchInputEvent) => void;
|
|
@@ -27,9 +27,9 @@ class HoverLabelTouchImp extends HoverLabelTouch {
|
|
|
27
27
|
this.onTouchStart = (e) => {
|
|
28
28
|
if (!this.allow(e))
|
|
29
29
|
return;
|
|
30
|
-
if (!this.
|
|
30
|
+
if (!this.hoverLabelEntity)
|
|
31
31
|
return;
|
|
32
|
-
this.
|
|
32
|
+
this.hoverLabelEntity.hideHoverLabel();
|
|
33
33
|
this.touchStarted = false;
|
|
34
34
|
if (e.touchCount !== 1)
|
|
35
35
|
return;
|
|
@@ -56,9 +56,9 @@ class HoverLabelTouchImp extends HoverLabelTouch {
|
|
|
56
56
|
this.tryShowHoverLabel.tryShowHoverLabel(this.lastPosition);
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
this.
|
|
60
|
-
if (!this.
|
|
61
|
-
this.warn("
|
|
59
|
+
this.hoverLabelEntity = this.appObject.getComponent(HoverLabel_1.HoverLabelEntity.type);
|
|
60
|
+
if (!this.hoverLabelEntity) {
|
|
61
|
+
this.warn("Serializer has been added to an App Object that does not have a HoverLabelEntity. Add the Entity first");
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
this.tryShowHoverLabel = TryShowHoverLabel_1.TryShowHoverLabel.get(this.appObjects);
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { AppObject, AppObjectEntity
|
|
1
|
+
import { AppObject, AppObjectEntity } from "../../../AppObject";
|
|
2
2
|
import { Vector2 } from "../../../ValueObjects";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
static readonly type = "HoverLabel";
|
|
6
|
-
abstract readonly transform?: Transform3D;
|
|
3
|
+
export declare abstract class HoverLabelEntity extends AppObjectEntity {
|
|
4
|
+
static readonly type = "HoverLabelEntity";
|
|
7
5
|
abstract get show(): boolean;
|
|
8
6
|
abstract get position(): Vector2;
|
|
9
7
|
abstract get label(): string;
|
|
@@ -11,23 +9,5 @@ export declare abstract class HoverLabel extends AppObjectEntity {
|
|
|
11
9
|
abstract set allowHoverLabel(allow: boolean);
|
|
12
10
|
abstract showHoverLabel: (label: string, position: Vector2) => void;
|
|
13
11
|
abstract hideHoverLabel: () => void;
|
|
14
|
-
static get(appObj: AppObject): HoverLabel | undefined;
|
|
15
|
-
static getFromRepo(appObjects: AppObjectRepo): HoverLabel | undefined;
|
|
16
12
|
}
|
|
17
|
-
export declare function makeHoverLabel(appObject: AppObject):
|
|
18
|
-
declare class HoverLabelImp extends HoverLabel {
|
|
19
|
-
readonly transform?: Transform3D;
|
|
20
|
-
constructor(appObject: AppObject);
|
|
21
|
-
private _position;
|
|
22
|
-
get position(): Vector2;
|
|
23
|
-
private _show;
|
|
24
|
-
get show(): boolean;
|
|
25
|
-
private _label;
|
|
26
|
-
get label(): string;
|
|
27
|
-
private memoizedAllow;
|
|
28
|
-
get allowHoverLabel(): boolean;
|
|
29
|
-
set allowHoverLabel(allow: boolean);
|
|
30
|
-
showHoverLabel: (label: string, position: Vector2) => void;
|
|
31
|
-
hideHoverLabel: () => void;
|
|
32
|
-
}
|
|
33
|
-
export {};
|
|
13
|
+
export declare function makeHoverLabel(appObject: AppObject): HoverLabelEntity;
|
|
@@ -1,36 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeHoverLabel = exports.
|
|
3
|
+
exports.makeHoverLabel = exports.HoverLabelEntity = void 0;
|
|
4
4
|
const AppObject_1 = require("../../../AppObject");
|
|
5
5
|
const Entities_1 = require("../../../Entities");
|
|
6
6
|
const ValueObjects_1 = require("../../../ValueObjects");
|
|
7
7
|
const Transform3D_1 = require("../../Transform3D");
|
|
8
|
-
class
|
|
9
|
-
static get(appObj) {
|
|
10
|
-
return appObj.getComponent(this.type);
|
|
11
|
-
}
|
|
12
|
-
static getFromRepo(appObjects) {
|
|
13
|
-
const ucs = appObjects.getAllComponents(HoverLabel.type);
|
|
14
|
-
if (ucs.length === 0) {
|
|
15
|
-
console.warn("Unable to find a HoverLabel. Add one on Mount");
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
else if (ucs.length > 1) {
|
|
19
|
-
console.warn("Multiple HoverLabels have been found. There should only be one. Using the first one");
|
|
20
|
-
}
|
|
21
|
-
return ucs[0];
|
|
22
|
-
}
|
|
8
|
+
class HoverLabelEntity extends AppObject_1.AppObjectEntity {
|
|
23
9
|
}
|
|
24
|
-
exports.
|
|
25
|
-
|
|
10
|
+
exports.HoverLabelEntity = HoverLabelEntity;
|
|
11
|
+
HoverLabelEntity.type = "HoverLabelEntity";
|
|
26
12
|
function makeHoverLabel(appObject) {
|
|
27
13
|
Transform3D_1.Transform3D.addIfMissing(appObject);
|
|
28
14
|
return new HoverLabelImp(appObject);
|
|
29
15
|
}
|
|
30
16
|
exports.makeHoverLabel = makeHoverLabel;
|
|
31
|
-
class HoverLabelImp extends
|
|
17
|
+
class HoverLabelImp extends HoverLabelEntity {
|
|
32
18
|
constructor(appObject) {
|
|
33
|
-
super(appObject,
|
|
19
|
+
super(appObject, HoverLabelEntity.type);
|
|
34
20
|
this._position = ValueObjects_1.Vector2.Zero();
|
|
35
21
|
this._show = false;
|
|
36
22
|
this._label = "";
|
|
@@ -57,10 +43,6 @@ class HoverLabelImp extends HoverLabel {
|
|
|
57
43
|
this._position = ValueObjects_1.Vector2.Zero();
|
|
58
44
|
this.notifyOnChange();
|
|
59
45
|
};
|
|
60
|
-
this.transform = Transform3D_1.Transform3D.get(appObject);
|
|
61
|
-
if (!this.transform) {
|
|
62
|
-
throw Error("HoverLabel does not have a transform component");
|
|
63
|
-
}
|
|
64
46
|
}
|
|
65
47
|
get position() {
|
|
66
48
|
return this._position;
|
|
@@ -2,9 +2,9 @@ import { AppObject, AppObjectPM } from "../../../AppObject";
|
|
|
2
2
|
export declare class AllowHoverLabelPM extends AppObjectPM<boolean> {
|
|
3
3
|
static readonly type = "AllowHoverLabelPM";
|
|
4
4
|
static addIfMissing(appObj: AppObject): AllowHoverLabelPM;
|
|
5
|
-
private
|
|
5
|
+
private hoverLabelEntity?;
|
|
6
6
|
vmsAreEqual(a: boolean, b: boolean): boolean;
|
|
7
|
-
|
|
7
|
+
onEntityChange: () => void;
|
|
8
8
|
dispose: () => void;
|
|
9
9
|
constructor(appObject: AppObject);
|
|
10
10
|
}
|
|
@@ -6,26 +6,25 @@ const HoverLabel_1 = require("../Entities/HoverLabel");
|
|
|
6
6
|
class AllowHoverLabelPM extends AppObject_1.AppObjectPM {
|
|
7
7
|
constructor(appObject) {
|
|
8
8
|
super(appObject, AllowHoverLabelPM.type);
|
|
9
|
-
this.
|
|
10
|
-
if (!this.
|
|
9
|
+
this.onEntityChange = () => {
|
|
10
|
+
if (!this.hoverLabelEntity)
|
|
11
11
|
return;
|
|
12
|
-
this.doUpdateView(this.
|
|
12
|
+
this.doUpdateView(this.hoverLabelEntity.allowHoverLabel);
|
|
13
13
|
};
|
|
14
14
|
this.dispose = () => {
|
|
15
15
|
var _a, _b;
|
|
16
16
|
super.dispose();
|
|
17
|
-
(_a = this.
|
|
18
|
-
(_b = this.
|
|
17
|
+
(_a = this.hoverLabelEntity) === null || _a === void 0 ? void 0 : _a.removeChangeObserver(this.onEntityChange);
|
|
18
|
+
(_b = this.hoverLabelEntity) === null || _b === void 0 ? void 0 : _b.removeOnDisposeObserver(this.dispose);
|
|
19
19
|
};
|
|
20
|
-
this.
|
|
21
|
-
if (this.
|
|
22
|
-
this.
|
|
23
|
-
|
|
24
|
-
this.onEnityChange();
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
this.warn("App Object does not have a HoverLabel Entity");
|
|
20
|
+
this.hoverLabelEntity = this.appObject.getComponent(HoverLabel_1.HoverLabelEntity.type);
|
|
21
|
+
if (!this.hoverLabelEntity) {
|
|
22
|
+
this.warn("Serializer has been added to an App Object that does not have a HoverLabelEntity. Add the Entity first");
|
|
23
|
+
return;
|
|
28
24
|
}
|
|
25
|
+
this.hoverLabelEntity.addChangeObserver(this.onEntityChange);
|
|
26
|
+
this.hoverLabelEntity.addOnDisposeObserver(() => this.dispose());
|
|
27
|
+
this.onEntityChange();
|
|
29
28
|
}
|
|
30
29
|
static addIfMissing(appObj) {
|
|
31
30
|
const existing = appObj.getComponent(AllowHoverLabelPM.type);
|
|
@@ -10,9 +10,9 @@ export interface HoverLabelVM {
|
|
|
10
10
|
export declare class HoverLabelPM extends AppObjectPM<HoverLabelVM> {
|
|
11
11
|
static readonly type = "HoverLabelPM";
|
|
12
12
|
static addIfMissing(appObj: AppObject): HoverLabelPM;
|
|
13
|
-
private
|
|
13
|
+
private hoverLabelEntity?;
|
|
14
14
|
vmsAreEqual(a: HoverLabelVM, b: HoverLabelVM): boolean;
|
|
15
|
-
|
|
15
|
+
onEntityChange: () => void;
|
|
16
16
|
dispose: () => void;
|
|
17
17
|
constructor(appObject: AppObject);
|
|
18
18
|
}
|
|
@@ -6,37 +6,36 @@ const HoverLabel_1 = require("../Entities/HoverLabel");
|
|
|
6
6
|
class HoverLabelPM extends AppObject_1.AppObjectPM {
|
|
7
7
|
constructor(appObject) {
|
|
8
8
|
super(appObject, HoverLabelPM.type);
|
|
9
|
-
this.
|
|
10
|
-
if (!this.
|
|
9
|
+
this.onEntityChange = () => {
|
|
10
|
+
if (!this.hoverLabelEntity)
|
|
11
11
|
return;
|
|
12
12
|
const vm = {
|
|
13
13
|
show: false,
|
|
14
14
|
text: "",
|
|
15
15
|
position: { x: 0, y: 0 },
|
|
16
16
|
};
|
|
17
|
-
if (this.
|
|
17
|
+
if (this.hoverLabelEntity.show) {
|
|
18
18
|
vm.show = true;
|
|
19
|
-
vm.text = this.
|
|
20
|
-
vm.position.x = this.
|
|
21
|
-
vm.position.y = this.
|
|
19
|
+
vm.text = this.hoverLabelEntity.label;
|
|
20
|
+
vm.position.x = this.hoverLabelEntity.position.x;
|
|
21
|
+
vm.position.y = this.hoverLabelEntity.position.y;
|
|
22
22
|
}
|
|
23
23
|
this.doUpdateView(vm);
|
|
24
24
|
};
|
|
25
25
|
this.dispose = () => {
|
|
26
26
|
var _a, _b;
|
|
27
27
|
super.dispose();
|
|
28
|
-
(_a = this.
|
|
29
|
-
(_b = this.
|
|
28
|
+
(_a = this.hoverLabelEntity) === null || _a === void 0 ? void 0 : _a.removeChangeObserver(this.onEntityChange);
|
|
29
|
+
(_b = this.hoverLabelEntity) === null || _b === void 0 ? void 0 : _b.removeOnDisposeObserver(this.dispose);
|
|
30
30
|
};
|
|
31
|
-
this.
|
|
32
|
-
if (this.
|
|
33
|
-
this.
|
|
34
|
-
|
|
35
|
-
this.onEnityChange();
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
this.warn("App Object does not have a HoverLabel Entity");
|
|
31
|
+
this.hoverLabelEntity = this.appObject.getComponent(HoverLabel_1.HoverLabelEntity.type);
|
|
32
|
+
if (!this.hoverLabelEntity) {
|
|
33
|
+
this.warn("Serializer has been added to an App Object that does not have a HoverLabelEntity. Add the Entity first");
|
|
34
|
+
return;
|
|
39
35
|
}
|
|
36
|
+
this.hoverLabelEntity.addChangeObserver(this.onEntityChange);
|
|
37
|
+
this.hoverLabelEntity.addOnDisposeObserver(() => this.dispose());
|
|
38
|
+
this.onEntityChange();
|
|
40
39
|
}
|
|
41
40
|
static addIfMissing(appObj) {
|
|
42
41
|
const existing = appObj.getComponent(HoverLabelPM.type);
|
|
@@ -2,6 +2,7 @@ import { AppObject, AppObjectUC } from "../../../AppObject";
|
|
|
2
2
|
import { SerializedSystem } from "../../StateMachine";
|
|
3
3
|
export declare class SerializeAllowHoverLabel extends AppObjectUC implements SerializedSystem {
|
|
4
4
|
static readonly type = "SerializeAllowHoverLabel";
|
|
5
|
+
private hoverLabelEntity?;
|
|
5
6
|
name: string;
|
|
6
7
|
seriliziationVersion: number;
|
|
7
8
|
getSystemState(): object;
|
|
@@ -9,6 +9,11 @@ class SerializeAllowHoverLabel extends AppObject_1.AppObjectUC {
|
|
|
9
9
|
super(appObj, SerializeAllowHoverLabel.type);
|
|
10
10
|
this.name = "allowHoverLabel";
|
|
11
11
|
this.seriliziationVersion = 1;
|
|
12
|
+
this.hoverLabelEntity = this.appObject.getComponent(HoverLabel_1.HoverLabelEntity.type);
|
|
13
|
+
if (!this.hoverLabelEntity) {
|
|
14
|
+
this.warn("Serializer has been added to an App Object that does not have a HoverLabelEntity. Add the Entity first");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
12
17
|
const stateMachine = this.appObjects.getSingleton(StateMachine_1.StateMachineEntity.type);
|
|
13
18
|
if (stateMachine) {
|
|
14
19
|
stateMachine.registerSerializedSystem(this);
|
|
@@ -18,14 +23,13 @@ class SerializeAllowHoverLabel extends AppObject_1.AppObjectUC {
|
|
|
18
23
|
}
|
|
19
24
|
}
|
|
20
25
|
getSystemState() {
|
|
21
|
-
|
|
22
|
-
if (!hoverLabel) {
|
|
26
|
+
if (!this.hoverLabelEntity) {
|
|
23
27
|
return {
|
|
24
28
|
allow: false,
|
|
25
29
|
};
|
|
26
30
|
}
|
|
27
31
|
const state = {
|
|
28
|
-
allow:
|
|
32
|
+
allow: this.hoverLabelEntity.allowHoverLabel,
|
|
29
33
|
};
|
|
30
34
|
return state;
|
|
31
35
|
}
|
|
@@ -41,16 +45,14 @@ class SerializeAllowHoverLabel extends AppObject_1.AppObjectUC {
|
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
applyDefaultState() {
|
|
44
|
-
|
|
45
|
-
if (!hoverLabel)
|
|
48
|
+
if (!this.hoverLabelEntity)
|
|
46
49
|
return;
|
|
47
|
-
|
|
50
|
+
this.hoverLabelEntity.allowHoverLabel = true;
|
|
48
51
|
}
|
|
49
52
|
handleStateVersion1(data) {
|
|
50
|
-
|
|
51
|
-
if (!hoverLabel)
|
|
53
|
+
if (!this.hoverLabelEntity)
|
|
52
54
|
return;
|
|
53
|
-
|
|
55
|
+
this.hoverLabelEntity.allowHoverLabel = data.allow;
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
exports.SerializeAllowHoverLabel = SerializeAllowHoverLabel;
|
|
@@ -4,10 +4,4 @@ export declare abstract class ToggleAllowHoverLabelUC extends AppObjectUC {
|
|
|
4
4
|
abstract toggleAllowHoverLabel(): void;
|
|
5
5
|
static get(appObjects: AppObjectRepo): ToggleAllowHoverLabelUC | undefined;
|
|
6
6
|
}
|
|
7
|
-
export declare function makeToggleAllowHoverLabel(appObject: AppObject):
|
|
8
|
-
declare class ToggleAllowHoverLabelIMP extends ToggleAllowHoverLabelUC {
|
|
9
|
-
private hoverLabel?;
|
|
10
|
-
toggleAllowHoverLabel: () => void;
|
|
11
|
-
constructor(appObject: AppObject);
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
7
|
+
export declare function makeToggleAllowHoverLabel(appObject: AppObject): ToggleAllowHoverLabelUC;
|
|
@@ -27,14 +27,14 @@ class ToggleAllowHoverLabelIMP extends ToggleAllowHoverLabelUC {
|
|
|
27
27
|
constructor(appObject) {
|
|
28
28
|
super(appObject, ToggleAllowHoverLabelUC.type);
|
|
29
29
|
this.toggleAllowHoverLabel = () => {
|
|
30
|
-
if (!this.
|
|
30
|
+
if (!this.hoverLabelEntity)
|
|
31
31
|
return;
|
|
32
|
-
this.
|
|
32
|
+
this.hoverLabelEntity.allowHoverLabel = !this.hoverLabelEntity.allowHoverLabel;
|
|
33
33
|
Dispatcher_1.dispatchStateChange(this.appObjects);
|
|
34
34
|
};
|
|
35
|
-
this.
|
|
36
|
-
if (!this.
|
|
37
|
-
this.warn("
|
|
35
|
+
this.hoverLabelEntity = this.appObject.getComponent(HoverLabel_1.HoverLabelEntity.type);
|
|
36
|
+
if (!this.hoverLabelEntity) {
|
|
37
|
+
this.warn("PM has been added to an App Object that does not have a HoverLabelEntity. Add the Entity first");
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -5,10 +5,4 @@ export declare abstract class TryShowHoverLabel extends AppObjectUC {
|
|
|
5
5
|
abstract tryShowHoverLabel(position: Vector2): void;
|
|
6
6
|
static get(appObjects: AppObjectRepo): TryShowHoverLabel | undefined;
|
|
7
7
|
}
|
|
8
|
-
export declare function makeTryShowHoverLabel(appObject: AppObject):
|
|
9
|
-
declare class TryShowHoverLabelIMP extends TryShowHoverLabel {
|
|
10
|
-
private hoverLabel?;
|
|
11
|
-
constructor(appObject: AppObject);
|
|
12
|
-
tryShowHoverLabel: (position: Vector2) => void;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
8
|
+
export declare function makeTryShowHoverLabel(appObject: AppObject): TryShowHoverLabel;
|
|
@@ -28,10 +28,10 @@ class TryShowHoverLabelIMP extends TryShowHoverLabel {
|
|
|
28
28
|
constructor(appObject) {
|
|
29
29
|
super(appObject, TryShowHoverLabel.type);
|
|
30
30
|
this.tryShowHoverLabel = (position) => {
|
|
31
|
-
if (!this.
|
|
31
|
+
if (!this.hoverLabelEntity)
|
|
32
32
|
return;
|
|
33
|
-
if (!this.
|
|
34
|
-
this.
|
|
33
|
+
if (!this.hoverLabelEntity.allowHoverLabel) {
|
|
34
|
+
this.hoverLabelEntity.hideHoverLabel();
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
const scenePick = Babylon_1.scenePixelPick(position, this.appObjects);
|
|
@@ -47,15 +47,15 @@ class TryShowHoverLabelIMP extends TryShowHoverLabel {
|
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
if (label.display) {
|
|
50
|
-
this.
|
|
50
|
+
this.hoverLabelEntity.showHoverLabel(label.display, position);
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
53
|
-
this.
|
|
53
|
+
this.hoverLabelEntity.hideHoverLabel();
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
this.
|
|
57
|
-
if (!this.
|
|
58
|
-
this.warn("
|
|
56
|
+
this.hoverLabelEntity = this.appObject.getComponent(HoverLabel_1.HoverLabelEntity.type);
|
|
57
|
+
if (!this.hoverLabelEntity) {
|
|
58
|
+
this.warn("PM has been added to an App Object that does not have a HoverLabelEntity. Add the Entity first");
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|