优化属性分组显示顺序

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) private class PreviewerProperty(SpinePreviewer previewer)
{ {
[TypeConverter(typeof(SizeConverter))] [TypeConverter(typeof(SizeConverter))]
[Category("导出"), DisplayName("分辨率")] [Category("[0] "), DisplayName("")]
public Size Resolution { get => previewer.Resolution; set => previewer.Resolution = value; } public Size Resolution { get => previewer.Resolution; set => previewer.Resolution = value; }
[TypeConverter(typeof(PointFConverter))] [TypeConverter(typeof(PointFConverter))]
[Category("导出"), DisplayName("画面中心点")] [Category("[0] "), DisplayName("")]
public PointF Center { get => previewer.Center; set => previewer.Center = value; } 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; } 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; } 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; } 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; } 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; } 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; } 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; } 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); PropertyInfo? labelProp = category.GetType().GetProperty("Label", BindingFlags.Instance | BindingFlags.Public);
if (labelProp == null) continue; if (labelProp == null) continue;
string? label = labelProp.GetValue(category) as string; 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); PropertyInfo? gridItemsProp = category.GetType().GetProperty("GridItems", BindingFlags.Instance | BindingFlags.Public);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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