|
@@ -1818,22 +1818,22 @@ onUnmounted(() => {
|
|
|
workspace.dispose();
|
|
workspace.dispose();
|
|
|
workspace = null;
|
|
workspace = null;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 移除事件监听器
|
|
// 移除事件监听器
|
|
|
window.removeEventListener('resize', updateMapContainerDimensions);
|
|
window.removeEventListener('resize', updateMapContainerDimensions);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 停止当前正在执行的代码
|
|
// 停止当前正在执行的代码
|
|
|
shouldStopExecution = true;
|
|
shouldStopExecution = true;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 取消任何正在进行的执行
|
|
// 取消任何正在进行的执行
|
|
|
if (executionAbortController) {
|
|
if (executionAbortController) {
|
|
|
executionAbortController.abort();
|
|
executionAbortController.abort();
|
|
|
executionAbortController = null;
|
|
executionAbortController = null;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 清除当前执行的Promise引用
|
|
// 清除当前执行的Promise引用
|
|
|
currentExecutionPromise = null;
|
|
currentExecutionPromise = null;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 清理所有临时DOM元素
|
|
// 清理所有临时DOM元素
|
|
|
const mapBackground = document.querySelector('.map-background');
|
|
const mapBackground = document.querySelector('.map-background');
|
|
|
if (mapBackground) {
|
|
if (mapBackground) {
|
|
@@ -1844,7 +1844,7 @@ onUnmounted(() => {
|
|
|
mapBackground.removeChild(video);
|
|
mapBackground.removeChild(video);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 清除临时动画元素
|
|
// 清除临时动画元素
|
|
|
const tempElements = mapBackground.querySelectorAll('div[style*="backgroundImage"]');
|
|
const tempElements = mapBackground.querySelectorAll('div[style*="backgroundImage"]');
|
|
|
tempElements.forEach(temp => {
|
|
tempElements.forEach(temp => {
|
|
@@ -1853,11 +1853,11 @@ onUnmounted(() => {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 清理全局函数引用
|
|
// 清理全局函数引用
|
|
|
window.pickupItem = null;
|
|
window.pickupItem = null;
|
|
|
window.useItem = null;
|
|
window.useItem = null;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 重置游戏状态
|
|
// 重置游戏状态
|
|
|
gameState.player.carriedItems = [];
|
|
gameState.player.carriedItems = [];
|
|
|
gameState.player.position = { ...startPoint.value };
|
|
gameState.player.position = { ...startPoint.value };
|