Files
SpineViewer/SpineViewer/Models/PreferenceModel.cs
2025-10-02 10:32:24 +08:00

116 lines
2.7 KiB
C#

using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Spine.Interfaces;
using SpineViewer.Services;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Threading.Tasks;
using System.Windows.Media;
namespace SpineViewer.Models
{
/// <summary>
/// 首选项参数模型, 用于对话框修改以及本地保存
/// </summary>
public partial class PreferenceModel : ObservableObject
{
#region
[ObservableProperty]
private bool _forcePremul;
[ObservableProperty]
private bool _forceNearest;
[ObservableProperty]
private bool _forceMipmap;
#endregion
#region
[ObservableProperty]
private bool _isShown = true;
[ObservableProperty]
private bool _usePma;
[ObservableProperty]
private bool _debugTexture = true;
[ObservableProperty]
private bool _debugBounds;
[ObservableProperty]
private bool _debugBones;
[ObservableProperty]
private bool _debugRegions;
[ObservableProperty]
private bool _debugMeshHulls;
[ObservableProperty]
private bool _debugMeshes;
[ObservableProperty]
private bool _debugBoundingBoxes;
[ObservableProperty]
private bool _debugPaths;
[ObservableProperty]
private bool _debugPoints;
[ObservableProperty]
private bool _debugClippings;
#endregion
#region
public RelayCommand Cmd_SelectAutoRunWorkspaceConfigPath => _cmd_SelectAutoRunWorkspaceConfigPath ??= new(() =>
{
if (!DialogService.ShowOpenJsonDialog(out var fileName))
return;
AutoRunWorkspaceConfigPath = fileName;
});
private RelayCommand? _cmd_SelectAutoRunWorkspaceConfigPath;
[ObservableProperty]
private AppLanguage _appLanguage;
[ObservableProperty]
private bool _renderSelectedOnly;
[ObservableProperty]
private HitTestLevel _hitTestLevel;
[ObservableProperty]
private bool _logHitSlots;
[ObservableProperty]
private bool _wallpaperView;
[ObservableProperty]
private bool? _closeToTray = null;
[ObservableProperty]
private bool _autoRun;
[ObservableProperty]
private string _autoRunWorkspaceConfigPath;
[ObservableProperty]
private bool _associateFileSuffix;
#endregion
}
}