public static void DoSettingsDialog(MainForm mainForm, LibsnesCore bsnes) { var s = bsnes.GetSettings(); var ss = bsnes.GetSyncSettings(); using var dlg = new SNESOptions { RandomizedInitialState = ss.RandomizedInitialState, AlwaysDoubleSize = s.AlwaysDoubleSize, CropSGBFrame = s.CropSGBFrame, ShowObj1 = s.ShowOBJ_0, ShowObj2 = s.ShowOBJ_1, ShowObj3 = s.ShowOBJ_2, ShowObj4 = s.ShowOBJ_3, ShowBg1 = s.ShowBG1_0, ShowBg2 = s.ShowBG2_0, ShowBg3 = s.ShowBG3_0, ShowBg4 = s.ShowBG4_0 }; var result = dlg.ShowDialog(mainForm); if (result == DialogResult.OK) { s.AlwaysDoubleSize = dlg.AlwaysDoubleSize; s.CropSGBFrame = dlg.CropSGBFrame; ss.RandomizedInitialState = dlg.RandomizedInitialState; s.ShowOBJ_0 = dlg.ShowObj1; s.ShowOBJ_1 = dlg.ShowObj2; s.ShowOBJ_2 = dlg.ShowObj3; s.ShowOBJ_3 = dlg.ShowObj4; s.ShowBG1_0 = s.ShowBG1_1 = dlg.ShowBg1; s.ShowBG2_0 = s.ShowBG2_1 = dlg.ShowBg2; s.ShowBG3_0 = s.ShowBG3_1 = dlg.ShowBg3; s.ShowBG4_0 = s.ShowBG4_1 = dlg.ShowBg4; mainForm.PutCoreSettings(s); mainForm.PutCoreSyncSettings(ss); } }