From 63daccb3c1917e54a2f9ab4b8538b27c94b5f752 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Thu, 5 Sep 2024 17:40:10 +0100 Subject: [PATCH] Remove old InstallPaths --- project/code/TMV/InstallPaths.cs | 57 -------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 project/code/TMV/InstallPaths.cs diff --git a/project/code/TMV/InstallPaths.cs b/project/code/TMV/InstallPaths.cs deleted file mode 100644 index 8aa79c5..0000000 --- a/project/code/TMV/InstallPaths.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.IO; -using Godot; - -namespace KeepersCompound.TMV; - -// TODO: Error handling lol -public class InstallPaths -{ - public string rootPath; - public string famPath; - public string objPath; - public string omsPath; - public string fmsPath; - - public InstallPaths(string root) - { - var searchOptions = new EnumerationOptions - { - MatchCasing = MatchCasing.CaseInsensitive, - RecurseSubdirectories = true - }; - - rootPath = root; - famPath = Directory.GetFiles(rootPath, "fam.crf", searchOptions)[0]; - objPath = Directory.GetFiles(rootPath, "obj.crf", searchOptions)[0]; - var paths = Directory.GetFiles(rootPath, "install.cfg", searchOptions); - if (paths.Length == 0) - { - paths = Directory.GetFiles(rootPath, "darkinst.cfg", searchOptions); - } - var installCfgPath = paths[0]; - GD.Print($"Install.cfg: {installCfgPath}"); - foreach (var line in File.ReadLines(installCfgPath)) - { - if (line.StartsWith("load_path")) - { - var path = line.Split(" ")[1].Replace("\\", "/"); - omsPath = Path.GetFullPath(rootPath + path); - break; - } - } - - var camModPath = Directory.GetFiles(rootPath, "cam_mod.ini", searchOptions)[0]; - fmsPath = rootPath + "/FMs"; - foreach (var line in File.ReadLines(camModPath)) - { - if (line.StartsWith("fm_path")) - { - var path = line.Split(" ")[1].Replace("\\", "/"); - fmsPath = Path.GetFullPath(rootPath + path); - break; - } - } - - GD.Print($"OMs Path: {omsPath}"); - } -} \ No newline at end of file