Remove old InstallPaths
This commit is contained in:
parent
b223d53824
commit
63daccb3c1
|
@ -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}");
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue