Advanced loader - if magic folder necessary for the feature to work doesn't exist, create it. Allow drag and drop of dll files on the Current Core box
This commit is contained in:
parent
286d03a359
commit
2b625e9c53
|
@ -1316,6 +1316,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
else
|
||||
{
|
||||
ofd.InitialDirectory = PathManager.GetPathType("Libretro", "Cores");
|
||||
if (!Directory.Exists(ofd.InitialDirectory))
|
||||
{
|
||||
Directory.CreateDirectory(ofd.InitialDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
ofd.RestoreDirectory = true;
|
||||
|
|
|
@ -97,11 +97,14 @@
|
|||
//
|
||||
// txtLibretroCore
|
||||
//
|
||||
this.txtLibretroCore.AllowDrop = true;
|
||||
this.txtLibretroCore.Location = new System.Drawing.Point(81, 23);
|
||||
this.txtLibretroCore.Name = "txtLibretroCore";
|
||||
this.txtLibretroCore.ReadOnly = true;
|
||||
this.txtLibretroCore.Size = new System.Drawing.Size(314, 20);
|
||||
this.txtLibretroCore.TabIndex = 6;
|
||||
this.txtLibretroCore.DragDrop += new System.Windows.Forms.DragEventHandler(this.txtLibretroCore_DragDrop);
|
||||
this.txtLibretroCore.DragEnter += new System.Windows.Forms.DragEventHandler(this.txtLibretroCore_DragEnter);
|
||||
//
|
||||
// btnLibretroLaunchGame
|
||||
//
|
||||
|
|
|
@ -130,22 +130,44 @@ namespace BizHawk.Client.EmuHawk
|
|||
SuggestedExtensionFilter = filter;
|
||||
|
||||
Result = Command.RetroLaunchGame;
|
||||
DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void btnClassicLaunchGame_Click(object sender, EventArgs e)
|
||||
{
|
||||
Result = Command.ClassicLaunchGame;
|
||||
DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void btnLibretroLaunchNoGame_Click(object sender, EventArgs e)
|
||||
{
|
||||
Result = Command.RetroLaunchNoGame;
|
||||
DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void txtLibretroCore_DragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||
{
|
||||
var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||
if (Path.GetExtension(filePaths[0]).ToUpper() == ".DLL")
|
||||
{
|
||||
e.Effect = DragDropEffects.Copy;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
e.Effect = DragDropEffects.None;
|
||||
}
|
||||
|
||||
private void txtLibretroCore_DragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||
Global.Config.LibretroCore = filePaths[0];
|
||||
RefreshLibretroCore(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue