Skip to content

Commit ea403ed

Browse files
committed
Default to the user's quicklauncher directory.
1 parent b2b12ef commit ea403ed

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

xivModdingFramework/Helpers/PenumbraAPI.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,26 @@ private static async Task<bool> Request(string urlPath, object data = null)
7272
}
7373

7474

75+
public static string GetQuickLauncherGameDirectory()
76+
{
77+
var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "XIVLauncher", "launcherConfigV3.json");
78+
if (!File.Exists(path))
79+
{
80+
return "";
81+
}
82+
83+
try
84+
{
85+
var obj = JObject.Parse(File.ReadAllText(path));
86+
var st = (string)obj["GamePath"];
87+
return st;
88+
}
89+
catch (Exception ex)
90+
{
91+
return "";
92+
}
93+
}
94+
7595
public static string GetPenumbraDirectory()
7696
{
7797
var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "XIVLauncher", "pluginConfigs", "Penumbra.json");
@@ -91,6 +111,7 @@ public static string GetPenumbraDirectory()
91111
return "";
92112
}
93113
}
114+
94115
public static bool IsPenumbraInstalled()
95116
{
96117
var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "XIVLauncher", "dalamudConfig.json");

0 commit comments

Comments
 (0)