Skip to content

Commit

Permalink
add command line option --launch-immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
theMK2k committed Feb 1, 2023
1 parent cc07008 commit 9fa47fb
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

Releasepacks

# Other Source Managment Tools
\$tf/
.vs/
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 MK2k
Copyright (c) MK2k

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

If you choose **RetroArch Quick Launcher** as the default application for your ROM files, you'll see its dialog after double clicking your ROM file and by the press of the **OK** button or simply pressing **ENTER**, RetroArch is launched.

Alternatively choose **RetroArch_Quick_Launcher (launch immediately).bat** as the default application for your ROM files to skip the dialog and directly launch the ROM file. If something isn't set up correctly (e.g. Libretro Core not selected), the dialog will not be skipped.

![screenshot of RetroArch Quick Launcher's dialog](docs/screenshot.png "Title")

## Installation
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 9 additions & 9 deletions RetroArch_Quick_Launcher/frm_Main.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 24 additions & 10 deletions RetroArch_Quick_Launcher/frm_Main.vb
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ Partial Public Class frm_Main
Public dataPath As String = Environment.ExpandEnvironmentVariables("%HOMEDRIVE%%HOMEPATH%") & "\.retroarch-quick-launcher"
Public configPath As String = dataPath & "\" & "config.xml"

Private launchImmediately As Boolean = False

Shared Sub New()
DevExpress.UserSkins.BonusSkins.Register()
DevExpress.Skins.SkinManager.EnableFormSkins()
End Sub

Public Sub New()
InitializeComponent()
InitializeComponent()

MKNetDXLib.frm_MKDXBaseForm.Default_Form_Icon = Me.Icon
MKNetDXLib.cls_MKDXSkin.LoadSkin("DevExpress Dark Style")
Expand All @@ -24,10 +26,10 @@ Partial Public Class frm_Main
End If

If Not Alphaleonis.Win32.Filesystem.Directory.Exists(Me.dataPath) Then
MKNetDXLib.cls_MKDXHelper.MessageBox("Unable to create directory '" & dataPath & "'!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Me.dataPath = ""
Me.configPath = ""
End If
MKNetDXLib.cls_MKDXHelper.MessageBox("Unable to create directory '" & dataPath & "'!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Me.dataPath = ""
Me.configPath = ""
End If

If Alphaleonis.Win32.Filesystem.File.Exists(configPath) Then
Me.DS.ReadXml(configPath)
Expand All @@ -38,12 +40,17 @@ Partial Public Class frm_Main
Me.BS_CurrentConfig.EndEdit()

Dim cmdArgs = Environment.GetCommandLineArgs()
For i As Integer = 1 To cmdArgs.Length - 1
Me.ImportFile(cmdArgs(i), enm_ImportFileMode.AUTODETECT)
Next
End Sub
For i As Integer = 1 To cmdArgs.Length - 1
If cmdArgs(i) = "--launch-immediately" Then
Me.launchImmediately = True
Continue For
End If

Me.ImportFile(cmdArgs(i), enm_ImportFileMode.AUTODETECT)
Next
End Sub

Public Enum enm_ImportFileMode
Public Enum enm_ImportFileMode
GAME = 1
PATCH = 2
AUTODETECT = 3
Expand Down Expand Up @@ -414,4 +421,11 @@ Partial Public Class frm_Main
Private Sub lbl_Metropolis_Launcher_Click(sender As Object, e As EventArgs) Handles lbl_Metropolis_Launcher.Click
Process.Start("https://metropolis-launcher.net")
End Sub

Private Sub frm_Main_Shown(sender As Object, e As EventArgs) Handles Me.Shown
If Me.launchImmediately Then
'Me.Visible = False
Me.btn_OK_Click(Me.btn_OK, New EventArgs)
End If
End Sub
End Class

0 comments on commit 9fa47fb

Please sign in to comment.