Skip to content

Commit

Permalink
Add Usage and Cancel buttons to Scene Palette Asset Missing Component
Browse files Browse the repository at this point in the history
  • Loading branch information
izure committed May 12, 2021
1 parent 25c56e9 commit dcaa584
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 61 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eriengine",
"version": "1.0.0-alpha.16",
"version": "1.0.0-alpha.17",
"private": true,
"scripts": {
"lint": "vue-cli-service lint",
Expand Down
185 changes: 125 additions & 60 deletions src/Renderer/components/Manager/Data/Scene/Map/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -336,83 +336,137 @@
<v-dialog v-model="isAssetMissingOpen"
fullscreen
persistent
scrollable
transition="dialog-bottom-transition"
>
<v-card
tile
flat
>
<v-card-title>씬 파렛트 에셋 누락</v-card-title>
<v-card-subtitle>
씬을 구성하는 데이터 중 {{ missingAssets.length }}개의 에셋이 누락되었으며, 다음과 같습니다.
</v-card-subtitle>
<v-card-subtitle>{{ missingAssets.length }}개의 에셋 누락 문제를 해결하십시오.</v-card-subtitle>
<v-card-text>

<p>
씬에서 사용된 에셋의 경로가 변경되었거나, 삭제된 것 같습니다.
<br>
해당 내용을 기반으로 에셋의 위치를 확인하고 고치십시오.
</p>

<v-container>
<v-row>
<v-col>
<v-subheader>에셋의 위치가 변경되었을 경우</v-subheader>
<p class="text-caption">
옵션 중 <strong>추측되는 에셋으로 바꾸기</strong> 기능으로 변경할 수 있습니다.
<br>
비슷한 이름의 에셋을 찾아주지만, 정확한 것이 아닙니다.
</p>
</v-col>

<v-col>
<v-subheader>에셋을 삭제했을 경우</v-subheader>
<p class="text-caption">
옵션 중 <strong>씬에서 제거</strong> 기능으로 삭제할 수 있습니다.
<br>
씬에서 영구적으로 삭제됩니다.
</p>
</v-col>

<v-col>
<v-subheader>직접 고치기</v-subheader>
<p class="text-caption">
두 옵션 모두 마음에 들지 않을 수 있습니다.
<br>
목록을 클릭하여 열린 파일의 경로를 직접 수정한 후, 옵션 중 <strong>직접 고쳤으므로 무시하겠습니다</strong> 기능을 선택합니다.
</p>
</v-col>
</v-row>
</v-container>

<v-subheader>목록</v-subheader>
<v-list v-for="missingAsset in missingAssets"
:key="`preview-scene-missingasset-${missingAsset}`"
>
<v-list-item two-line>
<v-list-item-content>
<v-list-item-title>{{ missingAsset }}</v-list-item-title>
<v-list-item-subtitle class="text-caption">{{ getSimilarPath(missingAsset, allDatasPath) }} 아닌가요?</v-list-item-subtitle>
</v-list-item-content>
<v-list-item-action class="flex-row">
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
icon
class="text-caption"
v-on="on"
@click="requestChangeAssetPath(missingAsset, getSimilarPath(missingAsset, allDatasPath))"
>
<v-icon>mdi-find-replace</v-icon>
</v-btn>
</template>
<span>바꾸기</span>
</v-tooltip>
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
icon
class="text-caption"
v-on="on"
@click="requestDeleteMissingAsset(missingAsset)"
>
<v-icon>mdi-delete-forever</v-icon>
</v-btn>
</template>
<span>제거</span>
</v-tooltip>
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
icon
class="text-caption"
v-on="on"
@click="deleteMissingAsset(missingAsset)"
>
<v-icon>mdi-close</v-icon>
</v-btn>
</template>
<span>고쳤으므로 무시하겠습니다</span>
</v-tooltip>
</v-list-item-action>
</v-list-item>
<v-list-item-group>
<v-list-item two-line>
<v-list-item-content @click="showSimilarPath(missingAsset, allDatasPath)">
<v-list-item-title>{{ missingAsset }}</v-list-item-title>
<v-list-item-subtitle class="text-caption">{{ getSimilarPath(missingAsset, allDatasPath) }} 아닌가요?</v-list-item-subtitle>
</v-list-item-content>
<v-list-item-action class="flex-row">
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
icon
class="text-caption"
v-on="on"
@click="requestChangeAssetPath(missingAsset, getSimilarPath(missingAsset, allDatasPath))"
>
<v-icon>mdi-find-replace</v-icon>
</v-btn>
</template>
<span>추측되는 에셋으로 바꾸기</span>
</v-tooltip>
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
icon
class="text-caption"
v-on="on"
@click="requestDeleteMissingAsset(missingAsset)"
>
<v-icon>mdi-delete-forever</v-icon>
</v-btn>
</template>
<span>씬에서 제거</span>
</v-tooltip>
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
icon
class="text-caption"
v-on="on"
@click="deleteMissingAsset(missingAsset)"
>
<v-icon>mdi-close</v-icon>
</v-btn>
</template>
<span>직접 고쳤으므로 무시하겠습니다</span>
</v-tooltip>
</v-list-item-action>
</v-list-item>
</v-list-item-group>
</v-list>
<p>
해당 내용을 기반으로 에셋의 위치를 확인하고 고치십시오.
</p>

</v-card-text>

<v-divider />

<v-card-actions class="m-flex justify-center">
<v-btn
icon
@click="saveAndRestart"
:disabled="missingAssets.length > 0"
>
<v-icon>mdi-check</v-icon>
</v-btn>
<v-tooltip top>
<template v-slot:activator="{ on }">
<v-btn v-on="on"
icon
:disabled="missingAssets.length > 0"
@click="saveAndRestart"
>
<v-icon>mdi-content-save</v-icon>
</v-btn>
</template>
<span>저장</span>
</v-tooltip>
<v-tooltip top>
<template v-slot:activator="{ on }">
<v-btn v-on="on"
icon
@click="goBack('사용자가 작업을 취소했습니다')"
>
<v-icon>mdi-arrow-left</v-icon>
</v-btn>
</template>
<span>취소</span>
</v-tooltip>
</v-card-actions>
</v-card>
</v-dialog>
Expand Down Expand Up @@ -956,6 +1010,17 @@ export default class SceneMapEditor extends Vue {
this.scene.transfer.emit('receive-map-side', this.map.side)
}
private async showItem(filePath: string): Promise<void> {
ipcRenderer.invoke('show-item', filePath)
}
private showSimilarPath(assetPath: string, allDatasPath: string[]): void {
const similarPath = this.getSimilarPath(assetPath, allDatasPath)
const fullPath = path.resolve(this.$store.state.projectDirectory, similarPath)
this.showItem(fullPath)
}
private requestDeleteSelection(): void {
if (!this.scene) {
return
Expand Down

0 comments on commit dcaa584

Please sign in to comment.