From 076a50e3fb4ffbd5db6ebc92361ad50a71a6f73e Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 27 Feb 2017 10:57:24 +0100 Subject: [PATCH 1/9] Changed: Use modulateFromColorRGBOnly to colorize a bitmap in textures_tool --HG-- branch : develop --- code/nel/tools/3d/textures_tool/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/tools/3d/textures_tool/main.cpp b/code/nel/tools/3d/textures_tool/main.cpp index 592df935f..cccb62bee 100644 --- a/code/nel/tools/3d/textures_tool/main.cpp +++ b/code/nel/tools/3d/textures_tool/main.cpp @@ -180,8 +180,8 @@ int main(int argc, char **argv) for (uint j = 0; j < size; ++j) { - // TODO: find what computation do -// *(pRGBA++)-> = color; + pRGBA->modulateFromColorRGBOnly(*pRGBA, color); + ++pRGBA; } NLMISC::COFile out; From be591b21071f33700ac0275fad41188ca50a8041 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Wed, 15 Mar 2017 17:43:49 +0200 Subject: [PATCH 2/9] Changed: replace c++11 code --HG-- branch : develop --- code/ryzom/client/src/interface_v3/chat_text_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 5195d0b51..e21872018 100644 --- a/code/ryzom/client/src/interface_v3/chat_text_manager.cpp +++ b/code/ryzom/client/src/interface_v3/chat_text_manager.cpp @@ -187,8 +187,8 @@ static inline bool isUrlTag(const ucstring &s, ucstring::size_type index, ucstri if (isUrl && i > 0 && !markdown) { // '}' is in the list because of color tags, ie "@{FFFF}http://..." - const ucchar chars[] = {' ', '"', '\'', '(', '[', '}'}; - isUrl = std::find(std::begin(chars), std::end(chars), s[i - 1]) != std::end(chars); + const vector chars {' ', '"', '\'', '(', '[', '}'}; + isUrl = std::find(chars.begin(), chars.end(), s[i - 1]) != chars.end(); } return isUrl; } From c247b43a9bdb6900132341bf6e666a97ebc05d58 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sat, 18 Mar 2017 14:55:15 +0200 Subject: [PATCH 3/9] Changed: Fix ingame keys list --HG-- branch : develop --- code/ryzom/client/data/gamedev/interfaces_v3/macros.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/macros.xml b/code/ryzom/client/data/gamedev/interfaces_v3/macros.xml index 5dc1142bf..8c2eb9f82 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/macros.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/macros.xml @@ -200,7 +200,7 @@ - + From 2eab03328386830633c913886f2aa8eca0f5a758 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sat, 25 Mar 2017 15:00:43 +0200 Subject: [PATCH 4/9] Fixed: Music player loading non-existing files into playlist. --HG-- branch : develop --- code/ryzom/client/src/interface_v3/music_player.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/ryzom/client/src/interface_v3/music_player.cpp b/code/ryzom/client/src/interface_v3/music_player.cpp index 6088a3e52..b9cadad5c 100644 --- a/code/ryzom/client/src/interface_v3/music_player.cpp +++ b/code/ryzom/client/src/interface_v3/music_player.cpp @@ -353,6 +353,11 @@ public: continue; } + if (!CFile::fileExists(filenames[i])) { + nlwarning("Ignore non-existing file '%s'", filenames[i].c_str()); + continue; + } + CMusicPlayer::CSongs song; song.Filename = filenames[i]; SoundMngr->getMixer()->getSongTitle(filenames[i], song.Title, song.Length); From 4c6f79ed22715ab4e5e980281b23fd264d2bb7ae Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 27 Mar 2017 17:35:20 +0300 Subject: [PATCH 5/9] Fixed: missing stdpch.h (fixes #303) --HG-- branch : develop --- code/ryzom/client/src/item_group_manager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/ryzom/client/src/item_group_manager.cpp b/code/ryzom/client/src/item_group_manager.cpp index 14ea4aceb..12486666a 100644 --- a/code/ryzom/client/src/item_group_manager.cpp +++ b/code/ryzom/client/src/item_group_manager.cpp @@ -13,6 +13,9 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . + +#include "stdpch.h" + #include "item_group_manager.h" #include "interface_v3/inventory_manager.h" #include "nel/gui/widget_manager.h" From 0236b3e4a45b8908f0d06c55ec8a6918d0d3babc Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 27 Mar 2017 18:08:43 +0300 Subject: [PATCH 6/9] Fixed: compiling server (fixes #303) --HG-- branch : develop --- code/ryzom/server/src/logger_service/log_query.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/ryzom/server/src/logger_service/log_query.h b/code/ryzom/server/src/logger_service/log_query.h index 5c2d6d460..bb0e99315 100644 --- a/code/ryzom/server/src/logger_service/log_query.h +++ b/code/ryzom/server/src/logger_service/log_query.h @@ -22,6 +22,7 @@ #include #include +#include #include "nel/misc/common.h" @@ -61,7 +62,7 @@ struct TTimeSlice uint32 EndDate; }; -const TTimeSlice FullTimeSlice = {0, ~0}; +const TTimeSlice FullTimeSlice = {0, std::numeric_limits::max()}; /// Defile the complete selected time line typedef std::vector TTimeLine; From b446df86f0b50003b46262d40284f995efefcbfb Mon Sep 17 00:00:00 2001 From: Nimetu Date: Fri, 31 Mar 2017 20:43:43 +0300 Subject: [PATCH 7/9] Changed: Remove dead code --HG-- branch : develop --- .../src/interface_v3/action_handler_item.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/action_handler_item.cpp b/code/ryzom/client/src/interface_v3/action_handler_item.cpp index 371316882..e8c07f837 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_item.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_item.cpp @@ -2322,14 +2322,8 @@ REGISTER_ACTION_HANDLER( CHandlerRingXpCatalyserStopUse, "ring_xp_catalyser_stop // item groups class CHandlerItemGroupMove : public IActionHandler { - void execute (CCtrlBase *caller, const std::string &sParams) + void execute (CCtrlBase * /* pCaller */, const std::string &sParams) { - CDBCtrlSheet* pCS = dynamic_cast(caller); - if(!pCS) - { - nlinfo("Wrong cast"); - return; - } std::string destination = getParam(sParams, "destination"); std::string name = getParam(sParams, "name"); if(name.empty()) @@ -2347,14 +2341,8 @@ REGISTER_ACTION_HANDLER(CHandlerItemGroupMove, "item_group_move"); // *************************************************************************** class CHandlerItemGroupEquip : public IActionHandler { - void execute (CCtrlBase *caller, const std::string & sParams) + void execute (CCtrlBase * /* pCaller */, const std::string & sParams) { - CDBCtrlSheet* pCS = dynamic_cast(caller); - if(!pCS) - { - nlinfo("Wrong cast"); - return; - } std::string name = getParam(sParams, "name"); if(name.empty()) { From 87b0a85fe66d304b1c6bc7a6b128013065db1913 Mon Sep 17 00:00:00 2001 From: Guillaume Dupuy Date: Mon, 3 Apr 2017 01:34:29 +0200 Subject: [PATCH 8/9] Minor item group fixes : * Slot properly saved for right/left hand (couldn't equip 1H sword + dagger before) * Ingame macro edition for item group * Use the correct index (db index and not item list index) to autoEquip an item * non ascii characters (accentued characters and stuff like that) are now correctly displayed in interface / commands output --HG-- branch : develop --- .../data/gamedev/interfaces_v3/actions.xml | 15 +++++++ code/ryzom/client/src/commands.cpp | 40 +++++++++++++++---- .../src/interface_v3/action_handler_item.cpp | 5 ++- code/ryzom/client/src/item_group_manager.cpp | 20 ++++++++-- 4 files changed, 67 insertions(+), 13 deletions(-) diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/actions.xml b/code/ryzom/client/data/gamedev/interfaces_v3/actions.xml index 8696de32a..d628a6996 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/actions.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/actions.xml @@ -220,6 +220,21 @@ + + + + + + + + + + + + + + + diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index 978cc144a..8ba5f769f 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -233,14 +233,20 @@ NLMISC_COMMAND(equipGroup, "equip group ", "name") if(CItemGroupManager::getInstance()->equipGroup(args[0])) { ucstring msg = CI18N::get("cmdEquipGroupSuccess"); - strFindReplace(msg, "%name", args[0]); + //Use ucstring because group name can contain accentued characters (and stuff like that) + ucstring nameUC; + nameUC.fromUtf8(args[0]); + strFindReplace(msg, "%name", nameUC); pIM->displaySystemInfo(msg); return true; } else { ucstring msg = CI18N::get("cmdEquipGroupError"); - strFindReplace(msg, "%name", args[0]); + //Use ucstring because group name can contain accentued characters (and stuff like that) + ucstring nameUC; + nameUC.fromUtf8(args[0]); + strFindReplace(msg, "%name", nameUC); pIM->displaySystemInfo(msg); return false; } @@ -261,7 +267,10 @@ NLMISC_COMMAND(moveGroup, "move group to ", "name dst") if(CItemGroupManager::getInstance()->moveGroup(args[0], INVENTORIES::toInventory(args[1]))) { ucstring msg = CI18N::get("cmdMoveGroupSuccess"); - strFindReplace(msg, "%name", args[0]); + //Use ucstring because group name can contain accentued characters (and stuff like that) + ucstring nameUC; + nameUC.fromUtf8(args[0]); + strFindReplace(msg, "%name", nameUC); strFindReplace(msg, "%inventory", args[1]); pIM->displaySystemInfo(msg); return true; @@ -269,7 +278,10 @@ NLMISC_COMMAND(moveGroup, "move group to ", "name dst") else { ucstring msg = CI18N::get("cmdMoveGroupError"); - strFindReplace(msg, "%name", args[0]); + //Use ucstring because group name can contain accentued characters (and stuff like that) + ucstring nameUC; + nameUC.fromUtf8(args[0]); + strFindReplace(msg, "%name", nameUC); strFindReplace(msg, "%inventory", args[1]); pIM->displaySystemInfo(msg); return false; @@ -297,14 +309,20 @@ NLMISC_COMMAND(createGroup, "create group [true](create a for ev msg = CI18N::get("cmdCreateGroupSuccess2"); else msg = CI18N::get("cmdCreateGroupSuccess1"); - strFindReplace(msg, "%name", args[0]); + //Use ucstring because group name can contain accentued characters (and stuff like that) + ucstring nameUC; + nameUC.fromUtf8(args[0]); + strFindReplace(msg, "%name", nameUC); pIM->displaySystemInfo(msg); return true; } else { ucstring msg = CI18N::get("cmdCreateGroupError"); - strFindReplace(msg, "%name", args[0]); + //Use ucstring because group name can contain accentued characters (and stuff like that) + ucstring nameUC; + nameUC.fromUtf8(args[0]); + strFindReplace(msg, "%name", nameUC); pIM->displaySystemInfo(msg); return false; } @@ -325,14 +343,20 @@ NLMISC_COMMAND(deleteGroup, "delete group ", "name") if(CItemGroupManager::getInstance()->deleteGroup(args[0])) { ucstring msg = CI18N::get("cmdDeleteGroupSuccess"); - strFindReplace(msg, "%name", args[0]); + //Use ucstring because group name can contain accentued characters (and stuff like that) + ucstring nameUC; + nameUC.fromUtf8(args[0]); + strFindReplace(msg, "%name", nameUC); pIM->displaySystemInfo(msg); return true; } else { ucstring msg = CI18N::get("cmdDeleteGroupError"); - strFindReplace(msg, "%name", args[0]); + //Use ucstring because group name can contain accentued characters (and stuff like that) + ucstring nameUC; + nameUC.fromUtf8(args[0]); + strFindReplace(msg, "%name", nameUC); pIM->displaySystemInfo(msg); return false; } diff --git a/code/ryzom/client/src/interface_v3/action_handler_item.cpp b/code/ryzom/client/src/interface_v3/action_handler_item.cpp index e8c07f837..d15ae130c 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_item.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_item.cpp @@ -2041,7 +2041,10 @@ class CHandlerItemMenuCheck : public IActionHandler { std::string name = groupNames[i]; std::string ahParams = "name=" + name; - pGroupMenu->addLine(ucstring(name), "", "", name); + //Use ucstring because group name can contain accentued characters (and stuff like that) + ucstring nameUC; + nameUC.fromUtf8(name); + pGroupMenu->addLine(nameUC, "", "", name); CGroupSubMenu* pNewSubMenu = new CGroupSubMenu(CViewBase::TCtorParam()); pGroupMenu->setSubMenu(pGroupMenu->getNumLine()-1, pNewSubMenu); if(pNewSubMenu) diff --git a/code/ryzom/client/src/item_group_manager.cpp b/code/ryzom/client/src/item_group_manager.cpp index 12486666a..90b8424a6 100644 --- a/code/ryzom/client/src/item_group_manager.cpp +++ b/code/ryzom/client/src/item_group_manager.cpp @@ -492,8 +492,10 @@ bool CItemGroupManager::createGroup(std::string name, bool removeUnequiped) { SLOT_EQUIPMENT::TSlotEquipment slot = (SLOT_EQUIPMENT::TSlotEquipment)i; //Instead of doing two separate for, just be a bit tricky for hand equipment - if(slot == SLOT_EQUIPMENT::HANDR || slot == SLOT_EQUIPMENT::HANDL) - pCS = CInventoryManager::getInstance()->getHandSheet((uint32)(slot - SLOT_EQUIPMENT::HANDL)); + if(slot == SLOT_EQUIPMENT::HANDR) + pCS = CInventoryManager::getInstance()->getHandSheet(0); + else if(slot == SLOT_EQUIPMENT::HANDL) + pCS = CInventoryManager::getInstance()->getHandSheet(1); else pCS = CInventoryManager::getInstance()->getEquipSheet(i); if(!pCS) continue; @@ -537,7 +539,10 @@ void CItemGroupManager::listGroup() { CItemGroup group = _Groups[i]; ucstring msg = NLMISC::CI18N::get("cmdListGroupLine"); - NLMISC::strFindReplace(msg, "%name", group.name); + //Use ucstring because group name can contain accentued characters (and stuff like that) + ucstring nameUC; + nameUC.fromUtf8(group.name); + NLMISC::strFindReplace(msg, "%name", nameUC); NLMISC::strFindReplace(msg, "%size", NLMISC::toString(group.Items.size())); pIM->displaySystemInfo(msg); } @@ -607,7 +612,14 @@ std::vector CItemGroupManager::matchingItems(CItemGroup *group, SLOT_EQUIPMENT::TSlotEquipment slot; if(group->contains(pCS, slot)) { - out.push_back(CInventoryItem(pCS, inventory, i, slot)); + //Sometimes, index in the list differ from the index in DB, and we need the index in DB, not the one from the list + std::string dbPath = pCS->getSheet(); + std::size_t found = dbPath.find_last_of(":"); + std::string indexS = dbPath.substr(found+1); + uint32 index; + NLMISC::fromString(indexS, index); + if(i != index) nldebug("Index from list is %d, where index from DB is %d", i, index); + out.push_back(CInventoryItem(pCS, inventory, index, slot)); } } From cf3cf69c3914ac9e7e08e9212a9b8caa7e3ca479 Mon Sep 17 00:00:00 2001 From: Guillaume Dupuy Date: Mon, 3 Apr 2017 01:43:26 +0200 Subject: [PATCH 9/9] Don't fake invalid action if there is nothing to fake (no item equiped) --HG-- branch : develop --- code/ryzom/client/src/item_group_manager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/src/item_group_manager.cpp b/code/ryzom/client/src/item_group_manager.cpp index 90b8424a6..6584060ff 100644 --- a/code/ryzom/client/src/item_group_manager.cpp +++ b/code/ryzom/client/src/item_group_manager.cpp @@ -476,7 +476,8 @@ bool CItemGroupManager::equipGroup(std::string name, bool pullBefore) } // For some reason, there is no (visual) invalidation (server still blocks any action), force one // Unfortunately, there is no clean way to do this, so we'll simulate one - fakeInvalidActions((NLMISC::TGameCycle)maxEquipTime); + if(maxEquipTime > 0) + fakeInvalidActions((NLMISC::TGameCycle)maxEquipTime); return true; }