private static GameFilePlayAdapter CreatePlayAdapter(PlayForm form, EventHandler processExited, AppConfiguration appConfig) { GameFilePlayAdapter playAdapter = new GameFilePlayAdapter(); playAdapter.IWad = form.SelectedIWad; playAdapter.Map = form.SelectedMap; playAdapter.Skill = form.SelectedSkill; playAdapter.Record = form.Record; playAdapter.SpecificFiles = form.SpecificFiles; playAdapter.AdditionalFiles = form.GetAdditionalFiles().ToArray(); playAdapter.PlayDemo = form.PlayDemo; playAdapter.ExtraParameters = form.ExtraParameters; playAdapter.SaveStatistics = form.SaveStatistics; playAdapter.ProcessExited += processExited; if (form.SelectedDemo != null) { playAdapter.PlayDemoFile = Path.Combine(appConfig.DemoDirectory.GetFullPath(), form.SelectedDemo.FileName); } return(playAdapter); }
private void HandlePlaySettings(PlayForm form, IGameProfile gameProfile) { if (form.RememberSettings && gameProfile != null) { form.UpdateGameProfile(gameProfile); form.GameFile.SettingsGameProfileID = form.SelectedGameProfile.GameProfileID; DataSourceAdapter.UpdateGameFile(form.GameFile, new GameFileFieldType[] { GameFileFieldType.SettingsGameProfileID }); if (gameProfile is IGameFile gameFile) { DataSourceAdapter.UpdateGameFile(gameFile, new GameFileFieldType[] { GameFileFieldType.SourcePortID, GameFileFieldType.IWadID, GameFileFieldType.SettingsMap, GameFileFieldType.SettingsSkill, GameFileFieldType.SettingsFiles, GameFileFieldType.SettingsExtraParams, GameFileFieldType.SettingsSpecificFiles, GameFileFieldType.SettingsStat, GameFileFieldType.SettingsFilesIWAD, GameFileFieldType.SettingsFilesSourcePort, GameFileFieldType.SettingsSaved, GameFileFieldType.SettingsLoadLatestSave }); } else { DataSourceAdapter.UpdateGameProfile(gameProfile); } } }
private GameFilePlayAdapter CreatePlayAdapter(PlayForm form, EventHandler processExited, AppConfiguration appConfig) { GameFilePlayAdapter playAdapter = new GameFilePlayAdapter(); playAdapter.IWad = form.SelectedIWad; playAdapter.Map = form.SelectedMap; playAdapter.Skill = form.SelectedSkill; playAdapter.Record = form.Record; playAdapter.SpecificFiles = form.SpecificFiles; playAdapter.AdditionalFiles = form.GetAdditionalFiles().ToArray(); playAdapter.PlayDemo = form.PlayDemo; playAdapter.ExtraParameters = form.ExtraParameters; playAdapter.SaveStatistics = form.SaveStatistics; if (form.LoadLatestSave) { if (!AppConfiguration.CopySaveFiles) { MessageCheckBox message = new MessageCheckBox("Copy Save Files Disabled", "Copy save files is disabled and the load latest save feature may not function.\n\nSelect the check box below to enable this setting.", "Enable Setting", SystemIcons.Warning); message.StartPosition = FormStartPosition.CenterParent; message.ShowDialog(this); if (message.Checked) { AppConfiguration.EnableCopySaveFiles(); } } playAdapter.LoadSaveFile = GetLoadLatestSave(form.GameFile, form.SelectedSourcePort); } playAdapter.ProcessExited += processExited; if (form.SelectedDemo != null) { playAdapter.PlayDemoFile = Path.Combine(appConfig.DemoDirectory.GetFullPath(), form.SelectedDemo.FileName); } return(playAdapter); }