@netless/window-manager 1.0.13-test.18 → 1.0.13-test.19
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/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/AppManager.ts +0 -1
- package/src/Utils/Common.ts +0 -1
- package/src/Utils/RoomHacker.ts +15 -1
- package/src/View/MainView.ts +1 -1
package/package.json
CHANGED
package/src/AppManager.ts
CHANGED
|
@@ -923,7 +923,6 @@ export class AppManager {
|
|
|
923
923
|
}
|
|
924
924
|
|
|
925
925
|
private dispatchSetMainViewScenePath(scenePath: string): void {
|
|
926
|
-
console.log("[window-manager] dispatchSetMainViewScenePath " + scenePath);
|
|
927
926
|
this.dispatchInternalEvent(Events.SetMainViewScenePath, { nextScenePath: scenePath });
|
|
928
927
|
callbacks.emit("mainViewScenePathChange", scenePath);
|
|
929
928
|
// 兼容 15 的 SDK, 需要 room 的当前 ScenePath
|
package/src/Utils/Common.ts
CHANGED
|
@@ -34,7 +34,6 @@ export const setScenePath = (room: Room | undefined, scenePath: string) => {
|
|
|
34
34
|
if (room && room.isWritable) {
|
|
35
35
|
if (room.state.sceneState.scenePath !== scenePath) {
|
|
36
36
|
const nextScenePath = scenePath === "/" ? "" : scenePath;
|
|
37
|
-
console.log("[window-manager] real setScenePath for current room " + nextScenePath);
|
|
38
37
|
room.setScenePath(nextScenePath);
|
|
39
38
|
}
|
|
40
39
|
}
|
package/src/Utils/RoomHacker.ts
CHANGED
|
@@ -37,10 +37,24 @@ export const replaceRoomFunction = (room: Room | Player, manager: WindowManager)
|
|
|
37
37
|
room.scalePptToFit = (...args) => {
|
|
38
38
|
_scalePptToFit.call(room, ...args);
|
|
39
39
|
if (manager.appManager?.mainViewProxy) {
|
|
40
|
-
console.log("[window-manager] scalePptToFit " + JSON.stringify(args));
|
|
41
40
|
manager.appManager.mainViewProxy.setCameraAndSize();
|
|
42
41
|
}
|
|
43
42
|
};
|
|
43
|
+
const _putScenes = room.putScenes;
|
|
44
|
+
room.putScenes = (...args) => {
|
|
45
|
+
const [path, scenes] = args;
|
|
46
|
+
const currentScenePath = manager.mainView.focusScenePath;
|
|
47
|
+
if (currentScenePath && path && scenes) {
|
|
48
|
+
console.log("[window-manager] putScenes " + JSON.stringify(args));
|
|
49
|
+
for (const scene of scenes) {
|
|
50
|
+
if (`${path}${scene.name}` === currentScenePath) {
|
|
51
|
+
console.error(`[window-manager] putScenes: scene name can not be the same as the current scene path: ${currentScenePath}`);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return _putScenes.call(room, ...args);
|
|
57
|
+
};
|
|
44
58
|
room.moveCamera = (camera: Camera) => manager.moveCamera(camera);
|
|
45
59
|
room.moveCameraToContain = (...args) => manager.moveCameraToContain(...args);
|
|
46
60
|
room.convertToPointInWorld = (...args) => manager.mainView.convertToPointInWorld(...args);
|
package/src/View/MainView.ts
CHANGED
|
@@ -380,7 +380,7 @@ export class MainViewProxy {
|
|
|
380
380
|
|
|
381
381
|
private syncMainView = (room: Room) => {
|
|
382
382
|
if (room.isWritable) {
|
|
383
|
-
console.log("[window-manager] syncMainView
|
|
383
|
+
console.log("[window-manager] syncMainView ");
|
|
384
384
|
room.syncMainView(this.mainView);
|
|
385
385
|
}
|
|
386
386
|
};
|