diff --git a/Knossos.NET/Classes/Knossos.cs b/Knossos.NET/Classes/Knossos.cs index ceb69a2b..3379c439 100644 --- a/Knossos.NET/Classes/Knossos.cs +++ b/Knossos.NET/Classes/Knossos.cs @@ -738,7 +738,7 @@ private static void AutoUpdateBuilds() /// /// /// - public static async void PlayMod(Mod mod, FsoExecType fsoExecType, bool standaloneServer = false, int standalonePort = 0) + public static async void PlayMod(Mod mod, FsoExecType fsoExecType, bool standaloneServer = false, int standalonePort = 0, bool vrMode = false) { if (TaskViewModel.Instance!.IsSafeState() == false) { @@ -801,6 +801,12 @@ public static async void PlayMod(Mod mod, FsoExecType fsoExecType, bool standalo var modList = new List(); FsoBuild? fsoBuild = null; + /* VR Mode Stuff */ + if(vrMode) + { + cmdline += " -vr"; + } + /* Resolve Dependencies should be all valid at this point */ var dependencyList = mod.GetModDependencyList(false,true); bool hasBuildDependency = false; diff --git a/Knossos.NET/ViewModels/Templates/ModCardViewModel.cs b/Knossos.NET/ViewModels/Templates/ModCardViewModel.cs index 590a6fff..cfecc8ad 100644 --- a/Knossos.NET/ViewModels/Templates/ModCardViewModel.cs +++ b/Knossos.NET/ViewModels/Templates/ModCardViewModel.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using System.Linq; using Avalonia.Threading; +using System.Diagnostics; namespace Knossos.NET.ViewModels { @@ -222,14 +223,42 @@ internal void ButtonCommand(object command) switch((string)command) { case "play" : Knossos.PlayMod(modVersions[activeVersionIndex], FsoExecType.Release); break; + case "playvr": Knossos.PlayMod(modVersions[activeVersionIndex], FsoExecType.Release, false, 0, true); break; case "fred2": Knossos.PlayMod(modVersions[activeVersionIndex], FsoExecType.Fred2); break; + case "fred2debug": Knossos.PlayMod(modVersions[activeVersionIndex], FsoExecType.Fred2Debug); break; case "debug": Knossos.PlayMod(modVersions[activeVersionIndex], FsoExecType.Debug); break; case "qtfred": Knossos.PlayMod(modVersions[activeVersionIndex], FsoExecType.QtFred); break; + case "qtfreddebug": Knossos.PlayMod(modVersions[activeVersionIndex], FsoExecType.QtFredDebug); break; case "update": ButtonCommandUpdate(); break; case "modify": ButtonCommandModify(); break; case "delete": ButtonCommandDelete(); break; case "details": ButtonCommandDetails(); break; case "settings": ButtonCommandSettings(); break; + case "logfile": OpenFS2Log(); break; + } + } + + private void OpenFS2Log() + { + if (File.Exists(KnUtils.GetFSODataFolderPath() + Path.DirectorySeparatorChar + "data" + Path.DirectorySeparatorChar + "fs2_open.log")) + { + try + { + var cmd = new Process(); + cmd.StartInfo.FileName = Path.Combine(KnUtils.GetFSODataFolderPath(), "data", "fs2_open.log"); + cmd.StartInfo.UseShellExecute = true; + cmd.Start(); + cmd.Dispose(); + } + catch (Exception ex) + { + Log.Add(Log.LogSeverity.Error, "ModCardViewModel.OpenFS2Log", ex); + } + } + else + { + if (MainWindow.instance != null) + MessageBox.Show(MainWindow.instance, "Log File " + Path.Combine(KnUtils.GetFSODataFolderPath(), "data", "fs2_open.log") + " not found.", "File not found", MessageBox.MessageBoxButtons.OK); } } diff --git a/Knossos.NET/Views/Templates/ModCardView.axaml b/Knossos.NET/Views/Templates/ModCardView.axaml index 820e7ce1..d294030e 100644 --- a/Knossos.NET/Views/Templates/ModCardView.axaml +++ b/Knossos.NET/Views/Templates/ModCardView.axaml @@ -37,7 +37,7 @@