From f84b7f781a50bf7db37b32e0f836ad912c0672fa Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 16 Jan 2016 19:37:28 +0100 Subject: [PATCH 1/8] Fixed: Travis-ci config syntax --HG-- branch : develop --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7de399206..7bee7dd53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,9 @@ script: - cmake --build build -- -j 2 notifications: - irc: "chat.freenode.net#ryzom" + irc: + channels: + - "chat.freenode.net#ryzom" template: - "%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}" - "Description : %{commit_message}" From f068c6ff661c8b69f6de7c055c7298678faced1c Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 16 Jan 2016 20:56:00 +0100 Subject: [PATCH 2/8] Fixed: Removed tab --HG-- branch : develop --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7bee7dd53..70030c877 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ script: notifications: irc: channels: - - "chat.freenode.net#ryzom" + - "chat.freenode.net#ryzom" template: - "%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}" - "Description : %{commit_message}" From b3cfd5f6bbb17a1477716b0bf156d2cae27117d5 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 16 Jan 2016 21:35:34 +0100 Subject: [PATCH 3/8] Fixed: Use lua_tointeger under Lua 5.2 and prior versions --HG-- branch : develop --- code/nel/include/nel/gui/lua_helper_inline.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/nel/include/nel/gui/lua_helper_inline.h b/code/nel/include/nel/gui/lua_helper_inline.h index df75e6b5b..1d6b4864a 100644 --- a/code/nel/include/nel/gui/lua_helper_inline.h +++ b/code/nel/include/nel/gui/lua_helper_inline.h @@ -253,7 +253,9 @@ inline lua_Integer CLuaState::toInteger(int index) { //H_AUTO(Lua_CLuaState_toInteger) checkIndex(index); +#if LUA_VERSION_NUM >= 503 sint isnum = 0; + // lua_tointeger fails with decimal numbers under Lua 5.3 lua_Integer res = lua_tointegerx(_State, index, &isnum); if (!isnum) { @@ -262,6 +264,9 @@ inline lua_Integer CLuaState::toInteger(int index) res = (lua_Integer)d; } return res; +#else + return lua_tointeger(_State, index); +#endif } //================================================================================ From 06eb63183ec1d6845d2559b6e75402ed44384d95 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 16 Jan 2016 23:47:12 +0100 Subject: [PATCH 4/8] Added: Config file for translation_tools --HG-- branch : develop --- .../translation_tools/translation_tools.cfg | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 code/ryzom/tools/translation_tools/translation_tools.cfg diff --git a/code/ryzom/tools/translation_tools/translation_tools.cfg b/code/ryzom/tools/translation_tools/translation_tools.cfg new file mode 100644 index 000000000..1e0d338a8 --- /dev/null +++ b/code/ryzom/tools/translation_tools/translation_tools.cfg @@ -0,0 +1,59 @@ +// This cfg is used for bot names extraction + + +// This paths are recursives +Paths = +{ + // word editor class config file are here + "$RYZOM_LEVELDESIGN/leveldesign/world_editor_files", + // all the primitives we want to parse are here + "$RYZOM_LEVELDESIGN/primitives" +}; + +// This paths are non recursives +PathsNoRecurse = +{ + // allow the prog to load the sheet_id.bin file. + "$RYZOM_LEVELDESIGN/leveldesign/Game_elem", + // path for world_editor_class.xml + "$RYZOM_LEVELDESIGN/leveldesign/world_editor_files", +}; + +LeveldesignDataPath = "$RYZOM_LEVELDESIGN"; + +// This paths are recursive and parsed only if the creature data packed sheet is not found (this take time) +GeorgesPaths = +{ + // the DFNs + "$RYZOM_LEVELDESIGN/leveldesign/DFN", + // All the creature and npc sheets + "$RYZOM_LEVELDESIGN/leveldesign/Game_elem/creature" +}; + +// The filters, if the fullpath to a file contains a part of this filter, it is rejected +Filters = +{ + // we don't want backuped primitives ! + "backup_old", + // nor the test primitives ! + "test_", + +/* "botobject", + "deposit", + "dynfauna", + "dynnpc", + "invasion", + "staticfauna", + "task" +*/ +}; + +// This is the name of the world_editor_classes.xml file. +LigoClassFile = "world_editor_classes.xml"; + +// Path to the working bot name file +WorkBotNamesFile = "work/bot_names.txt"; +// Path to the translated bot names file +TransBotNamesFile = "translated/bot_names.txt"; +// Path to the work title file +WorkTitleFile = "work/title_words_wk.txt"; From 5b3e181227aa11173b72f3875923192f0f9ce0ad Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 16 Jan 2016 23:47:58 +0100 Subject: [PATCH 5/8] Changed: Minor changes --HG-- branch : develop --- code/ryzom/client/src/browse_faq.cpp | 1 + .../extract_new_sheet_names.cpp | 46 +++++++++---------- 2 files changed, 22 insertions(+), 25 deletions(-) diff --git a/code/ryzom/client/src/browse_faq.cpp b/code/ryzom/client/src/browse_faq.cpp index 3899a2960..cdf830fe8 100644 --- a/code/ryzom/client/src/browse_faq.cpp +++ b/code/ryzom/client/src/browse_faq.cpp @@ -52,6 +52,7 @@ void browseFAQ(NLMISC::CConfigFile &cf) } } } + if (url.empty()) { // not found diff --git a/code/ryzom/tools/translation_tools/extract_new_sheet_names.cpp b/code/ryzom/tools/translation_tools/extract_new_sheet_names.cpp index 70d01c93f..d230034b5 100644 --- a/code/ryzom/tools/translation_tools/extract_new_sheet_names.cpp +++ b/code/ryzom/tools/translation_tools/extract_new_sheet_names.cpp @@ -59,19 +59,19 @@ struct CSheetWordListBuilder : public IWordListBuilder virtual bool buildWordList(std::vector &allWords, string workSheetFileName) { SheetExt= toLower(SheetExt); - + // verify the directory is correct if(!CFile::isDirectory(SheetPath)) { nlwarning("Error: Directory '%s' not found. '%s' Aborted", SheetPath.c_str(), workSheetFileName.c_str()); return false; } - + // list all files. std::vector allFiles; allFiles.reserve(100000); CPath::getPathContent(SheetPath, true, false, true, allFiles, NULL); - + // Keep only the extension we want, and remove "_" (parent) allWords.clear(); allWords.reserve(allFiles.size()); @@ -91,7 +91,7 @@ struct CSheetWordListBuilder : public IWordListBuilder return true; } - + }; @@ -103,7 +103,7 @@ struct CRegionPrimWordListBuilder : public IWordListBuilder { string PrimPath; vector PrimFilter; - + virtual bool buildWordList(std::vector &allWords, string workSheetFileName) { // verify the directory is correct @@ -112,12 +112,12 @@ struct CRegionPrimWordListBuilder : public IWordListBuilder nlwarning("Error: Directory '%s' not found. '%s' Aborted", PrimPath.c_str(), workSheetFileName.c_str()); return false; } - + // list all files. std::vector allFiles; allFiles.reserve(100000); CPath::getPathContent(PrimPath, true, false, true, allFiles, NULL); - + // parse all primitive that match the filter allWords.clear(); allWords.reserve(100000); @@ -146,11 +146,11 @@ struct CRegionPrimWordListBuilder : public IWordListBuilder return false; } CPrimitiveContext::instance().CurrentPrimitive = NULL; - + // For all primitives of interest - const char *listClass[]= {"continent", "region", "place", "stable", + const char *listClass[]= {"continent", "region", "place", "stable", "teleport_destination", "room_template"}; - const char *listProp[]= {"name", "name", "name", "name", + const char *listProp[]= {"name", "name", "name", "name", "place_name", "place_name"}; const uint numListClass= sizeof(listClass)/sizeof(listClass[0]); const uint numListProp= sizeof(listProp)/sizeof(listProp[0]); @@ -178,7 +178,7 @@ struct CRegionPrimWordListBuilder : public IWordListBuilder } } } - + return true; } }; @@ -199,7 +199,7 @@ void extractNewWords(string workSheetFileName, string columnId, IWordListBuilder } // get the key column index uint keyColIndex = 0; - + if(!workSheet.findCol(columnId, keyColIndex)) { nlwarning("Error: Don't find the column '%s'. '%s' Aborted", columnId.c_str(), workSheetFileName.c_str()); @@ -220,7 +220,7 @@ void extractNewWords(string workSheetFileName, string columnId, IWordListBuilder ucstring key= workSheetLwr.getData(i, keyColIndex); workSheetLwr.setData(i, keyColIndex, toLower(key)); } - + // **** List all words with the builder given std::vector allWords; @@ -247,7 +247,7 @@ void extractNewWords(string workSheetFileName, string columnId, IWordListBuilder workSheet.resize(workSheet.size()+1); workSheet.setData(rowIdx, keyColIndex, keyName); workSheet.setData(rowIdx, nameColIndex, string("")+keyName); - + nbAdd++; } } @@ -284,7 +284,7 @@ void extractNewWords(string workSheetFileName, string columnId, IWordListBuilder { nbRemove++; // log - NLMISC::InfoLog->displayRawNL("'%s': '%s' entry erased at line '%d'.", workSheetFileName.c_str(), + NLMISC::InfoLog->displayRawNL("'%s': '%s' entry erased at line '%d'.", workSheetFileName.c_str(), keyStr.c_str(), i); } } @@ -343,12 +343,12 @@ int extractNewSheetNames(int argc, char *argv[]) return -1; } } - + // **** avoid some flood NLMISC::createDebug(); NLMISC::DebugLog->addNegativeFilter("numCol changed to"); NLMISC::InfoLog->addNegativeFilter("CPath::addSearchPath"); - + // **** read the configuration file CConfigFile cf; @@ -375,14 +375,12 @@ int extractNewSheetNames(int argc, char *argv[]) LigoConfig.readPrimitiveClass(ligoPath.c_str(), false); NLLIGO::Register(); CPrimitiveContext::instance().CurrentLigoConfig = &LigoConfig; - - - + // **** Parse all the different type of sheets const char *sheetDefs[]= { - // 1st is the name of the worksheet file. - // 2nd is the Key column identifier. + // 1st is the name of the worksheet file. + // 2nd is the Key column identifier. // 3rd is the sheet extension // 4th is the directory where to find new sheets "work/item_words_wk.txt", "item ID", "sitem", "leveldesign/game_element/sitem", @@ -391,7 +389,7 @@ int extractNewSheetNames(int argc, char *argv[]) "work/sphrase_words_wk.txt", "sphrase ID", "sphrase", "leveldesign/game_element/sphrase", }; uint numSheetDefs= sizeof(sheetDefs) / (4*sizeof(sheetDefs[0])); - + // For all different type of sheet for(uint i=0;i Date: Sat, 16 Jan 2016 23:48:32 +0100 Subject: [PATCH 6/8] Changed: Set CMP0020 NEW in root project --HG-- branch : develop --- code/CMakeLists.txt | 5 +++++ code/nel/tools/3d/panoply_preview/CMakeLists.txt | 1 - code/nel/tools/3d/shared_widgets/CMakeLists.txt | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 08ab7729b..f4f6928ae 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -31,6 +31,11 @@ IF(COMMAND cmake_policy) # Works around warnings about escaped quotes in ADD_DEFINITIONS # statements cmake_policy(SET CMP0005 OLD) + + # allow to link to qtmain automatically under Windows + IF(POLICY CMP0020) + CMAKE_POLICY(SET CMP0020 NEW) + ENDIF() ENDIF(COMMAND cmake_policy) INCLUDE(nel) diff --git a/code/nel/tools/3d/panoply_preview/CMakeLists.txt b/code/nel/tools/3d/panoply_preview/CMakeLists.txt index 6d1cbd354..4f96eeea3 100644 --- a/code/nel/tools/3d/panoply_preview/CMakeLists.txt +++ b/code/nel/tools/3d/panoply_preview/CMakeLists.txt @@ -15,7 +15,6 @@ SET(CMAKE_AUTOMOC ON) QT5_ADD_RESOURCES(RESOURCE_ADDED ${RESOURCES}) -CMAKE_POLICY(SET CMP0020 NEW) ADD_EXECUTABLE(nl_panoply_preview WIN32 ${SRC} ${SRCS} ${HDRS} diff --git a/code/nel/tools/3d/shared_widgets/CMakeLists.txt b/code/nel/tools/3d/shared_widgets/CMakeLists.txt index 153995dd2..4208988ec 100644 --- a/code/nel/tools/3d/shared_widgets/CMakeLists.txt +++ b/code/nel/tools/3d/shared_widgets/CMakeLists.txt @@ -11,7 +11,6 @@ SET(CMAKE_AUTOMOC ON) QT5_ADD_RESOURCES(RESOURCE_ADDED ${RESOURCES}) -CMAKE_POLICY(SET CMP0020 NEW) NL_TARGET_LIB(shared_widgets ${SRCS} ${HDRS} ${RSRC} ${RESOURCE_ADDED}) TARGET_LINK_LIBRARIES(shared_widgets nelmisc nel3d Qt5::Widgets) From c5fbf56984c7623705507e5473c71ce836a65186 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 16 Jan 2016 23:48:44 +0100 Subject: [PATCH 7/8] Fixed: Missing ++ --HG-- branch : develop --- code/nel/src/misc/cmd_args.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/src/misc/cmd_args.cpp b/code/nel/src/misc/cmd_args.cpp index 82863ba1b..bbdee0e11 100644 --- a/code/nel/src/misc/cmd_args.cpp +++ b/code/nel/src/misc/cmd_args.cpp @@ -70,7 +70,7 @@ void CCmdArgs::addArg(const std::string &helpName, const std::string &helpDescri bool CCmdArgs::haveArg(const std::string &argName) const { // process each argument - for(uint i = 0; i < _Args.size(); i) + for(uint i = 0; i < _Args.size(); ++i) { const TArg &arg = _Args[i]; From 0be5356f7883ef3ec0c5694c2aa03517d6bc256c Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 16 Jan 2016 23:49:39 +0100 Subject: [PATCH 8/8] Fixed: Right directories --HG-- branch : develop --- .../tools/translation_tools/extract_new_sheet_names.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/ryzom/tools/translation_tools/extract_new_sheet_names.cpp b/code/ryzom/tools/translation_tools/extract_new_sheet_names.cpp index d230034b5..791f51b77 100644 --- a/code/ryzom/tools/translation_tools/extract_new_sheet_names.cpp +++ b/code/ryzom/tools/translation_tools/extract_new_sheet_names.cpp @@ -368,8 +368,8 @@ int extractNewSheetNames(int argc, char *argv[]) CPath::addSearchPath(NLMISC::expandEnvironmentVariables(pathNoRecurse.asString(i)), false, false); } - std::string leveldesignDataPath = NLMISC::expandEnvironmentVariables(leveldesignDataPathVar.asString()); - + std::string leveldesignDataPath = CPath::standardizePath(NLMISC::expandEnvironmentVariables(leveldesignDataPathVar.asString())); + // init ligo config once string ligoPath = CPath::lookup(NLMISC::expandEnvironmentVariables(ligoClassFile.asString()), true, true); LigoConfig.readPrimitiveClass(ligoPath.c_str(), false); @@ -395,7 +395,7 @@ int extractNewSheetNames(int argc, char *argv[]) { CSheetWordListBuilder builder; builder.SheetExt= sheetDefs[i*4+2]; - builder.SheetPath= CPath::standardizePath(leveldesignDataPath) + sheetDefs[i*4+3]; + builder.SheetPath= leveldesignDataPath + sheetDefs[i*4+3]; extractNewWords(sheetDefs[i*4+0], sheetDefs[i*4+1], builder); } @@ -403,7 +403,7 @@ int extractNewSheetNames(int argc, char *argv[]) { // build place names CRegionPrimWordListBuilder builder; - builder.PrimPath= leveldesignDataPath; + builder.PrimPath= leveldesignDataPath + "primitives"; builder.PrimFilter.push_back("region_*.primitive"); builder.PrimFilter.push_back("indoors_*.primitive"); extractNewWords("work/place_words_wk.txt", "placeId", builder);