(ded4a3e0a) v0.9.0.7

This commit is contained in:
Joonas Rikkonen
2019-06-25 16:00:44 +03:00
parent e5ae622c77
commit 4a51db77b5
1777 changed files with 421528 additions and 917 deletions
@@ -18,34 +18,26 @@ namespace Barotrauma
public string FileName { get; private set; }
public string[] FileNames { get; private set; }
public OpenFileDialog()
{
ofd = new System.Windows.Forms.OpenFileDialog();
}
public OpenFileDialog() { }
public System.Windows.Forms.DialogResult ShowDialog()
{
ofd = new System.Windows.Forms.OpenFileDialog();
ofd.Multiselect = Multiselect;
ofd.InitialDirectory = InitialDirectory;
ofd.Filter = Filter;
ofd.Title = Title;
#if LINUX
System.Windows.Forms.DialogResult result;
var wrapperForm = new WrapperForm(ofd);
System.Windows.Forms.Application.Run(wrapperForm);
System.Windows.Forms.Application.Exit();
FileName = wrapperForm.FileName;
FileNames = wrapperForm.FileNames;
return wrapperForm.Result;
#else
var result = ofd.ShowDialog();
FileName = ofd.FileName;
FileNames = ofd.FileNames;
result = wrapperForm.Result;
ofd = null;
return result;
#endif
}
#if LINUX
private class WrapperForm : System.Windows.Forms.Form
{
private System.Windows.Forms.OpenFileDialog ofd;
@@ -66,9 +58,8 @@ namespace Barotrauma
FileName = ofd.FileName;
FileNames = ofd.FileNames;
System.Threading.Thread.Sleep(100);
this.Close();
System.Windows.Forms.Application.Exit();
}
}
#endif
}
}