├── .github └── FUNDING.yml ├── .gitignore ├── BindingListView ├── AggregateBindingListView.cs ├── BindingListView.cs ├── BindingListView.csproj ├── BindingListView.nuspec ├── CompositeItemFilter.cs ├── IItemFilter.cs ├── INotifyingEditableObject.cs ├── InvalidSourceListException.cs ├── MultiSourceIndexList.cs ├── ObjectView.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings └── ProvidedViewPropertyDescriptor.cs ├── CheckBoxComboBox ├── CheckBoxComboBox.Designer.cs ├── CheckBoxComboBox.cs ├── CheckBoxComboBox.csproj ├── GripBounds.cs ├── NativeMethods.cs ├── Popup.Designer.cs ├── Popup.cs ├── PopupComboBox.Designer.cs ├── PopupComboBox.cs ├── PopupComboBox.resx ├── Properties │ └── AssemblyInfo.cs └── Selection Wrappers │ ├── ListSelectionWrapper.cs │ └── ObjectSelectionWrapper.cs ├── DoomLauncher.sln ├── DoomLauncher ├── Adapters │ ├── DataAccess.cs │ ├── DbDataSourceAdapter.cs │ ├── DirectoryDataSourceAdapter.cs │ ├── GameLauncher.cs │ ├── IdGamesDataAdapater.cs │ ├── Launch │ │ ├── ExtraParametersLaunchFeature.cs │ │ ├── GameFilesLaunchFeature.cs │ │ ├── ILaunchFeature.cs │ │ ├── IWadLaunchFeature.cs │ │ ├── LaunchParameters.cs │ │ ├── LaunchResult.cs │ │ ├── LoadSaveLaunchFeature.cs │ │ ├── MapSkillLaunchFeature.cs │ │ ├── PlayDemoLaunchFeature.cs │ │ ├── RecordLaunchFeature.cs │ │ ├── SourcePortExtraParametersLaunchFeature.cs │ │ ├── StatisticsReaderLaunchFeature.cs │ │ └── UtilityFilesLaunchFeature.cs │ ├── MSSQLDataAdapter.cs │ ├── PlaySession.cs │ ├── SqliteDatabaseAdapter.cs │ └── WadArchiveDataAdapter.cs ├── App.config ├── Archive │ ├── ArchiveReader.cs │ ├── Directory │ │ ├── DirectoryArchiveEntry.cs │ │ └── DirectoryArchiveReader.cs │ ├── EmptyArchiveReader.cs │ ├── FileArchiveReader.cs │ ├── IArchiveEntry.cs │ ├── IArchiveReader.cs │ ├── Rar │ │ ├── RarArchiveEntry.cs │ │ └── RarArchiveReader.cs │ ├── RecursiveArchiveReader.cs │ ├── SevenZip │ │ ├── SevenZipArchiveEntry.cs │ │ └── SevenZipArchiveReader.cs │ ├── Wad │ │ ├── WadArchiveReader.cs │ │ └── WadEntry.cs │ └── Zip │ │ ├── ZipArchiveReader.cs │ │ └── ZipArchiveReaderEntry.cs ├── Config │ ├── AppConfiguration.cs │ ├── AppVersion.cs │ ├── ColorTheme.cs │ ├── ColorThemeType.cs │ ├── ColumnConfig.cs │ ├── ConfigType.cs │ ├── DataCache.cs │ ├── FileManagement.cs │ ├── GameFileListEventArgs.cs │ ├── IDirectoriesConfiguration.cs │ ├── Icons.cs │ ├── LauncherPath.cs │ ├── ScreenFilter.cs │ └── TagMapLookup.cs ├── Controls │ ├── BasicFileView.cs │ ├── CCheckBox.cs │ ├── CComboBox.cs │ ├── CDataGridView.cs │ ├── CProgressBar.cs │ ├── CRichTextBox.Designer.cs │ ├── CRichTextBox.cs │ ├── CTabControl.cs │ ├── CheckBoxList.Designer.cs │ ├── CheckBoxList.cs │ ├── CheckBoxList.resx │ ├── ColumnField.cs │ ├── DownloadView.Designer.cs │ ├── DownloadView.cs │ ├── DownloadView.resx │ ├── DownloadViewItem.Designer.cs │ ├── DownloadViewItem.cs │ ├── DownloadViewItem.resx │ ├── FileType.cs │ ├── FilesCtrl.Designer.cs │ ├── FilesCtrl.cs │ ├── FilesCtrl.resx │ ├── FlowLayoutPanelDB.Designer.cs │ ├── FlowLayoutPanelDB.cs │ ├── FormButton.cs │ ├── GameFileAssociationView.Designer.cs │ ├── GameFileAssociationView.cs │ ├── GameFileAssociationView.resx │ ├── GameFileEdit.Designer.cs │ ├── GameFileEdit.cs │ ├── GameFileEdit.resx │ ├── GameFileSummary.Designer.cs │ ├── GameFileSummary.cs │ ├── GameFileSummary.resx │ ├── GameFileTile.Designer.cs │ ├── GameFileTile.cs │ ├── GameFileTile.resx │ ├── GameFileTileBase.cs │ ├── GameFileTileExpanded.Designer.cs │ ├── GameFileTileExpanded.cs │ ├── GameFileTileExpanded.resx │ ├── GameFileTileViewControl.Designer.cs │ ├── GameFileTileViewControl.cs │ ├── GameFileTileViewControl.resx │ ├── GameFileViewControl.Designer.cs │ ├── GameFileViewControl.cs │ ├── GameFileViewControl.resx │ ├── GenericFileView.Designer.cs │ ├── GenericFileView.cs │ ├── GenericFileView.resx │ ├── GlowButton.cs │ ├── GrowLabel.Designer.cs │ ├── GrowLabel.cs │ ├── PagingControl.Designer.cs │ ├── PagingControl.cs │ ├── PagingControl.resx │ ├── RatingControl.Designer.cs │ ├── RatingControl.cs │ ├── RatingControl.resx │ ├── ScreenshotView.Designer.cs │ ├── ScreenshotView.cs │ ├── ScreenshotView.resx │ ├── SearchControl.Designer.cs │ ├── SearchControl.cs │ ├── SearchControl.resx │ ├── SlideShowPictureBox.Designer.cs │ ├── SlideShowPictureBox.cs │ ├── SlideShowPictureBox.resx │ ├── SourcePortEdit.Designer.cs │ ├── SourcePortEdit.cs │ ├── SourcePortEdit.resx │ ├── StatBar.cs │ ├── StatisticsView.Designer.cs │ ├── StatisticsView.cs │ ├── StatisticsView.resx │ ├── StatsControl.Designer.cs │ ├── StatsControl.cs │ ├── StatsControl.resx │ ├── TableLayoutPanelDB.Designer.cs │ ├── TableLayoutPanelDB.cs │ ├── TagControl.Designer.cs │ ├── TagControl.cs │ ├── TagControl.resx │ ├── TagEdit.Designer.cs │ ├── TagEdit.cs │ ├── TagEdit.resx │ ├── TagSelectControl.Designer.cs │ ├── TagSelectControl.cs │ ├── TagSelectControl.resx │ ├── TitleBarControl.Designer.cs │ ├── TitleBarControl.cs │ ├── TitleBarControl.resx │ ├── UpdateControl.Designer.cs │ ├── UpdateControl.cs │ └── UpdateControl.resx ├── DataSources │ ├── CleanupFile.cs │ ├── ConfigurationData.cs │ ├── CustomParam.cs │ ├── FileData.cs │ ├── GameFile.cs │ ├── GameProfile.cs │ ├── ITagDataSource.cs │ ├── IWadData.cs │ ├── IdGamesGameFile.cs │ ├── NewFileData.cs │ ├── PreviewImage.cs │ ├── SettingsDataSource.cs │ ├── SourcePortData.cs │ ├── SourcePortLaunchType.cs │ ├── StaticTagData.cs │ ├── StatsData.cs │ ├── TagData.cs │ ├── TagMapping.cs │ ├── WadArchiveFile.cs │ └── WadArchiveGameFile.cs ├── Demo │ ├── CldDemoParser.cs │ ├── DemoUtil.cs │ └── IDemoParser.cs ├── DoomLauncher.VisualElementsManifest.xml ├── DoomLauncher.csproj ├── DoomLauncher.ico ├── DoomLauncher.sqlite ├── DoomLauncherSmall.ico ├── Dpi │ └── DpiScale.cs ├── Forms │ ├── AboutBox.Designer.cs │ ├── AboutBox.cs │ ├── AboutBox.resx │ ├── CumulativeStats.Designer.cs │ ├── CumulativeStats.cs │ ├── CumulativeStats.resx │ ├── DirectoriesForm.Designer.cs │ ├── DirectoriesForm.cs │ ├── DirectoriesForm.resx │ ├── FileDetailsEditForm.Designer.cs │ ├── FileDetailsEditForm.cs │ ├── FileDetailsEditForm.resx │ ├── FileManagementSelect.Designer.cs │ ├── FileManagementSelect.cs │ ├── FileManagementSelect.resx │ ├── FileSelectForm.Designer.cs │ ├── FileSelectForm.cs │ ├── FileSelectForm.resx │ ├── FilterForm.Designer.cs │ ├── FilterForm.cs │ ├── FilterForm.resx │ ├── FilterSettingsForm.Designer.cs │ ├── FilterSettingsForm.cs │ ├── FilterSettingsForm.resx │ ├── GameFileEditForm.Designer.cs │ ├── GameFileEditForm.cs │ ├── GameFileEditForm.resx │ ├── MainForm.Designer.cs │ ├── MainForm.cs │ ├── MainForm.resx │ ├── MainForm_Config.cs │ ├── MainForm_Init.cs │ ├── MainForm_Meta.cs │ ├── MainForm_Play.cs │ ├── MainForm_Sync.cs │ ├── MessageCheckBox.Designer.cs │ ├── MessageCheckBox.cs │ ├── MessageCheckBox.resx │ ├── MetaDataForm.Designer.cs │ ├── MetaDataForm.cs │ ├── MetaDataForm.resx │ ├── PlayForm.Designer.cs │ ├── PlayForm.cs │ ├── PlayForm.resx │ ├── PlayRandomForm.Designer.cs │ ├── PlayRandomForm.cs │ ├── PlayRandomForm.resx │ ├── ProgressBarForm.Designer.cs │ ├── ProgressBarForm.cs │ ├── ProgressBarForm.resx │ ├── SaveInfo.Designer.cs │ ├── SaveInfo.cs │ ├── SaveInfo.resx │ ├── ScreenshotEditForm.Designer.cs │ ├── ScreenshotEditForm.cs │ ├── ScreenshotEditForm.resx │ ├── ScreenshotViewerForm.Designer.cs │ ├── ScreenshotViewerForm.cs │ ├── ScreenshotViewerForm.resx │ ├── SettingsForm.Designer.cs │ ├── SettingsForm.cs │ ├── SettingsForm.resx │ ├── SimpleFileSelectForm.Designer.cs │ ├── SimpleFileSelectForm.cs │ ├── SimpleFileSelectForm.resx │ ├── SourcePortEditForm.Designer.cs │ ├── SourcePortEditForm.cs │ ├── SourcePortEditForm.resx │ ├── SourcePortViewForm.Designer.cs │ ├── SourcePortViewForm.cs │ ├── SourcePortViewForm.resx │ ├── SpecificFilesForm.Designer.cs │ ├── SpecificFilesForm.cs │ ├── SpecificFilesForm.resx │ ├── SplashScreen.Designer.cs │ ├── SplashScreen.cs │ ├── SplashScreen.resx │ ├── StatsInfo.Designer.cs │ ├── StatsInfo.cs │ ├── StatsInfo.resx │ ├── SyncStatusForm.Designer.cs │ ├── SyncStatusForm.cs │ ├── SyncStatusForm.resx │ ├── TagEditForm.Designer.cs │ ├── TagEditForm.cs │ ├── TagEditForm.resx │ ├── TagForm.Designer.cs │ ├── TagForm.cs │ ├── TagForm.resx │ ├── TagSelectForm.Designer.cs │ ├── TagSelectForm.cs │ ├── TagSelectForm.resx │ ├── TextBoxForm.Designer.cs │ ├── TextBoxForm.cs │ ├── TextBoxForm.resx │ ├── TxtGenerator.Designer.cs │ ├── TxtGenerator.cs │ ├── TxtGenerator.resx │ ├── Welcome.Designer.cs │ ├── Welcome.cs │ └── Welcome.resx ├── GameFileView │ ├── GameFileViewFactory.cs │ └── GameFileViewType.cs ├── GameStores │ ├── AutomaticGameStoreCheck.cs │ ├── GameStoreFiles.cs │ ├── StoreGame.cs │ └── StoreGameLoader.cs ├── Handlers │ ├── AddFileType.cs │ ├── ArchiveUtil.cs │ ├── AutoCompleteCombo.cs │ ├── DemoHandler.cs │ ├── DownloadHandler.cs │ ├── FIleAddResults.cs │ ├── FileLoadHandler.cs │ ├── FileLoadHandlerLegacy.cs │ ├── FileMapComparer.cs │ ├── GameFileTileManager.cs │ ├── GameProfileUtil.cs │ ├── ImageExtensions.cs │ ├── InvalidFile.cs │ ├── LaunchData.cs │ ├── MenuConstants.cs │ ├── NativeMethods.cs │ ├── NewFileDetector.cs │ ├── PathExtensions.cs │ ├── SaveGameHandler.cs │ ├── ScreenshotHandler.cs │ ├── Sync │ │ ├── Doom64GameFileFragment.cs │ │ ├── IGameFileFragment.cs │ │ ├── IdGamesTextFileParser.cs │ │ ├── IdGamesTextInfo.cs │ │ ├── MapInfoUtil.cs │ │ ├── MapStringGameFileFragment.cs │ │ ├── SyncResult.cs │ │ ├── TextFileGameFileFragment.cs │ │ ├── TitlePicGameFileFragment.cs │ │ └── TitlePicUtil.cs │ ├── SyncFileData.cs │ ├── SyncFileOption.cs │ ├── SyncLibraryHandler.cs │ ├── TabHandler.cs │ ├── TabKeys.cs │ ├── ThumbnailManager.cs │ ├── ToolTipDisplayHandler.cs │ ├── ToolTipGroup.cs │ ├── ToolTipHandler.cs │ ├── Util.cs │ ├── UtilityHandler.cs │ ├── VersionHandler.cs │ └── VersionUpdateResults.cs ├── Help.docx ├── Help.pdf ├── Help.zip ├── IWad │ └── IWadInfo.cs ├── Interfaces │ ├── IConfigurationData.cs │ ├── IConfigurationDataSourceAdapter.cs │ ├── ICustomParam.cs │ ├── IDataSourceAdapter.cs │ ├── IDatabaseAdapter.cs │ ├── IFileAssociationView.cs │ ├── IFileData.cs │ ├── IGameFile.cs │ ├── IGameFileColumnView.cs │ ├── IGameFileDataSourceAdapter.cs │ ├── IGameFileDownloadable.cs │ ├── IGameFileSortableView.cs │ ├── IGameFileTile.cs │ ├── IGameFileView.cs │ ├── IGameProfile.cs │ ├── IIWadData.cs │ ├── IIWadDataSourceAdapter.cs │ ├── INewFileDetector.cs │ ├── ISettingsDataSource.cs │ ├── ISourcePortData.cs │ ├── IStatsData.cs │ ├── IStatsDataSourceAdapter.cs │ ├── ITabView.cs │ ├── ITagData.cs │ ├── ITagMapLookup.cs │ └── ITagMapping.cs ├── LaunchArgs.cs ├── Program.Init.cs ├── Program.cs ├── ProgressBarType.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── RecentFileType.cs ├── Resources │ ├── BackgroundImage.png │ ├── Bars.png │ ├── Delete.png │ ├── DoomLauncherTile.png │ ├── DownArrow.bmp │ ├── DownArrow.png │ ├── Edit.png │ ├── Export.png │ ├── ExportAll.png │ ├── File.png │ ├── FolderOpen.png │ ├── PLAYPAL.LMP │ ├── PMAPA0.png │ ├── POSSL0.png │ ├── Pin.png │ ├── Play.png │ ├── SOULB0.png │ ├── Save.png │ ├── Search.png │ ├── StepBack.png │ ├── Tags.png │ ├── UpArrow.png │ ├── Video.png │ ├── arrow-down-solid.png │ ├── bon2a_.png │ ├── bon2a_extra.png │ ├── bon2d.png │ ├── bona.bmp │ └── th.png ├── SaveGame │ ├── DsgSaveGameReader.cs │ ├── HelionSaveGameReader.cs │ ├── ISaveGameReader.cs │ └── ZDoomSaveGameReader.cs ├── Search │ ├── GameFileFieldType.cs │ ├── GameFileGetOptions.cs │ ├── GameFileSearchField.cs │ ├── GameFileSearchOp.cs │ ├── IGameFileGetOptions.cs │ └── OrderType.cs ├── SourcePort │ ├── DoomsdaySourcePortFlavor.cs │ ├── GenericSourcePortFlavor.cs │ ├── HelionSourcePortFlavor.cs │ ├── ISourcePortFlavor.cs │ ├── LevelstatSourcePortFlavor.cs │ ├── SpData.cs │ ├── StatdumpSourcePortFlavor.cs │ └── ZDoomSourcePortFlavor.cs ├── Statistics │ ├── IStatisticsReader.cs │ ├── LevelstatReader.cs │ ├── MultiLineStatReader.cs │ ├── NewStatisticsEventArgs.cs │ ├── StatFileScanner.cs │ ├── StatdumpReader.cs │ └── ZDoomStatsReader.cs ├── Stylize │ ├── CToolStripRenderer.cs │ ├── DarkTheme.cs │ ├── DefaultTheme.cs │ ├── IThemeColors.cs │ ├── ImmersiveDarkMode.cs │ ├── StyledMessageBox.cs │ └── Stylizer.cs ├── TabViews │ ├── BasicTabViewCtrl.Designer.cs │ ├── BasicTabViewCtrl.cs │ ├── BasicTabViewCtrl.resx │ ├── IWadTabViewCtrl.Designer.cs │ ├── IWadTabViewCtrl.cs │ ├── IdGamesTabViewCtrl.Designer.cs │ ├── IdGamesTabViewCtrl.cs │ ├── LocalTabViewCtrl.cs │ ├── OptionsTabViewCtrl.Designer.cs │ ├── OptionsTabViewCtrl.cs │ ├── TagTabView.Designer.cs │ ├── TagTabView.cs │ └── UntaggedTabView.cs ├── TextFileParsers │ └── ZdlParser.cs ├── TileImages │ ├── DoomLauncherTile.png │ ├── DoomLauncherTileSmall.png │ ├── chexquest.png │ ├── chexquest3.png │ ├── doom.png │ ├── doom2.png │ ├── doom64.png │ ├── hacx.png │ ├── heretic.png │ ├── hexen.png │ ├── plutonia.png │ ├── strife.png │ └── tnt.png ├── Update │ ├── ApplicationUpdate.cs │ ├── ApplicationUpdateInfo.cs │ └── ApplicationUpdater.cs ├── WindowsVersion │ └── WindowsVersion.cs ├── app.manifest └── packages.config ├── DoomLauncherRelease ├── App.config ├── DoomLauncherRelease.csproj ├── Program.cs └── Properties │ └── AssemblyInfo.cs ├── LICENSE ├── Newtonsoft.Json.dll ├── Newtonsoft.Json.xml ├── README.adoc ├── Setup ├── EnableLaunchApplication.js └── Setup.vdproj ├── UnitTest ├── DoomLauncher.sqlite ├── Properties │ └── AssemblyInfo.cs ├── Resources │ ├── Directory.zip │ ├── TestSteamInstall │ │ └── config │ │ │ └── libraryfolders.vdf │ ├── TestSteamLibrary1 │ │ └── steamapps │ │ │ ├── appmanifest_2280.acf │ │ │ ├── appmanifest_2390.acf │ │ │ └── common │ │ │ ├── TestDoom │ │ │ ├── base │ │ │ │ └── doom.wad │ │ │ └── rerelease │ │ │ │ ├── doom2.wad │ │ │ │ ├── id1.wad │ │ │ │ ├── masterlevels.wad │ │ │ │ ├── nerve.wad │ │ │ │ ├── plutonia.wad │ │ │ │ ├── sigil.wad │ │ │ │ └── tnt.wad │ │ │ └── TestHeretic │ │ │ └── base │ │ │ └── heretic.wad │ ├── TestSteamLibrary2 │ │ └── steamapps │ │ │ ├── appmanifest_2360.acf │ │ │ ├── appmanifest_2390.acf │ │ │ └── common │ │ │ ├── TestHeretic │ │ │ └── base │ │ │ │ └── heretic.wad │ │ │ └── TestHexen │ │ │ └── base │ │ │ └── hexen.wad │ ├── archive.7z │ ├── archive.rar │ ├── archive.zip │ ├── chocosave1.dsg │ ├── invalid1.wad │ ├── invalid2.wad │ ├── joymaps1.zip │ ├── mapinfo.zip │ ├── mapinfo_doom64.zip │ ├── pathtest.zip │ ├── prboomsave1.dsg │ ├── pyrrhic.zip │ ├── pyrrhicmaps.zip │ ├── simple.wad │ ├── testpk3.pk3 │ ├── uroburos.zip │ ├── zandemo.cld │ ├── zdoomsave_v1.zds │ ├── zdoomsave_v2.zds │ ├── zdoomsave_v3.zds │ ├── zdoomsave_v4.zds │ └── zmapinfo.zip ├── TestInit.cs ├── Tests │ ├── Helpers │ │ ├── DirectoriesConfiguration.cs │ │ ├── Tree.cs │ │ ├── TreeEntry.cs │ │ └── TreeReader.cs │ ├── TestArchives.cs │ ├── TestAutomaticSteamCheck.cs │ ├── TestCldDemoParser.cs │ ├── TestCnDoomStats.cs │ ├── TestDirectoryAdapter.cs │ ├── TestDirectoryArchive.cs │ ├── TestDoom64GameFileFragment.cs │ ├── TestDsgSave.cs │ ├── TestFile.cs │ ├── TestFileDetector.cs │ ├── TestGameFile.cs │ ├── TestGameFileTags.cs │ ├── TestGameLauncher.cs │ ├── TestGameProfile.cs │ ├── TestGameProfileUtil.cs │ ├── TestGameStoreFiles.cs │ ├── TestIWad.cs │ ├── TestIdGamesFileParser.cs │ ├── TestIdGamesTextInfo.cs │ ├── TestLaunchParameters.cs │ ├── TestLauncherPath.cs │ ├── TestLevelstat.cs │ ├── TestLoadFiles.cs │ ├── TestMapLumps.cs │ ├── TestMapStringGameFileFragment.cs │ ├── TestRecursiveArchiveReader.cs │ ├── TestSourcePort.cs │ ├── TestSpecificFiles.cs │ ├── TestStatdump.cs │ ├── TestStats.cs │ ├── TestSteamLoader.cs │ ├── TestSyncLibraryHandler.cs │ ├── TestUpdateInfo.cs │ ├── TestUtil.cs │ ├── TestWadReader.cs │ ├── TestZdlParser.cs │ ├── TestZdoomSave.cs │ └── TestZdoomStats.cs ├── UnitTest.csproj ├── app.config └── packages.config ├── WadReader ├── DoomImage │ ├── DoomImage.cs │ ├── Palette.cs │ └── PaletteReaders.cs ├── FileLump.cs ├── Properties │ └── AssemblyInfo.cs ├── Util.cs ├── WadFileReader.cs ├── WadHeader.cs ├── WadReader.csproj ├── WadType.cs └── packages.config ├── WpfControlLibrary ├── AssemblyInfo.cs ├── WpfComboBox.xaml ├── WpfComboBox.xaml.cs └── WpfControlLibrary.csproj └── appveyor.yml /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | custom: https://paypal.me/nstlaurent22 14 | -------------------------------------------------------------------------------- /BindingListView/BindingListView.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $id$ 5 | $version$ 6 | $title$ 7 | $author$ 8 | https://github.com/waynebloss/BindingListView/blob/master/license.txt 9 | https://github.com/waynebloss/BindingListView 10 | false 11 | $description$ 12 | The BindingListView .NET library provides a type-safe, sortable, filterable, data-bindable view of one or more lists of objects. It is the business objects equivalent of using a DataView on a DataTable in ADO.NET. If you have a list of objects to display on a Windows Forms UI (e.g. in a DataGridView) and want to allow your user to sort and filter, then this is the library to use! 13 | Initial 14 | Copyright 2014 15 | .net IBindingListView winforms 16 | 17 | -------------------------------------------------------------------------------- /BindingListView/CompositeItemFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Equin.ApplicationFramework 5 | { 6 | public class CompositeItemFilter : IItemFilter 7 | { 8 | private List> _filters; 9 | 10 | public CompositeItemFilter() 11 | { 12 | _filters = new List>(); 13 | } 14 | 15 | public void AddFilter(IItemFilter filter) 16 | { 17 | _filters.Add(filter); 18 | } 19 | 20 | public void RemoveFilter(IItemFilter filter) 21 | { 22 | _filters.Remove(filter); 23 | } 24 | 25 | public bool Include(T item) 26 | { 27 | foreach (IItemFilter filter in _filters) 28 | { 29 | if (!filter.Include(item)) 30 | { 31 | return false; 32 | } 33 | } 34 | return true; 35 | } 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /BindingListView/INotifyingEditableObject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | 4 | namespace Equin.ApplicationFramework 5 | { 6 | /// 7 | /// Extends by providing events to raise during edit state changes. 8 | /// 9 | internal interface INotifyingEditableObject : IEditableObject 10 | { 11 | /// 12 | /// An edit has started on the object. 13 | /// 14 | /// 15 | /// This event should be raised from BeginEdit(). 16 | /// 17 | event EventHandler EditBegun; 18 | /// 19 | /// The editing of the object was cancelled. 20 | /// 21 | /// 22 | /// This event should be raised from CancelEdit(). 23 | /// 24 | event EventHandler EditCancelled; 25 | /// 26 | /// The editing of the object was ended. 27 | /// 28 | /// 29 | /// This event should be raised from EndEdit(). 30 | /// 31 | event EventHandler EditEnded; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /BindingListView/InvalidSourceListException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Equin.ApplicationFramework 6 | { 7 | [Serializable] 8 | public class InvalidSourceListException : Exception 9 | { 10 | public InvalidSourceListException() 11 | : base(Properties.Resources.InvalidSourceList) 12 | { 13 | 14 | } 15 | 16 | public InvalidSourceListException(string message) 17 | : base(message) 18 | { 19 | 20 | } 21 | 22 | public InvalidSourceListException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) 23 | : base(info, context) 24 | { 25 | 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /BindingListView/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/BindingListView/Properties/AssemblyInfo.cs -------------------------------------------------------------------------------- /BindingListView/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Equin.ApplicationFramework.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.3.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /BindingListView/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CheckBoxComboBox/CheckBoxComboBox.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace PresentationControls 2 | { 3 | partial class CheckBoxComboBox 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | [System.CodeDom.Compiler.GeneratedCode("Winform Designer", "VS2015 SP1")] 30 | private void InitializeComponent() 31 | { 32 | components = new System.ComponentModel.Container(); 33 | } 34 | 35 | #endregion 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /CheckBoxComboBox/Popup.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace PresentationControls 2 | { 3 | partial class Popup 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing) 17 | { 18 | if (components != null) 19 | { 20 | components.Dispose(); 21 | } 22 | if (content != null) 23 | { 24 | System.Windows.Forms.Control _content = content; 25 | content = null; 26 | _content.Dispose(); 27 | } 28 | } 29 | base.Dispose(disposing); 30 | } 31 | 32 | #region Component Designer generated code 33 | 34 | /// 35 | /// Required method for Designer support - do not modify 36 | /// the contents of this method with the code editor. 37 | /// 38 | [System.CodeDom.Compiler.GeneratedCode("Winform Designer", "VS2015 SP1")] 39 | private void InitializeComponent() 40 | { 41 | components = new System.ComponentModel.Container(); 42 | } 43 | 44 | #endregion 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /CheckBoxComboBox/PopupComboBox.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace PresentationControls 2 | { 3 | partial class PopupComboBox 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing) 17 | { 18 | if (components != null) 19 | { 20 | components.Dispose(); 21 | } 22 | if (dropDown != null) 23 | { 24 | dropDown.Dispose(); 25 | } 26 | } 27 | base.Dispose(disposing); 28 | } 29 | 30 | #region Component Designer generated code 31 | 32 | /// 33 | /// Required method for Designer support - do not modify 34 | /// the contents of this method with the code editor. 35 | /// 36 | [System.CodeDom.Compiler.GeneratedCode("Winform Designer", "VS2015 SP1")] 37 | private void InitializeComponent() 38 | { 39 | this.SuspendLayout(); 40 | // 41 | // PopupComboBox 42 | // 43 | this.ResumeLayout(false); 44 | 45 | } 46 | 47 | #endregion 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /CheckBoxComboBox/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("CheckBoxComboBox")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("IT")] 11 | [assembly: AssemblyProduct("CheckBoxComboBox")] 12 | [assembly: AssemblyCopyright("Copyright © IT 2007")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("0b11e2be-4211-4d2a-9102-6847a56d6fd8")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /DoomLauncher/Adapters/Launch/ExtraParametersLaunchFeature.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Config; 2 | using DoomLauncher.Interfaces; 3 | 4 | namespace DoomLauncher.Adapters.Launch 5 | { 6 | public class ExtraParametersLaunchFeature : ILaunchFeature 7 | { 8 | private readonly string _extraParameters; // Never null 9 | private readonly bool _extraParametersOnly; 10 | 11 | public ExtraParametersLaunchFeature(string extraParameters, bool extraParametersOnly) 12 | { 13 | _extraParameters = extraParameters ?? ""; 14 | _extraParametersOnly = extraParametersOnly; 15 | } 16 | 17 | public LaunchParameters CreateParameter(IGameFile gameFile, ISourcePortData sourcePort, bool isGameFileIwad, IDirectoriesConfiguration directories) 18 | { 19 | if (_extraParametersOnly) 20 | return LaunchParameters.ExclusiveParam(_extraParameters); 21 | else 22 | return LaunchParameters.Param(_extraParameters); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DoomLauncher/Adapters/Launch/ILaunchFeature.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Config; 2 | using DoomLauncher.Interfaces; 3 | 4 | namespace DoomLauncher.Adapters.Launch 5 | { 6 | public interface ILaunchFeature 7 | { 8 | LaunchParameters CreateParameter(IGameFile gameFile, ISourcePortData sourcePort, bool isGameFileIwad, IDirectoriesConfiguration directories); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /DoomLauncher/Adapters/Launch/LaunchResult.cs: -------------------------------------------------------------------------------- 1 |  2 | using static DoomLauncher.GameLauncher; 3 | 4 | namespace DoomLauncher.Adapters.Launch 5 | { 6 | public class LaunchResult 7 | { 8 | public GameLaunchInfo GameLaunchInfo { get; } 9 | 10 | public string ErrorMessage { get; } 11 | 12 | public bool Failed 13 | { 14 | get => !string.IsNullOrEmpty(ErrorMessage); 15 | } 16 | 17 | private LaunchResult(GameLaunchInfo gameLaunchInfo, string errorMessage) 18 | { 19 | GameLaunchInfo = gameLaunchInfo; 20 | ErrorMessage = errorMessage; 21 | } 22 | 23 | public static LaunchResult Success(GameLaunchInfo gameLaunchInfo) => 24 | new LaunchResult(gameLaunchInfo, null); 25 | 26 | public static LaunchResult Failure(string errorMessage) => 27 | new LaunchResult(null, errorMessage); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DoomLauncher/Adapters/Launch/LoadSaveLaunchFeature.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Config; 2 | using DoomLauncher.Interfaces; 3 | using DoomLauncher.SourcePort; 4 | 5 | namespace DoomLauncher.Adapters.Launch 6 | { 7 | public class LoadSaveLaunchFeature : ILaunchFeature 8 | { 9 | private readonly string _loadSaveFile; 10 | 11 | public LoadSaveLaunchFeature(string loadSaveFile) 12 | { 13 | _loadSaveFile = loadSaveFile; 14 | } 15 | 16 | public LaunchParameters CreateParameter(IGameFile gameFile, ISourcePortData sourcePort, bool isGameFileIwad, IDirectoriesConfiguration directories) 17 | { 18 | if (!string.IsNullOrEmpty(_loadSaveFile) && sourcePort.GetFlavor().LoadSaveGameSupported()) 19 | { 20 | var paramString = sourcePort.GetFlavor().LoadSaveParameter(new SpData(_loadSaveFile)); 21 | return LaunchParameters.Param(paramString); 22 | } 23 | else 24 | return LaunchParameters.EMPTY; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DoomLauncher/Adapters/Launch/MapSkillLaunchFeature.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Config; 2 | using DoomLauncher.Interfaces; 3 | using DoomLauncher.SourcePort; 4 | using System.Text; 5 | 6 | namespace DoomLauncher.Adapters.Launch 7 | { 8 | public class MapSkillLaunchFeature : ILaunchFeature 9 | { 10 | 11 | private readonly string _map; 12 | private readonly string _skill; 13 | 14 | public MapSkillLaunchFeature(string map, string skill) 15 | { 16 | _map = map; 17 | _skill = skill; 18 | } 19 | 20 | public LaunchParameters CreateParameter(IGameFile gameFile, ISourcePortData sourcePort, bool isGameFileIwad, IDirectoriesConfiguration directories) 21 | { 22 | LaunchParameters result = LaunchParameters.EMPTY; 23 | 24 | if (_map != null) 25 | { 26 | var warpParam = LaunchParameters.Param(sourcePort.GetFlavor().WarpParameter(new SpData(_map))); 27 | result = warpParam; 28 | 29 | if (_skill != null) 30 | { 31 | var skillParam = LaunchParameters.Param(sourcePort.GetFlavor().SkillParameter(new SpData(_skill))); 32 | result = warpParam.Combine(skillParam); 33 | } 34 | } 35 | 36 | return result; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /DoomLauncher/Adapters/Launch/PlayDemoLaunchFeature.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Config; 2 | using DoomLauncher.Interfaces; 3 | using DoomLauncher.SourcePort; 4 | using System; 5 | using System.IO; 6 | 7 | namespace DoomLauncher.Adapters.Launch 8 | { 9 | public class PlayDemoLaunchFeature : ILaunchFeature 10 | { 11 | private readonly string _playDemoFile; 12 | 13 | public PlayDemoLaunchFeature(string playDemoFile) 14 | { 15 | _playDemoFile = playDemoFile; 16 | } 17 | 18 | public LaunchParameters CreateParameter(IGameFile gameFile, ISourcePortData sourcePort, bool isGameFileIwad, IDirectoriesConfiguration directories) 19 | { 20 | FileInfo fi = new FileInfo(_playDemoFile); 21 | 22 | if (!fi.Exists) 23 | { 24 | return LaunchParameters.Failure($"Failed to find demo file {_playDemoFile}"); 25 | } 26 | else 27 | { 28 | var paramString = sourcePort.GetFlavor().PlayDemoParameter(new SpData(_playDemoFile)); 29 | return LaunchParameters.Param(paramString); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /DoomLauncher/Adapters/Launch/RecordLaunchFeature.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Config; 2 | using DoomLauncher.Interfaces; 3 | using DoomLauncher.SourcePort; 4 | using System; 5 | using System.IO; 6 | 7 | namespace DoomLauncher.Adapters.Launch 8 | { 9 | public class RecordLaunchFeature : ILaunchFeature 10 | { 11 | public LaunchParameters CreateParameter(IGameFile gameFile, ISourcePortData sourcePort, bool isGameFileIwad, IDirectoriesConfiguration directories) 12 | { 13 | var recordedFileName = Path.Combine(directories.TempDirectory.GetFullPath(), Guid.NewGuid().ToString()); 14 | var paramString = sourcePort.GetFlavor().RecordParameter(new SpData(recordedFileName)); 15 | 16 | return LaunchParameters.Param(paramString).WithRecordedFileName(recordedFileName); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DoomLauncher/Adapters/Launch/SourcePortExtraParametersLaunchFeature.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Config; 2 | using DoomLauncher.Interfaces; 3 | 4 | namespace DoomLauncher.Adapters.Launch 5 | { 6 | public class SourcePortExtraParametersLaunchFeature : ILaunchFeature 7 | { 8 | public LaunchParameters CreateParameter(IGameFile gameFile, ISourcePortData sourcePort, bool isGameFileIwad, IDirectoriesConfiguration directories) 9 | { 10 | return LaunchParameters.Param(sourcePort.ExtraParameters); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DoomLauncher/Adapters/Launch/StatisticsReaderLaunchFeature.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Config; 2 | using DoomLauncher.Interfaces; 3 | using System; 4 | 5 | namespace DoomLauncher.Adapters.Launch 6 | { 7 | public class StatisticsReaderLaunchFeature : ILaunchFeature 8 | { 9 | public LaunchParameters CreateParameter(IGameFile gameFile, ISourcePortData sourcePort, bool isGameFileIwad, IDirectoriesConfiguration directories) 10 | { 11 | IStatisticsReader statsReader = sourcePort.GetFlavor().CreateStatisticsReader(gameFile, Array.Empty()); 12 | return LaunchParameters.Param(statsReader?.LaunchParameter); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DoomLauncher/Adapters/MSSQLDataAdapter.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System.Data.Common; 3 | using System.Data.SqlClient; 4 | 5 | namespace DoomLauncher 6 | { 7 | class MSSQLDataAdapter : IDatabaseAdapter 8 | { 9 | public DbConnection CreateConnection(string connectionString) 10 | { 11 | return new SqlConnection(connectionString); 12 | } 13 | 14 | public DbDataAdapter CreateAdapter() 15 | { 16 | return new SqlDataAdapter(); 17 | } 18 | 19 | public DbParameter CreateParameter(string name, object value) 20 | { 21 | return new SqlParameter(name, value); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DoomLauncher/Adapters/PlaySession.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using static DoomLauncher.GameLauncher; 3 | 4 | namespace DoomLauncher.Adapters 5 | { 6 | public class PlaySession 7 | { 8 | public PlaySession(GameLaunchInfo launchInfo, IStatisticsReader statisticsReader, DateTime start) 9 | { 10 | GameLaunchInfo = launchInfo; 11 | StatisticsReader = statisticsReader; 12 | Start = start; 13 | } 14 | 15 | public GameLaunchInfo GameLaunchInfo { get; } 16 | public IStatisticsReader StatisticsReader { get; } 17 | public DateTime Start { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DoomLauncher/Adapters/SqliteDatabaseAdapter.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System.Data.Common; 3 | using System.Data.SQLite; 4 | 5 | namespace DoomLauncher 6 | { 7 | public class SqliteDatabaseAdapter : IDatabaseAdapter 8 | { 9 | public DbConnection CreateConnection(string connectionString) 10 | { 11 | return new SQLiteConnection(connectionString); 12 | } 13 | 14 | public DbDataAdapter CreateAdapter() 15 | { 16 | return new SQLiteDataAdapter(); 17 | } 18 | 19 | public DbParameter CreateParameter(string name, object value) 20 | { 21 | return new SQLiteParameter(name, value); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DoomLauncher/Archive/Directory/DirectoryArchiveEntry.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace DoomLauncher 4 | { 5 | internal class DirectoryArchiveEntry : AbstractArchiveEntry 6 | { 7 | private readonly FileInfo m_file; 8 | 9 | public DirectoryArchiveEntry(string file) 10 | { 11 | m_file = new FileInfo(file); 12 | } 13 | 14 | public override long Length => m_file.Length; 15 | 16 | public override string Name => m_file.Name; 17 | 18 | public override string FullName => m_file.FullName; 19 | 20 | public override bool ExtractRequired => false; 21 | 22 | public override bool IsDirectory => false; 23 | 24 | public override void ExtractToFile(string file, bool overwrite = false) 25 | { 26 | m_file.CopyTo(file, overwrite); 27 | } 28 | 29 | public override void Read(byte[] buffer, int offset, int length) 30 | { 31 | using (var fs = m_file.OpenRead()) 32 | fs.Read(buffer, offset, length); 33 | } 34 | 35 | public override string GetNameWithoutExtension() => Name; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DoomLauncher/Archive/Directory/DirectoryArchiveReader.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | 4 | namespace DoomLauncher 5 | { 6 | public class DirectoryArchiveReader : IArchiveReader 7 | { 8 | private readonly string m_directory; 9 | private readonly List m_entries = new List(); 10 | 11 | public IEnumerable Entries => m_entries; 12 | public bool EntriesHaveExtensions => true; 13 | 14 | public DirectoryArchiveReader(string directory) 15 | { 16 | m_directory = directory; 17 | RecursivelyIterateDirectory(m_directory); 18 | } 19 | 20 | void RecursivelyIterateDirectory(string directory) 21 | { 22 | try 23 | { 24 | foreach (string dir in Directory.GetDirectories(directory)) 25 | { 26 | foreach (string file in Directory.GetFiles(dir)) 27 | m_entries.Add(new DirectoryArchiveEntry(file)); 28 | RecursivelyIterateDirectory(dir); 29 | } 30 | } 31 | catch 32 | { 33 | } 34 | } 35 | 36 | public void Dispose() 37 | { 38 | 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /DoomLauncher/Archive/EmptyArchiveReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace DoomLauncher 5 | { 6 | public class EmptyArchiveReader : IArchiveReader 7 | { 8 | public IEnumerable Entries => Array.Empty(); 9 | 10 | public bool EntriesHaveExtensions => false; 11 | 12 | public void Dispose() 13 | { 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DoomLauncher/Archive/IArchiveReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace DoomLauncher 5 | { 6 | public interface IArchiveReader : IDisposable 7 | { 8 | IEnumerable Entries { get; } 9 | bool EntriesHaveExtensions { get; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DoomLauncher/Archive/Rar/RarArchiveEntry.cs: -------------------------------------------------------------------------------- 1 | using SharpCompress.Archives; 2 | using System.IO; 3 | 4 | namespace DoomLauncher.Archive.Rar 5 | { 6 | public class RarArchiveEntry : AbstractArchiveEntry 7 | { 8 | private readonly SharpCompress.Archives.Rar.RarArchiveEntry m_entry; 9 | 10 | public RarArchiveEntry(SharpCompress.Archives.Rar.RarArchiveEntry entry) 11 | { 12 | m_entry = entry; 13 | } 14 | 15 | public override long Length => m_entry.Size; 16 | 17 | public override string Name => Path.GetFileName(m_entry.Key); 18 | 19 | public override string FullName => m_entry.Key; 20 | 21 | public override bool ExtractRequired => true; 22 | 23 | public override bool IsDirectory => m_entry.IsDirectory; 24 | 25 | public override void ExtractToFile(string file, bool overwrite = false) 26 | { 27 | if (!overwrite && File.Exists(file)) 28 | return; 29 | 30 | m_entry.WriteToFile(file); 31 | } 32 | 33 | public override void Read(byte[] buffer, int offset, int length) 34 | { 35 | using (MemoryStream ms = new MemoryStream(buffer, offset, length)) 36 | m_entry.WriteTo(ms); 37 | } 38 | 39 | public override bool Equals(object obj) 40 | { 41 | if (!(obj is IArchiveEntry entry)) 42 | return false; 43 | 44 | return entry.FullName == FullName; 45 | } 46 | 47 | public override int GetHashCode() 48 | { 49 | return FullName.GetHashCode(); 50 | } 51 | 52 | public override string GetNameWithoutExtension() => Path.GetFileNameWithoutExtension(Name); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /DoomLauncher/Archive/Rar/RarArchiveReader.cs: -------------------------------------------------------------------------------- 1 | using SharpCompress.Archives.Rar; 2 | using System.Collections.Generic; 3 | 4 | namespace DoomLauncher.Archive.Rar 5 | { 6 | internal class RarArchiveReader : IArchiveReader 7 | { 8 | private readonly RarArchive m_archive; 9 | 10 | public RarArchiveReader(string file) 11 | { 12 | m_archive = RarArchive.Open(file); 13 | } 14 | 15 | public IEnumerable Entries 16 | { 17 | get 18 | { 19 | foreach (var entry in m_archive.Entries) 20 | yield return new RarArchiveEntry(entry); 21 | } 22 | } 23 | 24 | public bool EntriesHaveExtensions => true; 25 | 26 | public void Dispose() 27 | { 28 | m_archive.Dispose(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DoomLauncher/Archive/SevenZip/SevenZipArchiveReader.cs: -------------------------------------------------------------------------------- 1 | using SevenZip; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace DoomLauncher.Archive.SevenZip 6 | { 7 | public class SevenZipArchiveReader : IArchiveReader 8 | { 9 | private readonly SevenZipExtractor m_extractor; 10 | private readonly MemoryStreamManager m_streamManager = new MemoryStreamManager(); 11 | 12 | public SevenZipArchiveReader(string file, string sevenZipInteropLibrary) 13 | { 14 | SevenZipBase.SetLibraryPath(sevenZipInteropLibrary); 15 | m_extractor = new SevenZipExtractor(file); 16 | } 17 | 18 | public IEnumerable Entries 19 | { 20 | get 21 | { 22 | foreach (var entry in m_extractor.ArchiveFileData) 23 | yield return new SevenZipArchiveEntry(m_extractor, entry, m_streamManager); 24 | } 25 | } 26 | 27 | public bool EntriesHaveExtensions => true; 28 | 29 | public void Dispose() 30 | { 31 | m_extractor.Dispose(); 32 | foreach (var stream in m_streamManager.Streams) 33 | stream.Dispose(); 34 | } 35 | } 36 | 37 | public class MemoryStreamManager 38 | { 39 | public List Streams = new List(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /DoomLauncher/Archive/Wad/WadArchiveReader.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | using WadReader; 4 | 5 | namespace DoomLauncher 6 | { 7 | internal class WadArchiveReader : IArchiveReader 8 | { 9 | private readonly FileStream m_fs; 10 | private readonly List m_entries = new List(); 11 | 12 | public IEnumerable Entries => m_entries; 13 | public bool EntriesHaveExtensions => false; 14 | public readonly bool IsValid; 15 | public readonly string Filename; 16 | 17 | public WadArchiveReader(string file) 18 | { 19 | Filename = file; 20 | m_fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); 21 | WadFileReader wadReader = new WadFileReader(m_fs); 22 | IsValid = wadReader.IsValid; 23 | var lumps = wadReader.ReadLumps(); 24 | foreach (var lump in lumps) 25 | m_entries.Add(new WadEntry(m_fs, lump)); 26 | } 27 | 28 | public void Dispose() 29 | { 30 | m_fs.Dispose(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /DoomLauncher/Archive/Wad/WadEntry.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using WadReader; 3 | 4 | namespace DoomLauncher 5 | { 6 | public class WadEntry : AbstractArchiveEntry 7 | { 8 | private readonly FileStream m_fs; 9 | private readonly FileLump m_lump; 10 | 11 | public override long Length => m_lump.Length; 12 | 13 | public override string Name { get; } 14 | 15 | public override string FullName => Name; 16 | 17 | public override bool ExtractRequired => false; 18 | 19 | public override bool IsDirectory => false; 20 | 21 | public WadEntry(FileStream fs, FileLump lump) 22 | { 23 | m_fs = fs; 24 | m_lump = lump; 25 | Name = lump.Name; 26 | } 27 | 28 | public override void ExtractToFile(string file, bool overwrite = false) 29 | { 30 | File.WriteAllBytes(file, m_lump.ReadData(m_fs)); 31 | } 32 | 33 | public override void Read(byte[] buffer, int offset, int length) 34 | { 35 | m_lump.ReadData(m_fs, buffer, offset, length); 36 | } 37 | 38 | public override string GetNameWithoutExtension() => Name; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /DoomLauncher/Archive/Zip/ZipArchiveReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.IO.Compression; 5 | 6 | namespace DoomLauncher 7 | { 8 | public class ZipArchiveReader : IArchiveReader 9 | { 10 | private readonly ZipArchive m_archive; 11 | 12 | public bool EntriesHaveExtensions => true; 13 | 14 | public ZipArchiveReader(string file) 15 | { 16 | var stream = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); 17 | try 18 | { 19 | m_archive = new ZipArchive(stream); 20 | } 21 | catch (Exception ex) 22 | { 23 | stream.Dispose(); 24 | throw ex; 25 | } 26 | } 27 | 28 | public IEnumerable Entries 29 | { 30 | get 31 | { 32 | foreach (var entry in m_archive.Entries) 33 | yield return new ZipArchiveReaderEntry(entry); 34 | } 35 | } 36 | 37 | public void Dispose() 38 | { 39 | Dispose(true); 40 | GC.SuppressFinalize(this); 41 | } 42 | 43 | protected virtual void Dispose(bool disposing) 44 | { 45 | m_archive.Dispose(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /DoomLauncher/Archive/Zip/ZipArchiveReaderEntry.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.IO.Compression; 3 | 4 | namespace DoomLauncher 5 | { 6 | class ZipArchiveReaderEntry : AbstractArchiveEntry 7 | { 8 | private readonly ZipArchiveEntry m_entry; 9 | 10 | public ZipArchiveReaderEntry(ZipArchiveEntry zipArchiveEntry) 11 | { 12 | m_entry = zipArchiveEntry; 13 | } 14 | 15 | public override long Length => m_entry.Length; 16 | 17 | public override void Read(byte[] buffer, int offset, int length) 18 | { 19 | m_entry.Open().Read(buffer, offset, length); 20 | } 21 | 22 | public override string Name => m_entry.Name; 23 | public override string FullName => m_entry.FullName; 24 | 25 | public override bool ExtractRequired => true; 26 | 27 | public override bool IsDirectory => m_entry.FullName.EndsWith("/"); 28 | 29 | public override void ExtractToFile(string file, bool overwrite = false) 30 | { 31 | m_entry.ExtractToFile(file, overwrite); 32 | } 33 | 34 | public override bool Equals(object obj) 35 | { 36 | if (!(obj is IArchiveEntry entry)) 37 | return false; 38 | 39 | return entry.FullName == FullName; 40 | } 41 | 42 | public override int GetHashCode() 43 | { 44 | return FullName.GetHashCode(); 45 | } 46 | 47 | public override string GetNameWithoutExtension() => Path.GetFileNameWithoutExtension(Name); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /DoomLauncher/Config/AppVersion.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public enum AppVersion 4 | { 5 | Unknown, 6 | Version_1_0_0, 7 | Version_1_1_0, 8 | Version_1_2_0, 9 | Version_2_1_0, 10 | Version_2_2_0, 11 | Version_2_2_1, 12 | Version_2_3_0, 13 | Version_2_4_0, 14 | Version_2_4_1, 15 | Version_2_6_0, 16 | Version_2_6_3, 17 | Version_2_6_3_1, 18 | Version_2_6_3_2, 19 | Version_2_6_4_1, 20 | Version_2_6_4_1_Update1, 21 | Version_2_7_0_0, 22 | Version_2_8_0_0, 23 | Version_2_8_0_0_1, 24 | Version_3_1_0, 25 | Version_3_2_0, 26 | Version_3_2_0_Update1, 27 | Version_3_2_0_Update2, 28 | Version_3_2_0_Update3, 29 | Version_3_3_0, 30 | Version_3_3_1, 31 | Version_3_3_2, 32 | Version_3_4_0, 33 | Version_3_4_0_Update1, 34 | Version_3_5_2, 35 | Version_3_5_2_Update1, 36 | Version_3_5_2_Update2, 37 | Version_3_5_3_Update1, 38 | Version_3_5_3_Update2, 39 | Version_3_5_3_Update3, 40 | Version_3_7_0, 41 | Version_3_7_0_Update1, 42 | Version_3_7_4, 43 | Version_3_7_7, 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /DoomLauncher/Config/ColorTheme.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public static class ColorTheme 4 | { 5 | public static IThemeColors Current { get; set; } = new DefaultTheme(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /DoomLauncher/Config/ColorThemeType.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher.Config 2 | { 3 | public enum ColorThemeType 4 | { 5 | Default, 6 | Dark, 7 | System 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DoomLauncher/Config/ColumnConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace DoomLauncher 4 | { 5 | 6 | public class ColumnConfig 7 | { 8 | public ColumnConfig() { } 9 | public ColumnConfig(string parent, string column, int width, SortOrder sort) 10 | { 11 | Parent = parent; 12 | Column = column; 13 | Width = width; 14 | Sort = sort; 15 | } 16 | 17 | public string Parent { get; set; } 18 | public string Column { get; set; } 19 | public int Width { get; set; } 20 | public SortOrder Sort { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DoomLauncher/Config/ConfigType.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public enum ConfigType 4 | { 5 | DefaultSourcePort, 6 | DefaultIWad, 7 | DefaultSkill, 8 | AutoSearch, 9 | FileManagement, 10 | GameFileViewType, 11 | VisibleViews, 12 | ColorThemeType 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DoomLauncher/Config/FileManagement.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public enum FileManagement 4 | { 5 | Managed, 6 | Unmanaged, 7 | Prompt, 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DoomLauncher/Config/GameFileListEventArgs.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System.Collections.Generic; 3 | 4 | namespace DoomLauncher 5 | { 6 | public class GameFileListEventArgs 7 | { 8 | public IEnumerable GameFiles { get; set; } 9 | 10 | public GameFileListEventArgs(IEnumerable gameFiles) 11 | { 12 | GameFiles = gameFiles; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DoomLauncher/Config/IDirectoriesConfiguration.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace DoomLauncher.Config 3 | { 4 | public interface IDirectoriesConfiguration 5 | { 6 | LauncherPath GameFileDirectory { get; } 7 | LauncherPath ScreenshotDirectory { get; } 8 | LauncherPath SaveGameDirectory { get; } 9 | LauncherPath TempDirectory { get; } 10 | LauncherPath DemoDirectory { get; } 11 | LauncherPath ThumbnailDirectory { get; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DoomLauncher/Config/ScreenFilter.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public enum ScreenFilterType 4 | { 5 | Ellipse, 6 | Scanline 7 | } 8 | 9 | public class ScreenFilter 10 | { 11 | public ScreenFilterType Type { get; set; } 12 | public float Opacity { get; set; } 13 | public int LineThickness { get; set; } 14 | public int BlockSize { get; set; } 15 | public float SpacingX { get; set; } 16 | public float SpacingY { get; set; } 17 | public bool Stagger { get; set; } 18 | public int ScanlineSpacing { get; set; } 19 | public bool VerticalScanlines { get; set; } 20 | public bool HorizontalScanlines { get; set; } 21 | public bool Enabled { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DoomLauncher/Controls/CDataGridView.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace DoomLauncher 4 | { 5 | class CDataGridView : DataGridView 6 | { 7 | public CDataGridView() 8 | { 9 | DoubleBuffered = true; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /DoomLauncher/Controls/CRichTextBox.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher.Controls 2 | { 3 | partial class CRichTextBox 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | components = new System.ComponentModel.Container(); 32 | } 33 | 34 | #endregion 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /DoomLauncher/Controls/CRichTextBox.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Windows.Forms; 4 | 5 | namespace DoomLauncher.Controls 6 | { 7 | public partial class CRichTextBox : RichTextBox 8 | { 9 | public CRichTextBox() 10 | { 11 | InitializeComponent(); 12 | WarnLinkClick = true; 13 | LinkClicked += CRichTextBox_LinkClicked; 14 | } 15 | 16 | public bool WarnLinkClick { get; set; } 17 | 18 | private void CRichTextBox_LinkClicked(object sender, LinkClickedEventArgs e) 19 | { 20 | if (ShouldNavigate(e)) 21 | Process.Start(e.LinkText); 22 | } 23 | 24 | private bool ShouldNavigate(LinkClickedEventArgs e) 25 | { 26 | if (WarnLinkClick) 27 | { 28 | return MessageBox.Show(this, string.Format("You are about to navigate to:{1}{0} {1}{1}Continue?", e.LinkText, Environment.NewLine), 29 | "Navigate", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK; 30 | } 31 | 32 | return true; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DoomLauncher/Controls/ColumnField.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public class ColumnField 4 | { 5 | public ColumnField(string datakey, string title) 6 | { 7 | DataKey = datakey; 8 | Title = title; 9 | } 10 | 11 | public string DataKey { get; set; } 12 | public string Title { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DoomLauncher/Controls/DownloadViewItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace DoomLauncher 5 | { 6 | public partial class DownloadViewItem : UserControl 7 | { 8 | public event EventHandler Cancelled; 9 | 10 | public DownloadViewItem() 11 | { 12 | InitializeComponent(); 13 | 14 | Stylizer.StylizeControl(this, DesignMode); 15 | } 16 | 17 | public object Key 18 | { 19 | get; 20 | set; 21 | } 22 | 23 | public string DisplayText 24 | { 25 | get { return lblText.Text; } 26 | set { lblText.Text = value; } 27 | } 28 | 29 | public int ProgressValue 30 | { 31 | get { return progressBar.Value; } 32 | set { progressBar.Value = value; } 33 | } 34 | 35 | public bool CancelVisible 36 | { 37 | get { return btnCancel.Visible; } 38 | set { btnCancel.Visible = value; } 39 | } 40 | 41 | private void btnCancel_Click(object sender, EventArgs e) 42 | { 43 | Cancelled?.Invoke(this, new EventArgs()); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /DoomLauncher/Controls/FileType.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public enum FileType 4 | { 5 | Unknown = 0, 6 | Screenshot = 1, 7 | Demo = 2, 8 | SaveGame = 3, 9 | Thumbnail = 4, 10 | TileImage = 5, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /DoomLauncher/Controls/FlowLayoutPanelDB.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | partial class FlowLayoutPanelDB 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | components = new System.ComponentModel.Container(); 32 | //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 33 | } 34 | 35 | #endregion 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DoomLauncher/Controls/FlowLayoutPanelDB.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace DoomLauncher 4 | { 5 | public partial class FlowLayoutPanelDB : FlowLayoutPanel 6 | { 7 | public bool CaptureArrowKeys { get; set; } = false; 8 | 9 | public FlowLayoutPanelDB() 10 | { 11 | SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); 12 | } 13 | 14 | protected override bool IsInputKey(Keys keyData) 15 | { 16 | if (CaptureArrowKeys) 17 | { 18 | switch (keyData) 19 | { 20 | case Keys.Up: 21 | case Keys.Down: 22 | case Keys.Left: 23 | case Keys.Right: 24 | return true; 25 | case Keys.Shift | Keys.Up: 26 | case Keys.Shift | Keys.Down: 27 | case Keys.Shift | Keys.Left: 28 | case Keys.Shift | Keys.Right: 29 | return true; 30 | } 31 | } 32 | 33 | return base.IsInputKey(keyData); 34 | } 35 | 36 | protected override CreateParams CreateParams 37 | { 38 | get 39 | { 40 | CreateParams cp = base.CreateParams; 41 | cp.ExStyle |= 0x02000000; // WS_CLIPCHILDREN 42 | return cp; 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /DoomLauncher/Controls/FormButton.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace DoomLauncher 4 | { 5 | public class FormButton : Button 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DoomLauncher/Controls/GameFileTileBase.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Drawing; 5 | using System.Windows.Forms; 6 | 7 | namespace DoomLauncher 8 | { 9 | public abstract class GameFileTileBase : UserControl, IGameFileTile 10 | { 11 | public abstract event MouseEventHandler TileClick; 12 | public abstract event EventHandler TileDoubleClick; 13 | 14 | public abstract int ImageWidth { get; protected set; } 15 | public abstract IGameFile GameFile { get; protected set; } 16 | public abstract bool Selected { get; protected set; } 17 | 18 | public abstract void ClearData(); 19 | public abstract void SetData(IGameFile gameFile, IEnumerable tags); 20 | public abstract void SetImageLocation(string file); 21 | public abstract void SetImage(Image image); 22 | public abstract void SetSelected(bool set); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DoomLauncher/Controls/GrowLabel.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | partial class GrowLabel 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | [System.CodeDom.Compiler.GeneratedCode("Winform Designer", "VS2015 SP1")] 30 | private void InitializeComponent() 31 | { 32 | components = new System.ComponentModel.Container(); 33 | } 34 | 35 | #endregion 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DoomLauncher/Controls/GrowLabel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.IO; 4 | using System.Windows.Forms; 5 | 6 | namespace DoomLauncher 7 | { 8 | public partial class GrowLabel : Label 9 | { 10 | private bool mGrowing; 11 | 12 | public GrowLabel() 13 | { 14 | AutoSize = false; 15 | IsPath = false; 16 | } 17 | 18 | public bool IsPath { get; set; } 19 | 20 | private void ResizeLabel() 21 | { 22 | if (mGrowing) 23 | return; 24 | 25 | try 26 | { 27 | mGrowing = true; 28 | Size sz = new Size(Width, int.MaxValue); 29 | string text = Text; 30 | 31 | if (IsPath) 32 | text = Text.Replace(Path.DirectorySeparatorChar, ' ').Replace(Path.AltDirectorySeparatorChar, ' '); 33 | 34 | sz = TextRenderer.MeasureText(text, Font, sz, TextFormatFlags.WordBreak); 35 | Height = sz.Height; 36 | } 37 | finally 38 | { 39 | mGrowing = false; 40 | } 41 | } 42 | 43 | protected override void OnTextChanged(EventArgs e) 44 | { 45 | base.OnTextChanged(e); 46 | ResizeLabel(); 47 | } 48 | 49 | protected override void OnFontChanged(EventArgs e) 50 | { 51 | base.OnFontChanged(e); 52 | ResizeLabel(); 53 | } 54 | 55 | protected override void OnSizeChanged(EventArgs e) 56 | { 57 | base.OnSizeChanged(e); 58 | ResizeLabel(); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /DoomLauncher/Controls/TableLayoutPanelDB.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | partial class TableLayoutPanelDB 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | [System.CodeDom.Compiler.GeneratedCode("Winform Designer", "VS2015 SP1")] 30 | private void InitializeComponent() 31 | { 32 | components = new System.ComponentModel.Container(); 33 | } 34 | 35 | #endregion 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DoomLauncher/Controls/TableLayoutPanelDB.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace DoomLauncher 4 | { 5 | public partial class TableLayoutPanelDB : TableLayoutPanel 6 | { 7 | public TableLayoutPanelDB() 8 | { 9 | SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); 10 | } 11 | 12 | protected override CreateParams CreateParams 13 | { 14 | get 15 | { 16 | CreateParams cp = base.CreateParams; 17 | cp.ExStyle |= 0x02000000; // WS_CLIPCHILDREN 18 | return cp; 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DoomLauncher/DataSources/CleanupFile.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher.DataSources 2 | { 3 | public class CleanupFile 4 | { 5 | public int CleanupFileID { get; set; } 6 | public string FileName { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DoomLauncher/DataSources/ConfigurationData.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | 3 | namespace DoomLauncher.DataSources 4 | { 5 | class ConfigurationData : IConfigurationData 6 | { 7 | public ConfigurationData() 8 | { 9 | AvailableValues = string.Empty; 10 | Value = string.Empty; 11 | } 12 | 13 | public int ConfigID { get; set; } 14 | public string Name { get; set; } 15 | public string Value { get; set; } 16 | public string AvailableValues { get; set; } 17 | public bool UserCanModify { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DoomLauncher/DataSources/CustomParam.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public class CustomParamDataSource : ICustomParam 4 | { 5 | public int CustomParamID { get; set; } 6 | public string FileName { get; set; } 7 | public string Parameter { get; set; } 8 | public int GameFileID { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DoomLauncher/DataSources/ITagDataSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace DoomLauncher.Interfaces 8 | { 9 | public interface ITagDataSource 10 | { 11 | int TagID { get; set; } 12 | string Name { get; set; } 13 | bool HasTab { get; set; } 14 | bool HasColor { get; set; } 15 | int? Color { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DoomLauncher/DataSources/IWadData.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | 3 | namespace DoomLauncher 4 | { 5 | public class IWadData : IIWadData 6 | { 7 | public int IWadID { get; set; } 8 | public string Name { get; set; } 9 | public string FileName { get; set; } 10 | public int? GameFileID { get; set; } 11 | 12 | public override bool Equals(object obj) 13 | { 14 | IIWadData iwad = obj as IIWadData; 15 | 16 | if (iwad != null) 17 | { 18 | return iwad.FileName == FileName; 19 | } 20 | 21 | return false; 22 | } 23 | 24 | public override int GetHashCode() 25 | { 26 | return FileName.GetHashCode(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DoomLauncher/DataSources/NewFileData.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public class NewFileData 4 | { 5 | public int SourcePortID { get; set; } 6 | public string Description { get; set; } 7 | public string UserTitle { get; set; } 8 | public string UserDescription { get; set; } 9 | public string Map { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DoomLauncher/DataSources/PreviewImage.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public class PreviewImage 4 | { 5 | public PreviewImage(string path, string title) 6 | { 7 | Path = path; 8 | Title = title; 9 | } 10 | 11 | public string Path { get; set; } 12 | public string Title { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DoomLauncher/DataSources/SettingsDataSource.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DoomLauncher.DataSources 9 | { 10 | class SettingsDataSource : ISettingsDataSource 11 | { 12 | public int GameFileID { get; set; } 13 | public int SettingsID { get; set; } 14 | public string SettingsName { get; set; } 15 | public string SettingsMap { get; set; } 16 | public string SettingsSkill { get; set; } 17 | public string SettingsExtraParams { get; set; } 18 | public string SettingsFiles { get; set; } 19 | public string SettingsSpecificFiles { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DoomLauncher/DataSources/SourcePortLaunchType.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public enum SourcePortLaunchType 4 | { 5 | SourcePort, 6 | Utility, 7 | Doom64 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DoomLauncher/DataSources/StaticTagData.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.DataSources; 2 | 3 | namespace DoomLauncher 4 | { 5 | class StaticTagData : TagData 6 | { 7 | public static string GetFavoriteName(string name) => string.Concat("● ", name); 8 | 9 | public override string FavoriteName => GetFavoriteName(Name); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DoomLauncher/DataSources/TagData.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | 3 | namespace DoomLauncher.DataSources 4 | { 5 | public class TagData : ITagData 6 | { 7 | public static readonly string FavoriteChar = "★"; 8 | 9 | public int TagID { get; set; } 10 | public string Name { get; set; } 11 | public bool HasTab { get; set; } 12 | public bool HasColor { get; set; } 13 | public int? Color { get; set; } 14 | public bool ExcludeFromOtherTabs { get; set; } 15 | public bool Favorite { get; set; } 16 | 17 | public virtual string FavoriteName => Favorite ? string.Concat(FavoriteChar, " ", Name) : Name; 18 | 19 | public override bool Equals(object obj) 20 | { 21 | if (obj is ITagData tag) 22 | return tag.TagID == TagID; 23 | 24 | return false; 25 | } 26 | 27 | public override int GetHashCode() 28 | { 29 | return TagID; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /DoomLauncher/DataSources/TagMapping.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | 3 | namespace DoomLauncher.DataSources 4 | { 5 | public class TagMapping : ITagMapping 6 | { 7 | public int TagID { get; set; } 8 | public int FileID { get; set; } 9 | 10 | public override bool Equals(object obj) 11 | { 12 | ITagMapping mapping = obj as ITagMapping; 13 | 14 | if (mapping != null) 15 | { 16 | return mapping.FileID == this.FileID && mapping.TagID == this.TagID; 17 | } 18 | 19 | return false; 20 | } 21 | 22 | public override int GetHashCode() 23 | { 24 | return string.Format("{0},{1}", FileID, TagID).GetHashCode(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DoomLauncher/DataSources/WadArchiveFile.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher.DataSources 2 | { 3 | class WadArchiveFile : FileData 4 | { 5 | public override bool IsUrl { get { return true; } } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /DoomLauncher/DataSources/WadArchiveGameFile.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System.Collections.Generic; 3 | 4 | namespace DoomLauncher.DataSources 5 | { 6 | class WadArchiveGameFile : GameFile 7 | { 8 | public override string FileName 9 | { 10 | get 11 | { 12 | if (filenames != null && filenames.Length > 0) 13 | return filenames[0]; 14 | return null; 15 | } 16 | set 17 | { 18 | if (filenames == null) 19 | filenames = new string[1]; 20 | filenames[0] = value; 21 | } 22 | } 23 | [JsonProperty("extra")] 24 | public override string Title { get; set; } 25 | [JsonProperty("size")] 26 | public override int FileSizeBytes { get; set; } 27 | [JsonProperty("type")] 28 | public string type { get; set; } 29 | [JsonProperty("port")] 30 | public string port { get; set; } 31 | [JsonProperty("links")] 32 | public string[] links { get; set; } 33 | [JsonProperty("filenames")] 34 | public string[] filenames { get; set; } 35 | [JsonProperty("screenshots")] 36 | public Dictionary screenshots { get; set; } 37 | public override string LastDirectory => string.Empty; 38 | } 39 | 40 | class ScreenshotItem 41 | { 42 | [JsonProperty("name")] 43 | public string name { get; set; } 44 | [JsonProperty("value")] 45 | public string value { get; set; } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /DoomLauncher/Demo/DemoUtil.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | namespace DoomLauncher.Demo 4 | { 5 | public static class DemoUtil 6 | { 7 | public static IDemoParser GetDemoParser(string demoFile) 8 | { 9 | IDemoParser[] parsers = new IDemoParser[] 10 | { 11 | new CldDemoParser(demoFile) 12 | }; 13 | 14 | return parsers.FirstOrDefault(x => x.CanParse()); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DoomLauncher/Demo/IDemoParser.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher.Demo 2 | { 3 | public interface IDemoParser 4 | { 5 | bool CanParse(); 6 | string[] GetRequiredFiles(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DoomLauncher/DoomLauncher.VisualElementsManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /DoomLauncher/DoomLauncher.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/DoomLauncher.ico -------------------------------------------------------------------------------- /DoomLauncher/DoomLauncher.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/DoomLauncher.sqlite -------------------------------------------------------------------------------- /DoomLauncher/DoomLauncherSmall.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/DoomLauncherSmall.ico -------------------------------------------------------------------------------- /DoomLauncher/Dpi/DpiScale.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Windows.Forms; 3 | 4 | namespace DoomLauncher 5 | { 6 | public class DpiScale 7 | { 8 | public DpiScale(Graphics g) 9 | { 10 | DpiScaleX = g.DpiX / 96.0f; 11 | DpiScaleY = g.DpiY / 96.0f; 12 | } 13 | 14 | public DpiScale(float scaleX, float scaleY) 15 | { 16 | DpiScaleX = scaleX; 17 | DpiScaleY = scaleY; 18 | } 19 | 20 | public int ScaleIntY(int height) => (int)(height * DpiScaleY); 21 | public int ScaleIntX(int width) => (int)(width * DpiScaleY); 22 | 23 | public float ScaleFloatY(float height) => height * DpiScaleY; 24 | public float ScaleFloatX(float width) => width * DpiScaleX; 25 | 26 | public readonly float DpiScaleX; 27 | public readonly float DpiScaleY; 28 | 29 | public void ScaleControl(Control control) 30 | { 31 | control.Width = ScaleIntX(control.Width); 32 | control.Height = ScaleIntY(control.Height); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DoomLauncher/Forms/DirectoriesForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | 5 | namespace DoomLauncher.Forms 6 | { 7 | public partial class DirectoriesForm : Form 8 | { 9 | public DirectoriesForm() 10 | { 11 | InitializeComponent(); 12 | lstDirectories.HeaderStyle = ColumnHeaderStyle.None; 13 | lstDirectories.Columns[0].Width = lstDirectories.Width; 14 | Icons.DpiScale = new DpiScale(CreateGraphics()); 15 | btnAdd.Image = Icons.File; 16 | btnDelete.Image = Icons.Delete; 17 | 18 | Stylizer.Stylize(this, DesignMode); 19 | } 20 | 21 | public void SetDirectories(string[] directories) 22 | { 23 | Array.ForEach(directories, x => lstDirectories.Items.Add(x)); 24 | } 25 | 26 | public List GetDirectories() 27 | { 28 | List ret = new List(); 29 | 30 | foreach (ListViewItem item in lstDirectories.Items) 31 | ret.Add(item.Text); 32 | 33 | return ret; 34 | } 35 | 36 | private void btnAdd_Click(object sender, EventArgs e) 37 | { 38 | FolderBrowserDialog dialog = new FolderBrowserDialog(); 39 | 40 | if (dialog.ShowDialog(this) == DialogResult.OK) 41 | { 42 | lstDirectories.Items.Add(dialog.SelectedPath); 43 | } 44 | } 45 | 46 | private void btnDelete_Click(object sender, EventArgs e) 47 | { 48 | if (lstDirectories.SelectedItems.Count > 0) 49 | lstDirectories.Items.Remove(lstDirectories.SelectedItems[0]); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /DoomLauncher/Forms/FileManagementSelect.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace DoomLauncher.Forms 4 | { 5 | public partial class FileManagementSelect : Form 6 | { 7 | public FileManagementSelect() 8 | { 9 | InitializeComponent(); 10 | cmbFileManagement.DataSource = new string[] { "Managed", "Unmanaged" }; 11 | 12 | Stylizer.Stylize(this, DesignMode, StylizerOptions.SetupTitleBar); 13 | } 14 | 15 | public FileManagement GetSelectedFileManagement() 16 | { 17 | if (cmbFileManagement.SelectedIndex == 0) 18 | return FileManagement.Managed; 19 | 20 | return FileManagement.Unmanaged; 21 | } 22 | 23 | private void BtnOK_Click(object sender, System.EventArgs e) 24 | { 25 | Close(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DoomLauncher/Forms/FilterForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher.Forms 2 | { 3 | partial class FilterForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | m_pen.Dispose(); 20 | } 21 | base.Dispose(disposing); 22 | } 23 | 24 | #region Windows Form Designer generated code 25 | 26 | /// 27 | /// Required method for Designer support - do not modify 28 | /// the contents of this method with the code editor. 29 | /// 30 | private void InitializeComponent() 31 | { 32 | this.SuspendLayout(); 33 | // 34 | // CrtFilterForm 35 | // 36 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 37 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 38 | this.ClientSize = new System.Drawing.Size(800, 450); 39 | this.Name = "CrtFilterForm"; 40 | this.Text = "CrtFilterForm"; 41 | this.ResumeLayout(false); 42 | 43 | } 44 | 45 | #endregion 46 | } 47 | } -------------------------------------------------------------------------------- /DoomLauncher/Forms/MetaDataForm.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace DoomLauncher 4 | { 5 | public partial class MetaDataForm : Form 6 | { 7 | public MetaDataForm() 8 | { 9 | InitializeComponent(); 10 | gameFileEdit1.SetShowCheckBoxes(true); 11 | gameFileEdit1.SetShowMaps(false); 12 | 13 | Stylizer.Stylize(this, DesignMode, StylizerOptions.SetupTitleBar); 14 | } 15 | 16 | public GameFileEdit GameFileEdit 17 | { 18 | get { return gameFileEdit1; } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DoomLauncher/Forms/SaveInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace DoomLauncher.Forms 4 | { 5 | public partial class SaveInfo : Form 6 | { 7 | public SaveInfo() 8 | { 9 | InitializeComponent(); 10 | 11 | pbInfo1.Image = DoomLauncher.Properties.Resources.bon2b; 12 | Stylizer.Stylize(this, DesignMode, StylizerOptions.SetupTitleBar); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DoomLauncher/Forms/SimpleFileSelectForm.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Windows.Forms; 4 | 5 | namespace DoomLauncher 6 | { 7 | public partial class SimpleFileSelectForm : Form 8 | { 9 | public SimpleFileSelectForm() 10 | { 11 | InitializeComponent(); 12 | Stylizer.Stylize(this, DesignMode, StylizerOptions.SetupTitleBar); 13 | } 14 | 15 | public void Initialize(IEnumerable files) 16 | { 17 | foreach (string file in files) 18 | lstFiles.Items.Add(file); 19 | 20 | if (files.Count() > 0) 21 | lstFiles.SelectedItem = files.First(); 22 | } 23 | 24 | public string SelectedFile 25 | { 26 | get 27 | { 28 | if (lstFiles.SelectedItems.Count > 0) 29 | return (string)lstFiles.SelectedItems[0]; 30 | 31 | return null; 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DoomLauncher/Forms/SplashScreen.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Windows.Forms; 3 | 4 | namespace DoomLauncher 5 | { 6 | public partial class SplashScreen : Form 7 | { 8 | public SplashScreen() 9 | { 10 | SetStyle(ControlStyles.SupportsTransparentBackColor, true); 11 | BackColor = Color.Transparent; 12 | TransparencyKey = Color.Magenta; 13 | InitializeComponent(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DoomLauncher/Forms/StatsInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace DoomLauncher 5 | { 6 | public partial class StatsInfo : Form 7 | { 8 | public StatsInfo() 9 | { 10 | InitializeComponent(); 11 | 12 | pbInfo1.Image = DoomLauncher.Properties.Resources.bon2b; 13 | 14 | lblZdoom.Text = "For all ZDoom based ports. Uses save games to parse statistics. This means statistics cannot be read for the last level of an episode. " + 15 | "Items and skill level are not available for ZDoom, Zandronum, and GZDoom pre-3.5.0. Statistics will be recorded when the game is saved or when an auto save is generated."; 16 | lblBoom.Text = "Uses the -levelstat parameter and parses the generated levelstat.txt. All statistics will be recorded when the game has exited."; 17 | lblChocolate.Text = "Uses the -statdump parameter and parses the generated stats.txt. All statistics will be recorded when the game has exited. ExM8 maps are only generated by CNDoom."; 18 | 19 | Stylizer.Stylize(this, DesignMode, StylizerOptions.SetupTitleBar); 20 | } 21 | 22 | private void btnOK_Click(object sender, EventArgs e) 23 | { 24 | Close(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DoomLauncher/Forms/TagEditForm.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace DoomLauncher 4 | { 5 | public partial class TagEditForm : Form 6 | { 7 | private TagEdit m_tagEdit; 8 | 9 | public TagEditForm() 10 | { 11 | InitializeComponent(); 12 | 13 | m_tagEdit = new TagEdit(); 14 | m_tagEdit.Dock = DockStyle.Fill; 15 | tblMain.Controls.Add(m_tagEdit, 0, 1); 16 | 17 | Stylizer.Stylize(this, DesignMode, StylizerOptions.SetupTitleBar); 18 | } 19 | 20 | public TagEdit TagEditControl 21 | { 22 | get { return m_tagEdit; } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DoomLauncher/Forms/TagForm.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System.Windows.Forms; 3 | 4 | namespace DoomLauncher 5 | { 6 | public partial class TagForm : Form 7 | { 8 | private readonly TagControl m_tabCtrl; 9 | 10 | public TagForm() 11 | { 12 | InitializeComponent(); 13 | 14 | m_tabCtrl = new TagControl(); 15 | m_tabCtrl.Dock = DockStyle.Fill; 16 | tblMain.Controls.Add(m_tabCtrl, 0, 1); 17 | 18 | Stylizer.Stylize(this, DesignMode, StylizerOptions.SetupTitleBar); 19 | } 20 | 21 | public void Init(IDataSourceAdapter adapter) 22 | { 23 | m_tabCtrl.Init(adapter); 24 | } 25 | 26 | public TagControl TagControl 27 | { 28 | get { return m_tabCtrl; } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DoomLauncher/Forms/TagSelectForm.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Controls; 2 | using System; 3 | using System.Windows.Forms; 4 | 5 | namespace DoomLauncher 6 | { 7 | public partial class TagSelectForm : Form 8 | { 9 | public TagSelectForm() 10 | { 11 | InitializeComponent(); 12 | Stylizer.Stylize(this, DesignMode, StylizerOptions.SetupTitleBar); 13 | } 14 | 15 | public TagSelectControl TagSelectControl => tagSelectControl; 16 | 17 | protected override void OnShown(EventArgs e) 18 | { 19 | // DataGridViews make no sense sometimes, the checks are being cleared between setting/show so reset the DataSource here 20 | base.OnShown(e); 21 | TagSelectControl.SetCheckedTags(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DoomLauncher/Forms/Welcome.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | 5 | namespace DoomLauncher.Forms 6 | { 7 | public partial class Welcome : Form 8 | { 9 | public Welcome() 10 | { 11 | InitializeComponent(); 12 | Stylizer.Stylize(this, DesignMode, StylizerOptions.SetupTitleBar); 13 | lblInfo.BackColor = Color.Transparent; 14 | lblWelcome.BackColor = Color.Transparent; 15 | lblInfo.ForeColor = Color.White; 16 | lblWelcome.ForeColor = Color.White; 17 | lnkHelp.LinkColor = Color.White; 18 | } 19 | 20 | private void lnkHelp_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 21 | { 22 | try 23 | { 24 | Process.Start("Help.pdf"); 25 | } 26 | catch 27 | { 28 | MessageBox.Show(this, "Could not open the help file. Did you copy all the files to your Doom Launcher folder correctly?", "Help Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /DoomLauncher/GameFileView/GameFileViewType.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public enum GameFileViewType 4 | { 5 | GridView, 6 | TileView, 7 | TileViewCondensed 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/AddFileType.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | enum AddFileType 4 | { 5 | GameFile, 6 | IWad 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/AutoCompleteCombo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Windows.Forms; 6 | 7 | namespace DoomLauncher.Handlers 8 | { 9 | public static class AutoCompleteCombo 10 | { 11 | public static void SetAutoCompleteCustomSource(ComboBox cmb, IEnumerable datasource, Type dataType, string property) 12 | { 13 | AutoCompleteStringCollection collection = new AutoCompleteStringCollection(); 14 | 15 | if (dataType != null) 16 | { 17 | PropertyInfo pi = dataType.GetProperty(property); 18 | collection.AddRange(datasource.Select(x => (string)pi.GetValue(x)).ToArray()); 19 | } 20 | else 21 | { 22 | collection.AddRange(datasource.Cast().ToArray()); 23 | } 24 | 25 | cmb.DataSource = datasource; 26 | cmb.AutoCompleteSource = AutoCompleteSource.CustomSource; 27 | cmb.AutoCompleteMode = AutoCompleteMode.SuggestAppend; 28 | cmb.AutoCompleteCustomSource = collection; 29 | cmb.DropDown += Cmb_DropDown; 30 | 31 | if (!datasource.Any()) 32 | cmb.Text = string.Empty; 33 | } 34 | 35 | private static void Cmb_DropDown(object sender, EventArgs e) 36 | { 37 | ((ComboBox)sender).PreviewKeyDown += Cmb_PreviewKeyDown; 38 | } 39 | 40 | private static void Cmb_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) 41 | { 42 | ComboBox cmb = (ComboBox)sender; 43 | cmb.PreviewKeyDown -= Cmb_PreviewKeyDown; 44 | if (cmb.DroppedDown) 45 | cmb.Focus(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/DemoHandler.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace DoomLauncher 6 | { 7 | class DemoHandler 8 | { 9 | public DemoHandler(IDataSourceAdapter adapter, LauncherPath demoDirectory) 10 | { 11 | DataAdapter = adapter; 12 | DemoDirectory = demoDirectory; 13 | } 14 | 15 | public IEnumerable HandleNewDemo(ISourcePortData sourcePort, IGameFile gameFile, string demoFile, string descriptionText) 16 | { 17 | List ret = new List(); 18 | FileInfo fi = new FileInfo(demoFile); 19 | 20 | if (gameFile.GameFileID.HasValue && fi.Exists) 21 | { 22 | fi.CopyTo(Path.Combine(DemoDirectory.GetFullPath(), fi.Name)); 23 | 24 | FileData file = new FileData(); 25 | file.FileName = fi.Name; 26 | file.GameFileID = gameFile.GameFileID.Value; 27 | file.SourcePortID = sourcePort.SourcePortID; 28 | file.FileTypeID = FileType.Demo; 29 | file.Description = descriptionText; 30 | 31 | DataAdapter.InsertFile(file); 32 | } 33 | 34 | return ret; 35 | } 36 | 37 | public IDataSourceAdapter DataAdapter { get; set; } 38 | public LauncherPath DemoDirectory { get; set; } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/FIleAddResults.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace DoomLauncher 5 | { 6 | public class FileError 7 | { 8 | public string FileName { get; set; } 9 | public string Error { get; set; } 10 | } 11 | 12 | class FileAddResults 13 | { 14 | public List NewFiles = new List(); 15 | public List ReplacedFiles = new List(); 16 | public List Errors = new List(); 17 | 18 | public IEnumerable GetAllFiles() => NewFiles.Union(ReplacedFiles); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/FileMapComparer.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System.Collections.Generic; 3 | 4 | namespace DoomLauncher.Handlers 5 | { 6 | public class FileMapComparer : IComparer 7 | { 8 | public int Compare(IFileData x, IFileData y) 9 | { 10 | bool xMap = string.IsNullOrEmpty(x.Map); 11 | bool yMap = string.IsNullOrEmpty(y.Map); 12 | if (!xMap && yMap) 13 | return 0; 14 | 15 | if (xMap && !yMap) 16 | return -1; 17 | if (!xMap && yMap) 18 | return 1; 19 | 20 | return x.Map.CompareTo(y.Map); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/InvalidFile.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public class InvalidFile 4 | { 5 | public InvalidFile(string filename, string reason) 6 | { 7 | FileName = filename; 8 | Reason = reason; 9 | } 10 | 11 | public string FileName { get; } 12 | public string Reason { get; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/LaunchData.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace DoomLauncher 6 | { 7 | class LaunchData 8 | { 9 | public LaunchData(IGameFile gameFile, IGameProfile gameProfile, IEnumerable additionalGameFiles) 10 | { 11 | GameFile = gameFile; 12 | GameProfile = gameProfile; 13 | if (additionalGameFiles == null) 14 | AdditionalGameFiles = new List(); 15 | else 16 | AdditionalGameFiles = additionalGameFiles.ToList(); 17 | Success = true; 18 | } 19 | 20 | public LaunchData(string errorTitle, string errorDescritpion) 21 | { 22 | Success = false; 23 | ErrorTitle = errorTitle; 24 | ErrorDescription = errorDescritpion; 25 | } 26 | 27 | public bool Success { get; set; } 28 | public string ErrorTitle { get; set; } 29 | public string ErrorDescription { get; set; } 30 | public IGameFile GameFile { get; set; } 31 | public IGameProfile GameProfile { get; set; } 32 | public List AdditionalGameFiles { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/MenuConstants.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public static class MenuConstants 4 | { 5 | public static readonly string Rename = "Rename..."; 6 | public static readonly string Utility = "Utility"; 7 | public static readonly string Resync = "Resync"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/NativeMethods.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace DoomLauncher 5 | { 6 | public class NativeMethods 7 | { 8 | public enum GWL 9 | { 10 | ExStyle = -20 11 | } 12 | 13 | public enum LWA 14 | { 15 | ColorKey = 0x1, 16 | Alpha = 0x2 17 | } 18 | 19 | [DllImport("user32.dll", EntryPoint = "GetWindowLong")] 20 | private static extern int GetWindowLongNative(IntPtr hWnd, GWL nIndex); 21 | 22 | [DllImport("user32.dll", EntryPoint = "SetWindowLong")] 23 | private static extern int SetWindowLongNative(IntPtr hWnd, GWL nIndex, int dwNewLong); 24 | 25 | [DllImport("user32.dll", EntryPoint = "SetLayeredWindowAttributes")] 26 | private static extern bool SetLayeredWindowAttributesNative(IntPtr hWnd, int crKey, int alpha, LWA dwFlags); 27 | 28 | [DllImport("user32.dll", EntryPoint= "MoveWindow", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall, ExactSpelling = true, SetLastError = true)] 29 | private static extern void MoveWindowNative(IntPtr hwnd, int X, int Y, int nWidth, int nHeight, bool bRepaint); 30 | 31 | #pragma warning disable S4200 32 | public static int GetWindowLong(IntPtr hWnd, GWL nIndex) => GetWindowLongNative(hWnd, nIndex); 33 | public static int SetWindowLong(IntPtr hWnd, GWL nIndex, int dwNewLong) => SetWindowLongNative(hWnd, nIndex, dwNewLong); 34 | public static bool SetLayeredWindowAttributes(IntPtr hWnd, int crKey, int alpha, LWA dwFlags) => SetLayeredWindowAttributesNative(hWnd, crKey, alpha, dwFlags); 35 | public static void MoveWindow(IntPtr hwnd, int X, int Y, int nWidth, int nHeight, bool bRepaint) => MoveWindowNative(hwnd, X, Y, nWidth, nHeight, bRepaint); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/Sync/Doom64GameFileFragment.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System.Text.RegularExpressions; 3 | 4 | namespace DoomLauncher.Handlers.Sync { 5 | public class Doom64GameFileFragment : IGameFileFragment 6 | { 7 | private static readonly Regex ClassTypeRegex = new Regex(@"classtype\s*="); // Only Doom64 files have classtype in the MAPINFO 8 | 9 | private readonly IDataSourceAdapter m_database; 10 | 11 | public Doom64GameFileFragment(IDataSourceAdapter database) 12 | { 13 | m_database = database; 14 | } 15 | 16 | public SyncResult ApplyToGameFile(IGameFile file, IArchiveReader reader, string[] mapInfoData) 17 | { 18 | var isDoom64 = IsDoom64Wad(mapInfoData); 19 | file.IsDoom64 = isDoom64; 20 | 21 | if (isDoom64) 22 | { 23 | var doom64Iwad = m_database.GetGameFile("doom64.zip"); 24 | if (doom64Iwad != null) 25 | { 26 | file.IWadID = doom64Iwad.IWadID; 27 | } 28 | } 29 | 30 | return SyncResult.EMPTY; 31 | } 32 | 33 | private bool IsDoom64Wad(string[] mapInfoData) 34 | { 35 | foreach (string data in mapInfoData) 36 | { 37 | MatchCollection matches = ClassTypeRegex.Matches(data); 38 | if (matches.Count > 0) 39 | return true; 40 | } 41 | return false; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/Sync/IGameFileFragment.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | 3 | namespace DoomLauncher.Handlers.Sync 4 | { 5 | public interface IGameFileFragment 6 | { 7 | SyncResult ApplyToGameFile(IGameFile file, IArchiveReader reader, string[] mapInfoData); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/SyncFileData.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | class SyncFileData 4 | { 5 | public SyncFileData(string filename) 6 | { 7 | FileName = filename; 8 | } 9 | 10 | public string FileName { get; set; } 11 | public bool Selected { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/SyncFileOption.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | enum SyncFileOption 4 | { 5 | None, 6 | Add, 7 | Delete 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/TabKeys.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public static class TabKeys 4 | { 5 | public static readonly string RecentKey = "Recent"; 6 | public static readonly string LocalKey = "Local"; 7 | public static readonly string IWadsKey = "IWads"; 8 | public static readonly string IdGamesKey = "Id Games"; 9 | public static readonly string UntaggedKey = "Untagged"; 10 | 11 | public static string[] KeyNames => new string[] { RecentKey, LocalKey, UntaggedKey, IWadsKey, IdGamesKey }; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/ToolTipGroup.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Windows.Forms; 3 | 4 | namespace DoomLauncher.Handlers 5 | { 6 | public class ToolTipGroup 7 | { 8 | 9 | private readonly List<(ToolTip, Control)> m_toolTips = new List<(ToolTip, Control)>(); 10 | 11 | public void SetToolTip(Control control, string caption) 12 | { 13 | var tooltip = new ToolTip(); 14 | tooltip.SetToolTip(control, " " + caption); 15 | tooltip.BackColor = ColorTheme.Current.TextBoxBackground; 16 | tooltip.ForeColor = ColorTheme.Current.Text; 17 | tooltip.OwnerDraw = true; 18 | tooltip.Draw += ToolTip_Draw; 19 | tooltip.Popup += ToolTip_Popup; 20 | m_toolTips.Add((tooltip, control)); 21 | } 22 | 23 | private void ToolTip_Popup(object sender, PopupEventArgs e) 24 | { 25 | foreach (var item in m_toolTips) 26 | { 27 | if (ReferenceEquals(sender, item.Item1)) 28 | continue; 29 | 30 | item.Item1.Hide(item.Item2); 31 | } 32 | } 33 | 34 | private static void ToolTip_Draw(object sender, DrawToolTipEventArgs e) 35 | { 36 | e.DrawBackground(); 37 | e.DrawBorder(); 38 | e.DrawText(TextFormatFlags.WordBreak); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /DoomLauncher/Handlers/VersionUpdateResults.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher.Handlers 2 | { 3 | public class VersionUpdateResults 4 | { 5 | public readonly bool RestartRequired; 6 | 7 | public VersionUpdateResults(bool restartRequired) 8 | { 9 | RestartRequired = restartRequired; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /DoomLauncher/Help.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Help.docx -------------------------------------------------------------------------------- /DoomLauncher/Help.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Help.pdf -------------------------------------------------------------------------------- /DoomLauncher/Help.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Help.zip -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IConfigurationData.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher.Interfaces 2 | { 3 | public interface IConfigurationData 4 | { 5 | int ConfigID { get; set; } 6 | string Name { get; set; } 7 | string Value { get; set; } 8 | string AvailableValues { get; set; } 9 | bool UserCanModify { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IConfigurationDataSourceAdapter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DoomLauncher.Interfaces 4 | { 5 | public interface IConfigurationDataSourceAdapter 6 | { 7 | IEnumerable GetConfiguration(); 8 | void InsertConfiguration(IConfigurationData config); 9 | void UpdateConfiguration(IConfigurationData config); 10 | 11 | IEnumerable GetTags(); 12 | void InsertTag(ITagData tag); 13 | void UpdateTag(ITagData tag); 14 | void DeleteTag(ITagData tag); 15 | IEnumerable GetTagMappings(); 16 | IEnumerable GetTagMappings(int gameFileID); 17 | void InsertTagMapping(ITagMapping tag); 18 | void DeleteTagMapping(ITagMapping tag); 19 | void DeleteTagMapping(int tagID); 20 | 21 | IEnumerable GetGameProfiles(int gameFileID); 22 | IEnumerable GetGlobalGameProfiles(); 23 | void InsertGameProfile(IGameProfile gameProfile); 24 | void UpdateGameProfile(IGameProfile gameProfile); 25 | void DeleteGameProfile(int gameProfileID); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/ICustomParam.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public interface ICustomParam 4 | { 5 | int CustomParamID { get; set; } 6 | int GameFileID { get; set; } 7 | string FileName { get; set; } 8 | string Parameter { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IDatabaseAdapter.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Common; 2 | 3 | namespace DoomLauncher.Interfaces 4 | { 5 | public interface IDatabaseAdapter 6 | { 7 | DbConnection CreateConnection(string connectionString); 8 | DbDataAdapter CreateAdapter(); 9 | DbParameter CreateParameter(string name, object value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IFileAssociationView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | 5 | namespace DoomLauncher.Interfaces 6 | { 7 | public class MenuOptions 8 | { 9 | public string Title { get; set; } 10 | public Func Action { get; set; } 11 | } 12 | 13 | interface IFileAssociationView 14 | { 15 | void SetContextMenu(ContextMenuStrip menu); 16 | void SetData(IGameFile gameFile); 17 | void ClearData(); 18 | 19 | bool DeleteAllowed { get; } 20 | bool CopyOrExportAllowed { get; } 21 | bool NewAllowed { get; } 22 | bool EditAllowed { get; } 23 | bool ViewAllowed { get; } 24 | bool ChangeOrderAllowed { get; } 25 | 26 | bool New(); 27 | bool Edit(); 28 | bool Delete(); 29 | void CopyToClipboard(); 30 | void CopyAllToClipboard(); 31 | void View(); 32 | bool MoveFileOrderUp(); 33 | bool MoveFileOrderDown(); 34 | bool SetFileOrderFirst(); 35 | bool Export(); 36 | bool ExportAll(); 37 | 38 | IGameFile GameFile { get; set; } 39 | 40 | IList MenuOptions { get; } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IFileData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DoomLauncher.Interfaces 4 | { 5 | public interface IFileData 6 | { 7 | int? FileID { get; set; } 8 | int GameFileID { get; set; } 9 | string FileName { get; set; } 10 | DateTime DateCreated { get; set; } 11 | FileType FileTypeID { get; set; } 12 | int SourcePortID { get; set; } 13 | string Description { get; set; } 14 | string OriginalFileName { get; set; } 15 | string OriginalFilePath { get; set; } 16 | string UserTitle { get; set; } 17 | string UserDescription { get; set; } 18 | string Map { get; set; } 19 | int FileOrder { get; set; } 20 | bool IsUrl { get; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IGameFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DoomLauncher.Interfaces 4 | { 5 | public interface IGameFile 6 | { 7 | int? GameFileID { get; set; } 8 | string FileName { get; set; } 9 | string FileNameNoPath { get; } 10 | string LastDirectory { get; } 11 | string Title { get; set; } 12 | string Author { get; set; } 13 | DateTime? ReleaseDate { get; set; } 14 | string Description { get; set; } 15 | int? IWadID { get; set; } 16 | int? SourcePortID { get; set; } 17 | string Thumbnail { get; set; } 18 | string Comments { get; set; } 19 | string Map { get; set; } 20 | int? MapCount { get; set; } 21 | double? Rating { get; set; } 22 | DateTime? LastPlayed { get; set; } 23 | DateTime? Downloaded { get; set; } 24 | 25 | string SettingsMap { get; set; } 26 | string SettingsSkill { get; set; } 27 | string SettingsExtraParams { get; set; } 28 | string SettingsFiles { get; set; } 29 | string SettingsFilesSourcePort { get; set; } 30 | string SettingsFilesIWAD { get; set; } 31 | string SettingsSpecificFiles { get; set; } 32 | bool SettingsStat { get; set; } 33 | bool SettingsLoadLatestSave { get; set; } 34 | bool SettingsSaved { get; set; } 35 | bool SettingsExtraParamsOnly { get; set; } 36 | int? SettingsGameProfileID { get; set; } 37 | 38 | int MinutesPlayed { get; set; } 39 | int FileSizeBytes { get; set; } 40 | 41 | bool IsDoom64 { get; set; } 42 | 43 | bool IsUnmanaged(); 44 | bool IsDirectory(); 45 | 46 | IArchiveReader OpenGameFile(LauncherPath gameFileDirectory); 47 | 48 | bool ArchiveExists(LauncherPath gameFileDirectory); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IGameFileColumnView.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | 6 | namespace DoomLauncher 7 | { 8 | public interface IGameFileColumnView : IGameFileView, IGameFileSortableView 9 | { 10 | event CancelEventHandler CustomRowPaint; 11 | 12 | bool CustomRowColorPaint { get; set; } 13 | IGameFile CustomRowPaintDataBoundItem { get; } 14 | Color CustomRowPaintForeColor { get; set; } 15 | 16 | ColumnField[] ColumnFields { get; } 17 | void SetColumnFields(IEnumerable columnFields); 18 | void SetColumnFormat(string colName, string format); 19 | void SetColumnWidth(string key, int width); 20 | int GetColumnWidth(string key); 21 | 22 | string[] GetColumnKeyOrder(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IGameFileDataSourceAdapter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DoomLauncher.Interfaces 4 | { 5 | public interface IGameFileDataSourceAdapter 6 | { 7 | int GetGameFilesCount(); 8 | IEnumerable GetGameFiles(); 9 | IEnumerable GetGameFiles(IGameFileGetOptions options); 10 | IEnumerable GetGameFileIWads(); 11 | IEnumerable GetUntaggedGameFiles(); 12 | IEnumerable GetGameFileNames(); 13 | IGameFile GetGameFile(string fileName); 14 | void InsertGameFile(IGameFile gameFile); 15 | void UpdateGameFile(IGameFile gameFile); 16 | void UpdateGameFile(IGameFile gameFile, GameFileFieldType[] updateFields); 17 | void DeleteGameFile(IGameFile gameFile); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IGameFileDownloadable.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Net; 3 | 4 | namespace DoomLauncher.Interfaces 5 | { 6 | interface IGameFileDownloadable 7 | { 8 | event DownloadProgressChangedEventHandler DownloadProgressChanged; 9 | event AsyncCompletedEventHandler DownloadCompleted; 10 | 11 | void Download(IGameFileDataSourceAdapter adapter, string dlFilename); 12 | void Cancel(); 13 | string FileName { get; set; } 14 | int FileSizeBytes { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IGameFileSortableView.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace DoomLauncher 4 | { 5 | public interface IGameFileSortableView 6 | { 7 | string GetSortedColumnKey(); 8 | SortOrder GetColumnSort(string key); 9 | 10 | void SetSortedColumn(string key, SortOrder sort); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IGameFileTile.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Drawing; 5 | using System.Windows.Forms; 6 | 7 | namespace DoomLauncher 8 | { 9 | public interface IGameFileTile 10 | { 11 | event MouseEventHandler TileClick; 12 | event EventHandler TileDoubleClick; 13 | 14 | IGameFile GameFile { get; } 15 | bool Selected { get; } 16 | 17 | void SetSelected(bool set); 18 | void SetData(IGameFile gameFile, IEnumerable tags); 19 | void SetImageLocation(string file); 20 | void SetImage(Image image); 21 | void ClearData(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IGameFileView.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Windows.Forms; 5 | 6 | namespace DoomLauncher 7 | { 8 | public class GameFileEventArgs 9 | { 10 | public IGameFile GameFile { get; private set; } 11 | public GameFileEventArgs(IGameFile gameFile) 12 | { 13 | GameFile = gameFile; 14 | } 15 | } 16 | 17 | public delegate void GameFileEventHandler(object sender, GameFileEventArgs e); 18 | 19 | public interface IGameFileView 20 | { 21 | event EventHandler ItemClick; 22 | event EventHandler ItemDoubleClick; 23 | event EventHandler SelectionChange; 24 | event KeyPressEventHandler ViewKeyPress; 25 | event KeyEventHandler ViewKeyDown; 26 | event DragEventHandler DragEnter; 27 | event DragEventHandler DragDrop; 28 | event GameFileEventHandler GameFileEnter; 29 | event GameFileEventHandler GameFileLeave; 30 | 31 | void SetDisplayText(string text); 32 | void SetContextMenuStrip(ContextMenuStrip menu); 33 | IEnumerable DataSource { get; set; } 34 | IGameFile SelectedItem { get; set; } 35 | IGameFile[] SelectedItems { get; } 36 | IGameFile GameFileForIndex(int index); 37 | void RefreshData(); 38 | bool Focus(); 39 | void UpdateGameFile(IGameFile gameFile); 40 | 41 | bool MultiSelect { get; set; } 42 | bool AllowDrop { get; set; } 43 | 44 | void SuspendLayout(); 45 | void ResumeLayout(); 46 | 47 | object DoomLauncherParent { get; set; } 48 | 49 | void SetVisible(bool set); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IGameProfile.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher.Interfaces 2 | { 3 | public interface IGameProfile 4 | { 5 | int GameProfileID { get; set; } 6 | int? GameFileID { get; set; } 7 | int? IWadID { get; set; } 8 | int? SourcePortID { get; set; } 9 | string Name { get; set; } 10 | string SettingsMap { get; set; } 11 | string SettingsSkill { get; set; } 12 | string SettingsExtraParams { get; set; } 13 | string SettingsFiles { get; set; } 14 | string SettingsFilesSourcePort { get; set; } 15 | string SettingsFilesIWAD { get; set; } 16 | string SettingsSpecificFiles { get; set; } 17 | bool SettingsStat { get; set; } 18 | bool SettingsLoadLatestSave { get; set; } 19 | bool SettingsSaved { get; set; } 20 | bool SettingsExtraParamsOnly { get; set; } 21 | bool IsGlobal { get; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IIWadData.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher.Interfaces 2 | { 3 | public interface IIWadData 4 | { 5 | int IWadID { get; set; } 6 | string Name { get; set; } 7 | string FileName { get; set; } 8 | int? GameFileID { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IIWadDataSourceAdapter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DoomLauncher.Interfaces 4 | { 5 | public interface IIWadDataSourceAdapter 6 | { 7 | IEnumerable GetIWads(); 8 | IIWadData GetIWad(int gameFileID); 9 | void InsertIWad(IIWadData iwad); 10 | void DeleteIWad(IIWadData iwad); 11 | void UpdateIWad(IIWadData iwad); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/INewFileDetector.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher.Interfaces 2 | { 3 | public interface INewFileDetector 4 | { 5 | void StartDetection(); 6 | string[] GetNewFiles(); 7 | string[] GetModifiedFiles(); 8 | string[] GetDeletedFiles(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/ISettingsDataSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace DoomLauncher.Interfaces 8 | { 9 | public interface ISettingsDataSource 10 | { 11 | int GameFileID { get; set; } 12 | int SettingsID { get; set; } 13 | string SettingsName { get; set; } 14 | string SettingsMap { get; set; } 15 | string SettingsSkill { get; set; } 16 | string SettingsExtraParams { get; set; } 17 | string SettingsFiles { get; set; } 18 | string SettingsSpecificFiles { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/ISourcePortData.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.SourcePort; 2 | 3 | namespace DoomLauncher.Interfaces 4 | { 5 | public interface ISourcePortData 6 | { 7 | int SourcePortID { get; set; } 8 | string Name { get; set; } 9 | string Executable { get; set; } 10 | string SupportedExtensions { get; set; } 11 | LauncherPath Directory { get; set; } 12 | string SettingsFiles { get; set; } 13 | SourcePortLaunchType LaunchType { get; set; } 14 | string FileOption { get; set; } 15 | string ExtraParameters { get; set; } 16 | LauncherPath AltSaveDirectory { get; set; } 17 | bool Archived { get; set; } 18 | 19 | ISourcePortFlavor GetFlavor(); 20 | 21 | string GetFullExecutablePath(); 22 | LauncherPath GetReadSavePath(); 23 | LauncherPath GetLoadSavePath(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IStatsData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DoomLauncher 4 | { 5 | public interface IStatsData 6 | { 7 | int KillCount { get; set; } 8 | int TotalKills { get; set; } 9 | int SecretCount { get; set; } 10 | int TotalSecrets { get; set; } 11 | float LevelTime { get; set; } 12 | int ItemCount { get; set; } 13 | int TotalItems { get; set; } 14 | string MapName { get; set; } 15 | DateTime RecordTime { get; set; } 16 | int? Skill { get; set; } 17 | 18 | string FormattedKills { get; } 19 | string FormattedSecrets { get; } 20 | string FormattedItems { get; } 21 | string FormattedTime { get; } 22 | 23 | int GameFileID { get; set; } 24 | int SourcePortID { get; set; } 25 | int StatID { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/IStatsDataSourceAdapter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DoomLauncher.Interfaces 4 | { 5 | public interface IStatsDataSourceAdapter 6 | { 7 | IEnumerable GetStats(); 8 | IEnumerable GetStats(int gameFileID); 9 | IEnumerable GetStats(IEnumerable gameFiles); 10 | void InsertStats(IStatsData stats); 11 | void UpdateStats(IStatsData stats); 12 | void DeleteStatsByFile(int gameFileID); 13 | void DeleteStats(int statID); 14 | void DeleteStats(ISourcePortData sourcePort); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/ITabView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace DoomLauncher.Interfaces 5 | { 6 | public interface ITabView : ICloneable 7 | { 8 | event EventHandler DataSourceChanging; 9 | event EventHandler DataSourceChanged; 10 | 11 | void SetGameFiles(); 12 | void SetGameFiles(IEnumerable searchFields); 13 | void SetGameFilesData(IEnumerable gameFiles); 14 | void UpdateDataSourceFile(IGameFile gameFile); 15 | List GetColumnConfig(); 16 | void SetColumnConfig(ColumnField[] columnTextFields, ColumnConfig[] colConfig); 17 | bool IsLocal { get; } 18 | bool IsEditAllowed { get; } 19 | bool IsDeleteAllowed { get; } 20 | bool IsSearchAllowed { get; } 21 | bool IsPlayAllowed { get; } 22 | bool IsAutoSearchAllowed { get; } 23 | string Title { get; set; } 24 | object Key { get; } 25 | IGameFileDataSourceAdapter Adapter { get; set; } 26 | IGameFileView GameFileViewControl { get; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/ITagData.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher.Interfaces 2 | { 3 | public interface ITagData 4 | { 5 | int TagID { get; set; } 6 | string Name { get; set; } 7 | bool HasTab { get; set; } 8 | bool HasColor { get; set; } 9 | int? Color { get; set; } 10 | bool ExcludeFromOtherTabs { get; set; } 11 | bool Favorite { get; set; } 12 | string FavoriteName { get; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/ITagMapLookup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace DoomLauncher.Interfaces 5 | { 6 | public interface ITagMapLookup 7 | { 8 | event EventHandler TagMappingChanged; 9 | void Refresh(ITagData[] tags); 10 | void RemoveGameFile(IGameFile gameFile); 11 | ITagData[] GetTags(IGameFile gameFile); 12 | IEnumerable GetEnumerableTags(IGameFile gameFile); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DoomLauncher/Interfaces/ITagMapping.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher.Interfaces 2 | { 3 | public interface ITagMapping 4 | { 5 | int TagID { get; set; } 6 | int FileID { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DoomLauncher/LaunchArgs.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public class LaunchArgs 4 | { 5 | public string LaunchFileName { get; set; } 6 | public int? LaunchGameFileID { get; set; } 7 | public bool AutoClose { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DoomLauncher/ProgressBarType.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | enum ProgressBarType 4 | { 5 | Copy, 6 | Sync, 7 | Update, 8 | Delete, 9 | Search, 10 | CreateZip 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /DoomLauncher/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("DoomLauncher")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("DoomLauncher")] 12 | [assembly: AssemblyCopyright("")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("0c03f10e-9945-4048-8708-d9623e8845ec")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("3.7.6.0")] 35 | [assembly: AssemblyFileVersion("3.7.6.0")] 36 | -------------------------------------------------------------------------------- /DoomLauncher/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace DoomLauncher.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.3.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DoomLauncher/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DoomLauncher/RecentFileType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace DoomLauncher 8 | { 9 | public enum RecentFileType 10 | { 11 | Played, 12 | Downloaded 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DoomLauncher/Resources/BackgroundImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/BackgroundImage.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/Bars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/Bars.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/Delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/Delete.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/DoomLauncherTile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/DoomLauncherTile.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/DownArrow.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/DownArrow.bmp -------------------------------------------------------------------------------- /DoomLauncher/Resources/DownArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/DownArrow.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/Edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/Edit.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/Export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/Export.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/ExportAll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/ExportAll.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/File.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/File.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/FolderOpen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/FolderOpen.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/PLAYPAL.LMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/PLAYPAL.LMP -------------------------------------------------------------------------------- /DoomLauncher/Resources/PMAPA0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/PMAPA0.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/POSSL0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/POSSL0.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/Pin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/Pin.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/Play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/Play.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/SOULB0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/SOULB0.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/Save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/Save.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/Search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/Search.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/StepBack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/StepBack.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/Tags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/Tags.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/UpArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/UpArrow.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/Video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/Video.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/arrow-down-solid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/arrow-down-solid.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/bon2a_.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/bon2a_.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/bon2a_extra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/bon2a_extra.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/bon2d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/bon2d.png -------------------------------------------------------------------------------- /DoomLauncher/Resources/bona.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/bona.bmp -------------------------------------------------------------------------------- /DoomLauncher/Resources/th.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/Resources/th.png -------------------------------------------------------------------------------- /DoomLauncher/SaveGame/DsgSaveGameReader.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Linq; 3 | using System.Text; 4 | 5 | namespace DoomLauncher.SaveGame 6 | { 7 | public class DsgSaveGameReader : ISaveGameReader 8 | { 9 | private readonly string m_file; 10 | 11 | public DsgSaveGameReader(string file) 12 | { 13 | m_file = file; 14 | } 15 | 16 | public string GetName() 17 | { 18 | try 19 | { 20 | using (var stream = File.OpenRead(m_file)) 21 | { 22 | byte[] data = new byte[24]; 23 | int read = stream.Read(data, 0, data.Length); 24 | 25 | if (read != -1) 26 | { 27 | int index = data.ToList().IndexOf(0); 28 | if (index == -1) 29 | index = data.Length; 30 | if (index > 0) 31 | return Encoding.UTF8.GetString(data.Take(index).ToArray()); 32 | } 33 | } 34 | } 35 | catch 36 | { 37 | //continue to return the filename if we fail for any reason 38 | } 39 | 40 | return Path.GetFileName(m_file); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /DoomLauncher/SaveGame/HelionSaveGameReader.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Linq; 3 | using System; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text; 7 | 8 | namespace DoomLauncher.SaveGame 9 | { 10 | public class HelionSaveGameReader : ISaveGameReader 11 | { 12 | private readonly string m_file; 13 | 14 | public HelionSaveGameReader(string file) 15 | { 16 | m_file = file; 17 | } 18 | 19 | public string GetName() 20 | { 21 | try 22 | { 23 | string name = TryGetSaveName(m_file); 24 | if (!string.IsNullOrEmpty(name)) 25 | return name; 26 | 27 | return Path.GetFileName(m_file); 28 | } 29 | catch(Exception) 30 | { 31 | return Path.GetFileName(m_file); 32 | } 33 | } 34 | 35 | private static string TryGetSaveName(string fileName) 36 | { 37 | ZipArchiveReader zipArchive = new ZipArchiveReader(fileName); 38 | var entry = zipArchive.Entries.FirstOrDefault(x => x.Name.Equals("save.json", StringComparison.OrdinalIgnoreCase)); 39 | 40 | if (entry == null) 41 | return null; 42 | 43 | JObject data = JsonConvert.DeserializeObject(Encoding.UTF8.GetString(entry.ReadEntry())) as JObject; 44 | JToken textData = data.GetValue("Text"); 45 | if (textData == null) 46 | return null; 47 | 48 | return textData.ToString(); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /DoomLauncher/SaveGame/ISaveGameReader.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher.SaveGame 2 | { 3 | public interface ISaveGameReader 4 | { 5 | string GetName(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /DoomLauncher/Search/GameFileFieldType.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public enum GameFileFieldType 4 | { 5 | Filename, 6 | Title, 7 | Author, 8 | Description, 9 | ReleaseDate, 10 | GameFileID, 11 | LastPlayed, 12 | Downloaded, 13 | Map, 14 | SourcePortID, 15 | IWadID, 16 | Comments, 17 | Rating, 18 | SettingsMap, 19 | SettingsSkill, 20 | SettingsExtraParams, 21 | SettingsFiles, 22 | SettingsSpecificFiles, 23 | MapCount, 24 | MinutesPlayed, 25 | MD5, 26 | SettingsStat, 27 | SettingsFilesIWAD, 28 | SettingsFilesSourcePort, 29 | SettingsGameProfileID, 30 | SettingsSaved, 31 | SettingsLoadLatestSave, 32 | SettingsExtraParamsOnly 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DoomLauncher/Search/GameFileGetOptions.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public class GameFileGetOptions : IGameFileGetOptions 4 | { 5 | public GameFileGetOptions() 6 | { 7 | } 8 | 9 | public GameFileGetOptions(GameFileSearchField sf) 10 | { 11 | SearchField = sf; 12 | } 13 | 14 | public GameFileGetOptions(GameFileFieldType[] selectFields) 15 | { 16 | SelectFields = selectFields; 17 | } 18 | 19 | public GameFileGetOptions(GameFileFieldType[] selectFields, GameFileSearchField searchField) 20 | { 21 | SelectFields = selectFields; 22 | SearchField = searchField; 23 | } 24 | 25 | public GameFileGetOptions(int limit) 26 | { 27 | Limit = limit; 28 | } 29 | 30 | public GameFileFieldType[] SelectFields { get; set; } 31 | public GameFileSearchField SearchField { get; set; } 32 | public GameFileFieldType? OrderField { get; set; } 33 | public OrderType? OrderBy { get; set; } 34 | public int? Limit { get; set; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /DoomLauncher/Search/GameFileSearchField.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | namespace DoomLauncher 4 | { 5 | public class GameFileSearchField 6 | { 7 | private static GameFileFieldType[] s_dateTimeFields = new GameFileFieldType[] 8 | { 9 | GameFileFieldType.ReleaseDate, 10 | GameFileFieldType.Downloaded, 11 | GameFileFieldType.LastPlayed 12 | }; 13 | 14 | public GameFileSearchField(GameFileFieldType type, string search) 15 | { 16 | SearchFieldType = type; 17 | SearchText = search; 18 | SearchOp = GameFileSearchOp.Equal; 19 | } 20 | 21 | public GameFileSearchField(GameFileFieldType type, GameFileSearchOp op, string search) 22 | { 23 | SearchFieldType = type; 24 | SearchText = search; 25 | SearchOp = op; 26 | } 27 | 28 | public static bool IsDateTimeField(GameFileFieldType field) 29 | { 30 | return s_dateTimeFields.ToList().Contains(field); 31 | } 32 | 33 | public GameFileSearchOp SearchOp 34 | { 35 | get; 36 | set; 37 | } 38 | 39 | public GameFileFieldType SearchFieldType 40 | { 41 | get; 42 | set; 43 | } 44 | 45 | public string SearchText 46 | { 47 | get; 48 | set; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /DoomLauncher/Search/GameFileSearchOp.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public enum GameFileSearchOp 4 | { 5 | Equal, 6 | NotEqual, 7 | LessThan, 8 | GreaterThan, 9 | Like 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DoomLauncher/Search/IGameFileGetOptions.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public interface IGameFileGetOptions 4 | { 5 | GameFileFieldType[] SelectFields { get; set; } 6 | GameFileSearchField SearchField { get; set; } 7 | GameFileFieldType? OrderField { get; set; } 8 | OrderType? OrderBy { get; set; } 9 | int? Limit { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DoomLauncher/Search/OrderType.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | public enum OrderType 4 | { 5 | Asc, 6 | Desc 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DoomLauncher/SourcePort/HelionSourcePortFlavor.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace DoomLauncher.SourcePort 6 | { 7 | public class HelionSourcePortFlavor : GenericSourcePortFlavor 8 | { 9 | public HelionSourcePortFlavor(ISourcePortData sourcePortData) 10 | : base(sourcePortData) 11 | { 12 | 13 | } 14 | 15 | public override string WarpParameter(SpData data) => GetMapParameter(data.Value); 16 | 17 | public override string LoadSaveParameter(SpData data) => 18 | $"-loadgame \"{data.Value}\""; 19 | 20 | public override bool Supported() => CheckFileNameWithoutExtension("Helion"); 21 | 22 | public override bool StatisticsSupported() => true; 23 | 24 | public override IStatisticsReader CreateStatisticsReader(IGameFile gameFile, IEnumerable existingStats) => 25 | new LevelstatReader(gameFile, Path.Combine(m_sourcePortData.Directory.GetFullPath(), "levelstat.txt")); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DoomLauncher/SourcePort/ISourcePortFlavor.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using DoomLauncher.SaveGame; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | 6 | namespace DoomLauncher.SourcePort 7 | { 8 | public interface ISourcePortFlavor 9 | { 10 | string IwadParameter(SpData data); 11 | string FileParameter(SpData data); 12 | string WarpParameter(SpData data); 13 | string SkillParameter(SpData data); 14 | string RecordParameter(SpData data); 15 | string PlayDemoParameter(SpData data); 16 | string LoadSaveParameter(SpData data); 17 | 18 | bool Supported(); //if the exe is supported by this implementation 19 | bool StatisticsSupported(); 20 | bool LoadSaveGameSupported(); 21 | string[] GetScreenshotDirectories(); 22 | string[] GetSaveGameDirectories(); 23 | IStatisticsReader CreateStatisticsReader(IGameFile gameFile, IEnumerable existingStats); 24 | ISaveGameReader CreateSaveGameReader(FileInfo file); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DoomLauncher/SourcePort/LevelstatSourcePortFlavor.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace DoomLauncher.SourcePort 6 | { 7 | public class LevelstatSourcePortFlavor : GenericSourcePortFlavor 8 | { 9 | public LevelstatSourcePortFlavor(ISourcePortData sourcePortData) 10 | : base(sourcePortData) 11 | { 12 | 13 | } 14 | 15 | public override bool Supported() => 16 | CheckFileNameContains("crispy-doom") // + crispy-doom-truecolor 17 | || CheckFileNameContains("crispy-heretic") // + crispy-heretic-truecolor 18 | || CheckFileNameWithoutExtension("so-doom") 19 | || CheckFileNameWithoutExtension("inter-heretic") 20 | || CheckFileNameContains("boom-plus.exe") // prboom-plus + glboom-plus 21 | || CheckFileNameWithoutExtension("dsda-doom") 22 | || CheckFileNameWithoutExtension("fdwl") 23 | || CheckFileNameWithoutExtension("woof") 24 | || CheckFileNameWithoutExtension("nugget-doom") 25 | || CheckFileNameWithoutExtension("cherry-doom"); 26 | 27 | public override bool StatisticsSupported() => true; 28 | 29 | public override IStatisticsReader CreateStatisticsReader(IGameFile gameFile, IEnumerable existingStats) => 30 | new LevelstatReader(gameFile, Path.Combine(m_sourcePortData.Directory.GetFullPath(), "levelstat.txt")); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /DoomLauncher/SourcePort/SpData.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace DoomLauncher.SourcePort 6 | { 7 | public class SpData 8 | { 9 | public SpData() { } 10 | 11 | public SpData(string value) 12 | { 13 | Value = value; 14 | } 15 | 16 | public SpData(string value, IGameFile gameFile, IEnumerable addFiles) 17 | { 18 | Value = value; 19 | GameFile = gameFile; 20 | AdditionalFiles = addFiles.ToList(); 21 | } 22 | 23 | public string Value { get; private set; } 24 | public IGameFile GameFile { get; private set; } 25 | public List AdditionalFiles { get; private set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DoomLauncher/SourcePort/StatdumpSourcePortFlavor.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using DoomLauncher.Statistics; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | 6 | namespace DoomLauncher.SourcePort 7 | { 8 | public class StatdumpSourcePortFlavor : GenericSourcePortFlavor 9 | { 10 | public StatdumpSourcePortFlavor(ISourcePortData sourcePortData) 11 | : base(sourcePortData) 12 | { 13 | 14 | } 15 | 16 | public override bool Supported() => 17 | CheckFileNameWithoutExtension("chocolate-doom") || 18 | CheckFileNameWithoutExtension("cndoom") || 19 | CheckFileNameWithoutExtension("crl-doom") || 20 | CheckFileNameWithoutExtension("inter-doom"); 21 | 22 | public override bool StatisticsSupported() => true; 23 | 24 | public override IStatisticsReader CreateStatisticsReader(IGameFile gameFile, IEnumerable existingStats) => 25 | new StatdumpReader(gameFile, Path.Combine(m_sourcePortData.Directory.GetFullPath(), "stats.txt")); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DoomLauncher/Statistics/IStatisticsReader.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | 3 | namespace DoomLauncher 4 | { 5 | public delegate void NewStatisticsEventHandler(object sender, NewStatisticsEventArgs e); 6 | 7 | public interface IStatisticsReader 8 | { 9 | event NewStatisticsEventHandler NewStastics; 10 | void Start(); 11 | void Stop(); 12 | string[] Errors { get; } 13 | string LaunchParameter { get; } 14 | bool ReadOnClose { get; } 15 | void ReadNow(); 16 | IGameFile GameFile { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DoomLauncher/Statistics/LevelstatReader.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using DoomLauncher.Statistics; 3 | 4 | namespace DoomLauncher 5 | { 6 | public class LevelstatReader : MultiLineStatReader 7 | { 8 | private static string s_statRegex = @"\S+-(\d+:)?\d+:\d+.\d+\((\d+:)?\d+:\d+\)K:\d+/\d+I:\d+/\d+S:\d+/\d+"; 9 | private static ParseItem[] s_regexItems = new ParseItem[] 10 | { 11 | new ParseItem(@"\S+-", "-", "MapName"), 12 | new ParseItem(@"(\S+)?\S+:\S+\(", "-(", "LevelTime"), 13 | new ParseItem(@"\d+/", "/", "KillCount"), 14 | new ParseItem(@"K:\d+", "K:", "TotalKills"), 15 | new ParseItem(@"\d+/", "/", "ItemCount"), 16 | new ParseItem(@"I:\d+", "I:", "TotalItems"), 17 | new ParseItem(@"\d+/", "/", "SecretCount"), 18 | new ParseItem(@"S:\d+", "S:", "TotalSecrets") 19 | }; 20 | 21 | public LevelstatReader(IGameFile gameFile, string statFile) : base(gameFile, statFile, s_statRegex, s_regexItems) 22 | { 23 | RemoveNewLines = false; 24 | } 25 | 26 | public override string LaunchParameter { get { return "-levelstat"; } } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DoomLauncher/Statistics/NewStatisticsEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DoomLauncher 4 | { 5 | public class NewStatisticsEventArgs : EventArgs 6 | { 7 | public NewStatisticsEventArgs(IStatsData stats) 8 | { 9 | Statistics = stats; 10 | Update = false; 11 | } 12 | 13 | public NewStatisticsEventArgs(IStatsData stats, bool update) 14 | { 15 | Statistics = stats; 16 | Update = update; 17 | } 18 | 19 | public IStatsData Statistics { get; set; } 20 | public bool Update { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DoomLauncher/Statistics/StatdumpReader.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | 3 | namespace DoomLauncher.Statistics 4 | { 5 | public class StatdumpReader : MultiLineStatReader 6 | { 7 | private static string s_statRegex = @"=+\w+(/\w+)?=+Time:\d+:\d+\(par:\d+:\d+\)\w+\(\w+\):Kills:\d+(/\d+\(-?\d+%\))?Items:\d+(/\d+\(-?\d+%\))?Secrets:\d+(/\d+)?"; 8 | private static ParseItem[] s_regexItems = new ParseItem[] 9 | { 10 | new ParseItem(@"\w+(/\w+)?", string.Empty, "MapName"), 11 | new ParseItem(@"\d+:\d+", string.Empty, "LevelTime"), 12 | new ParseItem(@"\d+:\d+", string.Empty, null), //remove par 13 | new ParseItem(@"\w+\(\w+\):", string.Empty, null), //remove player name 14 | new ParseItem(@":\d+", ":", "KillCount"), 15 | new ParseItem(@"Kills/\d+", "Kills/", "TotalKills"), 16 | new ParseItem(@":\d+", ":", "ItemCount"), 17 | new ParseItem(@"Items/\d+", "Items/", "TotalItems"), 18 | new ParseItem(@":\d+", ":", "SecretCount"), 19 | new ParseItem(@"Secrets/\d+", "Secrets/", "TotalSecrets") 20 | }; 21 | 22 | public StatdumpReader(IGameFile gameFile, string statFile) : base(gameFile, statFile, s_statRegex, s_regexItems) 23 | { 24 | ErrorOnParseItem = false; 25 | } 26 | 27 | public override string LaunchParameter { get { return $"-statdump \"{StatFile}\""; } } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DoomLauncher/Stylize/CToolStripRenderer.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Windows.Forms; 3 | 4 | namespace DoomLauncher 5 | { 6 | public class CToolStripRenderer : ToolStripProfessionalRenderer 7 | { 8 | protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) 9 | { 10 | const string ArrowText = "⏵"; 11 | SizeF size = e.Graphics.MeasureString(ArrowText, e.Item.Font); 12 | Color color = e.Item.Selected ? ColorTheme.Current.HighlightText : ColorTheme.Current.Text; 13 | e.Graphics.DrawString(ArrowText, e.Item.Font, new SolidBrush(color), new PointF(e.Item.Width - size.Width, 1)); 14 | } 15 | 16 | protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) 17 | { 18 | Color color = e.Item.Selected ? ColorTheme.Current.HighlightText : ColorTheme.Current.Text; 19 | e.Graphics.DrawString(e.Item.Text, e.Item.Font, new SolidBrush(color), new PointF(24, 2)); 20 | } 21 | 22 | protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e) 23 | { 24 | if (e.Item.Selected) 25 | { 26 | Rectangle rectangle = new Rectangle(0, 0, e.Item.Size.Width - 1, e.Item.Size.Height - 1); 27 | e.Graphics.FillRectangle(new SolidBrush(ColorTheme.Current.Highlight), rectangle); 28 | return; 29 | } 30 | 31 | base.OnRenderMenuItemBackground(e); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DoomLauncher/Stylize/DarkTheme.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Windows.Forms; 3 | 4 | namespace DoomLauncher 5 | { 6 | public class DarkTheme : IThemeColors 7 | { 8 | public Color TitlebarBackground => WindowDark; 9 | public Color WindowDark => Color.FromArgb(255, 32, 32, 32); 10 | public Color Window => Color.FromArgb(255, 48, 48, 54); 11 | public Color WindowLight => Color.FromArgb(255, 58, 58, 64); 12 | public Color Text => Color.White; 13 | public Color DisabledText => Color.FromArgb(255, 102, 102, 102); 14 | public Color HighlightText => Color.White; 15 | public Color Highlight => Color.FromArgb(255, 90, 101, 234); 16 | public FlatStyle ComboFlatStyle => FlatStyle.Flat; 17 | public FlatStyle ButtonFlatStyle => FlatStyle.Flat; 18 | public Color ButtonTextColor => Text; 19 | public Color ButtonBackground => Color.FromArgb(255, 90, 101, 234); 20 | public Color CheckBoxBackground => WindowLight; 21 | public Color TextBoxBackground => WindowDark; 22 | public Color DropDownBackground => WindowDark; 23 | public Color Border => Color.FromArgb(255, 32, 32, 32); 24 | public Color LinkText => Highlight; 25 | public Color GridBorder => WindowDark; 26 | public Color GridRow => WindowDark; 27 | public Color GridRowAlt => WindowDark; 28 | public Color Separator => Color.Gray; 29 | public Color StatBackgroundGradientFrom => WindowDark; 30 | public Color StatBackgroundGradientTo => Window; 31 | public Color StatText => Color.White; 32 | public Color CloseBackgroundHighlight => Color.FromArgb(255, 213, 50, 38); 33 | public Color CloseForeColorHighlight => Color.White; 34 | public Color ImageBackground => Color.Black; 35 | public Color GridBackground => WindowDark; 36 | public bool GridRowBorder => false; 37 | public bool IsDark => true; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /DoomLauncher/Stylize/DefaultTheme.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Windows.Forms; 3 | 4 | namespace DoomLauncher 5 | { 6 | public class DefaultTheme : IThemeColors 7 | { 8 | public Color TitlebarBackground => WindowLight; 9 | public Color WindowDark => SystemColors.Control; 10 | public Color Window => SystemColors.Control; 11 | public Color WindowLight => SystemColors.Window; 12 | public Color Text => SystemColors.WindowText; 13 | public Color DisabledText => Color.FromArgb(255, 142, 142, 142); 14 | public Color HighlightText => SystemColors.HighlightText; 15 | public Color Highlight => SystemColors.Highlight; 16 | public Color ButtonTextColor => Text; 17 | public FlatStyle ComboFlatStyle => FlatStyle.Standard; 18 | public FlatStyle ButtonFlatStyle => FlatStyle.Standard; 19 | public Color ButtonBackground => SystemColors.Window; 20 | public Color CheckBoxBackground => SystemColors.Window; 21 | public Color TextBoxBackground => Color.White; 22 | public Color DropDownBackground => SystemColors.Window; 23 | public Color Border => SystemColors.ControlDark; 24 | public Color LinkText => Highlight; 25 | public Color GridBorder => SystemColors.ControlDark; 26 | public Color GridRow => SystemColors.Window; 27 | public Color GridRowAlt => SystemColors.ControlLight; 28 | public Color Separator => Color.Gray; 29 | public Color StatBackgroundGradientFrom => Color.Gray; 30 | public Color StatBackgroundGradientTo => Color.FromArgb(255, 191, 191, 191); 31 | public Color StatText => Color.White; 32 | public Color CloseBackgroundHighlight => Color.FromArgb(255, 213, 50, 38); 33 | public Color CloseForeColorHighlight => Color.White; 34 | public Color ImageBackground => Color.Black; 35 | public Color GridBackground => Color.White; 36 | public bool GridRowBorder => true; 37 | public bool IsDark => false; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /DoomLauncher/Stylize/IThemeColors.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Windows.Forms; 3 | 4 | namespace DoomLauncher 5 | { 6 | public interface IThemeColors 7 | { 8 | Color TitlebarBackground { get; } 9 | Color Window { get; } 10 | Color WindowLight { get; } 11 | Color WindowDark { get; } 12 | Color Text { get; } 13 | Color DisabledText { get; } 14 | Color HighlightText { get; } 15 | Color Highlight { get; } 16 | Color ButtonTextColor { get; } 17 | FlatStyle ComboFlatStyle { get; } 18 | FlatStyle ButtonFlatStyle { get; } 19 | Color ButtonBackground { get; } 20 | Color CheckBoxBackground { get; } 21 | Color TextBoxBackground { get; } 22 | Color DropDownBackground { get; } 23 | Color Border { get; } 24 | Color LinkText { get; } 25 | Color GridBorder { get; } 26 | Color GridRow { get; } 27 | Color GridRowAlt { get; } 28 | Color Separator { get; } 29 | Color StatBackgroundGradientFrom { get; } 30 | Color StatBackgroundGradientTo { get; } 31 | Color StatText { get; } 32 | Color CloseBackgroundHighlight { get; } 33 | Color CloseForeColorHighlight { get; } 34 | Color ImageBackground { get; } 35 | Color GridBackground { get; } 36 | bool GridRowBorder { get; } 37 | bool IsDark { get; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /DoomLauncher/Stylize/ImmersiveDarkMode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Windows.Forms; 4 | using DoomLauncher.WindowsVersion; 5 | 6 | namespace DoomLauncher 7 | { 8 | public static class ImmersiveDarkMode 9 | { 10 | [DllImport("dwmapi.dll")] 11 | private static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, ref int attrValue, int attrSize); 12 | 13 | private const int DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 = 19; 14 | private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20; 15 | 16 | public static bool UseImmersiveDarkMode(Form form, bool enabled) 17 | { 18 | try 19 | { 20 | if (!WindowsVersionInfo.GetOsVersionInfo(out var versionInfo)) 21 | return false; 22 | 23 | if (WindowsVersionInfo.IsWindows10OrGreater(versionInfo, 17763)) 24 | { 25 | var attribute = DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1; 26 | if (WindowsVersionInfo.IsWindows10OrGreater(versionInfo, 18985)) 27 | attribute = DWMWA_USE_IMMERSIVE_DARK_MODE; 28 | 29 | int useImmersiveDarkMode = enabled ? 1 : 0; 30 | return DwmSetWindowAttribute(form.Handle, attribute, ref useImmersiveDarkMode, sizeof(int)) == 0; 31 | } 32 | } 33 | catch { } 34 | 35 | return false; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /DoomLauncher/Stylize/StyledMessageBox.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Forms; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | 5 | namespace DoomLauncher.Stylize 6 | { 7 | public static class StyledMessageBox 8 | { 9 | public static DialogResult Show(IWin32Window window, string text, string caption, MessageBoxButtons buttons, 10 | MessageBoxIcon icon = MessageBoxIcon.Error, 11 | MessageBoxDefaultButton defaultButton = MessageBoxDefaultButton.Button1) 12 | { 13 | var systemIcon = SystemIcons.Information; 14 | switch (icon) 15 | { 16 | case MessageBoxIcon.Error: 17 | systemIcon = SystemIcons.Error; 18 | break; 19 | case MessageBoxIcon.Warning: 20 | systemIcon = SystemIcons.Warning; 21 | break; 22 | case MessageBoxIcon.Question: 23 | systemIcon = SystemIcons.Question; 24 | break; 25 | case MessageBoxIcon.Asterisk: 26 | systemIcon = SystemIcons.Asterisk; 27 | break; 28 | } 29 | 30 | var form = new MessageCheckBox(caption, text, string.Empty, systemIcon, buttons, defaultButton); 31 | form.SetShowCheckBox(false); 32 | form.StartPosition = FormStartPosition.CenterParent; 33 | return form.ShowDialog(window); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /DoomLauncher/TabViews/BasicTabViewCtrl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | partial class BasicTabViewCtrl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | [System.CodeDom.Compiler.GeneratedCode("Winform Designer", "VS2015 SP1")] 30 | private void InitializeComponent() 31 | { 32 | this.SuspendLayout(); 33 | // 34 | // BasicTabViewCtrl 35 | // 36 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 37 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 38 | this.Name = "BasicTabViewCtrl"; 39 | this.ResumeLayout(false); 40 | 41 | } 42 | 43 | #endregion 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /DoomLauncher/TabViews/IWadTabViewCtrl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | partial class IWadTabViewCtrl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | [System.CodeDom.Compiler.GeneratedCode("Winform Designer", "VS2015 SP1")] 30 | private void InitializeComponent() 31 | { 32 | components = new System.ComponentModel.Container(); 33 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 34 | } 35 | 36 | #endregion 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /DoomLauncher/TabViews/IWadTabViewCtrl.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | namespace DoomLauncher 7 | { 8 | public partial class IWadTabViewCtrl : LocalTabViewCtrl 9 | { 10 | private static readonly GameFileFieldType[] SearchFields = new[] { GameFileFieldType.GameFileID, GameFileFieldType.Filename }; 11 | private readonly IDataSourceAdapter m_dsAdapter; 12 | 13 | public IWadTabViewCtrl(object key, string title, IDataSourceAdapter adapter, GameFileFieldType[] selectFields, ITagMapLookup lookup, GameFileViewFactory factory) 14 | : base(key, title, adapter, selectFields, lookup, factory) 15 | { 16 | InitializeComponent(); 17 | m_dsAdapter = adapter; 18 | } 19 | 20 | public override void SetGameFiles() 21 | { 22 | SetDataSource(m_dsAdapter.GetGameFileIWads()); 23 | } 24 | 25 | public override void SetGameFiles(IEnumerable searchFields) 26 | { 27 | var gameFileIWads = m_dsAdapter.GetGameFileIWads(); 28 | IEnumerable items = Enumerable.Empty(); 29 | foreach (GameFileSearchField sf in searchFields) 30 | items = items.Union(Adapter.GetGameFiles(new GameFileGetOptions(SearchFields, sf))); 31 | 32 | gameFileIWads = gameFileIWads.Where(x => items.Any(y => x.GameFileID == y.GameFileID)); 33 | SetDataSource(gameFileIWads); 34 | } 35 | 36 | public override bool IsSearchAllowed => true; 37 | protected override bool FilterIWads => false; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /DoomLauncher/TabViews/IdGamesTabViewCtrl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | partial class IdGamesTabViewCtrl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | [System.CodeDom.Compiler.GeneratedCode("Winform Designer", "VS2015 SP1")] 30 | private void InitializeComponent() 31 | { 32 | components = new System.ComponentModel.Container(); 33 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 34 | } 35 | 36 | #endregion 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /DoomLauncher/TabViews/LocalTabViewCtrl.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System.Drawing; 3 | using System.Linq; 4 | 5 | namespace DoomLauncher 6 | { 7 | public class LocalTabViewCtrl : BasicTabViewCtrl 8 | { 9 | private readonly ITagMapLookup m_tagLookup; 10 | 11 | public LocalTabViewCtrl(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields, ITagMapLookup lookup, GameFileViewFactory factory) 12 | : base(key, title, adapter, selectFields, factory) 13 | { 14 | GameFileViewControl.DoomLauncherParent = this; 15 | m_tagLookup = lookup; 16 | 17 | if (m_tagLookup != null && GameFileViewControl is IGameFileColumnView columnView) 18 | { 19 | columnView.CustomRowColorPaint = true; 20 | columnView.CustomRowPaint += GameFileViewControl_CustomRowPaint; 21 | } 22 | } 23 | 24 | void GameFileViewControl_CustomRowPaint(object sender, System.ComponentModel.CancelEventArgs e) 25 | { 26 | if (GameFileViewControl is IGameFileColumnView columnView) 27 | { 28 | e.Cancel = false; 29 | IGameFile gameFile = columnView.CustomRowPaintDataBoundItem; 30 | 31 | if (gameFile != null) 32 | { 33 | ITagData tag = m_tagLookup.GetTags(gameFile).FirstOrDefault(x => x.HasColor && x.Color.HasValue); 34 | 35 | if (tag != null) 36 | columnView.CustomRowPaintForeColor = Color.FromArgb(tag.Color.Value); 37 | else 38 | columnView.CustomRowPaintForeColor = ColorTheme.Current.Text; 39 | } 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /DoomLauncher/TabViews/OptionsTabViewCtrl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | partial class OptionsTabViewCtrl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | [System.CodeDom.Compiler.GeneratedCode("Winform Designer", "VS2015 SP1")] 30 | private void InitializeComponent() 31 | { 32 | components = new System.ComponentModel.Container(); 33 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 34 | } 35 | 36 | #endregion 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /DoomLauncher/TabViews/TagTabView.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace DoomLauncher 2 | { 3 | partial class TagTabView 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | [System.CodeDom.Compiler.GeneratedCode("Winform Designer", "VS2015 SP1")] 30 | private void InitializeComponent() 31 | { 32 | this.components = new System.ComponentModel.Container(); 33 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 34 | this.Text = "TagTabView"; 35 | } 36 | 37 | #endregion 38 | } 39 | } -------------------------------------------------------------------------------- /DoomLauncher/TabViews/UntaggedTabView.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Interfaces; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace DoomLauncher 6 | { 7 | class UntaggedTabView : LocalTabViewCtrl 8 | { 9 | public UntaggedTabView(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields, ITagMapLookup lookup, GameFileViewFactory factory) 10 | : base(key, title, adapter, selectFields, lookup, factory) 11 | { 12 | 13 | } 14 | 15 | public override void SetGameFiles() 16 | { 17 | SetDataSource(Adapter.GetUntaggedGameFiles()); 18 | } 19 | 20 | public override void SetGameFiles(IEnumerable searchFields) 21 | { 22 | IEnumerable items = new IGameFile[0]; 23 | var untaggedFiles = Adapter.GetUntaggedGameFiles(); 24 | 25 | foreach (GameFileSearchField sf in searchFields) 26 | { 27 | var search = Adapter.GetGameFiles(new GameFileGetOptions(m_selectFields, sf)); 28 | items = items.Union(untaggedFiles.Intersect(search)); 29 | } 30 | 31 | SetDataSource(items); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DoomLauncher/TileImages/DoomLauncherTile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/TileImages/DoomLauncherTile.png -------------------------------------------------------------------------------- /DoomLauncher/TileImages/DoomLauncherTileSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/TileImages/DoomLauncherTileSmall.png -------------------------------------------------------------------------------- /DoomLauncher/TileImages/chexquest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/TileImages/chexquest.png -------------------------------------------------------------------------------- /DoomLauncher/TileImages/chexquest3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/TileImages/chexquest3.png -------------------------------------------------------------------------------- /DoomLauncher/TileImages/doom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/TileImages/doom.png -------------------------------------------------------------------------------- /DoomLauncher/TileImages/doom2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/TileImages/doom2.png -------------------------------------------------------------------------------- /DoomLauncher/TileImages/doom64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/TileImages/doom64.png -------------------------------------------------------------------------------- /DoomLauncher/TileImages/hacx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/TileImages/hacx.png -------------------------------------------------------------------------------- /DoomLauncher/TileImages/heretic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/TileImages/heretic.png -------------------------------------------------------------------------------- /DoomLauncher/TileImages/hexen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/TileImages/hexen.png -------------------------------------------------------------------------------- /DoomLauncher/TileImages/plutonia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/TileImages/plutonia.png -------------------------------------------------------------------------------- /DoomLauncher/TileImages/strife.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/TileImages/strife.png -------------------------------------------------------------------------------- /DoomLauncher/TileImages/tnt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/DoomLauncher/TileImages/tnt.png -------------------------------------------------------------------------------- /DoomLauncher/Update/ApplicationUpdate.cs: -------------------------------------------------------------------------------- 1 | using Octokit; 2 | using System; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace DoomLauncher 7 | { 8 | public class ApplicationUpdate 9 | { 10 | private readonly TimeSpan m_timeout; 11 | 12 | public ApplicationUpdate(TimeSpan timeout) 13 | { 14 | m_timeout = timeout; 15 | } 16 | 17 | public async Task GetUpdateApplicationInfo(Version currentVersion) 18 | { 19 | try 20 | { 21 | var github = new GitHubClient(new ProductHeaderValue($"{Util.GitHubUser}.{Util.GitHubRepositoryName}")); 22 | github.SetRequestTimeout(m_timeout); 23 | var release = await github.Repository.Release.GetLatest(Util.GitHubUser, Util.GitHubRepositoryName); 24 | 25 | if (release != null) 26 | { 27 | Version remoteVersion = new Version(release.Name); 28 | if (remoteVersion > currentVersion) 29 | { 30 | ReleaseAsset asset; 31 | if (LauncherPath.IsInstalled()) 32 | asset = release.Assets.FirstOrDefault(x => x.Name.EndsWith("_install.zip")); 33 | else 34 | asset = release.Assets.FirstOrDefault(x => x.Name.EndsWith(".zip") && !x.Name.EndsWith("_install.zip")); 35 | 36 | if (asset != null) 37 | return new ApplicationUpdateInfo(remoteVersion, asset.BrowserDownloadUrl, release.HtmlUrl, asset.CreatedAt.LocalDateTime); 38 | } 39 | } 40 | } 41 | catch(RateLimitExceededException) 42 | { 43 | return null; 44 | } 45 | 46 | return null; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /DoomLauncher/Update/ApplicationUpdateInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DoomLauncher 4 | { 5 | public class ApplicationUpdateInfo 6 | { 7 | public ApplicationUpdateInfo(Version version, string downloadUrl, string releasePage, DateTime releaseDate) 8 | { 9 | Version = version; 10 | DownloadUrl = downloadUrl; 11 | ReleasePageUrl = releasePage; 12 | ReleaseDate = releaseDate; 13 | } 14 | 15 | public readonly Version Version; 16 | public readonly string DownloadUrl; 17 | public readonly string ReleasePageUrl; 18 | public readonly DateTime ReleaseDate; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DoomLauncher/WindowsVersion/WindowsVersion.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32; 2 | using System; 3 | 4 | namespace DoomLauncher.WindowsVersion 5 | { 6 | public enum WindowsTheme 7 | { 8 | Dark, 9 | Light, 10 | Unknown 11 | } 12 | 13 | public static class WindowsVersionInfo 14 | { 15 | public static bool GetOsVersionInfo(out Version versionInfo) 16 | { 17 | try 18 | { 19 | versionInfo = Environment.OSVersion.Version; 20 | return true; 21 | } 22 | catch 23 | { 24 | versionInfo = new Version(); 25 | return false; 26 | } 27 | } 28 | 29 | public static bool IsWindows10OrGreater(Version versionInfo, int build) => 30 | versionInfo.Major >= 10 && versionInfo.Build >= build; 31 | 32 | public static WindowsTheme GetTheme() 33 | { 34 | try 35 | { 36 | int res = (int)Registry.GetValue( 37 | "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", 38 | "AppsUseLightTheme", -1); 39 | switch (res) 40 | { 41 | case 0: return WindowsTheme.Dark; 42 | case 1: return WindowsTheme.Light; 43 | default: return WindowsTheme.Unknown; 44 | } 45 | } 46 | catch 47 | { 48 | return WindowsTheme.Unknown; 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /DoomLauncher/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /DoomLauncherRelease/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /DoomLauncherRelease/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("DoomLauncherRelease")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("DoomLauncherRelease")] 12 | [assembly: AssemblyCopyright("Copyright © 2018")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("52357dd1-59a8-4412-98ca-6601d84b66b4")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /UnitTest/DoomLauncher.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/DoomLauncher.sqlite -------------------------------------------------------------------------------- /UnitTest/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("UnitTest")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("UnitTest")] 12 | [assembly: AssemblyCopyright("Copyright © 2018")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("2e593d49-b240-49be-9e9d-5dd1250eedf3")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /UnitTest/Resources/Directory.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/Directory.zip -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamInstall/config/libraryfolders.vdf: -------------------------------------------------------------------------------- 1 | "libraryfolders" 2 | { 3 | "0" 4 | { 5 | "irrelevantStuff" "blah" 6 | "path" "Resources\\TestSteamLibrary1" 7 | "apps" 8 | { 9 | "48700" "4947778366" 10 | "228980" "383082318" 11 | } 12 | "whatevs" "010101010" 13 | } 14 | "1" 15 | { 16 | "path" "Resources\\TestSteamLibrary2" 17 | "apps" 18 | { 19 | "70" "589449723" 20 | "220" "3831084326" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamLibrary1/steamapps/appmanifest_2280.acf: -------------------------------------------------------------------------------- 1 | "AppState" 2 | { 3 | "blahblah" "123" 4 | "appid" "2280" 5 | "name" "DOOM + DOOM II" 6 | "installdir" "TestDoom" 7 | "irrelevantInfo" "99999998" 8 | } 9 | -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamLibrary1/steamapps/appmanifest_2390.acf: -------------------------------------------------------------------------------- 1 | "AppState" 2 | { 3 | "something" "xxx" 4 | "appid" "2390" 5 | "name" "Heretic" 6 | "installdir" "TestHeretic" 7 | "nonsense" "33333434" 8 | } 9 | -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamLibrary1/steamapps/common/TestDoom/base/doom.wad: -------------------------------------------------------------------------------- 1 | doom.wad -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamLibrary1/steamapps/common/TestDoom/rerelease/doom2.wad: -------------------------------------------------------------------------------- 1 | doom2.wad -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamLibrary1/steamapps/common/TestDoom/rerelease/id1.wad: -------------------------------------------------------------------------------- 1 | id1.wad -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamLibrary1/steamapps/common/TestDoom/rerelease/masterlevels.wad: -------------------------------------------------------------------------------- 1 | masterlevels.wad -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamLibrary1/steamapps/common/TestDoom/rerelease/nerve.wad: -------------------------------------------------------------------------------- 1 | nerve.wad -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamLibrary1/steamapps/common/TestDoom/rerelease/plutonia.wad: -------------------------------------------------------------------------------- 1 | plutonia.wad -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamLibrary1/steamapps/common/TestDoom/rerelease/sigil.wad: -------------------------------------------------------------------------------- 1 | sigil.wad -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamLibrary1/steamapps/common/TestDoom/rerelease/tnt.wad: -------------------------------------------------------------------------------- 1 | tnt.wad -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamLibrary1/steamapps/common/TestHeretic/base/heretic.wad: -------------------------------------------------------------------------------- 1 | heretic.wad -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamLibrary2/steamapps/appmanifest_2360.acf: -------------------------------------------------------------------------------- 1 | "AppState" 2 | { 3 | "ignoreme" "xxxxx" 4 | "appid" "2360" 5 | "name" "Hexen" 6 | "installdir" "TestHexen" 7 | "ignoremetoo" "yyy" 8 | } 9 | -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamLibrary2/steamapps/appmanifest_2390.acf: -------------------------------------------------------------------------------- 1 | "AppState" 2 | { 3 | "something" "xxx" 4 | "appid" "2390" 5 | "name" "Heretic" 6 | "installdir" "TestHeretic" 7 | "nonsense" "33333434" 8 | } 9 | -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamLibrary2/steamapps/common/TestHeretic/base/heretic.wad: -------------------------------------------------------------------------------- 1 | heretic.wad (library2) -------------------------------------------------------------------------------- /UnitTest/Resources/TestSteamLibrary2/steamapps/common/TestHexen/base/hexen.wad: -------------------------------------------------------------------------------- 1 | hexen.wad -------------------------------------------------------------------------------- /UnitTest/Resources/archive.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/archive.7z -------------------------------------------------------------------------------- /UnitTest/Resources/archive.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/archive.rar -------------------------------------------------------------------------------- /UnitTest/Resources/archive.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/archive.zip -------------------------------------------------------------------------------- /UnitTest/Resources/chocosave1.dsg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/chocosave1.dsg -------------------------------------------------------------------------------- /UnitTest/Resources/invalid1.wad: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/invalid1.wad -------------------------------------------------------------------------------- /UnitTest/Resources/invalid2.wad: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/invalid2.wad -------------------------------------------------------------------------------- /UnitTest/Resources/joymaps1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/joymaps1.zip -------------------------------------------------------------------------------- /UnitTest/Resources/mapinfo.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/mapinfo.zip -------------------------------------------------------------------------------- /UnitTest/Resources/mapinfo_doom64.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/mapinfo_doom64.zip -------------------------------------------------------------------------------- /UnitTest/Resources/pathtest.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/pathtest.zip -------------------------------------------------------------------------------- /UnitTest/Resources/prboomsave1.dsg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/prboomsave1.dsg -------------------------------------------------------------------------------- /UnitTest/Resources/pyrrhic.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/pyrrhic.zip -------------------------------------------------------------------------------- /UnitTest/Resources/pyrrhicmaps.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/pyrrhicmaps.zip -------------------------------------------------------------------------------- /UnitTest/Resources/simple.wad: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/simple.wad -------------------------------------------------------------------------------- /UnitTest/Resources/testpk3.pk3: -------------------------------------------------------------------------------- 1 | PK -------------------------------------------------------------------------------- /UnitTest/Resources/uroburos.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/uroburos.zip -------------------------------------------------------------------------------- /UnitTest/Resources/zandemo.cld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/zandemo.cld -------------------------------------------------------------------------------- /UnitTest/Resources/zdoomsave_v1.zds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/zdoomsave_v1.zds -------------------------------------------------------------------------------- /UnitTest/Resources/zdoomsave_v2.zds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/zdoomsave_v2.zds -------------------------------------------------------------------------------- /UnitTest/Resources/zdoomsave_v3.zds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/zdoomsave_v3.zds -------------------------------------------------------------------------------- /UnitTest/Resources/zdoomsave_v4.zds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/zdoomsave_v4.zds -------------------------------------------------------------------------------- /UnitTest/Resources/zmapinfo.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nstlaurent/DoomLauncher/1ef5a24c7428fc610aa57fa98afd5526594d4c7b/UnitTest/Resources/zmapinfo.zip -------------------------------------------------------------------------------- /UnitTest/TestInit.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | using DoomLauncher; 3 | using UnitTest.Tests; 4 | using System.IO; 5 | 6 | namespace UnitTest 7 | { 8 | [TestClass] 9 | static class TestInit 10 | { 11 | [AssemblyInitialize()] 12 | public static void TestInitialize(TestContext testContext) 13 | { 14 | DbDataSourceAdapter adapter = (DbDataSourceAdapter)TestUtil.CreateAdapter(); 15 | 16 | DataCache.Instance.Init(adapter); 17 | 18 | VersionHandler versionHandler = new VersionHandler(adapter.DataAccess, adapter, new AppConfiguration(adapter)); 19 | versionHandler.HandleVersionUpdate(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /UnitTest/Tests/Helpers/DirectoriesConfiguration.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher; 2 | using DoomLauncher.Config; 3 | 4 | namespace UnitTest.Tests 5 | { 6 | class DirectoriesConfiguration : IDirectoriesConfiguration 7 | { 8 | public LauncherPath GameFileDirectory { get; set; } 9 | 10 | public LauncherPath ScreenshotDirectory { get; set; } 11 | 12 | public LauncherPath SaveGameDirectory { get; set; } 13 | 14 | public LauncherPath TempDirectory { get; set; } 15 | 16 | public LauncherPath DemoDirectory { get; set; } 17 | 18 | public LauncherPath ThumbnailDirectory { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /UnitTest/Tests/Helpers/Tree.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace UnitTest.Tests 5 | { 6 | public class Tree 7 | { 8 | public string Name { get; } 9 | 10 | public List Children { get; } 11 | 12 | public bool HasChildren => Children.Count > 0; 13 | 14 | public Tree(string name, params Tree[] children) 15 | { 16 | Name = name; 17 | Children = children.ToList(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /UnitTest/Tests/Helpers/TreeEntry.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher; 2 | using System; 3 | 4 | namespace UnitTest.Tests 5 | { 6 | public class TreeEntry : AbstractArchiveEntry 7 | { 8 | public Tree Tree { get; } 9 | 10 | public TreeEntry(Tree tree) 11 | { 12 | Tree = tree; 13 | } 14 | 15 | public TreeReader GetTreeReader() 16 | { 17 | if (Tree.HasChildren) 18 | return new TreeReader(Tree); 19 | else 20 | return null; 21 | } 22 | 23 | public override long Length => 1; 24 | 25 | public override string Name => Tree.Name; 26 | 27 | public override string FullName => Name; 28 | 29 | public override bool ExtractRequired => false; 30 | 31 | public override bool IsDirectory => false; 32 | 33 | public override void ExtractToFile(string file, bool overwrite = false) 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | 38 | public override string GetNameWithoutExtension() 39 | { 40 | throw new NotImplementedException(); 41 | } 42 | 43 | public override void Read(byte[] buffer, int offset, int length) 44 | { 45 | throw new NotImplementedException(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /UnitTest/Tests/Helpers/TreeReader.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace UnitTest.Tests 6 | { 7 | public class TreeReader : IArchiveReader 8 | { 9 | public static int TreeReadersCreated { get; set; } 10 | public static int TreeReadersDisposed { get; set; } 11 | 12 | public Tree Tree { get; } 13 | 14 | public TreeReader(Tree tree) 15 | { 16 | Tree = tree; 17 | TreeReadersCreated++; 18 | } 19 | 20 | public IEnumerable Entries => 21 | Tree.Children.Select(tree => new TreeEntry(tree)); 22 | 23 | public bool EntriesHaveExtensions => false; 24 | 25 | public void Dispose() 26 | { 27 | TreeReadersDisposed++; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /UnitTest/Tests/TestCldDemoParser.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.Demo; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | using System.IO; 4 | 5 | namespace UnitTest.Tests 6 | { 7 | [TestClass] 8 | public class TestCldDemoParser 9 | { 10 | [TestMethod] 11 | public void TestCldDemoParserFile() 12 | { 13 | string file = "zandemo.cld"; 14 | File.Copy(Path.Combine("Resources", file), file, true); 15 | 16 | IDemoParser parser = DemoUtil.GetDemoParser(file); 17 | 18 | Assert.IsNotNull(parser); 19 | 20 | string[] files = parser.GetRequiredFiles(); 21 | Assert.AreEqual("doom2.wad", files[0]); 22 | Assert.AreEqual("pyrrhic_.wad", files[1]); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /UnitTest/Tests/TestDsgSave.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.SaveGame; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace UnitTest.Tests 5 | { 6 | [TestClass] 7 | public class TestDsgSave 8 | { 9 | [TestMethod] 10 | public void TestPrBoomSave() 11 | { 12 | string save1 = "prboomsave1.dsg"; 13 | TestUtil.CopyResourceFile(save1); 14 | 15 | DsgSaveGameReader reader = new DsgSaveGameReader(save1); 16 | 17 | Assert.AreEqual("NEW2", reader.GetName()); 18 | } 19 | 20 | [TestMethod] 21 | public void TestChocolateDoomSave() 22 | { 23 | string save1 = "chocosave1.dsg"; 24 | TestUtil.CopyResourceFile(save1); 25 | 26 | DsgSaveGameReader reader = new DsgSaveGameReader(save1); 27 | 28 | Assert.AreEqual("CHOCOTESTTESTTESTTESTTE", reader.GetName()); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /UnitTest/Tests/TestGameStoreFiles.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | using System.Collections.Generic; 3 | using DoomLauncher.GameStores; 4 | using System.Linq; 5 | 6 | namespace UnitTest.Tests 7 | { 8 | [TestClass] 9 | public class TestGameStoreFiles 10 | { 11 | [TestMethod] 12 | public void Combine_AddsLists() 13 | { 14 | var gameStoreFiles1 = new GameStoreFiles(new List { "a.wad", "b.wad" }, new List { "x.wad" }, null); 15 | var gameStoreFiles2 = new GameStoreFiles(new List { "c.wad" }, new List { "y.wad", "z.wad" }, null); 16 | 17 | var result = gameStoreFiles1.Combine(gameStoreFiles2); 18 | 19 | Assert.IsTrue(new List { "a.wad", "b.wad", "c.wad" }.SequenceEqual(result.InstalledIWads)); 20 | Assert.IsTrue(new List { "x.wad", "y.wad", "z.wad" }.SequenceEqual(result.InstalledPWads)); 21 | } 22 | 23 | [TestMethod] 24 | public void Combine_AddsListsIgnoringDuplicates() 25 | { 26 | var gameStoreFiles1 = new GameStoreFiles(new List { @"base\a.wad", "b.wad" }, new List { @"base\x.wad" }, null); 27 | var gameStoreFiles2 = new GameStoreFiles(new List { @"release\a.wad" }, new List { @"release\x.wad", "z.wad" }, null); 28 | 29 | var result = gameStoreFiles1.Combine(gameStoreFiles2); 30 | 31 | 32 | Assert.IsTrue(new List { @"base\a.wad", "b.wad" }.SequenceEqual(result.InstalledIWads)); 33 | Assert.IsTrue(new List { @"base\x.wad", "z.wad" }.SequenceEqual(result.InstalledPWads)); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /UnitTest/Tests/TestMapStringGameFileFragment.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher; 2 | using DoomLauncher.DataSources; 3 | using DoomLauncher.Handlers.Sync; 4 | using Microsoft.VisualStudio.TestTools.UnitTesting; 5 | using System.IO; 6 | 7 | namespace UnitTest.Tests 8 | { 9 | [TestClass] 10 | public class TestMapStringGameFileFragment 11 | { 12 | [TestMethod] 13 | public void MapString() 14 | { 15 | var mapInfo = @" 16 | map map01 { 17 | music = ""test1"" 18 | } 19 | 20 | MAP MAP02 { 21 | music = ""test2"" 22 | } 23 | "; 24 | 25 | var frag = new MapStringGameFileFragment(new LauncherPath(Directory.GetCurrentDirectory())); 26 | var gameFile = new GameFile(); 27 | frag.ApplyToGameFile(gameFile, null, new string[] { mapInfo }); 28 | 29 | Assert.AreEqual("map01, MAP02", gameFile.Map); 30 | Assert.AreEqual(2, gameFile.MapCount); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /UnitTest/Tests/TestUpdateInfo.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | using System; 4 | using System.Threading.Tasks; 5 | 6 | namespace UnitTest.Tests 7 | { 8 | [TestClass] 9 | public class TestUpdateInfo 10 | { 11 | [TestMethod] 12 | public async Task TestGetVersion() 13 | { 14 | ApplicationUpdate applicationUpdate = new ApplicationUpdate(TimeSpan.FromSeconds(30)); 15 | Version version = new Version("1.0.0.0"); 16 | ApplicationUpdateInfo info = await applicationUpdate.GetUpdateApplicationInfo(version); 17 | 18 | if (info != null) 19 | { 20 | Assert.IsTrue(info.Version > version); 21 | Assert.IsTrue(info.DownloadUrl.EndsWith(".zip")); 22 | 23 | info = await applicationUpdate.GetUpdateApplicationInfo(info.Version); 24 | 25 | Assert.IsNull(info); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /UnitTest/Tests/TestZdlParser.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher; 2 | using DoomLauncher.DataSources; 3 | using DoomLauncher.Interfaces; 4 | using Microsoft.VisualStudio.TestTools.UnitTesting; 5 | using System.Collections.Generic; 6 | 7 | namespace UnitTest.Tests 8 | { 9 | [TestClass] 10 | public class TestZdlParser 11 | { 12 | [TestMethod] 13 | public void TestZdlParserFile() 14 | { 15 | string file = @"[zdl.save] 16 | port=gzdoom 17 | iwad=C:/ZDL/DOOM2.WAD 18 | extra=extra 19 | file0=C:/ZDL/pinnacle.zip 20 | file1=C:/ZDL/bd21testApr25.zip 21 | skill=4 22 | warp=MAP01 23 | [zdl.general] 24 | conflib=sunrise 25 | "; 26 | 27 | ZdlParser parser = new ZdlParser(CreateSourcePorts(), CreateIWads()); 28 | IGameFile[] gameFiles = parser.Parse(file); 29 | 30 | Assert.AreEqual(2, gameFiles.Length); 31 | 32 | Assert.AreEqual("C:/ZDL/pinnacle.zip", gameFiles[0].FileName); 33 | Assert.AreEqual("MAP01", gameFiles[0].SettingsMap); 34 | Assert.AreEqual("4", gameFiles[0].SettingsSkill); 35 | Assert.AreEqual("extra", gameFiles[0].SettingsExtraParams); 36 | 37 | Assert.AreEqual("C:/ZDL/bd21testApr25.zip", gameFiles[1].FileName); 38 | } 39 | 40 | private IEnumerable CreateIWads() 41 | { 42 | return new IIWadData[] 43 | { 44 | new IWadData { FileName = "DOOM2.WAD" }, 45 | new IWadData { FileName = "DOOM.WAD" }, 46 | new IWadData { FileName = "PLUTONIA.WAD" } 47 | }; 48 | } 49 | 50 | private IEnumerable CreateSourcePorts() 51 | { 52 | return new ISourcePortData[] 53 | { 54 | new SourcePortData { Name = "GZDoom" }, 55 | new SourcePortData { Name = "PrBoom" }, 56 | new SourcePortData { Name = "Chocolate Doom" } 57 | }; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /UnitTest/Tests/TestZdoomSave.cs: -------------------------------------------------------------------------------- 1 | using DoomLauncher.SaveGame; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace UnitTest.Tests 5 | { 6 | [TestClass] 7 | public class TestZdoomSave 8 | { 9 | [TestMethod] 10 | public void TestZdoomSaveBinary() 11 | { 12 | string save1 = "zdoomsave_v1.zds"; 13 | TestUtil.CopyResourceFile(save1); 14 | 15 | ZDoomSaveGameReader reader = new ZDoomSaveGameReader(save1); 16 | 17 | Assert.AreEqual("Autosave Aug 21 13:30", reader.GetName()); 18 | } 19 | 20 | [TestMethod] 21 | public void TestZdoomSaveJson() 22 | { 23 | string save1 = "zdoomsave_v2.zds"; 24 | TestUtil.CopyResourceFile(save1); 25 | 26 | ZDoomSaveGameReader reader = new ZDoomSaveGameReader(save1); 27 | 28 | Assert.AreEqual("Autosave Aug 21 13:12", reader.GetName()); 29 | } 30 | 31 | [TestMethod] 32 | public void TestZdoomSaveJson_3_5() 33 | { 34 | string save1 = "zdoomsave_v3.zds"; 35 | TestUtil.CopyResourceFile(save1); 36 | 37 | ZDoomSaveGameReader reader = new ZDoomSaveGameReader(save1); 38 | 39 | Assert.AreEqual("Autosave Aug 28 06:25", reader.GetName()); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /UnitTest/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /UnitTest/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /WadReader/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("WadReader")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("WadReader")] 12 | [assembly: AssemblyCopyright("")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("68aa5a5a-4e3a-483b-acc2-c3962c3b4590")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("3.7.6.0")] 35 | [assembly: AssemblyFileVersion("3.7.6.0")] 36 | -------------------------------------------------------------------------------- /WadReader/Util.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace WadReader 5 | { 6 | static class Util 7 | { 8 | public static T ReadStuctureFromStream(Stream stream) 9 | { 10 | byte[] bytes = new byte[Marshal.SizeOf(typeof(T))]; 11 | stream.Read(bytes, 0, bytes.Length); 12 | 13 | GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned); 14 | T obj = (T)Marshal.PtrToStructure(handle.AddrOfPinnedObject(),typeof(T)); 15 | handle.Free(); 16 | return obj; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /WadReader/WadType.cs: -------------------------------------------------------------------------------- 1 | namespace WadReader 2 | { 3 | public enum WadType 4 | { 5 | PWAD, 6 | IWAD, 7 | Unknown 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /WadReader/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /WpfControlLibrary/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | [assembly: ThemeInfo( 4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 5 | //(used if a resource is not found in the page, 6 | // or application resource dictionaries) 7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 8 | //(used if a resource is not found in the page, 9 | // app, or any theme specific resource dictionaries) 10 | )] 11 | -------------------------------------------------------------------------------- /WpfControlLibrary/WpfComboBox.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /WpfControlLibrary/WpfComboBox.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace WpfControlLibrary 17 | { 18 | /// 19 | /// Interaction logic for UserControl1.xaml 20 | /// 21 | public partial class UserControl1 : UserControl 22 | { 23 | public UserControl1() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /WpfControlLibrary/WpfControlLibrary.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0-windows 5 | enable 6 | true 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: '{build}' 2 | configuration: Release 3 | platform: Any CPU 4 | image: Visual Studio 2022 5 | before_build: 6 | - cmd: nuget restore 7 | 8 | build_script: 9 | - ps: | 10 | $env:DevenvPath = 'C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE' 11 | - '"%DevenvPath%\devenv.com" DoomLauncher.sln /build Release /project Setup\Setup.vdproj /projectconfig Release /Out errorFile.txt' 12 | - msbuild DoomLauncher.sln /target:UnitTest /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" 13 | 14 | test: 15 | on 16 | 17 | after_build: 18 | - '%APPVEYOR_BUILD_FOLDER%\DoomLauncherRelease\bin\Release\DoomLauncherRelease.exe %APPVEYOR_BUILD_FOLDER%' 19 | 20 | artifacts: 21 | path: ReleaseBuild/DoomLauncher*.zip 22 | name: BuiltZip 23 | --------------------------------------------------------------------------------