Fix generate task override behaviour (#3661)

This commit is contained in:
DingDongSoLong4
2023-05-03 05:42:25 +02:00
committed by GitHub
parent 1717474a81
commit 67a2161c62
9 changed files with 96 additions and 51 deletions

View File

@@ -20,7 +20,7 @@ func (t *GenerateSpriteTask) GetDescription() string {
}
func (t *GenerateSpriteTask) Start(ctx context.Context) {
if !t.Overwrite && !t.required() {
if !t.required() {
return
}
@@ -54,6 +54,11 @@ func (t GenerateSpriteTask) required() bool {
if t.Scene.Path == "" {
return false
}
if t.Overwrite {
return true
}
sceneHash := t.Scene.GetHash(t.fileNamingAlgorithm)
return !t.doesSpriteExist(sceneHash)
}