using HKW.HKWUtils.Observable; using LinePutScript.Localization.WPF; using System.Collections.ObjectModel; using System.ComponentModel; using System.Windows; namespace VPet.Solution.Models.SettingEditor; public class GraphicsSettingModel : ObservableClass { #region ZoomLevel private double _zoomLevel = 1; /// /// 缩放倍率 /// [DefaultValue(1)] [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.ZoomLevel))] public double ZoomLevel { get => _zoomLevel; set => SetProperty(ref _zoomLevel, value); } private double _zoomLevelMinimum = 0.5; [DefaultValue(0.5)] public double ZoomLevelMinimum { get => _zoomLevelMinimum; set => SetProperty(ref _zoomLevelMinimum, value); } private double _zoomLevelMaximum = 3; [DefaultValue(3)] public double ZoomLevelMaximum { get => _zoomLevelMaximum; set => SetProperty(ref _zoomLevelMaximum, value); } #endregion #region Resolution private int _resolution = 1000; /// /// 桌宠图形渲染的分辨率,越高图形越清晰 /// [DefaultValue(1000)] [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.Resolution))] public int Resolution { get => _resolution; set => SetProperty(ref _resolution, value); } #endregion #region IsBiggerScreen private bool _isBiggerScreen; /// /// 是否为更大的屏幕 /// [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.IsBiggerScreen))] public bool IsBiggerScreen { get => _isBiggerScreen; set { SetProperty(ref _isBiggerScreen, value); if (value is true) ZoomLevelMaximum = 8; else ZoomLevelMaximum = 3; } } #endregion #region TopMost private bool _topMost; /// /// 是否置于顶层 /// [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.TopMost))] public bool TopMost { get => _topMost; set => SetProperty(ref _topMost, value); } #endregion #region HitThrough private bool _hitThrough; /// /// 是否鼠标穿透 /// [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.HitThrough))] public bool HitThrough { get => _hitThrough; set => SetProperty(ref _hitThrough, value); } #endregion #region Language private string _language = Languages.First(); /// /// 语言 /// [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.Language))] public string Language { get => _language; set => SetProperty(ref _language, value); } public static ObservableCollection Languages { get; } = new() { "zh-Hans", "zh-Hant", "en" }; // NOTE: 实际上这里面并没有文化 new(LocalizeCore.AvailableCultures); #endregion #region Font private string _font; /// /// 字体 /// [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.Font))] public string Font { get => _font; set => SetProperty(ref _font, value); } #endregion #region Theme private string _theme; /// /// 主题 /// [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.Theme))] public string Theme { get => _theme; set => SetProperty(ref _theme, value); } #endregion #region StartUPBoot private bool _startUPBoot; /// /// 开机启动 /// [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.StartUPBoot))] public bool StartUPBoot { get => _startUPBoot; set => SetProperty(ref _startUPBoot, value); } #endregion #region StartUPBootSteam private bool _startUPBootSteam; /// /// 开机启动 Steam /// [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.StartUPBootSteam))] public bool StartUPBootSteam { get => _startUPBootSteam; set => SetProperty(ref _startUPBootSteam, value); } #endregion #region StartRecordLast private bool _startRecordLast = true; /// /// 是否记录游戏退出位置 /// [DefaultValue(true)] [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.StartRecordLast))] public bool StartRecordLast { get => _startRecordLast; set => SetProperty(ref _startRecordLast, value); } #endregion //private Point _startRecordLastPoint; ///// ///// 记录上次退出位置 ///// //public Point StartRecordLastPoint //{ // get => _startRecordLastPoint; // set => SetProperty(ref _startRecordLastPoint, value); //} #region StartRecordPoint private ObservablePoint _startRecordPoint; /// /// 设置中桌宠启动的位置 /// [ReflectionProperty] [ReflectionPropertyConverter(typeof(ObservablePointToPointConverter))] public ObservablePoint StartRecordPoint { get => _startRecordPoint; set => SetProperty(ref _startRecordPoint, value); } #endregion #region HideFromTaskControl private bool _hideFromTaskControl; /// /// 在任务切换器(Alt+Tab)中隐藏窗口 /// [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.HideFromTaskControl))] public bool HideFromTaskControl { get => _hideFromTaskControl; set => SetProperty(ref _hideFromTaskControl, value); } #endregion #region MessageBarOutside private bool _messageBarOutside; /// /// 消息框外置 /// [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.MessageBarOutside))] public bool MessageBarOutside { get => _messageBarOutside; set => SetProperty(ref _messageBarOutside, value); } #endregion #region PetHelper private bool _petHelper; /// /// 是否显示宠物帮助窗口 /// [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.PetHelper))] public bool PetHelper { get => _petHelper; set => SetProperty(ref _petHelper, value); } #endregion #region PetHelpLeft private double _petHelpLeft; // TODO 加入 PetHelpLeft /// /// 快捷穿透按钮X坐标 /// [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.PetHelpLeft))] public double PetHelpLeft { get => _petHelpLeft; set => SetProperty(ref _petHelpLeft, value); } #endregion #region PetHelpTop private double _petHelpTop; // TODO 加入 PetHelpTop /// /// 快捷穿透按钮Y坐标 /// [ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.PetHelpTop))] public double PetHelpTop { get => _petHelpTop; set => SetProperty(ref _petHelpTop, value); } #endregion }