Slideshow while game paused?

General discussion for players of Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2763
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Slideshow while game paused?

Post by Wildeblood »

I have questions:

Do javascript timers continue running while Oolite is paused?

Once one invokes a mission screen while the game is paused, is there any way to escape that situation again?
"Must keep this response efficient to preserve remaining context."
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6842
Joined: Wed Feb 28, 2007 7:54 am

Re: Slideshow while game paused?

Post by another_commander »

Looks like once you've triggered a mission screen while paused there is no way out unless you script-trigger another screen to exit the mission one. I guess this is not a great way to do it, though.

I have enabled pause and unpause from within mission screens (unless you are in text input mode in the mission screen) on this test exe: https://www.filemail.com/d/xgnzrmnlpdfzkxr

Wanna have a go with it and see how it fares for you? I don't quite remember why there had to be a specific check for not being in a mission screen when handling the pause key, but my assumption is that unless you are in text input mode there should be no harm in being able to pause and unpause.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6842
Joined: Wed Feb 28, 2007 7:54 am

Re: Slideshow while game paused?

Post by another_commander »

New exe is up for testing for one week from now here: https://www.filemail.com/d/havmxvfubunbccn

Pause and unpause should now work even if the mission screen is entered by script while the game is paused (could happen via console command) and text entry in the mission screen is enabled. If this happens, you can still get out by just unpausing the game and typing normally in the prompt. In such a case you will not be able to pause the game again until text input has been completed. All this while docked, there are no provisions for any of it during flight.

Feedback welcome and if this works without unforeseen issues it might find its way to master. For completeness, here is the source modification done to obtain the test exe. We are looking at the file src/Core/Entities/PlayerEntityControls.m, - (void) pollDockedControls:(double)delta_t method:

Code: Select all

- (void) pollDockedControls:(double)delta_t
{
	MyOpenGLView			*gameView = [UNIVERSE gameView];
	GameController			*gameController = [UNIVERSE gameController];
	const BOOL *joyButtonState = [[OOJoystickManager sharedStickHandler] getAllButtonStates];
	NSString				*exceptionContext = @"setup";
	
	@try
	{
		// Pause game, 'p' key
		exceptionContext = @"pause key";
		if (([self checkKeyPress:n_key_pausebutton] || joyButtonState[BUTTON_PAUSE]) && (gui_screen != GUI_SCREEN_LONG_RANGE_CHART &&
				gui_screen != GUI_SCREEN_REPORT &&
				gui_screen != GUI_SCREEN_SAVE && gui_screen != GUI_SCREEN_KEYBOARD_ENTRY) )
		{
			BOOL isMissionScreenWithTextEntry = gui_screen == GUI_SCREEN_MISSION && _missionTextEntry;
			if (!pause_pressed)
			{
				if ([gameController isGamePaused])
				{
					script_time = saved_script_time;
					[gameView allowStringInput:NO];
					if ([UNIVERSE pauseMessageVisible])
					{
						[UNIVERSE clearPreviousMessage];	// remove the 'paused' message.
					}
					[[UNIVERSE gui] setForegroundTextureKey:@"docked_overlay"];
					[gameController setGamePaused:NO];
				}
				else
				{
					if (!isMissionScreenWithTextEntry)
					{
						saved_script_time = script_time;
						[[UNIVERSE messageGUI] clear];
						
						[UNIVERSE pauseGame];	// 'paused' handler
					}
				}
			}
			if (!isMissionScreenWithTextEntry)
			{
				pause_pressed = YES;
			}
		}
		else
		{
			pause_pressed = NO;
		}
[...] // rest of method not modified
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2763
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Re: Slideshow while game paused?

Post by Wildeblood »

Thank you very much, a_c.
"Must keep this response efficient to preserve remaining context."
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6842
Joined: Wed Feb 28, 2007 7:54 am

Re: Slideshow while game paused?

Post by another_commander »

Later today I am planning to raise a PR on github about this. Allowing pause and unpause capability in mission screens including everyday stuff like contract lists and details, is planned to become a feature soon unless I have missed something really important. If I have, it would be best to let me know now.
Post Reply