mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-01-01 14:20:05 +01:00
Small refactor of menu with options Fix protection error on menuwithoptions Make profiles controller non static Dynamicall set and load options Use IsOSDForeground when retriveing current game name Better alt-tab functionality Get rid off thread.sleep Merged #38
54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Xml.Linq;
|
|
using CommonHelpers;
|
|
|
|
namespace PowerControl.Helper
|
|
{
|
|
public class ProfileSettings : BaseSettings
|
|
{
|
|
private static string profilesPath = Path.Combine(Directory.GetCurrentDirectory(), "Profiles");
|
|
|
|
static ProfileSettings()
|
|
{
|
|
Directory.CreateDirectory(profilesPath);
|
|
}
|
|
|
|
public ProfileSettings(string profileName) : base("Profile")
|
|
{
|
|
this.TouchSettings = true;
|
|
this.ConfigFile = Path.Combine(profilesPath, profileName + ".ini");
|
|
|
|
this.SettingChanging += delegate { };
|
|
this.SettingChanged += delegate { };
|
|
}
|
|
|
|
public T Get<T>(string key, T defaultValue)
|
|
{
|
|
return base.Get(key, defaultValue);
|
|
}
|
|
|
|
public new bool Set<T>(string key, T value)
|
|
{
|
|
return base.Set(key, value);
|
|
}
|
|
|
|
public static bool CheckIfExists(string profileName)
|
|
{
|
|
foreach (FileInfo fi in Directory.CreateDirectory(profilesPath).GetFiles())
|
|
{
|
|
if (fi.Name[^4..].Equals(".ini") && fi.Name[..^4].Equals(profileName))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|