Page 1 of 1
Slideshow while game paused?
Posted: Mon Jun 16, 2025 5:36 am
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?
Re: Slideshow while game paused?
Posted: Mon Jun 16, 2025 7:36 am
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.
Re: Slideshow while game paused?
Posted: Tue Jun 17, 2025 9:05 am
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
Re: Slideshow while game paused?
Posted: Tue Jun 17, 2025 6:12 pm
by Wildeblood
Thank you very much, a_c.
Re: Slideshow while game paused?
Posted: Fri Jun 20, 2025 7:04 am
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.