From 38956445899885c6ccbc204f49e990e1a3c9d9a6 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 13 Dec 2015 21:01:13 +0200 Subject: [PATCH 1/4] Changed: Display inventory bulk with two decimal places --HG-- branch : develop --- code/ryzom/client/src/interface_v3/action_handler_game.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/action_handler_game.cpp b/code/ryzom/client/src/interface_v3/action_handler_game.cpp index 644722511..76b28f827 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -4048,7 +4048,7 @@ public: // Get the sum of the bulk for this db branch const double epsilon = 0.001; - sint32 val = sint32(CInventoryManager::getBranchBulk(dbBranch, 0, 10000) + epsilon); + float val = CInventoryManager::getBranchBulk(dbBranch, 0, 10000) + epsilon; // Get the Max value sint32 maxVal= 0; @@ -4058,7 +4058,7 @@ public: // Replace in the formated text ucstring str= CI18N::get("uittBulkFormat"); - strFindReplace(str, "%v", toString(val) ); + strFindReplace(str, "%v", toString("%.2f", val) ); strFindReplace(str, "%m", toString(maxVal) ); CWidgetManager::getInstance()->setContextHelpText(str); } @@ -4502,4 +4502,4 @@ public: } } }; -REGISTER_ACTION_HANDLER( CHandlerEmote, "emote"); \ No newline at end of file +REGISTER_ACTION_HANDLER( CHandlerEmote, "emote"); From a64709552cc00db2dab2845eea3308819858543c Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 13 Dec 2015 21:01:56 +0200 Subject: [PATCH 2/4] Added: 12-hour clock in radar and chat --HG-- branch : develop --- .../client/data/gamedev/interfaces_v3/compass.xml | 2 +- .../client/data/gamedev/interfaces_v3/config.xml | 3 +++ .../data/gamedev/interfaces_v3/game_config.xml | 15 ++++++++++++++- .../client/src/interface_v3/chat_text_manager.cpp | 6 +++++- .../client/src/interface_v3/interface_manager.cpp | 13 ++++++++++++- .../client/src/interface_v3/interface_manager.h | 4 ++++ 6 files changed, 39 insertions(+), 4 deletions(-) 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..6377953a6 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 + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml b/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml index bd0952277..ca68212cf 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml @@ -1399,12 +1399,20 @@ posparent="cao" x="0" y="-12" /> + @@ -3255,6 +3263,11 @@ widget="boolbut" link="UI:SAVE:SHOW_CLOCK" realtime="true" /> + 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] "); From 0f34e0ea918b4dfcd71f3c22fa40c4a97231eca0 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 13 Dec 2015 21:02:25 +0200 Subject: [PATCH 3/4] Changed: Attach dyn chat to main chat as default. --HG-- branch : develop --- code/ryzom/client/data/gamedev/interfaces_v3/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/config.xml b/code/ryzom/client/data/gamedev/interfaces_v3/config.xml index 6377953a6..7b73429c4 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/config.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/config.xml @@ -3705,7 +3705,7 @@ This MUST follow the Enum MISSION_DESC::TIconId value_from_code="getMaxDynChanPerPlayer()" /> Date: Sun, 13 Dec 2015 21:08:22 +0200 Subject: [PATCH 4/4] Added: Translation for 12-hour clock options --HG-- branch : compatibility-develop --- code/ryzom/tools/translation/work/wk.uxt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/ryzom/tools/translation/work/wk.uxt b/code/ryzom/tools/translation/work/wk.uxt index 33650b73d..bac979702 100644 --- a/code/ryzom/tools/translation/work/wk.uxt +++ b/code/ryzom/tools/translation/work/wk.uxt @@ -13450,3 +13450,5 @@ uiVRGeneral [Virtual Reality Options] uigcVR [VIRTUAL REALITY] uigcFxAnisotropicFilter [Anisotropic Filtering:] uigcFxAnisotropicFilterNone [None] +uiShowClock12h [Use 12-hour clock] +uittShowClock12h [If checked, use 12-hour clock in compass and in chat messages.]