Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
izure committed Feb 15, 2021
1 parent b63a891 commit f3621e3
Show file tree
Hide file tree
Showing 6 changed files with 223 additions and 123 deletions.
47 changes: 37 additions & 10 deletions src/Renderer/components/Manager/Data/Scene/Map/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@
</v-list>
</v-menu>
</v-btn>

<v-btn
v-if="isSaving"
:loading="isSaving"
:disabled="isSaving"
text
>
저장 중...
</v-btn>

</v-toolbar>

Expand Down Expand Up @@ -317,14 +326,6 @@
</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
<v-list-item>
<v-list-item-content>
<v-list-item-title>저장</v-list-item-title>
<v-list-item-subtitle>
맵은 자동으로 저장됩니다.
</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
</v-list>
</v-card-text>
</v-card>
Expand Down Expand Up @@ -394,6 +395,7 @@ export default class SceneMapEditor extends Vue {
@NonReactivity(null) private game!: Phaser.Game|null
@NonReactivity(null) private scene!: PreviewScene|null
private isSaving: boolean = false
private isBuilding: boolean = false
private isBuiltFail: boolean = false
private isTooltipOpen: boolean = false
Expand Down Expand Up @@ -436,6 +438,12 @@ export default class SceneMapEditor extends Vue {
click: (): void => {
this.openMapResizer()
}
},
{
text: '저장하기',
click: (): void => {
this.save()
}
}
]
},
Expand Down Expand Up @@ -535,7 +543,7 @@ export default class SceneMapEditor extends Vue {
private async createGame(): Promise<void> {
const [ width, height ] = this.projectConfig.gameDisplaySize
const previewScene: PreviewScene = new PreviewScene(this.projectDirectory, this.storageKey, this.filePath)
const previewScene: PreviewScene = new PreviewScene(this.projectDirectory, this.storageKey)
const config = createConfig(width, height, [ previewScene ], this.canvasParent)
this.game = new Phaser.Game(config)
Expand All @@ -551,6 +559,14 @@ export default class SceneMapEditor extends Vue {
.on('load-map-success', (map: Engine.GameProject.SceneMap): void => {
this.mapSceneSide = map.side
})
.on('save-map-fail', (message: string): void => {
this.isSaving = false
this.$store.dispatch('snackbar', message)
})
.on('save-map-success', (): void => {
this.isSaving = false
this.$store.dispatch('snackbar', '저장되었습니다!')
})
this.resizeCanvas()
}
Expand Down Expand Up @@ -666,7 +682,7 @@ export default class SceneMapEditor extends Vue {
return
}
this.scene.transfer.emit('receive-properties', {
this.scene.transfer.emit('receive-wall-properties', {
alias: this.propertyAlias,
scale: this.propertyScale,
isSensor: this.propertyIsSensor
Expand Down Expand Up @@ -709,6 +725,17 @@ export default class SceneMapEditor extends Vue {
this.setDisposeBrush(null)
}
private save(): void {
if (!this.scene) {
return
}
if (this.isSaving) {
return
}
this.isSaving = true
this.scene.transfer.emit('receive-save-request')
}
private checkKeyExists(): boolean {
if (!this.storageKey) {
Expand Down
Loading

0 comments on commit f3621e3

Please sign in to comment.