Skip to content

Print date and time in the Load/Save Game menus in the current locale#847

Open
fabiangreffrath wants to merge 2 commits intomasterfrom
setlocale
Open

Print date and time in the Load/Save Game menus in the current locale#847
fabiangreffrath wants to merge 2 commits intomasterfrom
setlocale

Conversation

@fabiangreffrath
Copy link
Copy Markdown
Collaborator

Fixes #818

@Pedro-Beirao
Copy link
Copy Markdown
Collaborator

Right I had fixed this a few months ago but never did a PR, thanks!

In locales where the year is not abbreviated to 2 numbers, we need to increase SAVESTRINGSIZE to 26. Can you do it in this PR? Or I'll make another.

@fabiangreffrath
Copy link
Copy Markdown
Collaborator Author

In locales where the year is not abbreviated to 2 numbers, we need to increase SAVESTRINGSIZE to 26. Can you do it in this PR? Or I'll make another.

This will immediately introduce an incompatiblity with any older savegame.

@fabiangreffrath
Copy link
Copy Markdown
Collaborator Author

We could drop seconds:

--- a/prboom2/src/m_menu.c
+++ b/prboom2/src/m_menu.c
@@ -1482,7 +1482,7 @@ static void M_QuickSave(void)
   time (&now);
   timeinfo = localtime (&now);

-  strftime(description, sizeof(description), "quick %x %X", timeinfo);
+  strftime(description, sizeof(description), "quick %x %H:%M", timeinfo);

   G_SaveGame(QUICKSAVESLOT, description);
   doom_printf("%s", description);

@fabiangreffrath
Copy link
Copy Markdown
Collaborator Author

Or we abbreviate the "quick" string with e.g. a mere "q"?

@Pedro-Beirao
Copy link
Copy Markdown
Collaborator

I dont mind making older saves incompatible, we do it pretty often in dsda. But yea we would have to increase the SAVEVERSION as well.

Its possible users want multiple saves during a minute, so I think we should keep the seconds.
And I dont like how just the 'q' looks.

Screenshot 2026-02-18 at 15 41 04

@fabiangreffrath
Copy link
Copy Markdown
Collaborator Author

Strictly speaking, we don't even need neither "QUICK" nor "Q" at all. We have an entire savegame page called "Q" just for these.

@Pedro-Beirao
Copy link
Copy Markdown
Collaborator

True 😅

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.

Quicksave name doesn't respect locale's date format

2 participants