优化属性分组显示顺序

This commit is contained in:
ww-rm
2025-03-26 18:54:35 +08:00
parent fcc21d63b0
commit e6f533ea65
8 changed files with 45 additions and 39 deletions

View File

@@ -54,32 +54,32 @@ namespace SpineViewer.Controls
private class PreviewerProperty(SpinePreviewer previewer)
{
[TypeConverter(typeof(SizeConverter))]
[Category("导出"), DisplayName("分辨率")]
[Category("[0] "), DisplayName("")]
public Size Resolution { get => previewer.Resolution; set => previewer.Resolution = value; }
[TypeConverter(typeof(PointFConverter))]
[Category("导出"), DisplayName("画面中心点")]
[Category("[0] "), DisplayName("")]
public PointF Center { get => previewer.Center; set => previewer.Center = value; }
[Category("导出"), DisplayName("缩放")]
[Category("[0] "), DisplayName("")]
public float Zoom { get => previewer.Zoom; set => previewer.Zoom = value; }
[Category("导出"), DisplayName("旋转")]
[Category("[0] "), DisplayName("")]
public float Rotation { get => previewer.Rotation; set => previewer.Rotation = value; }
[Category("导出"), DisplayName("水平翻转")]
[Category("[0] "), DisplayName("")]
public bool FlipX { get => previewer.FlipX; set => previewer.FlipX = value; }
[Category("导出"), DisplayName("垂直翻转")]
[Category("[0] "), DisplayName("")]
public bool FlipY { get => previewer.FlipY; set => previewer.FlipY = value; }
[Category("导出"), DisplayName("仅渲染选中")]
[Category("[0] "), DisplayName("")]
public bool RenderSelectedOnly { get => previewer.RenderSelectedOnly; set => previewer.RenderSelectedOnly = value; }
[Category("预览"), DisplayName("显示坐标轴")]
[Category("[1] "), DisplayName("")]
public bool ShowAxis { get => previewer.ShowAxis; set => previewer.ShowAxis = value; }
[Category("预览"), DisplayName("最大帧率")]
[Category("[1] "), DisplayName("")]
public uint MaxFps { get => previewer.MaxFps; set => previewer.MaxFps = value; }
}

View File

@@ -39,7 +39,7 @@ namespace SpineViewer.Dialogs
PropertyInfo? labelProp = category.GetType().GetProperty("Label", BindingFlags.Instance | BindingFlags.Public);
if (labelProp == null) continue;
string? label = labelProp.GetValue(category) as string;
if (label != "[1] 导出") continue;
if (label != "[0] 导出") continue;
// 获取该分组下的所有属性项
PropertyInfo? gridItemsProp = category.GetType().GetProperty("GridItems", BindingFlags.Instance | BindingFlags.Public);

View File

@@ -60,32 +60,32 @@ namespace SpineViewer.Exporter
/// 输出文件夹
/// </summary>
[Editor(typeof(FolderNameEditor), typeof(UITypeEditor))]
[Category("[1] "), DisplayName(""), Description("")]
[Category("[0] "), DisplayName(""), Description("")]
public string? OutputDir { get; set; } = null;
/// <summary>
/// 导出单个
/// </summary>
[Category("[1] "), DisplayName(""), Description("")]
[Category("[0] "), DisplayName(""), Description("")]
public bool ExportSingle { get; set; } = false;
/// <summary>
/// 画面分辨率
/// </summary>
[TypeConverter(typeof(SizeConverter))]
[Category("[1] "), DisplayName(""), Description("")]
[Category("[0] "), DisplayName(""), Description("")]
public Size Resolution { get; }
/// <summary>
/// 渲染视窗
/// </summary>
[Category("[1] "), DisplayName(""), Description("")]
[Category("[0] "), DisplayName(""), Description("")]
public SFML.Graphics.View View { get; }
/// <summary>
/// 是否仅渲染选中
/// </summary>
[Category("[1] "), DisplayName(""), Description("")]
[Category("[0] "), DisplayName(""), Description("")]
public bool RenderSelectedOnly { get; }
/// <summary>

View File

@@ -20,7 +20,7 @@ namespace SpineViewer.Exporter.Implementations.ExportArgs
/// 单帧画面格式
/// </summary>
[TypeConverter(typeof(ImageFormatConverter))]
[Category("[2] "), DisplayName("")]
[Category("[1] "), DisplayName("")]
public ImageFormat ImageFormat
{
get => imageFormat;
@@ -35,14 +35,14 @@ namespace SpineViewer.Exporter.Implementations.ExportArgs
/// <summary>
/// 文件名后缀
/// </summary>
[Category("[2] "), DisplayName(""), Description("")]
[Category("[1] "), DisplayName(""), Description("")]
public string FileSuffix { get => imageFormat.GetSuffix(); }
/// <summary>
/// DPI
/// </summary>
[TypeConverter(typeof(SizeFConverter))]
[Category("[2] "), DisplayName("DPI"), Description("")]
[Category("[1] "), DisplayName("DPI"), Description("")]
public SizeF DPI
{
get => dpi;

View File

@@ -20,7 +20,7 @@ namespace SpineViewer.Exporter.Implementations.ExportArgs
/// 文件名后缀
/// </summary>
[TypeConverter(typeof(SFMLImageFileSuffixConverter))]
[Category("[3] "), DisplayName(""), Description("")]
[Category("[2] "), DisplayName(""), Description("")]
public string FileSuffix { get; set; } = ".png";
}
}

View File

@@ -22,14 +22,14 @@ namespace SpineViewer.Exporter.Implementations.ExportArgs
/// <summary>
/// 调色板最大颜色数量
/// </summary>
[Category("[3] GIF "), DisplayName(""), Description("使, ")]
[Category("[2] GIF "), DisplayName(""), Description("使, ")]
public uint MaxColors { get => maxColors; set => maxColors = Math.Clamp(value, 2, 256); }
private uint maxColors = 256;
/// <summary>
/// 透明度阈值
/// </summary>
[Category("[3] GIF "), DisplayName(""), Description("")]
[Category("[2] GIF "), DisplayName(""), Description("")]
public byte AlphaThreshold { get => alphaThreshold; set => alphaThreshold = value; }
private byte alphaThreshold = 128;

View File

@@ -17,7 +17,7 @@ namespace SpineViewer.Exporter.Implementations.ExportArgs
/// <summary>
/// 导出时长
/// </summary>
[Category("[2] "), DisplayName(""), Description(", 0, 使")]
[Category("[1] "), DisplayName(""), Description(", 0, 使")]
public float Duration
{
get => duration;
@@ -28,7 +28,7 @@ namespace SpineViewer.Exporter.Implementations.ExportArgs
/// <summary>
/// 帧率
/// </summary>
[Category("[2] "), DisplayName(""), Description("")]
[Category("[1] "), DisplayName(""), Description("")]
public float FPS { get; set; } = 60;
public override string? Validate()

View File

@@ -223,37 +223,37 @@ namespace SpineViewer.Spine
/// 获取所属版本
/// </summary>
[TypeConverter(typeof(VersionConverter))]
[Category("基本信息"), DisplayName("运行时版本")]
[Category("[0] "), DisplayName("")]
public Version Version { get; }
/// <summary>
/// 资源所在完整目录
/// </summary>
[Category("基本信息"), DisplayName("资源目录")]
[Category("[0] "), DisplayName("")]
public string AssetsDir { get; }
/// <summary>
/// skel 文件完整路径
/// </summary>
[Category("基本信息"), DisplayName("skel文件路径")]
[Category("[0] "), DisplayName("skel文件路径")]
public string SkelPath { get; }
/// <summary>
/// atlas 文件完整路径
/// </summary>
[Category("基本信息"), DisplayName("atlas文件路径")]
[Category("[0] "), DisplayName("atlas文件路径")]
public string AtlasPath { get; }
/// <summary>
/// 名称
/// </summary>
[Category("基本信息"), DisplayName("名称")]
[Category("[0] "), DisplayName("")]
public string Name { get; }
/// <summary>
/// 获取所属文件版本
/// </summary>
[Category("基本信息"), DisplayName("文件版本")]
[Category("[0] "), DisplayName("")]
public abstract string FileVersion { get; }
#endregion
@@ -263,26 +263,26 @@ namespace SpineViewer.Spine
/// <summary>
/// 缩放比例
/// </summary>
[Category("变换"), DisplayName("缩放比例")]
[Category("[1] "), DisplayName("")]
public abstract float Scale { get; set; }
/// <summary>
/// 位置
/// </summary>
[TypeConverter(typeof(PointFConverter))]
[Category("变换"), DisplayName("位置")]
[Category("[1] "), DisplayName("")]
public abstract PointF Position { get; set; }
/// <summary>
/// 水平翻转
/// </summary>
[Category("变换"), DisplayName("水平翻转")]
[Category("[1] "), DisplayName("")]
public abstract bool FlipX { get; set; }
/// <summary>
/// 垂直翻转
/// </summary>
[Category("变换"), DisplayName("垂直翻转")]
[Category("[1] "), DisplayName("")]
public abstract bool FlipY { get; set; }
#endregion
@@ -292,9 +292,15 @@ namespace SpineViewer.Spine
/// <summary>
/// 是否使用预乘Alpha
/// </summary>
[Category("渲染"), DisplayName("预乘Alpha通道")]
[Category("[3] "), DisplayName("Alpha通道")]
public bool UsePremultipliedAlpha { get; set; } = true;
/// <summary>
/// 是否被隐藏, 被隐藏的模型将仅仅在列表显示, 不参与其他行为
/// </summary>
[Category("[3] "), DisplayName("")]
public bool IsHidden { get; set; } = false;
#endregion
#region |
@@ -310,13 +316,13 @@ namespace SpineViewer.Spine
/// 当前动画名称, 如果设置的动画不存在则忽略
/// </summary>
[TypeConverter(typeof(AnimationConverter))]
[Category("动画"), DisplayName("当前动画")]
[Category("[2] "), DisplayName("")]
public abstract string CurrentAnimation { get; set; }
/// <summary>
/// 当前动画时长
/// </summary>
[Category("动画"), DisplayName("当前动画时长")]
[Category("[2] "), DisplayName("")]
public float CurrentAnimationDuration { get => GetAnimationDuration(CurrentAnimation); }
/// <summary>
@@ -330,7 +336,7 @@ namespace SpineViewer.Spine
/// 当前皮肤名称, 如果设置的皮肤不存在则忽略
/// </summary>
[TypeConverter(typeof(SkinConverter))]
[Category("动画"), DisplayName("当前皮肤")]
[Category("[2] "), DisplayName("")]
public abstract string CurrentSkin { get; set; }
#endregion
@@ -431,13 +437,13 @@ namespace SpineViewer.Spine
/// <summary>
/// 显示包围盒
/// </summary>
[Category("调试"), DisplayName("显示包围盒")]
[Category("[4] "), DisplayName("")]
public bool DebugBounds { get; set; } = true;
/// <summary>
/// 显示骨骼
/// </summary>
[Category("调试"), DisplayName("显示骨骼(TODO)")]
[Category("[4] "), DisplayName("(TODO)")]
public bool DebugBones { get; set; } = false;
#region SFML.Graphics.Drawable