From 351c1be33154d12b55e658cfb8f3101858fba63c Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 8 May 2011 18:29:46 +0000 Subject: Allow IWAD files to be double-clicked in the finder to set the IWAD configuration. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2334 --- pkg/osx/IWADController.m | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'pkg/osx/IWADController.m') diff --git a/pkg/osx/IWADController.m b/pkg/osx/IWADController.m index 3c596850..0c55b3f5 100644 --- a/pkg/osx/IWADController.m +++ b/pkg/osx/IWADController.m @@ -343,5 +343,44 @@ static NSString *IWADFilenames[NUM_IWAD_TYPES + 1] = //free(env); } +// Examine a path to a WAD and determine whether it is an IWAD file. +// If so, it is added to the IWAD configuration, and true is returned. + +- (BOOL) addIWADPath: (NSString *) path +{ + IWADLocation *iwadList[NUM_IWAD_TYPES]; + NSArray *pathComponents; + NSString *filename; + unsigned int i; + + [self getIWADList: iwadList]; + + // Find an IWAD file that matches the filename in the path that we + // have been given. + + pathComponents = [path pathComponents]; + filename = [pathComponents objectAtIndex: [pathComponents count] - 1]; + + for (i = 0; i < NUM_IWAD_TYPES; ++i) + { + if ([filename caseInsensitiveCompare: IWADFilenames[i]] == 0) + { + // Configure this IWAD. + + [iwadList[i] setLocation: path]; + + // Rebuild dropdown list and select the new IWAD. + + [self setDropdownList]; + [self->iwadSelector selectItemWithTitle:IWADLabels[i]]; + return YES; + } + } + + // No IWAD found with this name. + + return NO; +} + @end -- cgit v1.2.3 From 1cfa4409aff87bc730f32744693a02eb7dc57187 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 13 Jun 2011 23:45:10 +0000 Subject: Rework configuration window; add Heretic/Hexen configuration boxes. Subversion-branch: /branches/raven-branch Subversion-revision: 2348 --- pkg/osx/IWADController.m | 4 ---- 1 file changed, 4 deletions(-) (limited to 'pkg/osx/IWADController.m') diff --git a/pkg/osx/IWADController.m b/pkg/osx/IWADController.m index b420d59d..ec181350 100644 --- a/pkg/osx/IWADController.m +++ b/pkg/osx/IWADController.m @@ -279,10 +279,6 @@ static NSString *IWADFilenames[NUM_IWAD_TYPES + 1] = - (void) awakeFromNib { - // TODO: This is temporary: - self->heretic = self->doom1; - self->hexen = self->doom2; - [self->configWindow center]; // Set configuration for all IWADs from configuration file. -- cgit v1.2.3