From 2fb111adf45e279dcfe7e191ae2e3dbf9159a9ca Mon Sep 17 00:00:00 2001 From: aurhat Date: Tue, 8 Sep 2015 00:52:16 +0200 Subject: [PATCH] Fix wall clock with 12h format Stock strftime doesn't use capitalized "P", so for example on Windows the wall clock didn't appear for 12h format. PM and AM are converted to lowercase. --- config/menus_settings.cfg | 2 +- source/src/renderhud.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/menus_settings.cfg b/config/menus_settings.cfg index 24de1e30..944ca44a 100644 --- a/config/menus_settings.cfg +++ b/config/menus_settings.cfg @@ -503,7 +503,7 @@ menuitem [Reset to default scoreboard...] [ loop rsl (listlen $DEFAULT_SCOREBOAR menuitem [Close] [ closecurmenu ] alias wallclockformat "" // strftime formatting -alias wallclockformatlist ["" %H:%M %H:%M:%S %I:%M%P %I:%M:%S%P U%H:%M U%H:%M:%S] //"U" at beginning means UTC/GMT time +alias wallclockformatlist ["" %H:%M %H:%M:%S %I:%M%p %I:%M:%S%p U%H:%M U%H:%M:%S] //"U" at beginning means UTC/GMT time newmenu HUD diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index c3cdbb25..8bdb2b36 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -841,7 +841,7 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat const char *ltimeformat = getalias("wallclockformat"); bool wallclock = ltimeformat && *ltimeformat; //wallclockformat beginning with "U" shows UTC/GMT time - if(wallclock) formatstring(ltime)("%s", timestring(*ltimeformat != 'U', ltimeformat + int(*ltimeformat == 'U'))); + if(wallclock) filtertext(ltime, timestring(*ltimeformat != 'U', ltimeformat + int(*ltimeformat == 'U')), FTXT_TOLOWER); if(showstats) {