@vived/app 4.30.0 → 4.32.0
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/BaseApp/Factories/setupBaseApp.d.ts +2 -2
- package/lib/Components/BaseApp/Factories/setupBaseApp.js +1 -0
- package/lib/Components/ChannelModel/UC/SelectChannelModelUC.js +7 -0
- package/lib/Components/InspectorTab/Adapters/index.d.ts +1 -0
- package/lib/Components/InspectorTab/Adapters/index.js +13 -0
- package/lib/Components/InspectorTab/Adapters/inspectorTabAdapter.d.ts +3 -0
- package/lib/Components/InspectorTab/Adapters/inspectorTabAdapter.js +23 -0
- package/lib/Components/InspectorTab/Controllers/KeyboardToSetTab.d.ts +10 -0
- package/lib/Components/InspectorTab/Controllers/KeyboardToSetTab.js +45 -0
- package/lib/Components/InspectorTab/Controllers/clickSetInspectorTab.d.ts +2 -0
- package/lib/Components/InspectorTab/Controllers/clickSetInspectorTab.js +13 -0
- package/lib/Components/InspectorTab/Controllers/clickSetInspectorTabIndex.d.ts +2 -0
- package/lib/Components/InspectorTab/Controllers/clickSetInspectorTabIndex.js +13 -0
- package/lib/Components/InspectorTab/Controllers/index.d.ts +3 -0
- package/lib/Components/InspectorTab/Controllers/index.js +15 -0
- package/lib/Components/InspectorTab/Entities/InspectorTabEntity.d.ts +12 -0
- package/lib/Components/InspectorTab/Entities/InspectorTabEntity.js +54 -0
- package/lib/Components/InspectorTab/Entities/index.d.ts +1 -0
- package/lib/Components/InspectorTab/Entities/index.js +13 -0
- package/lib/Components/InspectorTab/Factories/index.d.ts +1 -0
- package/lib/Components/InspectorTab/Factories/index.js +13 -0
- package/lib/Components/InspectorTab/Factories/setupInspectorTabs.d.ts +2 -0
- package/lib/Components/InspectorTab/Factories/setupInspectorTabs.js +17 -0
- package/lib/Components/InspectorTab/Mocks/InspectorTabPmMock.d.ts +8 -0
- package/lib/Components/InspectorTab/Mocks/InspectorTabPmMock.js +15 -0
- package/lib/Components/InspectorTab/Mocks/index.d.ts +1 -0
- package/lib/Components/InspectorTab/Mocks/index.js +13 -0
- package/lib/Components/InspectorTab/PMs/InspectorTabPM.d.ts +12 -0
- package/lib/Components/InspectorTab/PMs/InspectorTabPM.js +55 -0
- package/lib/Components/InspectorTab/PMs/index.d.ts +1 -0
- package/lib/Components/InspectorTab/PMs/index.js +13 -0
- package/lib/Components/InspectorTab/index.d.ts +6 -0
- package/lib/Components/InspectorTab/index.js +18 -0
- package/lib/Components/MouseInput/Factories/index.d.ts +1 -0
- package/lib/Components/MouseInput/Factories/index.js +13 -0
- package/lib/Components/MouseInput/Factories/setupMouseInput.d.ts +2 -0
- package/lib/Components/MouseInput/Factories/setupMouseInput.js +9 -0
- package/lib/Components/MouseInput/index.d.ts +1 -0
- package/lib/Components/MouseInput/index.js +1 -0
- package/lib/Components/OverlayColor/UC/SerializeOverlayColoredObjects.d.ts +27 -0
- package/lib/Components/OverlayColor/UC/SerializeOverlayColoredObjects.js +87 -0
- package/lib/Components/OverlayColor/UC/index.d.ts +1 -0
- package/lib/Components/OverlayColor/UC/index.js +1 -0
- package/lib/Components/SceneRoot/Controllers/DoubleTapToFocus.d.ts +1 -1
- package/lib/Components/SceneRoot/Controllers/DoubleTapToFocus.js +3 -5
- package/lib/Components/SceneRoot/Controllers/MouseClickToFocus.d.ts +1 -1
- package/lib/Components/SceneRoot/Controllers/MouseClickToFocus.js +6 -5
- package/lib/Components/SceneRoot/Controllers/MouseDoubleClickToRecenter.d.ts +1 -1
- package/lib/Components/SceneRoot/Controllers/MouseDoubleClickToRecenter.js +3 -5
- package/lib/Components/SceneRoot/Controllers/MouseOrbit.d.ts +2 -1
- package/lib/Components/SceneRoot/Controllers/MouseOrbit.js +19 -6
- package/lib/Components/SceneRoot/Controllers/MousePan.d.ts +2 -1
- package/lib/Components/SceneRoot/Controllers/MousePan.js +19 -6
- package/lib/Components/SceneRoot/Controllers/MouseRoll.d.ts +1 -1
- package/lib/Components/SceneRoot/Controllers/MouseRoll.js +3 -5
- package/lib/Components/SceneRoot/Controllers/MouseScale.d.ts +2 -1
- package/lib/Components/SceneRoot/Controllers/MouseScale.js +16 -6
- package/lib/Components/SceneRoot/Controllers/ScaleSceneRootSC.d.ts +2 -2
- package/lib/Components/SceneRoot/Controllers/ScaleSceneRootSC.js +8 -11
- package/lib/Components/SceneRoot/Controllers/SceneRootMoveSC.d.ts +2 -2
- package/lib/Components/SceneRoot/Controllers/SceneRootMoveSC.js +9 -12
- package/lib/Components/SceneRoot/Controllers/TouchOrbit.d.ts +3 -1
- package/lib/Components/SceneRoot/Controllers/TouchOrbit.js +24 -6
- package/lib/Components/SceneRoot/Controllers/TouchPan.d.ts +3 -1
- package/lib/Components/SceneRoot/Controllers/TouchPan.js +24 -6
- package/lib/Components/SceneRoot/Controllers/TouchPinch.d.ts +2 -2
- package/lib/Components/SceneRoot/Controllers/TouchPinch.js +12 -6
- package/lib/Components/SceneRoot/Controllers/TouchScale.d.ts +2 -2
- package/lib/Components/SceneRoot/Controllers/TouchScale.js +16 -5
- package/lib/Components/SceneRoot/Factories/index.d.ts +1 -0
- package/lib/Components/SceneRoot/Factories/index.js +13 -0
- package/lib/Components/SceneRoot/Factories/setupSceneRoot.d.ts +3 -0
- package/lib/Components/SceneRoot/Factories/setupSceneRoot.js +45 -0
- package/lib/Components/SceneRoot/Mocks/DragScaleSceneRootUcMock.d.ts +9 -0
- package/lib/Components/SceneRoot/Mocks/DragScaleSceneRootUcMock.js +13 -0
- package/lib/Components/SceneRoot/Mocks/MockDragScaleSceneRootUC.d.ts +9 -0
- package/lib/Components/SceneRoot/Mocks/MockDragScaleSceneRootUC.js +13 -0
- package/lib/Components/SceneRoot/Mocks/MockFocusOnPixelUC.d.ts +10 -0
- package/lib/Components/SceneRoot/Mocks/MockFocusOnPixelUC.js +15 -0
- package/lib/Components/SceneRoot/Mocks/MockOrbitSceneRootUC.d.ts +11 -0
- package/lib/Components/SceneRoot/Mocks/MockOrbitSceneRootUC.js +15 -0
- package/lib/Components/SceneRoot/Mocks/MockPanSceneRootUC.d.ts +10 -0
- package/lib/Components/SceneRoot/Mocks/MockPanSceneRootUC.js +14 -0
- package/lib/Components/SceneRoot/Mocks/MockPinchSceneRootUC.d.ts +10 -0
- package/lib/Components/SceneRoot/Mocks/MockPinchSceneRootUC.js +14 -0
- package/lib/Components/SceneRoot/Mocks/OrbitSceneRootUcMock.d.ts +11 -0
- package/lib/Components/SceneRoot/Mocks/OrbitSceneRootUcMock.js +15 -0
- package/lib/Components/SceneRoot/Mocks/PanSceneRootUcMock.d.ts +10 -0
- package/lib/Components/SceneRoot/Mocks/PanSceneRootUcMock.js +14 -0
- package/lib/Components/SceneRoot/Mocks/index.d.ts +5 -0
- package/lib/Components/SceneRoot/Mocks/index.js +17 -0
- package/lib/Components/SceneRoot/UC/CenterSceneRootOnPixelPick.js +1 -1
- package/lib/Components/SceneRoot/UC/FocusOnPixel.js +1 -1
- package/lib/Components/SceneRoot/index.d.ts +3 -1
- package/lib/Components/SceneRoot/index.js +3 -1
- package/lib/Components/Selection/Controller/KeyboardToClearSelection.d.ts +8 -0
- package/lib/Components/Selection/Controller/KeyboardToClearSelection.js +23 -0
- package/lib/Components/Selection/Controller/index.d.ts +1 -0
- package/lib/Components/Selection/Controller/index.js +1 -0
- package/lib/Components/Selection/Factories/index.d.ts +1 -0
- package/lib/Components/Selection/Factories/index.js +13 -0
- package/lib/Components/Selection/Factories/setupSelection.d.ts +2 -0
- package/lib/Components/Selection/Factories/setupSelection.js +27 -0
- package/lib/Components/Selection/index.d.ts +1 -0
- package/lib/Components/Selection/index.js +1 -0
- package/lib/Components/Stick/UCs/TryStickAppObjectUC.js +10 -0
- package/lib/Components/StoredView/Adapters/hasStoredViewAdapter.d.ts +2 -0
- package/lib/Components/StoredView/Adapters/hasStoredViewAdapter.js +19 -0
- package/lib/Components/StoredView/Adapters/index.d.ts +1 -0
- package/lib/Components/StoredView/Adapters/index.js +13 -0
- package/lib/Components/StoredView/Controllers/clearStoredView.d.ts +2 -0
- package/lib/Components/StoredView/Controllers/clearStoredView.js +13 -0
- package/lib/Components/StoredView/Controllers/index.d.ts +4 -0
- package/lib/Components/StoredView/Controllers/index.js +16 -0
- package/lib/Components/StoredView/Controllers/restoreStoredView.d.ts +2 -0
- package/lib/Components/StoredView/Controllers/restoreStoredView.js +13 -0
- package/lib/Components/StoredView/Controllers/setViewInXR.d.ts +2 -0
- package/lib/Components/StoredView/Controllers/setViewInXR.js +13 -0
- package/lib/Components/StoredView/Controllers/storeCurrentView.d.ts +2 -0
- package/lib/Components/StoredView/Controllers/storeCurrentView.js +13 -0
- package/lib/Components/StoredView/Factories/index.d.ts +1 -0
- package/lib/Components/StoredView/Factories/index.js +13 -0
- package/lib/Components/StoredView/Factories/setupStoredView.d.ts +2 -0
- package/lib/Components/StoredView/Factories/setupStoredView.js +21 -0
- package/lib/Components/StoredView/Mocks/ClearStoredViewUcMock.d.ts +8 -0
- package/lib/Components/StoredView/Mocks/ClearStoredViewUcMock.js +15 -0
- package/lib/Components/StoredView/Mocks/HasStoredViewPmMock.d.ts +8 -0
- package/lib/Components/StoredView/Mocks/HasStoredViewPmMock.js +15 -0
- package/lib/Components/StoredView/Mocks/RestoreStoredViewUcMock.d.ts +9 -0
- package/lib/Components/StoredView/Mocks/RestoreStoredViewUcMock.js +17 -0
- package/lib/Components/StoredView/Mocks/SetViewInXRUcMock.d.ts +8 -0
- package/lib/Components/StoredView/Mocks/SetViewInXRUcMock.js +15 -0
- package/lib/Components/StoredView/Mocks/StoreCurrentViewUcMock.d.ts +8 -0
- package/lib/Components/StoredView/Mocks/StoreCurrentViewUcMock.js +15 -0
- package/lib/Components/StoredView/Mocks/index.d.ts +1 -0
- package/lib/Components/StoredView/Mocks/index.js +13 -0
- package/lib/Components/StoredView/PM/HasStoredViewPM.js +7 -9
- package/lib/Components/StoredView/UC/ClearStoredViewUC.d.ts +0 -1
- package/lib/Components/StoredView/UC/ClearStoredViewUC.js +4 -15
- package/lib/Components/StoredView/UC/RestoreStoredViewUC.d.ts +0 -1
- package/lib/Components/StoredView/UC/RestoreStoredViewUC.js +8 -22
- package/lib/Components/StoredView/UC/SerializeStoredView.js +3 -6
- package/lib/Components/StoredView/UC/SetInXRUC.d.ts +0 -1
- package/lib/Components/StoredView/UC/SetInXRUC.js +4 -15
- package/lib/Components/StoredView/UC/StoreCurrentViewUC.d.ts +0 -1
- package/lib/Components/StoredView/UC/StoreCurrentViewUC.js +7 -19
- package/lib/Components/StoredView/index.d.ts +3 -0
- package/lib/Components/StoredView/index.js +3 -0
- package/lib/Components/Tools/Adapters/toolAdapter.d.ts +1 -1
- package/lib/Components/Tools/Adapters/toolAdapter.js +16 -23
- package/lib/Components/Tools/Controller/ToolHotkeys.d.ts +1 -1
- package/lib/Components/Tools/Controller/triggerTool.d.ts +1 -1
- package/lib/Components/Tools/Entities/ToolEntity.d.ts +7 -7
- package/lib/Components/Tools/Entities/ToolEntity.js +1 -2
- package/lib/Components/Tools/Entities/ToolRepository.d.ts +12 -11
- package/lib/Components/Tools/Entities/ToolRepository.js +30 -26
- package/lib/Components/Tools/Factories/index.d.ts +1 -0
- package/lib/Components/Tools/Factories/index.js +13 -0
- package/lib/Components/Tools/Factories/setupTools.d.ts +3 -0
- package/lib/Components/Tools/Factories/setupTools.js +15 -0
- package/lib/Components/Tools/Factories/toolFactory.d.ts +3 -0
- package/lib/Components/Tools/Factories/toolFactory.js +14 -0
- package/lib/Components/Tools/Mocks/MockToolRepo.d.ts +17 -0
- package/lib/Components/Tools/Mocks/MockToolRepo.js +28 -0
- package/lib/Components/Tools/Mocks/ToolPMMock.d.ts +2 -2
- package/lib/Components/Tools/Mocks/index.d.ts +1 -0
- package/lib/Components/Tools/Mocks/index.js +1 -0
- package/lib/Components/Tools/PM/ToolPM.d.ts +6 -6
- package/lib/Components/Tools/index.d.ts +1 -0
- package/lib/Components/Tools/index.js +1 -0
- package/lib/Components/TouchController/Factories/index.d.ts +1 -0
- package/lib/Components/TouchController/Factories/index.js +13 -0
- package/lib/Components/TouchController/Factories/setupTouchInput.d.ts +2 -0
- package/lib/Components/TouchController/Factories/setupTouchInput.js +9 -0
- package/lib/Components/TouchController/index.d.ts +1 -0
- package/lib/Components/TouchController/index.js +1 -0
- package/lib/Components/UndoRedo/Factories/index.d.ts +1 -0
- package/lib/Components/UndoRedo/Factories/index.js +13 -0
- package/lib/Components/UndoRedo/Factories/setupUndoRedo.d.ts +2 -0
- package/lib/Components/UndoRedo/Factories/setupUndoRedo.js +18 -0
- package/lib/Components/UndoRedo/UCs/UndoRedoButtonStatesHook.d.ts +11 -0
- package/lib/Components/UndoRedo/UCs/UndoRedoButtonStatesHook.js +55 -0
- package/lib/Components/UndoRedo/UCs/index.d.ts +1 -0
- package/lib/Components/UndoRedo/UCs/index.js +13 -0
- package/lib/Components/UndoRedo/index.d.ts +3 -1
- package/lib/Components/UndoRedo/index.js +3 -1
- package/lib/Components/index.d.ts +1 -0
- package/lib/Components/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AppObjectRepo } from "../../../AppObject";
|
|
2
|
-
export declare function setupBaseApp(appObjects: AppObjectRepo):
|
|
1
|
+
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
2
|
+
export declare function setupBaseApp(appObjects: AppObjectRepo): AppObject;
|
|
@@ -39,6 +39,9 @@ class SelectChannelModelUCImp extends SelectChannelModelUC {
|
|
|
39
39
|
repo.getAll().forEach((model) => {
|
|
40
40
|
model.enabled = model.id === channelModel.id;
|
|
41
41
|
});
|
|
42
|
+
if (this.dispatchState) {
|
|
43
|
+
this.dispatchState();
|
|
44
|
+
}
|
|
42
45
|
return channelModel.id;
|
|
43
46
|
});
|
|
44
47
|
};
|
|
@@ -57,4 +60,8 @@ class SelectChannelModelUCImp extends SelectChannelModelUC {
|
|
|
57
60
|
get repo() {
|
|
58
61
|
return this.getCachedSingleton(Entities_1.ChannelModelRepo.type);
|
|
59
62
|
}
|
|
63
|
+
get dispatchState() {
|
|
64
|
+
var _a;
|
|
65
|
+
return (_a = this.getCachedSingleton(Dispatcher_1.DispatchStateChangeUC.type)) === null || _a === void 0 ? void 0 : _a.doDispatch;
|
|
66
|
+
}
|
|
60
67
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./inspectorTabAdapter";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./inspectorTabAdapter"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inspectorTabAdapter = void 0;
|
|
4
|
+
const InspectorTabPM_1 = require("../PMs/InspectorTabPM");
|
|
5
|
+
exports.inspectorTabAdapter = {
|
|
6
|
+
defaultVM: InspectorTabPM_1.defaultInspectorTabVM,
|
|
7
|
+
subscribe: (appObjects, setVM) => {
|
|
8
|
+
const pm = InspectorTabPM_1.InspectorTabPM.get(appObjects);
|
|
9
|
+
if (!pm) {
|
|
10
|
+
appObjects.submitError("inspectorTabAdapter", "Unable to find InspectorTabPM");
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
pm.addView(setVM);
|
|
14
|
+
},
|
|
15
|
+
unsubscribe: (appObjects, setVM) => {
|
|
16
|
+
const pm = InspectorTabPM_1.InspectorTabPM.get(appObjects);
|
|
17
|
+
if (!pm) {
|
|
18
|
+
appObjects.submitError("inspectorTabAdapter", "Unable to find InspectorTabPM");
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
pm.removeView(setVM);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppObject, AppObjectController } from "../../../AppObject";
|
|
2
|
+
import { KeyboardController } from "../../KeyboardInput/Entities/KeyboardInput";
|
|
3
|
+
export declare class KeyboardToSetTab extends AppObjectController implements KeyboardController {
|
|
4
|
+
static type: string;
|
|
5
|
+
private get inspectorTabEntity();
|
|
6
|
+
private get baseApp();
|
|
7
|
+
private codeLookup;
|
|
8
|
+
onKeyDown: (e: KeyboardEvent) => void;
|
|
9
|
+
constructor(appObject: AppObject);
|
|
10
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyboardToSetTab = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
const BaseAppState_1 = require("../../BaseApp/Entity/BaseAppState");
|
|
6
|
+
const KeyboardInput_1 = require("../../KeyboardInput/Entities/KeyboardInput");
|
|
7
|
+
const Entities_1 = require("../Entities");
|
|
8
|
+
class KeyboardToSetTab extends AppObject_1.AppObjectController {
|
|
9
|
+
constructor(appObject) {
|
|
10
|
+
super(appObject, KeyboardToSetTab.type);
|
|
11
|
+
this.codeLookup = new Map([
|
|
12
|
+
["Digit1", 0],
|
|
13
|
+
["Digit2", 1],
|
|
14
|
+
["Digit3", 2],
|
|
15
|
+
["Digit4", 3],
|
|
16
|
+
["Digit5", 4],
|
|
17
|
+
]);
|
|
18
|
+
this.onKeyDown = (e) => {
|
|
19
|
+
var _a;
|
|
20
|
+
if (!this.inspectorTabEntity)
|
|
21
|
+
return;
|
|
22
|
+
if (((_a = this.baseApp) === null || _a === void 0 ? void 0 : _a.isAuthoring) !== true)
|
|
23
|
+
return;
|
|
24
|
+
if (!this.codeLookup.has(e.code))
|
|
25
|
+
return;
|
|
26
|
+
const desiredIndex = this.codeLookup.get(e.code);
|
|
27
|
+
if (desiredIndex === undefined ||
|
|
28
|
+
desiredIndex < 0 ||
|
|
29
|
+
desiredIndex >= this.inspectorTabEntity.inspectorTabs.length) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.inspectorTabEntity.activeTabIndex = desiredIndex;
|
|
33
|
+
};
|
|
34
|
+
const keyboardInput = KeyboardInput_1.KeyboardInputEntity.get(this.appObjects);
|
|
35
|
+
keyboardInput === null || keyboardInput === void 0 ? void 0 : keyboardInput.registerController(this);
|
|
36
|
+
}
|
|
37
|
+
get inspectorTabEntity() {
|
|
38
|
+
return this.getCachedSingleton(Entities_1.InspectorTabEntity.type);
|
|
39
|
+
}
|
|
40
|
+
get baseApp() {
|
|
41
|
+
return this.getCachedSingleton(BaseAppState_1.BaseAppState.type);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.KeyboardToSetTab = KeyboardToSetTab;
|
|
45
|
+
KeyboardToSetTab.type = "KeyboardToSetTab";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clickSetInspectorTab = void 0;
|
|
4
|
+
const InspectorTabEntity_1 = require("../Entities/InspectorTabEntity");
|
|
5
|
+
function clickSetInspectorTab(tab, appObjects) {
|
|
6
|
+
const entity = InspectorTabEntity_1.InspectorTabEntity.get(appObjects);
|
|
7
|
+
if (!entity) {
|
|
8
|
+
appObjects.submitError("clickSetInspectorTab", "Unable to find InspectorTabEntity");
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
entity.activeTab = tab;
|
|
12
|
+
}
|
|
13
|
+
exports.clickSetInspectorTab = clickSetInspectorTab;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clickSetInspectorTabIndex = void 0;
|
|
4
|
+
const InspectorTabEntity_1 = require("../Entities/InspectorTabEntity");
|
|
5
|
+
function clickSetInspectorTabIndex(tabIndex, appObjects) {
|
|
6
|
+
const entity = InspectorTabEntity_1.InspectorTabEntity.get(appObjects);
|
|
7
|
+
if (!entity) {
|
|
8
|
+
appObjects.submitError("clickSetInspectorTabIndex", "Unable to find InspectorTabEntity");
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
entity.activeTabIndex = tabIndex;
|
|
12
|
+
}
|
|
13
|
+
exports.clickSetInspectorTabIndex = clickSetInspectorTabIndex;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./clickSetInspectorTab"), exports);
|
|
14
|
+
__exportStar(require("./clickSetInspectorTabIndex"), exports);
|
|
15
|
+
__exportStar(require("./KeyboardToSetTab"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AppObject, AppObjectEntity, AppObjectRepo } from "../../../AppObject";
|
|
2
|
+
export declare abstract class InspectorTabEntity extends AppObjectEntity {
|
|
3
|
+
static readonly type = "InspectorTabEntity";
|
|
4
|
+
abstract get inspectorTabs(): string[];
|
|
5
|
+
abstract setInspectorTabs(tabs: string[]): void;
|
|
6
|
+
abstract get activeTab(): string;
|
|
7
|
+
abstract set activeTab(val: string);
|
|
8
|
+
abstract get activeTabIndex(): number;
|
|
9
|
+
abstract set activeTabIndex(val: number);
|
|
10
|
+
static get: (appObjects: AppObjectRepo) => InspectorTabEntity | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare function makeInspectorTabEntity(appObject: AppObject): InspectorTabEntity;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeInspectorTabEntity = exports.InspectorTabEntity = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
const Entities_1 = require("../../../Entities");
|
|
6
|
+
class InspectorTabEntity extends AppObject_1.AppObjectEntity {
|
|
7
|
+
}
|
|
8
|
+
exports.InspectorTabEntity = InspectorTabEntity;
|
|
9
|
+
InspectorTabEntity.type = "InspectorTabEntity";
|
|
10
|
+
InspectorTabEntity.get = (appObjects) => AppObject_1.getSingletonComponent(InspectorTabEntity.type, appObjects);
|
|
11
|
+
function makeInspectorTabEntity(appObject) {
|
|
12
|
+
return new InspectorTabEntityImp(appObject);
|
|
13
|
+
}
|
|
14
|
+
exports.makeInspectorTabEntity = makeInspectorTabEntity;
|
|
15
|
+
class InspectorTabEntityImp extends InspectorTabEntity {
|
|
16
|
+
constructor(appObject) {
|
|
17
|
+
super(appObject, InspectorTabEntity.type);
|
|
18
|
+
this._inspectorTabs = [];
|
|
19
|
+
this.memoizedIndex = new Entities_1.MemoizedNumber(-1, this.notifyOnChange);
|
|
20
|
+
this.appObjects.registerSingleton(this);
|
|
21
|
+
}
|
|
22
|
+
get inspectorTabs() {
|
|
23
|
+
return [...this._inspectorTabs];
|
|
24
|
+
}
|
|
25
|
+
setInspectorTabs(tabs) {
|
|
26
|
+
this._inspectorTabs = [...tabs];
|
|
27
|
+
if (tabs.length === 0)
|
|
28
|
+
return;
|
|
29
|
+
this.memoizedIndex.val = 0;
|
|
30
|
+
}
|
|
31
|
+
get activeTabIndex() {
|
|
32
|
+
return this.memoizedIndex.val;
|
|
33
|
+
}
|
|
34
|
+
set activeTabIndex(val) {
|
|
35
|
+
if (val < 0 || val >= this._inspectorTabs.length) {
|
|
36
|
+
this.warn("Invalid index: " + val);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.memoizedIndex.val = val;
|
|
40
|
+
}
|
|
41
|
+
get activeTab() {
|
|
42
|
+
if (this.memoizedIndex.val < 0)
|
|
43
|
+
return "";
|
|
44
|
+
return this._inspectorTabs[this.memoizedIndex.val];
|
|
45
|
+
}
|
|
46
|
+
set activeTab(inspectorTab) {
|
|
47
|
+
const index = this._inspectorTabs.indexOf(inspectorTab);
|
|
48
|
+
if (index === undefined || index < 0) {
|
|
49
|
+
this.warn("Unknown inspector tab: " + inspectorTab);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
this.memoizedIndex.val = index;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./InspectorTabEntity";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./InspectorTabEntity"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./setupInspectorTabs";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./setupInspectorTabs"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupInspectorTabs = void 0;
|
|
4
|
+
const Controllers_1 = require("../Controllers");
|
|
5
|
+
const Entities_1 = require("../Entities");
|
|
6
|
+
const PMs_1 = require("../PMs");
|
|
7
|
+
function setupInspectorTabs(appObjects, tabs) {
|
|
8
|
+
const ao = appObjects.getOrCreate("InspectorTabs");
|
|
9
|
+
// Entity
|
|
10
|
+
Entities_1.makeInspectorTabEntity(ao).setInspectorTabs(tabs);
|
|
11
|
+
// PM
|
|
12
|
+
PMs_1.makeInspectorTabPM(ao);
|
|
13
|
+
// Controller
|
|
14
|
+
new Controllers_1.KeyboardToSetTab(ao);
|
|
15
|
+
return ao;
|
|
16
|
+
}
|
|
17
|
+
exports.setupInspectorTabs = setupInspectorTabs;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
3
|
+
import { InspectorTabPM } from "../PMs/InspectorTabPM";
|
|
4
|
+
export declare class InspectorTabPmMock extends InspectorTabPM {
|
|
5
|
+
vmsAreEqual: jest.Mock<any, any>;
|
|
6
|
+
constructor(appObject: AppObject);
|
|
7
|
+
}
|
|
8
|
+
export declare function makeInspectorTabPmMock(appObjects: AppObjectRepo): InspectorTabPmMock;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeInspectorTabPmMock = exports.InspectorTabPmMock = void 0;
|
|
4
|
+
const InspectorTabPM_1 = require("../PMs/InspectorTabPM");
|
|
5
|
+
class InspectorTabPmMock extends InspectorTabPM_1.InspectorTabPM {
|
|
6
|
+
constructor(appObject) {
|
|
7
|
+
super(appObject, InspectorTabPM_1.InspectorTabPM.type);
|
|
8
|
+
this.vmsAreEqual = jest.fn();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.InspectorTabPmMock = InspectorTabPmMock;
|
|
12
|
+
function makeInspectorTabPmMock(appObjects) {
|
|
13
|
+
return new InspectorTabPmMock(appObjects.getOrCreate("InspectorTabPmMock"));
|
|
14
|
+
}
|
|
15
|
+
exports.makeInspectorTabPmMock = makeInspectorTabPmMock;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./InspectorTabPmMock";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./InspectorTabPmMock"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AppObject, AppObjectPM, AppObjectRepo } from "../../../AppObject";
|
|
2
|
+
export interface InspectorTabVM {
|
|
3
|
+
selectedTab: string;
|
|
4
|
+
selectedTabIndex: number;
|
|
5
|
+
tabs: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare const defaultInspectorTabVM: InspectorTabVM;
|
|
8
|
+
export declare abstract class InspectorTabPM extends AppObjectPM<InspectorTabVM> {
|
|
9
|
+
static readonly type = "InspectorTabPM";
|
|
10
|
+
static get: (appObjects: AppObjectRepo) => InspectorTabPM | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare function makeInspectorTabPM(appObject: AppObject): InspectorTabPM;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeInspectorTabPM = exports.InspectorTabPM = exports.defaultInspectorTabVM = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
const InspectorTabEntity_1 = require("../Entities/InspectorTabEntity");
|
|
6
|
+
exports.defaultInspectorTabVM = {
|
|
7
|
+
selectedTab: "",
|
|
8
|
+
selectedTabIndex: 0,
|
|
9
|
+
tabs: [],
|
|
10
|
+
};
|
|
11
|
+
class InspectorTabPM extends AppObject_1.AppObjectPM {
|
|
12
|
+
}
|
|
13
|
+
exports.InspectorTabPM = InspectorTabPM;
|
|
14
|
+
InspectorTabPM.type = "InspectorTabPM";
|
|
15
|
+
InspectorTabPM.get = (appObjects) => AppObject_1.getSingletonComponent(InspectorTabPM.type, appObjects);
|
|
16
|
+
function makeInspectorTabPM(appObject) {
|
|
17
|
+
return new InspectorTabPMImp(appObject);
|
|
18
|
+
}
|
|
19
|
+
exports.makeInspectorTabPM = makeInspectorTabPM;
|
|
20
|
+
class InspectorTabPMImp extends InspectorTabPM {
|
|
21
|
+
constructor(appObject) {
|
|
22
|
+
var _a;
|
|
23
|
+
super(appObject, InspectorTabPM.type);
|
|
24
|
+
this.onAppStateChange = () => {
|
|
25
|
+
if (!this.tabEntity)
|
|
26
|
+
return;
|
|
27
|
+
this.doUpdateView({
|
|
28
|
+
selectedTab: this.tabEntity.activeTab,
|
|
29
|
+
tabs: this.tabEntity.inspectorTabs,
|
|
30
|
+
selectedTabIndex: this.tabEntity.activeTabIndex,
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
(_a = this.tabEntity) === null || _a === void 0 ? void 0 : _a.addChangeObserver(this.onAppStateChange);
|
|
34
|
+
this.onAppStateChange();
|
|
35
|
+
this.appObjects.registerSingleton(this);
|
|
36
|
+
}
|
|
37
|
+
get tabEntity() {
|
|
38
|
+
return this.getCachedSingleton(InspectorTabEntity_1.InspectorTabEntity.type);
|
|
39
|
+
}
|
|
40
|
+
vmsAreEqual(a, b) {
|
|
41
|
+
if (a.selectedTab !== b.selectedTab)
|
|
42
|
+
return false;
|
|
43
|
+
if (a.selectedTabIndex !== b.selectedTabIndex)
|
|
44
|
+
return false;
|
|
45
|
+
if (a.tabs.length !== b.tabs.length)
|
|
46
|
+
return false;
|
|
47
|
+
let listsAreTheSame = true;
|
|
48
|
+
a.tabs.forEach((tabA, i) => {
|
|
49
|
+
const tabB = b.tabs[i];
|
|
50
|
+
if (tabA !== tabB)
|
|
51
|
+
listsAreTheSame = false;
|
|
52
|
+
});
|
|
53
|
+
return listsAreTheSame;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./InspectorTabPM";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./InspectorTabPM"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./Adapters"), exports);
|
|
14
|
+
__exportStar(require("./Controllers"), exports);
|
|
15
|
+
__exportStar(require("./Entities"), exports);
|
|
16
|
+
__exportStar(require("./Factories"), exports);
|
|
17
|
+
__exportStar(require("./Mocks"), exports);
|
|
18
|
+
__exportStar(require("./PMs"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./setupMouseInput";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./setupMouseInput"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupMouseInput = void 0;
|
|
4
|
+
const Entities_1 = require("../Entities");
|
|
5
|
+
function setupMouseInput(appObject) {
|
|
6
|
+
const ao = appObject.getOrCreate("MouseInput");
|
|
7
|
+
Entities_1.makeMouseInput(ao);
|
|
8
|
+
}
|
|
9
|
+
exports.setupMouseInput = setupMouseInput;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { OverlayColorEnums } from "../Entities/OverlayColor";
|
|
2
|
+
import { SerializedSystem } from "../../StateMachine/Entities/StateMachineEntity";
|
|
3
|
+
import { AppObjectUC, AppObject } from "../../../AppObject";
|
|
4
|
+
export declare abstract class SerializeOverlayColoredObjects extends AppObjectUC implements SerializedSystem {
|
|
5
|
+
static readonly type = "SerializeOverlayColoredObjects";
|
|
6
|
+
name: string;
|
|
7
|
+
abstract seriliziationVersion: number;
|
|
8
|
+
abstract getSystemState(): object;
|
|
9
|
+
abstract applySystemState(state: object, version: number, transitionDuration: number): void;
|
|
10
|
+
abstract applyDefaultState(transitionDuration: number): void;
|
|
11
|
+
}
|
|
12
|
+
export declare function makeSerializeOverlayColoredObjects(appObject: AppObject): SerializeOverlayColoredObjects;
|
|
13
|
+
export declare class SerializeOverlayColoredObjectsImp extends SerializeOverlayColoredObjects {
|
|
14
|
+
seriliziationVersion: number;
|
|
15
|
+
getSystemState(): object;
|
|
16
|
+
applySystemState(state: object, version: number, durationS: number): Promise<void> | void;
|
|
17
|
+
private applyStateV1;
|
|
18
|
+
applyDefaultState(): void;
|
|
19
|
+
constructor(appObj: AppObject);
|
|
20
|
+
}
|
|
21
|
+
export interface SerializedOverlayColoredObjectV1 {
|
|
22
|
+
id: string;
|
|
23
|
+
overlayColor: OverlayColorEnums;
|
|
24
|
+
}
|
|
25
|
+
export interface SerializedOverlayColoredObjectsV1 {
|
|
26
|
+
overlayColoredObjects: SerializedOverlayColoredObjectV1[];
|
|
27
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SerializeOverlayColoredObjectsImp = exports.makeSerializeOverlayColoredObjects = exports.SerializeOverlayColoredObjects = void 0;
|
|
4
|
+
const OverlayColor_1 = require("../Entities/OverlayColor");
|
|
5
|
+
const StateMachineEntity_1 = require("../../StateMachine/Entities/StateMachineEntity");
|
|
6
|
+
const AppObject_1 = require("../../../AppObject");
|
|
7
|
+
class SerializeOverlayColoredObjects extends AppObject_1.AppObjectUC {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.name = "overlaycolored-objects";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.SerializeOverlayColoredObjects = SerializeOverlayColoredObjects;
|
|
14
|
+
SerializeOverlayColoredObjects.type = "SerializeOverlayColoredObjects";
|
|
15
|
+
function makeSerializeOverlayColoredObjects(appObject) {
|
|
16
|
+
return new SerializeOverlayColoredObjectsImp(appObject);
|
|
17
|
+
}
|
|
18
|
+
exports.makeSerializeOverlayColoredObjects = makeSerializeOverlayColoredObjects;
|
|
19
|
+
class SerializeOverlayColoredObjectsImp extends SerializeOverlayColoredObjects {
|
|
20
|
+
constructor(appObj) {
|
|
21
|
+
super(appObj, SerializeOverlayColoredObjects.type);
|
|
22
|
+
this.seriliziationVersion = 1;
|
|
23
|
+
const stateMachine = this.appObjects.getSingleton(StateMachineEntity_1.StateMachineEntity.type);
|
|
24
|
+
if (stateMachine) {
|
|
25
|
+
stateMachine.registerSerializedSystem(this);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this.warn("Unable to find StateMachineEntity");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
getSystemState() {
|
|
32
|
+
const overlayColoredObjects = [];
|
|
33
|
+
const allOverlayColors = this.appObjects.getAllComponents(OverlayColor_1.OverlayColor.type);
|
|
34
|
+
allOverlayColors.forEach((overlayColor) => {
|
|
35
|
+
if (overlayColor.overlayColor !== OverlayColor_1.OverlayColorEnums.NONE)
|
|
36
|
+
overlayColoredObjects.push({
|
|
37
|
+
id: overlayColor.appObject.id,
|
|
38
|
+
overlayColor: overlayColor.overlayColor,
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
const state = {
|
|
42
|
+
overlayColoredObjects,
|
|
43
|
+
};
|
|
44
|
+
return state;
|
|
45
|
+
}
|
|
46
|
+
applySystemState(state, version, durationS) {
|
|
47
|
+
if (version === 1) {
|
|
48
|
+
return this.applyStateV1(state, durationS);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this.applyDefaultState();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
applyStateV1(state, durationS) {
|
|
55
|
+
const { overlayColoredObjects } = state;
|
|
56
|
+
if (!overlayColoredObjects) {
|
|
57
|
+
this.applyDefaultState();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
// Create a Map for faster lookups
|
|
61
|
+
const overlayLookup = new Map();
|
|
62
|
+
overlayColoredObjects.forEach((overlayColorObj) => {
|
|
63
|
+
overlayLookup.set(overlayColorObj.id, overlayColorObj.overlayColor);
|
|
64
|
+
});
|
|
65
|
+
const allOverlayColors = this.appObjects.getAllComponents(OverlayColor_1.OverlayColor.type);
|
|
66
|
+
allOverlayColors.forEach((overlayColor) => {
|
|
67
|
+
var _a;
|
|
68
|
+
const appObjectId = overlayColor.appObject.id;
|
|
69
|
+
overlayColor.overlayColor =
|
|
70
|
+
(_a = overlayLookup.get(appObjectId)) !== null && _a !== void 0 ? _a : OverlayColor_1.OverlayColorEnums.NONE;
|
|
71
|
+
});
|
|
72
|
+
overlayLookup.forEach((desiredColor, remainingObjectId) => {
|
|
73
|
+
const appObject = this.appObjects.get(remainingObjectId);
|
|
74
|
+
if (appObject) {
|
|
75
|
+
const overlayColor = OverlayColor_1.OverlayColor.addIfMissing(appObject);
|
|
76
|
+
overlayColor.overlayColor = desiredColor;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
applyDefaultState() {
|
|
81
|
+
const allOverlayColors = this.appObjects.getAllComponents(OverlayColor_1.OverlayColor.type);
|
|
82
|
+
allOverlayColors.forEach((overlayColor) => {
|
|
83
|
+
overlayColor.overlayColor = OverlayColor_1.OverlayColorEnums.NONE;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.SerializeOverlayColoredObjectsImp = SerializeOverlayColoredObjectsImp;
|