Skip to content

Fix and improve time formatting #125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 27, 2025
Merged

Fix and improve time formatting #125

merged 2 commits into from
Jun 27, 2025

Conversation

Buggem
Copy link
Contributor

@Buggem Buggem commented Jun 24, 2025

You can tell what it's about from the title.

Here are examples of the changes it makes:

Before After
1h 4:32 1:04:32
2:3 2:30
1h 1:1 1:01:01

@Buggem
Copy link
Contributor Author

Buggem commented Jun 24, 2025

For some reason this doesn't work in practice. anybody know why?

@a1batross
Copy link
Member

What do you mean it doesn't work?

I think I took formatting style from original WON HL and didn't put any thought if it's useful or not. Yours suggestion seems to make more sense to me.

@Buggem
Copy link
Contributor Author

Buggem commented Jun 24, 2025

@a1batross False alarm, just the 32-bit build not loading up the menu shared object properly, and instead choosing the built in one

@@ -51,9 +51,9 @@ struct player_entry_t
int seconds = ( time - hours * 3600 - minutes * 60 );

if( hours != 0 )
time_str.Format( "%ih %i:%i", hours, minutes, seconds );
time_str.Format( "%i:%02i:%02i", hours, minutes, seconds );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to do like this:

time_str.Format( "%02i:%02i:%02i", hours, minutes, seconds );

else
time_str.Format( "%i:%i", minutes, seconds );
time_str.Format( "%i:%02i", minutes, seconds );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing with this line:

time_str.Format( "%02i:%02i", minutes, seconds );

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't agree with these changes but as you're a active contributer I'm happy to merge them

@Buggem
Copy link
Contributor Author

Buggem commented Jun 27, 2025

@SNMetamorph I've done the changes you requested. Should we merge?

@SNMetamorph
Copy link
Member

@SNMetamorph I've done the changes you requested. Should we merge?

Looks good to me. Though, final word is up to @a1batross

@a1batross a1batross merged commit 76149e5 into FWGS:master Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants