diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/compass.xml b/code/ryzom/client/data/gamedev/interfaces_v3/compass.xml index c2bd7a407..003c90f00 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/compass.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/compass.xml @@ -567,7 +567,7 @@ diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/config.xml b/code/ryzom/client/data/gamedev/interfaces_v3/config.xml index 50ccf385a..7b73429c4 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/config.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/config.xml @@ -2765,6 +2765,9 @@ This MUST follow the Enum MISSION_DESC::TIconId + @@ -3702,7 +3705,7 @@ This MUST follow the Enum MISSION_DESC::TIconId value_from_code="getMaxDynChanPerPlayer()" /> + @@ -3255,6 +3263,11 @@ widget="boolbut" link="UI:SAVE:SHOW_CLOCK" realtime="true" /> + setContextHelpText(str); } @@ -4502,4 +4502,4 @@ public: } } }; -REGISTER_ACTION_HANDLER( CHandlerEmote, "emote"); \ No newline at end of file +REGISTER_ACTION_HANDLER( CHandlerEmote, "emote"); diff --git a/code/ryzom/client/src/interface_v3/chat_text_manager.cpp b/code/ryzom/client/src/interface_v3/chat_text_manager.cpp index 83ef7474e..0496f547e 100644 --- a/code/ryzom/client/src/interface_v3/chat_text_manager.cpp +++ b/code/ryzom/client/src/interface_v3/chat_text_manager.cpp @@ -167,7 +167,11 @@ CViewBase *CChatTextManager::createMsgText(const ucstring &cstMsg, NLMISC::CRGBA ucstring cur_time; if (showTimestamps()) { - cur_time = CInterfaceManager::getTimestampHuman(); + CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:SHOW_CLOCK_12H", false); + if (node && node->getValueBool()) + cur_time = CInterfaceManager::getTimestampHuman("[%I:%M:%S %p] "); + else + cur_time = CInterfaceManager::getTimestampHuman(); } // if text contain any color code, set the text formated and white, diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index fbaac2c86..2624aef77 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -1495,7 +1495,10 @@ void CInterfaceManager::updateFrameEvents() { if (pVT->getActive()) { - str = getTimestampHuman("%H:%M"); + if (use12hClock()) + str = getTimestampHuman("%I:%M %p"); + else + str = getTimestampHuman("%H:%M"); pVT->setText(str); } } @@ -3639,6 +3642,14 @@ void CInterfaceManager::CServerToLocalAutoCopy::onLocalChange(ICDBNode *localNod } } +// ------------------------------------------------------------------------------------------------ +bool CInterfaceManager::use12hClock() +{ + CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:SHOW_CLOCK_12H", false); + + return (node && node->getValueBool()); +} + // ------------------------------------------------------------------------------------------------ char* CInterfaceManager::getTimestampHuman(const char* format /* "[%H:%M:%S] " */) { diff --git a/code/ryzom/client/src/interface_v3/interface_manager.h b/code/ryzom/client/src/interface_v3/interface_manager.h index d0dccecc5..6025868e5 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.h +++ b/code/ryzom/client/src/interface_v3/interface_manager.h @@ -408,6 +408,10 @@ public: void notifyMailAvailable(); void notifyForumUpdated(); + /** Return true if 12-hour clock should be used + */ + static bool use12hClock(); + /** Returns a human readable timestamp with the given format. */ static char* getTimestampHuman(const char* format = "[%H:%M:%S] ");