Add the scenarios, fix some bugs
Still some more bugs to fix
This commit is contained in:
parent
6fbcf75363
commit
edfd011ecb
1310
Resources/Scenarios/oolite-standard.oolite-save
Normal file
1310
Resources/Scenarios/oolite-standard.oolite-save
Normal file
File diff suppressed because it is too large
Load Diff
1312
Resources/Scenarios/oolite-strict.oolite-save
Normal file
1312
Resources/Scenarios/oolite-strict.oolite-save
Normal file
File diff suppressed because it is too large
Load Diff
@ -1746,6 +1746,7 @@ static GLfloat sBaseMass = 0.0;
|
|||||||
- (void) completeSetUpAndSetTarget:(BOOL)setTarget
|
- (void) completeSetUpAndSetTarget:(BOOL)setTarget
|
||||||
{
|
{
|
||||||
[OOSoundSource stopAll];
|
[OOSoundSource stopAll];
|
||||||
|
|
||||||
[self setDockedStation:[UNIVERSE station]];
|
[self setDockedStation:[UNIVERSE station]];
|
||||||
[self setLastAegisLock:[UNIVERSE planet]];
|
[self setLastAegisLock:[UNIVERSE planet]];
|
||||||
|
|
||||||
@ -2004,7 +2005,7 @@ static GLfloat sBaseMass = 0.0;
|
|||||||
[self updateTrumbles:delta_t];
|
[self updateTrumbles:delta_t];
|
||||||
|
|
||||||
OOEntityStatus status = [self status];
|
OOEntityStatus status = [self status];
|
||||||
if (EXPECT_NOT(status == STATUS_START_GAME && gui_screen != GUI_SCREEN_INTRO1 && gui_screen != GUI_SCREEN_INTRO2 && gui_screen != GUI_SCREEN_NEWGAME))
|
if (EXPECT_NOT(status == STATUS_START_GAME && gui_screen != GUI_SCREEN_INTRO1 && gui_screen != GUI_SCREEN_INTRO2 && gui_screen != GUI_SCREEN_NEWGAME && gui_screen != GUI_SCREEN_LOAD))
|
||||||
{
|
{
|
||||||
UPDATE_STAGE(@"setGuiToIntroFirstGo:");
|
UPDATE_STAGE(@"setGuiToIntroFirstGo:");
|
||||||
[self setGuiToIntroFirstGo:YES]; //set up demo mode
|
[self setGuiToIntroFirstGo:YES]; //set up demo mode
|
||||||
|
@ -1845,7 +1845,7 @@ static NSTimeInterval time_last_frame;
|
|||||||
[demoShip release];
|
[demoShip release];
|
||||||
demoShip = nil;
|
demoShip = nil;
|
||||||
|
|
||||||
[self loadPlayerFromFile:commanderFile];
|
[self loadPlayerFromFile:commanderFile asNew:NO];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3491,7 +3491,6 @@ static BOOL autopilot_pause;
|
|||||||
{
|
{
|
||||||
[[OOMusicController sharedController] stopThemeMusic];
|
[[OOMusicController sharedController] stopThemeMusic];
|
||||||
disc_operation_in_progress = YES;
|
disc_operation_in_progress = YES;
|
||||||
[self setStatus:STATUS_DOCKED];
|
|
||||||
[UNIVERSE removeDemoShips];
|
[UNIVERSE removeDemoShips];
|
||||||
[gui clearBackground];
|
[gui clearBackground];
|
||||||
if (![self loadPlayer])
|
if (![self loadPlayer])
|
||||||
@ -3510,6 +3509,10 @@ static BOOL autopilot_pause;
|
|||||||
{
|
{
|
||||||
[self setGuiToIntroFirstGo:NO];
|
[self setGuiToIntroFirstGo:NO];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
disc_operation_in_progress = NO;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GUI_SCREEN_INTRO2:
|
case GUI_SCREEN_INTRO2:
|
||||||
@ -3631,6 +3634,23 @@ static BOOL autopilot_pause;
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if OO_USE_CUSTOM_LOAD_SAVE
|
||||||
|
// DJS: Farm off load/save screen options to LoadSave.m
|
||||||
|
case GUI_SCREEN_LOAD:
|
||||||
|
{
|
||||||
|
NSString *commanderFile = [self commanderSelector];
|
||||||
|
if(commanderFile)
|
||||||
|
{
|
||||||
|
// also release the demo ship here (see showShipyardModel and noteGUIDidChangeFrom)
|
||||||
|
[demoShip release];
|
||||||
|
demoShip = nil;
|
||||||
|
|
||||||
|
[self loadPlayerFromFile:commanderFile asNew:NO];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ MA 02110-1301, USA.
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
- (BOOL) loadPlayerFromFile:(NSString *)fileToOpen;
|
- (BOOL) loadPlayerFromFile:(NSString *)fileToOpen asNew:(BOOL)asNew;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -322,7 +322,13 @@ static uint16_t PersonalityForCommanderDict(NSDictionary *dict);
|
|||||||
OOLog(@"scenario.init.error",@"Game file not found for scenario %@",file);
|
OOLog(@"scenario.init.error",@"Game file not found for scenario %@",file);
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
return [self loadPlayerFromFile:path];
|
BOOL result = [self loadPlayerFromFile:path asNew:YES];
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
// don't drop the save game directory in
|
||||||
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -571,7 +577,7 @@ static uint16_t PersonalityForCommanderDict(NSDictionary *dict);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
- (BOOL) loadPlayerFromFile:(NSString *)fileToOpen
|
- (BOOL) loadPlayerFromFile:(NSString *)fileToOpen asNew:(BOOL)asNew
|
||||||
{
|
{
|
||||||
/* TODO: it would probably be better to load by creating a new
|
/* TODO: it would probably be better to load by creating a new
|
||||||
PlayerEntity, verifying that's OK, then replacing the global player.
|
PlayerEntity, verifying that's OK, then replacing the global player.
|
||||||
@ -656,6 +662,8 @@ static uint16_t PersonalityForCommanderDict(NSDictionary *dict);
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (loadedOK)
|
if (loadedOK)
|
||||||
|
{
|
||||||
|
if (!asNew)
|
||||||
{
|
{
|
||||||
[save_path autorelease];
|
[save_path autorelease];
|
||||||
save_path = [fileToOpen retain];
|
save_path = [fileToOpen retain];
|
||||||
@ -663,6 +671,7 @@ static uint16_t PersonalityForCommanderDict(NSDictionary *dict);
|
|||||||
[[[UNIVERSE gameView] gameController] setPlayerFileToLoad:fileToOpen];
|
[[[UNIVERSE gameView] gameController] setPlayerFileToLoad:fileToOpen];
|
||||||
[[[UNIVERSE gameView] gameController] setPlayerFileDirectory:fileToOpen];
|
[[[UNIVERSE gameView] gameController] setPlayerFileDirectory:fileToOpen];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OOLog(@"load.failed", @"***** Failed to load saved game \"%@\": %@", [fileToOpen lastPathComponent], fail_reason ? fail_reason : (NSString *)@"unknown error");
|
OOLog(@"load.failed", @"***** Failed to load saved game \"%@\": %@", [fileToOpen lastPathComponent], fail_reason ? fail_reason : (NSString *)@"unknown error");
|
||||||
@ -761,7 +770,7 @@ static uint16_t PersonalityForCommanderDict(NSDictionary *dict);
|
|||||||
NSURL *url = oPanel.URL;
|
NSURL *url = oPanel.URL;
|
||||||
if (url.isFileURL)
|
if (url.isFileURL)
|
||||||
{
|
{
|
||||||
return [self loadPlayerFromFile:url.path];
|
return [self loadPlayerFromFile:url.path asNew:NO];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ static GameController *sSharedController = nil;
|
|||||||
if (playerFileToLoad != nil)
|
if (playerFileToLoad != nil)
|
||||||
{
|
{
|
||||||
[self logProgress:DESC(@"loading-player")];
|
[self logProgress:DESC(@"loading-player")];
|
||||||
[PLAYER loadPlayerFromFile:playerFileToLoad];
|
[PLAYER loadPlayerFromFile:playerFileToLoad asNew:NO];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2679,7 +2679,7 @@ static GLfloat docked_light_specular[4] = { DOCKED_ILLUM_LEVEL, DOCKED_ILLUM_LEV
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[self reinitAndShowDemo:NO];
|
[self reinitAndShowDemo:YES];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9801,7 +9801,9 @@ static OOComparisonResult comparePrice(id dict1, id dict2, void *context)
|
|||||||
|
|
||||||
_sessionID++; // Must be after removing old entities and before adding new ones.
|
_sessionID++; // Must be after removing old entities and before adding new ones.
|
||||||
|
|
||||||
[ResourceManager setUseAddOns:!strict]; // also logs the paths
|
// demo must not be in strict mode, or you can't load scenarios
|
||||||
|
// from OXPs if your last game was strict
|
||||||
|
[ResourceManager setUseAddOns:(!strict || showDemo)]; // also logs the paths
|
||||||
//[ResourceManager loadScripts]; // initialised inside [player setUp]!
|
//[ResourceManager loadScripts]; // initialised inside [player setUp]!
|
||||||
|
|
||||||
// NOTE: Anything in the sharedCache is now trashed and must be
|
// NOTE: Anything in the sharedCache is now trashed and must be
|
||||||
@ -9856,7 +9858,6 @@ static OOComparisonResult comparePrice(id dict1, id dict2, void *context)
|
|||||||
|
|
||||||
if(showDemo)
|
if(showDemo)
|
||||||
{
|
{
|
||||||
[player setGuiToIntroFirstGo:YES];
|
|
||||||
[player setStatus:STATUS_START_GAME];
|
[player setStatus:STATUS_START_GAME];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -9865,9 +9866,18 @@ static OOComparisonResult comparePrice(id dict1, id dict2, void *context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
[player completeSetUp];
|
[player completeSetUp];
|
||||||
|
if(showDemo)
|
||||||
|
{
|
||||||
|
[player setGuiToIntroFirstGo:YES];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// no need to do these if showing the demo as the only way out
|
||||||
|
// now is to load a game
|
||||||
[self populateNormalSpace];
|
[self populateNormalSpace];
|
||||||
|
|
||||||
[player startUpComplete];
|
[player startUpComplete];
|
||||||
|
}
|
||||||
|
|
||||||
if(!showDemo)
|
if(!showDemo)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user