replay: level and minutes left not always shown

Open-source port of PoP that runs natively on Windows, Linux, etc.
Post Reply
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

replay: level and minutes left not always shown

Post by Norbert »

When I copy six .p1r files into replays/, then use Tab to cycle through them, status bar messages are inconsistent.
Only the first replay reports the "LEVEL ..." and "... MINUTES LEFT".
These messages are not displayed for other levels.
When I quickly press Tab after "LEVEL ...", the "... MINUTES LEFT" text is displayed for the next level.

Related, but not as important, the replays seem to be loaded in a random order. A solution might be to use "qsort (..., ..., ..., StrCmp);" with a StrCmp() you can find at the bottom of class.c in the Ggradebook 0.92 package.
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: replay: level and minutes left not always shown

Post by Falcury »

Norbert wrote:When I copy six .p1r files into replays/, then use Tab to cycle through them, status bar messages are inconsistent.
Only the first replay reports the "LEVEL ..." and "... MINUTES LEFT".
These messages are not displayed for other levels.
When I quickly press Tab after "LEVEL ...", the "... MINUTES LEFT" text is displayed for the next level.

Related, but not as important, the replays seem to be loaded in a random order. A solution might be to use "qsort (..., ..., ..., StrCmp);" with a StrCmp() you can find at the bottom of class.c in the Ggradebook 0.92 package.
I suppose the timer that handles the time display at the start of the level is not part of the savestate. Then, it would always be displayed when the game thinks a new level has been loaded (i.e. when the first replay is loaded). When you forcibly cycle to the next replay, this does not count as a 'level restart', however (similar to a quickload).
I suppose the desired behavior is to only show the time when you are actually at the beginning of a level?
Then, that would mean that we should add that timer variable to the savestate, I think (Note: not verified!)

Right now, replays are played in reverse file creation order... (This behavior uses qsort() as well; see the procedure in replay.c that lists all the replay files in the replays directory.) I suppose it would make sense to change this behavior (alphabetically? recording time instead of file creation time?)
Ideally, there would be some sort of selection screen. We would probably have to extend the GUI facilities a bit more (currently, all that can be easily done is a simple dialog box or a screen with text).
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: replay: level and minutes left not always shown

Post by Norbert »

I dunno, but the time left and replay order aren't that important, I think.
Consistently showing the level number might be informative and useful, in my opinion.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: replay: level and minutes left not always shown

Post by Norbert »

Was this fixed?
I could re-check, but maybe someone already knows the status.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: replay: level and minutes left not always shown

Post by David »

Norbert wrote: January 7th, 2018, 2:52 pm Was this fixed?
I could re-check, but maybe someone already knows the status.
I fixed it now: https://github.com/NagyD/SDLPoP/commit/ ... b335729a43
Took only a few minutes.
I don't know why didn't I solve this when you reported it...
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: replay: level and minutes left not always shown

Post by Norbert »

Thanks.
Post Reply