Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions Knossos.NET/Classes/Knossos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ private static async Task QuickLaunch()
string[] args = Environment.GetCommandLineArgs();
string modid = string.Empty;
string modver = string.Empty;
string modExecType = string.Empty;
bool saveID = false;
bool saveVer = false;
bool saveExecType = false;

foreach (var arg in args)
{
Expand All @@ -168,6 +170,11 @@ private static async Task QuickLaunch()
saveVer = false;
modver = arg;
}
if (saveExecType)
{
saveExecType = false;
modExecType = arg;
}
if (arg.ToLower() == "-playmod")
{
saveID = true;
Expand All @@ -176,16 +183,31 @@ private static async Task QuickLaunch()
{
saveVer = true;
}
if (arg.ToLower() == "-exec")
{
saveExecType = true;
}
}

if(modid != string.Empty)
{
if(modver != string.Empty)
var execType = FsoExecType.Release;
if (modExecType != string.Empty && modExecType.ToLower() != "default")
{
execType = FsoBuild.GetExecType(modExecType);
if(execType == FsoExecType.Unknown)
{
Log.Add(Log.LogSeverity.Error, "Knossos.QuickLaunch", "Quick launch was used but the exec type used was invalid, reverted to Release. Used exec type: " + modExecType);
execType = FsoExecType.Release;
}
}
if (modver != string.Empty)
{
var mod = GetInstalledMod(modid, modver);

if(mod != null)
{
PlayMod(mod, FsoExecType.Release);
PlayMod(mod, execType);
}
else
{
Expand All @@ -195,7 +217,7 @@ private static async Task QuickLaunch()
else
{
var modlist = GetInstalledModList(modid);
if(modlist != null && modlist.Count() > 0)
if (modlist != null && modlist.Count() > 0)
{
Mod? mod = null;
if (modlist.Count() > 1)
Expand All @@ -215,7 +237,7 @@ private static async Task QuickLaunch()

if(mod != null)
{
PlayMod(mod, FsoExecType.Release);
PlayMod(mod, execType);
}
}
else
Expand Down
4 changes: 2 additions & 2 deletions Knossos.NET/ViewModels/Windows/ModSettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ public ModSettingsViewModel(Mod modJson, ModCardViewModel? modCard=null)
{
if(!KnUtils.IsAppImage)
{
QuickLaunch = System.Diagnostics.Process.GetCurrentProcess().MainModule!.FileName + " -playmod " + modJson.id + " -version " + modJson.version;
QuickLaunch = System.Diagnostics.Process.GetCurrentProcess().MainModule!.FileName + " -playmod " + modJson.id + " -version " + modJson.version + " -exec Default";
}
else
{
QuickLaunch = KnUtils.AppImagePath + " -playmod " + modJson.id + " -version " + modJson.version;
QuickLaunch = KnUtils.AppImagePath + " -playmod " + modJson.id + " -version " + modJson.version + " -exec Default";
}
}catch { }
this.modJson = modJson;
Expand Down
4 changes: 4 additions & 0 deletions Knossos.NET/Views/Windows/ModSettingsView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
<!--Quick Launch-->
<Label Margin="0,5,0,0" FontWeight="Black" FontSize="20">QUICK LAUNCH</Label>
<TextBox Margin="5" Foreground="White" IsReadOnly="True" Text="{Binding QuickLaunch}"></TextBox>
<WrapPanel Margin="5,0,0,0">
<Label Foreground="White">Available exec type options: </Label>
<Label Foreground="Orange">Default, Release, Debug, Fred2, Fred2Debug, QtFred, QtFredDebug</Label>
</WrapPanel>
<!--FSO Build Settings -->
<Label Margin="0,20,0,0" FontWeight="Black" FontSize="20">FSO BUILD</Label>
<v:FsoBuildPickerView Content="{Binding FsoPicker}"/>
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,19 @@ This greately minimizes hard drive usage, but comes with two things to keep in m
KnossosNET supports direct mod launch by adding a Command Line argument, this will open the launcher, and will launch FSO to play a mod with all the current settings and configurations, and close the launcher.<br />
Example:<br />
<br />
KnossosNET.exe -playmod mod-id -version mod-version (optional)<br />
KnossosNET.exe -playmod mod-id -version mod-version (optional) -exec fso-exec-type (optional)<br />
<br />
If no version is given (KnossosNET.exe -playmod mod-id) the highest version of the mod will be launched.<br />
The "Mod Settings" window displays the Command Line to play that mod directly via quick launch.<br />
If no fso-exec-type is given or "Default", or an invalid type is passed "Release" will be used instead. <br />
Exec type options:<br />
-Default<br />
-Release<br />
-Debug<br />
-Fred2<br />
-Fred2Debug<br />
-QtFred<br />
-QtFredDebug<br />
The "Settings" window on a mod displays the Command Line to play that mod directly via Quick Launch. You can copy that Quick Launch Command Line and use it to create a shortcut to easily launch that mod. <br />

<br /><br />
## **Software Rendering Mode:**<br />
Expand Down