完善浏览器配置库与未保存提示
- 新增 IndexedDB 配置保存、加载、删除及批量导入导出 - 配置列表支持选中、双击加载和悬浮操作提示 - 新增未保存提示设置,默认关闭并持久化到浏览器 - 优化配置管理界面并同步九种语言文案 - 更新开发文档与生产构建产物
This commit is contained in:
1 parent
8bd9154414
commit
46083c8d2a
30 files changed
+2244
-1293
No files matched your search
+11
-3
@@ -40,9 +40,9 @@ import { loopPlaybackRange } from '../core/loopSegmentTiming'
|
||||
import { collectSubEmitterIds } from '../core/subEmitterIds'
|
||||
import { useParticleStore, type CollisionBody, type ParticleSystem } from '../store/particleStore'
|
||||
import { SpineRuntimeLayer } from '../spine/SpineRuntimeLayer'
|
||||
import { installEditorHistory, undoLastOperation } from '../editor/editorHistory'
|
||||
import { editorHistoryState, installEditorHistory, undoLastOperation } from '../editor/editorHistory'
|
||||
import { useEditorShortcuts } from '../editor/useEditorShortcuts'
|
||||
import { downloadEditorConfig } from '../editor/editorConfig'
|
||||
import { PROJECT_SAVE_EVENT } from '../editor/projectLibrary'
|
||||
import HelpDialog from './HelpDialog.vue'
|
||||
import StageToolbar from './StageToolbar.vue'
|
||||
import StageSettingsPanel from './StageSettingsPanel.vue'
|
||||
@@ -166,6 +166,12 @@ function onStageDoubleClick(e: MouseEvent) {
|
||||
pathEditing.onStageDoubleClick(e)
|
||||
}
|
||||
|
||||
function onBeforeUnload(event: BeforeUnloadEvent) {
|
||||
if (!store.settings.unsavedChangesPrompt || !editorHistoryState.dirty) return
|
||||
event.preventDefault()
|
||||
event.returnValue = ''
|
||||
}
|
||||
|
||||
function onWheelEvent(e: WheelEvent) {
|
||||
onWheel(stageContext, e)
|
||||
}
|
||||
@@ -182,7 +188,7 @@ useEditorShortcuts({
|
||||
canvasElement: holder,
|
||||
canvasFocused,
|
||||
undo: undoLastOperation,
|
||||
save: () => downloadEditorConfig(store),
|
||||
save: () => window.dispatchEvent(new Event(PROJECT_SAVE_EVENT)),
|
||||
togglePlay: () => store.togglePlay(),
|
||||
toStart: () => store.toStart(),
|
||||
setTool: (tool) => { activeTool.value = tool },
|
||||
@@ -553,9 +559,11 @@ onMounted(async () => {
|
||||
},
|
||||
)
|
||||
installEditorHistory(store)
|
||||
window.addEventListener('beforeunload', onBeforeUnload)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('beforeunload', onBeforeUnload)
|
||||
cancelAnimationFrame(raf)
|
||||
spineRuntime?.destroy()
|
||||
spineRuntime = null
|
||||
|
||||
Reference in new issue
Block a user