Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e293daf62 | ||
|
|
f9d7fdc516 | ||
|
|
6a04f3955c | ||
|
|
dce3b1780c |
@@ -1,5 +1,9 @@
|
||||
# CHANGELOG
|
||||
|
||||
## v0.10.9
|
||||
|
||||
- 预览图导出增加名称后缀参数
|
||||
|
||||
## v0.10.8
|
||||
|
||||
- 完善预览图导出
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
### 格式与版本转换
|
||||
|
||||
可以通过工具菜单进行骨骼文件换, 允许二进制和文本格式之间的转换, 以及不同版本间的转换.
|
||||
可以通过工具菜单进行骨骼文件转换, 允许二进制和文本格式之间的转换, 以及不同版本间的转换.
|
||||
|
||||
目前处于施工中, 仅支持转换 `3.8.x` 二进制到文本格式.
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace SpineViewer.Dialogs
|
||||
var outputDir = textBox_OutputDir.Text;
|
||||
if (string.IsNullOrEmpty(outputDir))
|
||||
{
|
||||
Result.OutputDir = null;
|
||||
outputDir = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -63,9 +63,16 @@ namespace SpineViewer.Dialogs
|
||||
return;
|
||||
}
|
||||
}
|
||||
Result.OutputDir = Path.GetFullPath(outputDir);
|
||||
outputDir = Path.GetFullPath(outputDir);
|
||||
}
|
||||
|
||||
if (outputDir is null && string.IsNullOrEmpty(Result.NameSuffix))
|
||||
{
|
||||
MessageBox.Info("输出文件夹和名称后缀不可同时为空,存在文件覆盖风险");
|
||||
return;
|
||||
}
|
||||
|
||||
Result.OutputDir = outputDir;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
@@ -87,7 +94,7 @@ namespace SpineViewer.Dialogs
|
||||
/// 预览图格式
|
||||
/// </summary>
|
||||
[TypeConverter(typeof(ImageFormatConverter))]
|
||||
[Category("导出参数"), DisplayName("预览图格式")]
|
||||
[Category("图像"), DisplayName("预览图格式")]
|
||||
public ImageFormat ImageFormat
|
||||
{
|
||||
get => imageFormat;
|
||||
@@ -103,7 +110,7 @@ namespace SpineViewer.Dialogs
|
||||
/// 预览图分辨率
|
||||
/// </summary>
|
||||
[TypeConverter(typeof(SizeConverter))]
|
||||
[Category("导出参数"), DisplayName("分辨率")]
|
||||
[Category("图像"), DisplayName("分辨率")]
|
||||
public Size Resolution
|
||||
{
|
||||
get => resolution;
|
||||
@@ -120,7 +127,7 @@ namespace SpineViewer.Dialogs
|
||||
/// 四周填充像素值
|
||||
/// </summary>
|
||||
[TypeConverter(typeof(PaddingConverter))]
|
||||
[Category("导出参数"), DisplayName("四周填充像素值")]
|
||||
[Category("图像"), DisplayName("四周填充像素值")]
|
||||
public Padding Padding
|
||||
{
|
||||
get => padding;
|
||||
@@ -139,7 +146,7 @@ namespace SpineViewer.Dialogs
|
||||
/// DPI
|
||||
/// </summary>
|
||||
[TypeConverter(typeof(SizeFConverter))]
|
||||
[Category("导出参数"), DisplayName("DPI")]
|
||||
[Category("图像"), DisplayName("DPI")]
|
||||
public SizeF DPI
|
||||
{
|
||||
get => dpi;
|
||||
@@ -151,6 +158,12 @@ namespace SpineViewer.Dialogs
|
||||
}
|
||||
}
|
||||
private SizeF dpi = new(144, 144);
|
||||
|
||||
/// <summary>
|
||||
/// 名称后缀
|
||||
/// </summary>
|
||||
[Category("其他"), DisplayName("名称后缀")]
|
||||
public string NameSuffix { get; set; } = "(preview)";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -301,6 +301,7 @@ namespace SpineViewer
|
||||
var resolution = arguments.Resolution;
|
||||
var padding = arguments.Padding;
|
||||
var dpi = arguments.DPI;
|
||||
var nameSuffix = arguments.NameSuffix;
|
||||
var renderSelectedOnly = spinePreviewer.RenderSelectedOnly;
|
||||
|
||||
var tex = new SFML.Graphics.RenderTexture((uint)resolution.Width, (uint)resolution.Height);
|
||||
@@ -325,7 +326,7 @@ namespace SpineViewer
|
||||
if (renderSelectedOnly && !spine.IsSelected)
|
||||
continue;
|
||||
|
||||
var filename = $"(preview) {spine.Name}{imageFormat.GetSuffix()}"; // 加上 preview 是为了防止覆盖同名的 png 文件
|
||||
var filename = $"{spine.Name}{nameSuffix}{imageFormat.GetSuffix()}";
|
||||
var savePath = outputDir is null ? Path.Combine(spine.AssetsDir, filename) : Path.Combine(outputDir, filename);
|
||||
|
||||
var tmp = spine.CurrentAnimation;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<BaseOutputPath>$(SolutionDir)out</BaseOutputPath>
|
||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||
<Version>0.10.8</Version>
|
||||
<Version>0.10.9</Version>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ApplicationIcon>appicon.ico</ApplicationIcon>
|
||||
|
||||
Reference in New Issue
Block a user