(6e187d247) Fixed contained items' status effects being added twice to the list of an ItemContainer's active status effects when swapping items. For example, when swapping a fuel rod with another one, the status effect that increases AvailableFuel would be applied twice, causing the reactor to act as if there were 2 rods in it. Closes #1643 + merge fix

This commit is contained in:
Joonas Rikkonen
2019-06-15 20:24:01 +03:00
parent f68c16d944
commit 87a0ee21eb
52 changed files with 497 additions and 983 deletions
@@ -18,34 +18,33 @@ 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;
#if LINUX || OSX
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;
result = wrapperForm.Result;
#else
var result = ofd.ShowDialog();
result = ofd.ShowDialog();
FileName = ofd.FileName;
FileNames = ofd.FileNames;
return result;
#endif
ofd = null;
return result;
}
#if LINUX
#if LINUX || OSX
private class WrapperForm : System.Windows.Forms.Form
{
private System.Windows.Forms.OpenFileDialog ofd;
@@ -66,7 +65,7 @@ namespace Barotrauma
FileName = ofd.FileName;
FileNames = ofd.FileNames;
System.Threading.Thread.Sleep(100);
this.Close();
System.Windows.Forms.Application.Exit();
}
}
#endif