Folder path fix

This commit is contained in:
Serge
2024-03-08 09:55:07 +01:00
parent 1b098cd3ee
commit a49ac1072e

View File

@@ -1,10 +1,5 @@
using GHelper.Helpers; using GHelper.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management; using System.Management;
using System.Text;
using System.Threading.Tasks;
namespace GHelper.Display namespace GHelper.Display
{ {
@@ -50,14 +45,19 @@ namespace GHelper.Display
private static string GetGameVisualPath() private static string GetGameVisualPath()
{ {
return "C:\\ProgramData\\ASUS\\GameVisual"; return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\ASUS\\GameVisual";
} }
public static Dictionary<SplendidGamut, string> GetGamutModes() public static Dictionary<SplendidGamut, string> GetGamutModes()
{ {
Dictionary<SplendidGamut, string> _modes = new Dictionary<SplendidGamut, string>(); Dictionary<SplendidGamut, string> _modes = new Dictionary<SplendidGamut, string>();
if (!Directory.Exists(GetGameVisualPath())) return _modes; string gameVisualPath = GetGameVisualPath();
if (!Directory.Exists(gameVisualPath))
{
Logger.WriteLine(gameVisualPath + "doesn't exit");
return _modes;
}
try try
{ {