VPet/VPet.Solution/Models/SettingEditor/GraphicsSettingModel.cs

297 lines
7.3 KiB
C#
Raw Normal View History

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