diff --git a/src/g_game.cpp b/src/g_game.cpp index a3375b5ca..6018628e9 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -2054,7 +2054,7 @@ void G_DoAutoSave () } readableTime = myasctime (); - description.Format("Autosave %.12s", readableTime + 4); + description.Format("Autosave %s", readableTime); G_DoSaveGame (false, file, description); } @@ -2077,14 +2077,9 @@ static void PutSaveWads (FSerializer &arc) static void PutSaveComment (FSerializer &arc) { - const char *readableTime; int levelTime; - // Get the current date and time - readableTime = myasctime (); - - FString comment; - comment.Format("%.10s%.5s%.9s", readableTime, &readableTime[19], &readableTime[10]); + FString comment = myasctime(); arc.AddString("Creation Time", comment); diff --git a/src/utility/cmdlib.cpp b/src/utility/cmdlib.cpp index 219d11faf..f26f067f2 100644 --- a/src/utility/cmdlib.cpp +++ b/src/utility/cmdlib.cpp @@ -426,6 +426,7 @@ void FormatGUID (char *buffer, size_t buffsize, const GUID &guid) const char *myasctime () { + static char readabletime[50]; time_t clock; struct tm *lt; @@ -433,11 +434,12 @@ const char *myasctime () lt = localtime (&clock); if (lt != NULL) { - return asctime (lt); + strftime(readabletime, 50, "%F %T", lt); + return readabletime; } else { - return "Pre Jan 01 00:00:00 1970\n"; + return "Unknown\n"; } } diff --git a/wadsrc/static/zscript/ui/menu/loadsavemenu.zs b/wadsrc/static/zscript/ui/menu/loadsavemenu.zs index 97ad9415a..4612fbde2 100644 --- a/wadsrc/static/zscript/ui/menu/loadsavemenu.zs +++ b/wadsrc/static/zscript/ui/menu/loadsavemenu.zs @@ -259,8 +259,8 @@ class LoadSaveMenu : ListMenu } else { - String s = mInput.GetText() .. ConFont.GetCursor(); - int length = ConFont.StringWidth(s) * CleanXFac; + String s = mInput.GetText() .. NewConsoleFont.GetCursor(); + int length = NewConsoleFont.StringWidth(s) * FontScale; int displacement = min(0, listboxWidth - 2 - length); screen.DrawText (NewConsoleFont, Font.CR_WHITE, (listboxLeft + 1 + displacement) / FontScale, (listboxTop+rowHeight*i + FontScale) / FontScale, s, DTA_VirtualWidthF, screen.GetWidth() / FontScale, DTA_VirtualHeightF, screen.GetHeight() / FontScale);