Ready for the first beta release. #105

Merged
That-One-Nerd merged 41 commits from main-canary into main 2023-05-18 13:05:42 -04:00
3 changed files with 36 additions and 1 deletions
Showing only changes of commit d83c16827f - Show all commits

View File

@ -7,6 +7,7 @@ global using SrcMod.Shell.Extensions;
global using SrcMod.Shell.Interop;
global using SrcMod.Shell.Modules.ObjectModels;
global using SrcMod.Shell.ObjectModels;
global using SrcMod.Shell.ObjectModels.Steam;
global using System;
global using System.Collections;
global using System.Collections.Generic;

View File

@ -65,7 +65,28 @@ public class Config
internal Config()
{
// TODO: This won't work if the steam installation is somewhere else.
const string gameDirDataPath = @"C:\Program Files (x86)\Steam\steamapps\libraryfolders.vdf";
VkvSerializer serializer = new(new()
{
useEscapeCodes = true,
useQuotes = true
});
FileStream gameDirData = new(gameDirDataPath, FileMode.Open);
LibraryFolder[]? folders = serializer.Deserialize<LibraryFolder[]>(gameDirData);
if (folders is null)
{
Write("[WARNING] Error parsing steam game directories.");
GameDirectories = Array.Empty<string>();
}
else
{
GameDirectories = new string[folders.Length];
for (int i = 0; i < folders.Length; i++) GameDirectories[i] = folders[i].path;
}
RunUnsafeCommands = AskMode.Ask;
}

View File

@ -0,0 +1,13 @@
namespace SrcMod.Shell.ObjectModels.Steam;
public class LibraryFolder
{
public string path;
public Dictionary<int, int> apps;
public LibraryFolder()
{
path = string.Empty;
apps = new();
}
}