mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-26 09:19:27 +00:00
Fix cryptic error message using "Repeat Last Export" in some special cases (fix #1247)
We cannot use the sprite sheet type to know if the last export was already done/defined by the user for a new sprite. We need a special field to indicate if the export was done and we can repeat it last export with the same configuration.
This commit is contained in:
parent
1c88af5689
commit
18f9d2478f
@ -278,6 +278,7 @@
|
||||
<option id="resize_scale" type="double" default="1" />
|
||||
</section>
|
||||
<section id="sprite_sheet">
|
||||
<option id="defined" type="bool" default="false" />
|
||||
<option id="type" type="app::SpriteSheetType" default="app::SpriteSheetType::None" />
|
||||
<option id="columns" type="int" default="0" />
|
||||
<option id="rows" type="int" default="0" />
|
||||
|
@ -757,6 +757,7 @@ void ExportSpriteSheetCommand::onExecute(Context* context)
|
||||
if (!window.ok())
|
||||
return;
|
||||
|
||||
docPref.spriteSheet.defined(true);
|
||||
docPref.spriteSheet.type(window.spriteSheetTypeValue());
|
||||
docPref.spriteSheet.columns(window.columnsValue());
|
||||
docPref.spriteSheet.rows(window.rowsValue());
|
||||
@ -778,6 +779,7 @@ void ExportSpriteSheetCommand::onExecute(Context* context)
|
||||
// Default preferences for future sprites
|
||||
DocumentPreferences& defPref(Preferences::instance().document(nullptr));
|
||||
defPref.spriteSheet = docPref.spriteSheet;
|
||||
defPref.spriteSheet.defined(false);
|
||||
if (!defPref.spriteSheet.textureFilename().empty())
|
||||
defPref.spriteSheet.textureFilename.setValueAndDefault(kSpecifiedFilename);
|
||||
if (!defPref.spriteSheet.dataFilename().empty())
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -51,8 +51,7 @@ void RepeatLastExportCommand::onExecute(Context* context)
|
||||
DocumentPreferences& docPref =
|
||||
Preferences::instance().document(document);
|
||||
|
||||
params.set("ui",
|
||||
(docPref.spriteSheet.type() == app::SpriteSheetType::None ? "1": "0"));
|
||||
params.set("ui", (docPref.spriteSheet.defined() ? "0": "1"));
|
||||
}
|
||||
|
||||
context->executeCommand(cmd, params);
|
||||
|
Loading…
Reference in New Issue
Block a user