mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-04-15 21:03:42 +08:00
45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
using System;
|
|
|
|
namespace BetterGenshinImpact.Genshin.Settings;
|
|
|
|
public class ResolutionSettings
|
|
{
|
|
protected string? height_name = null;
|
|
protected string? width_name = null;
|
|
protected string? fullscreen_name = null;
|
|
|
|
public int Height { get; protected set; }
|
|
public int Width { get; protected set; }
|
|
public bool FullScreen { get; protected set; }
|
|
|
|
public ResolutionSettings()
|
|
{
|
|
if (GenshinRegistry.GetRegistryKey() is not { } hk)
|
|
{
|
|
return;
|
|
}
|
|
|
|
string[] names = hk.GetValueNames();
|
|
|
|
foreach (string name in names)
|
|
{
|
|
if (name.Contains("Width"))
|
|
{
|
|
width_name = name;
|
|
}
|
|
if (name.Contains("Height"))
|
|
{
|
|
height_name = name;
|
|
}
|
|
if (name.Contains("Fullscreen"))
|
|
{
|
|
fullscreen_name = name;
|
|
}
|
|
}
|
|
|
|
Height = Convert.ToInt32(hk.GetValue(height_name));
|
|
Width = Convert.ToInt32(hk.GetValue(width_name));
|
|
FullScreen = Convert.ToInt32(hk.GetValue(fullscreen_name)) == 1;
|
|
}
|
|
}
|