mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Linux fixes
This commit is contained in:
@@ -104,6 +104,20 @@ namespace VRCX
|
||||
|
||||
public override string GetVRChatPhotosLocation()
|
||||
{
|
||||
var json = ReadConfigFile();
|
||||
if (!string.IsNullOrEmpty(json))
|
||||
{
|
||||
var obj = JsonConvert.DeserializeObject<JObject>(json);
|
||||
if (obj["picture_output_folder"] != null)
|
||||
{
|
||||
var photosDir = (string)obj["picture_output_folder"];
|
||||
if (!string.IsNullOrEmpty(photosDir) && Directory.Exists(photosDir))
|
||||
{
|
||||
return photosDir;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Path.Join(_vrcPrefixPath, "drive_c/users/steamuser/Pictures/VRChat");
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,26 @@ namespace VRCX
|
||||
|
||||
public override bool StartGame(string arguments)
|
||||
{
|
||||
try
|
||||
{
|
||||
var process = Process.Start(new ProcessStartInfo
|
||||
{
|
||||
FileName = "steam",
|
||||
Arguments = $"-applaunch 438100 {arguments}",
|
||||
UseShellExecute = false,
|
||||
});
|
||||
if (process?.ExitCode == 0)
|
||||
{
|
||||
process.Close();
|
||||
return true;
|
||||
}
|
||||
process?.Close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
logger.Error($"Failed to start VRChat: {e.Message}, attempting to start via Steam path.");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var steamPath = _steamPath;
|
||||
@@ -104,20 +124,8 @@ namespace VRCX
|
||||
|
||||
public override bool StartGameFromPath(string path, string arguments)
|
||||
{
|
||||
if (!path.EndsWith(".exe"))
|
||||
path = Path.Join(path, "launch.exe");
|
||||
|
||||
if (!path.EndsWith("launch.exe") || !File.Exists(path))
|
||||
return false;
|
||||
|
||||
Process.Start(new ProcessStartInfo
|
||||
{
|
||||
WorkingDirectory = Path.GetDirectoryName(path),
|
||||
FileName = path,
|
||||
UseShellExecute = false,
|
||||
Arguments = arguments
|
||||
})?.Close();
|
||||
return true;
|
||||
// This method is not used
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user