Added the playerWillSaveGame script event handler, taking as parameter the type of savegame, which can be standardSave, autoSave or quickSave, as per request in http://www.aegidian.org/bb/viewtopic.php?p=117800#117800.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3746 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
7a5b73ad92
commit
929fb9f2c0
@ -142,6 +142,8 @@ static uint16_t PersonalityForCommanderDict(NSDictionary *dict);
|
||||
tmp_name = player_name;
|
||||
tmp_path = save_path;
|
||||
|
||||
[self doScriptEvent:@"playerWillSaveGame" withArgument:@"autoSave"];
|
||||
|
||||
NSString *saveName = player_name;
|
||||
if (![player_name hasSuffix:DESC(@"autosave-commander-suffix")])
|
||||
saveName = [player_name stringByAppendingString:DESC(@"autosave-commander-suffix")];
|
||||
@ -180,6 +182,8 @@ static uint16_t PersonalityForCommanderDict(NSDictionary *dict);
|
||||
format:@"ERROR no file name returned by [[gameView gameController] playerFileToLoad]"];
|
||||
}
|
||||
|
||||
[self doScriptEvent:@"playerWillSaveGame" withArgument:@"quickSave"];
|
||||
|
||||
[self writePlayerToPath:path];
|
||||
[[UNIVERSE gameView] supressKeysUntilKeyUp];
|
||||
[self setGuiToStatusScreen];
|
||||
@ -577,6 +581,8 @@ static uint16_t PersonalityForCommanderDict(NSDictionary *dict);
|
||||
NSArray* path_components = [[sp filename] pathComponents];
|
||||
NSString* new_name = [[path_components objectAtIndex:[path_components count]-1] stringByDeletingPathExtension];
|
||||
|
||||
[self doScriptEvent:@"playerWillSaveGame" withArgument:@"standardSave"];
|
||||
|
||||
[player_name release];
|
||||
player_name = [new_name copy];
|
||||
|
||||
@ -628,9 +634,10 @@ static uint16_t PersonalityForCommanderDict(NSDictionary *dict);
|
||||
- (void)nativeSavePlayer:(NSString *)cdrName
|
||||
{
|
||||
NSString* dir = [[UNIVERSE gameController] playerFileDirectory];
|
||||
|
||||
NSString *savePath = [dir stringByAppendingPathComponent:[cdrName stringByAppendingPathExtension:@"oolite-save"]];
|
||||
|
||||
[self doScriptEvent:@"playerWillSaveGame" withArgument:@"standardSave"];
|
||||
|
||||
[player_name release];
|
||||
player_name = [cdrName copy];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user