Reverted macosx/Q3Controller.m to English, so the search for q3 files dialog is not so funny now :P

git-svn-id: https://svn.code.sf.net/p/q3cellshading/code/trunk@13 db09e94b-7117-0410-a7e6-85ae5ff6e0e9
This commit is contained in:
gmiranda 2006-07-13 07:58:03 +00:00
parent 56a9f90ff8
commit 096de66320

View file

@ -60,7 +60,7 @@ static void Sys_CreatePathToFile(NSString *path, NSDictionary *attributes);
// Don't reactivate the game if we are asking whether to quit
if (Sys_IsProcessingTerminationRequest)
return;
if (!Sys_Unhide())
// Didn't work -- hide again so we should get another chance to unhide later
[NSApp hide: nil];
@ -74,7 +74,7 @@ static void Sys_CreatePathToFile(NSString *path, NSDictionary *attributes);
// We're terminating via -terminate:
return NSTerminateNow;
}
// Avoid reactivating GL when we unhide due to this panel
Sys_IsProcessingTerminationRequest = qtrue;
choice = NSRunAlertPanel(nil, @"Quit without saving?", @"Don't Quit", @"Quit", nil);
@ -82,10 +82,10 @@ static void Sys_CreatePathToFile(NSString *path, NSDictionary *attributes);
if (choice == NSAlertAlternateReturn)
return NSTerminateNow;
// Make sure we get re-hidden
[NSApp hide:nil];
return NSTerminateCancel;
}
@ -132,23 +132,23 @@ extern void CL_Quit_f(void);
NSImage *bannerImage;
NSRect bannerRect;
NSImageView *bannerImageView;
bannerImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"banner.jpg"]];
bannerRect = NSMakeRect(0.0, 0.0, [bannerImage size].width, [bannerImage size].height);
splashPanel = [[NSPanel alloc] initWithContentRect:bannerRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
bannerImageView = [[NSImageView alloc] initWithFrame:bannerRect];
[bannerImageView setImage:bannerImage];
[splashPanel setContentView:bannerImageView];
[bannerImageView release];
[splashPanel center];
[splashPanel setHasShadow:YES];
[splashPanel orderFront: nil];
[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:2.5]];
[splashPanel close];
[bannerImage release];
}
}
@ -216,15 +216,15 @@ extern void CL_Quit_f(void);
argumentCount = [arguments count];
for (argumentIndex = 0; argumentIndex < argumentCount; argumentIndex++) {
NSString *arg;
arg = [arguments objectAtIndex:argumentIndex];
// Don't pass the Process Serial Number command line arg that the Window Server/Finder invokes us with
if ([arg hasPrefix: @"-psn_"])
continue;
argv[argc++] = strdup([arg cString]);
}
// Figure out where the level data is stored.
installationPathKey = @"RetailInstallationPath";
@ -234,7 +234,7 @@ extern void CL_Quit_f(void);
installationPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent];
}
#if !defined(DEDICATED)
#if !defined(DEDICATED)
appName = [[[NSBundle mainBundle] infoDictionary] objectForKey: @"CFBundleName"];
#else
// We are hard coding the app name here since the dedicated server is a tool, not a app bundle and does not have access to the Info.plist that the client app does. Suck.
@ -246,17 +246,17 @@ extern void CL_Quit_f(void);
NSString *dataPath;
NSOpenPanel *openPanel;
int result;
foundDirectory = NO;
defaultManager = [NSFileManager defaultManager];
//NSLog(@"Candidate installation path = %@", installationPath);
dataPath = [installationPath stringByAppendingPathComponent: @"baseq3"];
if ([defaultManager fileExistsAtPath: dataPath]) {
// Check that the data directory contains at least one .pk3 file. We don't know what it will be named, so don't hard code a name (for example it might be named 'french.pk3' for a French release
NSArray *files;
unsigned int fileIndex;
files = [defaultManager directoryContentsAtPath: dataPath];
fileIndex = [files count];
while (fileIndex--) {
@ -267,7 +267,7 @@ extern void CL_Quit_f(void);
}
}
}
if (foundDirectory)
break;
@ -278,9 +278,9 @@ extern void CL_Quit_f(void);
Sys_Quit();
exit(1);
#else
selectButton = @"Busca, busca...";
selectButton = @"Select Retail Installation...";
result = NSRunAlertPanel(demoAppName, @"Necesites les putes dades del joc %@ (el directori en si, no cap en concret de dins).", selectButton, @"Pirar", nil, appName);
result = NSRunAlertPanel(demoAppName, @"You need to select the installation directory for %@ (not any directory inside of it -- the installation directory itself).", selectButton, @"Quit", nil, appName);
switch (result) {
case NSAlertDefaultReturn:
break;
@ -288,7 +288,7 @@ extern void CL_Quit_f(void);
Sys_Quit();
break;
}
openPanel = [NSOpenPanel openPanel];
[openPanel setAllowsMultipleSelection:NO];
[openPanel setCanChooseDirectories:YES];
@ -306,22 +306,22 @@ extern void CL_Quit_f(void);
}
#endif
}
// Create the application support directory if it doesn't exist already
do {
NSArray *results;
NSString *libraryPath, *homePath, *filePath;
NSDictionary *attributes;
results = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
if (![results count])
break;
libraryPath = [results objectAtIndex: 0];
homePath = [libraryPath stringByAppendingPathComponent: @"Application Support"];
homePath = [homePath stringByAppendingPathComponent: appName];
filePath = [homePath stringByAppendingPathComponent: @"foo"];
attributes = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithUnsignedInt: 0750], NSFilePosixPermissions, nil];
NS_DURING {
Sys_CreatePathToFile(filePath, attributes);
@ -334,10 +334,10 @@ extern void CL_Quit_f(void);
Sys_Quit();
} NS_ENDHANDLER;
} while(0);
// Provoke the CD scanning code into looking up the CD.
Sys_CheckCD();
// Let the filesystem know where our local install is
Sys_SetDefaultInstallPath([installationPath cString]);
@ -356,7 +356,7 @@ extern void CL_Quit_f(void);
}
#endif
if (!cmdline) {
// merge the command line, this is kinda silly
// merge the command line, this is kinda silly
for (commandLineLength = 1, argumentIndex = 1; argumentIndex < argc; argumentIndex++)
commandLineLength += strlen(argv[argumentIndex]) + 1;
cmdline = malloc(commandLineLength);
@ -368,7 +368,7 @@ extern void CL_Quit_f(void);
}
}
Com_Printf("command line: %s\n", cmdline);
Com_Init(cmdline);
#ifndef DEDICATED
@ -399,7 +399,7 @@ static void Sys_CreatePathToFile(NSString *path, NSDictionary *attributes)
unsigned int dirIndex, dirCount;
unsigned int startingIndex;
NSFileManager *manager;
manager = [NSFileManager defaultManager];
pathComponents = [path pathComponents];
dirCount = [pathComponents count] - 1;
@ -410,7 +410,7 @@ static void Sys_CreatePathToFile(NSString *path, NSDictionary *attributes)
BOOL fileExists;
partialPath = [NSString pathWithComponents:[pathComponents subarrayWithRange:NSMakeRange(0, dirIndex + 1)]];
// Don't use the 'fileExistsAtPath:isDirectory:' version since it doesn't traverse symlinks
fileExists = [manager fileExistsAtPath:partialPath];
if (!fileExists) {