mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-04-03 11:05:16 +08:00
添加相对比例定位功能,将遮罩窗口中的状态列表和日志文本框从绝对坐标改为基于窗口宽高的比例坐标 新增OverlayRelativeOrAbsoluteConverter转换器处理坐标转换 修改相关视图模型和配置以支持比例定位
106 lines
2.5 KiB
C#
106 lines
2.5 KiB
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using OpenCvSharp;
|
|
using System;
|
|
|
|
namespace BetterGenshinImpact.Core.Config;
|
|
|
|
/// <summary>
|
|
/// 遮罩窗口配置
|
|
/// </summary>
|
|
[Serializable]
|
|
public partial class MaskWindowConfig : ObservableObject
|
|
{
|
|
/// <summary>
|
|
/// 方位提示是否启用
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
private bool _directionsEnabled;
|
|
|
|
/// <summary>
|
|
/// 是否在遮罩窗口上显示识别结果
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
private bool _displayRecognitionResultsOnMask = true;
|
|
|
|
/// <summary>
|
|
/// 是否启用遮罩窗口
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
private bool _maskEnabled = true;
|
|
|
|
///// <summary>
|
|
///// 显示遮罩窗口边框
|
|
///// </summary>
|
|
//[ObservableProperty] private bool _showMaskBorder = false;
|
|
|
|
/// <summary>
|
|
/// 显示日志窗口
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
private bool _showLogBox = true;
|
|
|
|
/// <summary>
|
|
/// 显示状态指示
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
private bool _showStatus = true;
|
|
|
|
/// <summary>
|
|
/// UID遮盖是否启用
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
private bool _uidCoverEnabled;
|
|
|
|
/// <summary>
|
|
/// 1080p下UID遮盖的位置与大小
|
|
/// </summary>
|
|
[NonSerialized]
|
|
public static readonly Rect UidCoverRightBottomRect = new(1920 - 1685, 1080 - 1053, 178, 22);
|
|
|
|
/// <summary>
|
|
/// 显示FPS
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
private bool _showFps = false;
|
|
|
|
/// <summary>
|
|
/// 作为原神子窗体
|
|
/// 有些bug没解决
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
private bool _useSubform = false;
|
|
|
|
/// <summary>
|
|
/// 遮罩文本透明度 (0.0-1.0)
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
private double _textOpacity = 1.0;
|
|
|
|
[ObservableProperty]
|
|
private bool _overlayLayoutEditEnabled = false;
|
|
|
|
[ObservableProperty]
|
|
private double _logTextBoxLeftRatio = 20.0 / 1920;
|
|
|
|
[ObservableProperty]
|
|
private double _logTextBoxTopRatio = 832.0 / 1080;
|
|
|
|
[ObservableProperty]
|
|
private double _logTextBoxWidthRatio = 477.0 / 1920;
|
|
|
|
[ObservableProperty]
|
|
private double _logTextBoxHeightRatio = 188.0 / 1080;
|
|
|
|
[ObservableProperty]
|
|
private double _statusListLeftRatio = 20.0 / 1920;
|
|
|
|
[ObservableProperty]
|
|
private double _statusListTopRatio = 807.0 / 1080;
|
|
|
|
[ObservableProperty]
|
|
private double _statusListWidthRatio = 477.0 / 1920;
|
|
|
|
[ObservableProperty]
|
|
private double _statusListHeightRatio = 24.0 / 1080;
|
|
}
|