public static void DoSettingsDialog(IMainFormForConfig mainForm, BsnesCore bsnes) { var s = bsnes.GetSettings(); var ss = bsnes.GetSyncSettings(); using var dlg = new BSNESOptions { AlwaysDoubleSize = s.AlwaysDoubleSize, CropSGBFrame = s.CropSGBFrame, Entropy = ss.Entropy, RegionOverride = ss.RegionOverride, Hotfixes = ss.Hotfixes, FastPPU = ss.FastPPU, FastDSP = ss.FastDSP, FastCoprocessors = ss.FastCoprocessors, UseSGB2 = ss.UseSGB2, ShowObj1 = s.ShowOBJ_0, ShowObj2 = s.ShowOBJ_1, ShowObj3 = s.ShowOBJ_2, ShowObj4 = s.ShowOBJ_3, ShowBg1_0 = s.ShowBG1_0, ShowBg1_1 = s.ShowBG1_1, ShowBg2_0 = s.ShowBG2_0, ShowBg2_1 = s.ShowBG2_1, ShowBg3_0 = s.ShowBG3_0, ShowBg3_1 = s.ShowBG3_1, ShowBg4_0 = s.ShowBG4_0, ShowBg4_1 = s.ShowBG4_1 }; DialogResult result = mainForm.ShowDialogAsChild(dlg); if (result == DialogResult.OK) { s.AlwaysDoubleSize = dlg.AlwaysDoubleSize; s.CropSGBFrame = dlg.CropSGBFrame; ss.Entropy = dlg.Entropy; ss.RegionOverride = dlg.RegionOverride; ss.Hotfixes = dlg.Hotfixes; ss.FastPPU = dlg.FastPPU; ss.FastDSP = dlg.FastDSP; ss.FastCoprocessors = dlg.FastCoprocessors; ss.UseSGB2 = dlg.UseSGB2; s.ShowOBJ_0 = dlg.ShowObj1; s.ShowOBJ_1 = dlg.ShowObj2; s.ShowOBJ_2 = dlg.ShowObj3; s.ShowOBJ_3 = dlg.ShowObj4; s.ShowBG1_0 = dlg.ShowBg1_0; s.ShowBG1_1 = dlg.ShowBg1_1; s.ShowBG2_0 = dlg.ShowBg2_0; s.ShowBG2_1 = dlg.ShowBg2_1; s.ShowBG3_0 = dlg.ShowBg3_0; s.ShowBG3_1 = dlg.ShowBg3_1; s.ShowBG4_0 = dlg.ShowBg4_0; s.ShowBG4_1 = dlg.ShowBg4_1; mainForm.PutCoreSettings(s); mainForm.PutCoreSyncSettings(ss); } }
public static DialogResult DoSettingsDialog(IDialogParent dialogParent, ISettingsAdapter settable) { var s = (BsnesCore.SnesSettings)settable.GetSettings(); var ss = (BsnesCore.SnesSyncSettings)settable.GetSyncSettings(); using var dlg = new BSNESOptions { AlwaysDoubleSize = s.AlwaysDoubleSize, CropSGBFrame = s.CropSGBFrame, Entropy = ss.Entropy, RegionOverride = ss.RegionOverride, Hotfixes = ss.Hotfixes, FastPPU = ss.FastPPU, FastDSP = ss.FastDSP, FastCoprocessors = ss.FastCoprocessors, UseSGB2 = ss.UseSGB2, ShowObj1 = s.ShowOBJ_0, ShowObj2 = s.ShowOBJ_1, ShowObj3 = s.ShowOBJ_2, ShowObj4 = s.ShowOBJ_3, ShowBg1_0 = s.ShowBG1_0, ShowBg1_1 = s.ShowBG1_1, ShowBg2_0 = s.ShowBG2_0, ShowBg2_1 = s.ShowBG2_1, ShowBg3_0 = s.ShowBG3_0, ShowBg3_1 = s.ShowBG3_1, ShowBg4_0 = s.ShowBG4_0, ShowBg4_1 = s.ShowBG4_1 }; var result = dialogParent.ShowDialogAsChild(dlg); if (result == DialogResult.OK) { s.AlwaysDoubleSize = dlg.AlwaysDoubleSize; s.CropSGBFrame = dlg.CropSGBFrame; ss.Entropy = dlg.Entropy; ss.RegionOverride = dlg.RegionOverride; ss.Hotfixes = dlg.Hotfixes; ss.FastPPU = dlg.FastPPU; ss.FastDSP = dlg.FastDSP; ss.FastCoprocessors = dlg.FastCoprocessors; ss.UseSGB2 = dlg.UseSGB2; s.ShowOBJ_0 = dlg.ShowObj1; s.ShowOBJ_1 = dlg.ShowObj2; s.ShowOBJ_2 = dlg.ShowObj3; s.ShowOBJ_3 = dlg.ShowObj4; s.ShowBG1_0 = dlg.ShowBg1_0; s.ShowBG1_1 = dlg.ShowBg1_1; s.ShowBG2_0 = dlg.ShowBg2_0; s.ShowBG2_1 = dlg.ShowBg2_1; s.ShowBG3_0 = dlg.ShowBg3_0; s.ShowBG3_1 = dlg.ShowBg3_1; s.ShowBG4_0 = dlg.ShowBg4_0; s.ShowBG4_1 = dlg.ShowBg4_1; settable.PutCoreSettings(s); settable.PutCoreSyncSettings(ss); } return(result); }