From 390d987557e57be8d8bc95edd499d5309be73306 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:22:10 +0200 Subject: [PATCH 01/39] Fixed: Variable "success" uninitialized if HTML content is empty --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 479f28738..19b82f169 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -4218,6 +4218,8 @@ namespace NLGUI removeContent(); endBuild(); + + success = false; } else { From ca75cc4deabc81fd0e9dc436b61ec58939b1994b Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:26:09 +0200 Subject: [PATCH 02/39] Fixed: Variable "fx" uninitialized if _Lines is empty --HG-- branch : develop --- code/nel/src/gui/view_text.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp index 8458def52..e773a6cb1 100644 --- a/code/nel/src/gui/view_text.cpp +++ b/code/nel/src/gui/view_text.cpp @@ -2405,6 +2405,7 @@ namespace NLGUI if (_Lines.empty()) { x = 0; + fx = 0; } else { From a8097f47d470fe9f7b21f96a432caf3f9312b236 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:28:34 +0200 Subject: [PATCH 03/39] Changed: Replace spaces by tabs --HG-- branch : develop --- code/nel/src/gui/view_text.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp index e773a6cb1..9efd2074d 100644 --- a/code/nel/src/gui/view_text.cpp +++ b/code/nel/src/gui/view_text.cpp @@ -850,10 +850,10 @@ namespace NLGUI prop = (char*) xmlGetProp( cur, (xmlChar*)"justification" ); if (prop) { - if (nlstricmp("clip_word", (const char *) prop) == 0) _TextMode = ClipWord; - else if (nlstricmp("dont_clip_word", (const char *) prop) == 0) _TextMode = DontClipWord; - else if (nlstricmp("justified", (const char *) prop) == 0) _TextMode = Justified; - else if (nlstricmp("centered", (const char *) prop) == 0) _TextMode = Centered; + if (nlstricmp("clip_word", (const char *) prop) == 0) _TextMode = ClipWord; + else if (nlstricmp("dont_clip_word", (const char *) prop) == 0) _TextMode = DontClipWord; + else if (nlstricmp("justified", (const char *) prop) == 0) _TextMode = Justified; + else if (nlstricmp("centered", (const char *) prop) == 0) _TextMode = Centered; else nlwarning(" bad text mode"); } @@ -1094,11 +1094,12 @@ namespace NLGUI else mouseIn= isIn(x,y); // if the mouse cursor is in the clip area - if(mouseIn) { - rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, _WReal, 1, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); - rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal+_HReal, _WReal, 1, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); - rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, 1, _HReal, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); - rVR.drawRotFlipBitmap (_RenderLayer, _XReal+_WReal, _YReal, 1, _HReal, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); + if(mouseIn) + { + rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, _WReal, 1, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); + rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal+_HReal, _WReal, 1, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); + rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, 1, _HReal, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); + rVR.drawRotFlipBitmap (_RenderLayer, _XReal+_WReal, _YReal, 1, _HReal, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); } } #endif @@ -1111,7 +1112,7 @@ namespace NLGUI return; // hack: allow shadow to overflow outside parent box. - // In CGroupHTML context, clip is set for row + // In CGroupHTML context, clip is set for row if (std::abs(_ShadowX) > 0) { ClipX -= 3; @@ -2373,7 +2374,7 @@ namespace NLGUI } // *************************************************************************** - void CViewText::setColorRGBA(NLMISC::CRGBA col) + void CViewText::setColorRGBA(NLMISC::CRGBA col) { _Color = col; } @@ -2405,7 +2406,7 @@ namespace NLGUI if (_Lines.empty()) { x = 0; - fx = 0; + fx = 0; } else { @@ -2543,7 +2544,7 @@ namespace NLGUI TextContext->setOblique (_Oblique); // find the line where the character is // CViewRenderer &rVR = *CViewRenderer::getInstance(); - uint charPos = 0; + uint charPos = 0; if (_MultiLine) { y -= getMultiMinOffsetY() * _Scale; From f190869d59013d745a8019db3d6d26688dafd3f1 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:40:24 +0200 Subject: [PATCH 04/39] Fixed: Support for VC++ 2019 (don't use registry anymore but CMAKE_CXX_COMPILER instead) --HG-- branch : develop --- code/CMakeModules/FindMSVC.cmake | 169 ++++++++----------------- code/CMakeModules/FindWindowsSDK.cmake | 23 +++- 2 files changed, 71 insertions(+), 121 deletions(-) diff --git a/code/CMakeModules/FindMSVC.cmake b/code/CMakeModules/FindMSVC.cmake index 5dbc4f6a8..2a08a08bb 100644 --- a/code/CMakeModules/FindMSVC.cmake +++ b/code/CMakeModules/FindMSVC.cmake @@ -1,89 +1,55 @@ # - Find MS Visual C++ # +# VC_DIR - where to find Visual C++ # VC_INCLUDE_DIR - where to find headers # VC_INCLUDE_DIRS - where to find headers # VC_LIBRARY_DIR - where to find libraries -# VC_FOUND - True if MSVC found. - -MACRO(ADD_TRAILING_SLASH _FILENAME_VAR) - # put content in a new variable - SET(_FILENAME ${${_FILENAME_VAR}}) - # get length of the string - STRING(LENGTH ${_FILENAME} _LEN) - # convert length to last pos - MATH(EXPR _POS "${_LEN}-1") - # get last character of the string - STRING(SUBSTRING ${_FILENAME} ${_POS} 1 _FILENAME_END) - # compare it with a slash - IF(NOT _FILENAME_END STREQUAL "/") - # not a slash, append it - SET(${_FILENAME_VAR} "${_FILENAME}/") - ELSE() - # already a slash - ENDIF() -ENDMACRO() - -MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION) - # Software/Wow6432Node/... - GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;${_VERSION}]" ABSOLUTE) - - IF(VC${_VERSION}_DIR AND VC${_VERSION}_DIR STREQUAL "/registry") - SET(VC${_VERSION}_DIR) - GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;${_VERSION}]" ABSOLUTE) - - IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") - # be sure it's finishing by a / - ADD_TRAILING_SLASH(VC${_VERSION}_DIR) - - SET(VC${_VERSION}_DIR "${VC${_VERSION}_DIR}VC/") - ENDIF() - ENDIF() +# VC_FOUND - True if MSVC found + +IF(CMAKE_CXX_COMPILER) + SET(_COMPILER ${CMAKE_CXX_COMPILER}) + SET(_VERSION ${CMAKE_CXX_COMPILER_VERSION}) +ELSEIF(CMAKE_C_COMPILER) + SET(_COMPILER ${CMAKE_C_COMPILER}) + SET(_VERSION ${CMAKE_C_COMPILER_VERSION}) +ELSE() + MESSAGE(FATAL_ERROR "No way to determine Visual C++ location") +ENDIF() - IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") - SET(VC${_VERSION}_FOUND ON) - DETECT_EXPRESS_VERSION(${_VERSION}) - IF(NOT MSVC_FIND_QUIETLY) - SET(_VERSION_STR ${_VERSION}) - IF(MSVC_EXPRESS) - SET(_VERSION_STR "${_VERSION_STR} Express") - ENDIF() - MESSAGE(STATUS "Found Visual C++ ${_VERSION_STR} in ${VC${_VERSION}_DIR}") - ENDIF() - ELSEIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") - SET(VC${_VERSION}_FOUND OFF) - SET(VC${_VERSION}_DIR "") +IF(MSVC_VERSION LESS 1910) + IF(MSVC_VERSION LESS 1500) + MESSAGE(FATAL_ERROR "Unsupported version of Visual C++ (minimum version is 2008)") + ELSEIF(MSVC_VERSION LESS 1600) + SET(MSVC_TOOLSET "90") + SET(_NAME "2008") + ELSEIF(MSVC_VERSION LESS 1700) + SET(MSVC_TOOLSET "100") + SET(_NAME "2010") + ELSEIF(MSVC_VERSION LESS 1800) + SET(MSVC_TOOLSET "110") + SET(_NAME "2012") + ELSEIF(MSVC_VERSION LESS 1900) + SET(MSVC_TOOLSET "120") + SET(_NAME "2013") + ELSE() + SET(MSVC_TOOLSET "140") + SET(_NAME "2015") ENDIF() -ENDMACRO() - -MACRO(DETECT_VC_VERSION _VERSION) - IF(NOT VC_FOUND) - SET(VC${_VERSION}_FOUND OFF) - DETECT_VC_VERSION_HELPER("HKEY_CURRENT_USER" ${_VERSION}) - IF(NOT VC${_VERSION}_FOUND) - DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION}) - ENDIF() + STRING(REGEX REPLACE "/bin/.+" "" VC_DIR ${_COMPILER}) - IF(VC${_VERSION}_FOUND) - SET(VC_FOUND ON) - SET(VC_DIR "${VC${_VERSION}_DIR}") - ENDIF() - ENDIF() -ENDMACRO() - -MACRO(DETECT_EXPRESS_VERSION _VERSION) - GET_FILENAME_COMPONENT(MSVC_EXPRESS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\${_VERSION}\\Setup\\VC;ProductDir]" ABSOLUTE) + MESSAGE(STATUS "Found Visual C++ ${_NAME} (${_VERSION}) in ${VC_DIR}") +ELSE() + # Toolset = version of runtime DLLs + SET(MSVC_TOOLSET "140") - IF(MSVC_EXPRESS AND NOT MSVC_EXPRESS STREQUAL "/registry") - SET(MSVC_EXPRESS ON) + IF(MSVC_VERSION LESS 1920) + SET(_NAME "2017") + ELSE() + SET(_NAME "2019") ENDIF() -ENDMACRO() - -IF(MSVC_VERSION GREATER 1909) - DETECT_VC_VERSION("15.0") - SET(MSVC_TOOLSET "140") - SET(VC_DIR "${VC_DIR}Tools/MSVC") + STRING(REGEX REPLACE "/MSVC/.+" "/MSVC" VC_DIR ${_COMPILER}) FILE(GLOB MSVC_TOOLCHAIN_VERSIONS RELATIVE ${VC_DIR} "${VC_DIR}/*") @@ -92,48 +58,15 @@ IF(MSVC_VERSION GREATER 1909) LIST(REVERSE MSVC_TOOLCHAIN_VERSIONS) ENDIF() - IF(NOT MSVC_TOOLCHAIN_VERSIONS) - MESSAGE(FATAL_ERROR "No MSVC version found in default search path ${VC_DIR}") - ENDIF() - - LIST(GET MSVC_TOOLCHAIN_VERSIONS 0 MSVC_TOOLCHAIN_VERSION) - - SET(VC_DIR "${VC_DIR}/${MSVC_TOOLCHAIN_VERSION}") - SET(VC_INCLUDE_DIR "${VC_DIR}/include") -ELSEIF(MSVC14) - DETECT_VC_VERSION("14.0") - SET(MSVC_TOOLSET "140") -ELSEIF(MSVC12) - DETECT_VC_VERSION("12.0") - SET(MSVC_TOOLSET "120") -ELSEIF(MSVC11) - DETECT_VC_VERSION("11.0") - SET(MSVC_TOOLSET "110") -ELSEIF(MSVC10) - DETECT_VC_VERSION("10.0") - SET(MSVC_TOOLSET "100") -ELSEIF(MSVC90) - DETECT_VC_VERSION("9.0") - SET(MSVC_TOOLSET "90") -ELSEIF(MSVC80) - DETECT_VC_VERSION("8.0") - SET(MSVC_TOOLSET "80") -ENDIF() + IF(MSVC_TOOLCHAIN_VERSIONS) + LIST(GET MSVC_TOOLCHAIN_VERSIONS 0 MSVC_TOOLCHAIN_VERSION) -# If you plan to use VC++ compilers with WINE, set VC_DIR environment variable -IF(NOT VC_DIR) - SET(VC_DIR $ENV{VC_DIR}) - # Fix path - FILE(TO_CMAKE_PATH ${VC_DIR} VC_DIR) -ENDIF() + SET(VC_DIR "${VC_DIR}/${MSVC_TOOLCHAIN_VERSION}") -IF(NOT VC_DIR) - IF(CMAKE_CXX_COMPILER) - SET(_COMPILER ${CMAKE_CXX_COMPILER}) + MESSAGE(STATUS "Found Visual C++ ${_NAME} (${_VERSION} with toolchain ${MSVC_TOOLCHAIN_VERSION}) in ${VC_DIR}") ELSE() - SET(_COMPILER ${CMAKE_C_COMPILER}) + MESSAGE(FATAL_ERROR "Unable to find Visual C++ in ${VC_DIR}") ENDIF() - STRING(REGEX REPLACE "/(bin|BIN|Bin)/.+" "" VC_DIR ${_COMPILER}) ENDIF() IF(NOT VC_INCLUDE_DIR AND VC_DIR AND EXISTS "${VC_DIR}") @@ -147,14 +80,14 @@ SET(MSVC_REDIST_DIR "${EXTERNAL_PATH}/redist") IF(NOT EXISTS "${MSVC_REDIST_DIR}") SET(MSVC_REDIST_DIR "${VC_DIR}/redist") - + IF(NOT EXISTS "${MSVC_REDIST_DIR}") SET(MSVC_REDIST_DIR) ENDIF() ENDIF() IF(MSVC_REDIST_DIR) - IF(MSVC1411 OR MSVC1410) + IF(MSVC_VERSION GREATER 1909) # If you have VC++ 2017 Express, put x64/Microsoft.VC141.CRT/*.dll in ${EXTERNAL_PATH}/redist # original files whould be in ${VC_DIR}/Redist/MSVC/14.11.25325/x64/Microsoft.VC141.CRT SET(MSVC14_REDIST_DIR "${MSVC_REDIST_DIR}") @@ -167,7 +100,7 @@ IF(MSVC_REDIST_DIR) # If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist SET(MSVC11_REDIST_DIR "${MSVC_REDIST_DIR}") ELSEIF(MSVC10) - # If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist + # If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist SET(MSVC10_REDIST_DIR "${MSVC_REDIST_DIR}") ELSEIF(MSVC90) SET(MSVC90_REDIST_DIR "${MSVC_REDIST_DIR}") @@ -176,7 +109,11 @@ IF(MSVC_REDIST_DIR) ENDIF() ENDIF() -MESSAGE(STATUS "Using headers from ${VC_INCLUDE_DIR}") +IF(VC_INCLUDE_DIR) + MESSAGE(STATUS "Using VC++ headers from ${VC_INCLUDE_DIR}") +ELSE() + MESSAGE(FATAL_ERROR "Unable to find VC++ headers") +ENDIF() SET(VC_INCLUDE_DIRS ${VC_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR}) diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake index 3d9c43bd9..1b02dffb3 100644 --- a/code/CMakeModules/FindWindowsSDK.cmake +++ b/code/CMakeModules/FindWindowsSDK.cmake @@ -20,6 +20,7 @@ MACRO(DETECT_WINSDK_VERSION_HELPER _ROOT _VERSION) IF(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry" AND EXISTS "${WINSDK${_VERSION}_DIR}/Include") SET(WINSDK${_VERSION}_FOUND ON) GET_FILENAME_COMPONENT(WINSDK${_VERSION}_VERSION_FULL "[${_ROOT}\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v${_VERSION};ProductVersion]" NAME) + IF(NOT WindowsSDK_FIND_QUIETLY) MESSAGE(STATUS "Found Windows SDK ${_VERSION} in ${WINSDK${_VERSION}_DIR}") ENDIF() @@ -28,14 +29,14 @@ MACRO(DETECT_WINSDK_VERSION_HELPER _ROOT _VERSION) ENDIF() ENDMACRO() -MACRO(DETECT_WINKIT_VERSION _VERSION _SUFFIX) - GET_FILENAME_COMPONENT(WINSDK${_VERSION}_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot${_SUFFIX}]" ABSOLUTE) +MACRO(DETECT_WINKIT_VERSION_HELPER _VERSION _SUFFIX _PREFIX _ARCH) + GET_FILENAME_COMPONENT(WINSDK${_VERSION}_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\${_PREFIX}Microsoft\\Windows Kits\\Installed Roots;KitsRoot${_SUFFIX}]" ABSOLUTE) - IF(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry") + IF(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry" AND EXISTS "${WINSDK${_VERSION}_DIR}/Include") SET(WINSDK${_VERSION}_FOUND ON) SET(WINSDK${_VERSION}_VERSION_FULL "${_VERSION}") IF(NOT WindowsSDK_FIND_QUIETLY) - MESSAGE(STATUS "Found Windows Kit ${_VERSION} in ${WINSDK${_VERSION}_DIR}") + MESSAGE(STATUS "Found Windows Kit ${_VERSION} in ${WINSDK${_VERSION}_DIR} (registry ${_ARCH} bits)") ENDIF() LIST(APPEND WINSDK_DETECTED_VERSIONS ${_VERSION}) ELSE() @@ -52,6 +53,14 @@ MACRO(DETECT_WINSDK_VERSION _VERSION) ENDIF() ENDMACRO() +MACRO(DETECT_WINKIT_VERSION _VERSION _SUFFIX) + DETECT_WINKIT_VERSION_HELPER("${_VERSION}" "${_SUFFIX}" "WOW6432Node\\\\" "32") + + IF(NOT WINSDK${_VERSION}_FOUND) + DETECT_WINKIT_VERSION_HELPER("${_VERSION}" "${_SUFFIX}" "" "64") + ENDIF() +ENDMACRO() + SET(WINSDK_DETECTED_VERSIONS) # Fixed versions for Windows Kits (VC++ from 2012) @@ -378,7 +387,11 @@ FIND_PATH(WINSDK_INCLUDE_DIR Windows.h NO_DEFAULT_PATH ) -MESSAGE(STATUS "Found Windows.h in ${WINSDK_INCLUDE_DIR}") +IF(WINSDK_INCLUDE_DIR) + MESSAGE(STATUS "Found Windows.h in ${WINSDK_INCLUDE_DIR}") +ELSE() + MESSAGE(FATAL_ERROR "Unable to find Windows.h") +ENDIF() # directory where WinRT headers are found FIND_PATH(WINSDK_WINRT_INCLUDE_DIR winstring.h From 61a137797a5adcefef741296564e3e923523ed91 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:40:44 +0200 Subject: [PATCH 05/39] Changed: Updated toolchains --HG-- branch : develop --- code/CMakeModules/OSXToolChain.cmake | 30 +++++++++++++++++++--------- code/CMakeModules/iOSToolChain.cmake | 16 +++++++-------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/code/CMakeModules/OSXToolChain.cmake b/code/CMakeModules/OSXToolChain.cmake index 3169aec78..d480c13b8 100644 --- a/code/CMakeModules/OSXToolChain.cmake +++ b/code/CMakeModules/OSXToolChain.cmake @@ -1,11 +1,11 @@ # Define OSX_SDK to force a specific version such as : -DOSX_SDK=10.11 # # Example: -# cmake ../code -DCMAKE_TOOLCHAIN_FILE=../code/CMakeModules/OSXToolChain.cmake -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_SERVER=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_LUA51=OFF -DWITH_LUA53=ON -DCMAKE_BUILD_TYPE=Release -DWITH_RYZOM_INSTALLER=OFF -DWITH_RYZOM_PATCH=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_TOOLS=OFF -DWITH_TOOLS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_WARNINGS=OFF -DWITH_QT5=OFF -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_UNIX_STRUCTURE=OFF -DWITH_INSTALL_LIBRARIES=OFF -DWITH_RYZOM_SANDBOX=OFF -DOSX_SDK=10.11 +# cmake .. -DCMAKE_TOOLCHAIN_FILE=$CMAKE_MODULE_PATH/OSXToolChain.cmake -DOSX_SDK=10.14 # Don't forget to define environment variables: # -# export MACOSX_DEPLOYMENT_TARGET=10.7 +# export MACOSX_DEPLOYMENT_TARGET=10.8 # export OSXCROSS_GCC_NO_STATIC_RUNTIME=1 # export PATH=$PATH:/home/src/osxcross/target/bin # @@ -15,18 +15,22 @@ # ./osxcross-macports install libxml2 jpeg curl libogg libvorbis freetype boost openssl zlib lua-5.3 giflib # to compile Luabind -# export CMAKE_MODULE_PATH=$HOME/shard/tools/external/cmake/modules -# cmake .. -DCMAKE_TOOLCHAIN_FILE=$HOME/ryzomcore/code/CMakeModules/OSXToolChain.cmake -DWITH_SHARED=OFF -DWITH_STATIC=ON -DWITH_LUA51=OFF -DWITH_LUA53=ON -DCMAKE_INSTALL_PREFIX=$HOME/osxcross/target/external +# cmake .. -DCMAKE_TOOLCHAIN_FILE=$CMAKE_MODULE_PATH/OSXToolChain.cmake -DWITH_SHARED=OFF -DWITH_STATIC=ON -DWITH_LUA51=OFF -DWITH_LUA53=ON -DCMAKE_INSTALL_PREFIX=$HOME/osxcross/target/external IF(DEFINED CMAKE_CROSSCOMPILING) # subsequent toolchain loading is not really needed RETURN() ENDIF() +# OSXCROSS_TARGET +# OSXCROSS_SDK + # Force the compilers to Clang for OS X +SET(OSXCROSS_HOST "x86_64-apple-darwin18") + # C -SET(CMAKE_C_COMPILER x86_64-apple-darwin15-clang) +SET(CMAKE_C_COMPILER ${OSXCROSS_HOST}-clang) SET(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") SET(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") SET(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") @@ -34,7 +38,7 @@ SET(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") SET(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") # C++ -SET(CMAKE_CXX_COMPILER x86_64-apple-darwin15-clang++) +SET(CMAKE_CXX_COMPILER ${OSXCROSS_HOST}-clang++) SET(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17") SET(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") SET(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") @@ -102,8 +106,8 @@ SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT}/MacOSX${OSX_SDK}.sdk) # Standard settings SET(CMAKE_SYSTEM_NAME Darwin) -SET(CMAKE_SYSTEM "Darwin-15.0.0") -SET(CMAKE_SYSTEM_VERSION "15.0.0") +SET(CMAKE_SYSTEM "Darwin-18.0.0") +SET(CMAKE_SYSTEM_VERSION "18.0.0") SET(CMAKE_SYSTEM_PROCESSOR "x86_64") SET(UNIX ON) @@ -123,9 +127,17 @@ SET(CMAKE_SYSTEM_FRAMEWORK_PATH ) # only search the OS X sdks, not the remainder of the host filesystem -SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) # determinate location for bin utils based on CMAKE_FIND_ROOT_PATH INCLUDE(CMakeFindBinUtils) + +set(CMAKE_AR "${OSXCROSS_HOST}-ar" CACHE FILEPATH "ar") +set(CMAKE_RANLIB "${OSXCROSS_HOST}-ranlib" CACHE FILEPATH "ranlib") +set(CMAKE_INSTALL_NAME_TOOL "${OSXCROSS_HOST}-install_name_tool" CACHE FILEPATH "install_name_tool") + +set(ENV{PKG_CONFIG_LIBDIR} "${MACPORTS_ROOT_DIR}/lib/pkgconfig") +set(ENV{PKG_CONFIG_SYSROOT_DIR} "${CMAKE_OSX_TOOLCHAIN_ROOT}/macports/pkgs") diff --git a/code/CMakeModules/iOSToolChain.cmake b/code/CMakeModules/iOSToolChain.cmake index 7bcb57227..37c483afb 100644 --- a/code/CMakeModules/iOSToolChain.cmake +++ b/code/CMakeModules/iOSToolChain.cmake @@ -137,23 +137,23 @@ SET(CMAKE_IOS_SIMULATOR_SYSROOT ${CMAKE_IOS_SIMULATOR_SDK_ROOT} CACHE PATH "Sysr IF(CMAKE_GENERATOR MATCHES Xcode) IF(${IOS_PLATFORM} STREQUAL "OS") - SET(CMAKE_SYSTEM_PROCESSOR "armv7") + SET(CMAKE_SYSTEM_PROCESSOR "arm64") ELSEIF(${IOS_PLATFORM} STREQUAL "SIMULATOR") - SET(CMAKE_SYSTEM_PROCESSOR "x86") + SET(CMAKE_SYSTEM_PROCESSOR "x86_64") ELSEIF(${IOS_PLATFORM} STREQUAL "ALL") - SET(CMAKE_SYSTEM_PROCESSOR "armv7") + SET(CMAKE_SYSTEM_PROCESSOR "arm64") ENDIF() ELSE() IF(${IOS_PLATFORM} STREQUAL "OS") SET(ARCHS armv7 arm64) - SET(CMAKE_SYSTEM_PROCESSOR "armv7") + SET(CMAKE_SYSTEM_PROCESSOR "arm64") ELSEIF(${IOS_PLATFORM} STREQUAL "SIMULATOR") - # iPhone simulator targets i386 - SET(ARCHS "i386") + # iPhone simulator targets x86_64 + SET(ARCHS "x86_64") SET(CMAKE_SYSTEM_PROCESSOR "x86") ELSEIF(${IOS_PLATFORM} STREQUAL "ALL") - SET(ARCHS armv7 arm64 i386 x86_64) - SET(CMAKE_SYSTEM_PROCESSOR "armv7") + SET(ARCHS armv7 arm64 x86_64) + SET(CMAKE_SYSTEM_PROCESSOR "arm64") ENDIF() ENDIF() From fb93157afde7c3a229d8717db0e4e92e066db363 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:45:10 +0200 Subject: [PATCH 06/39] Changed: Use FIND_PACKAGE_HELPER --HG-- branch : develop --- code/CMakeModules/FindFMOD.cmake | 56 ++--------------- code/CMakeModules/FindLuabind.cmake | 43 +------------ code/CMakeModules/FindOgg.cmake | 50 +-------------- code/CMakeModules/FindSTLport.cmake | 94 ++--------------------------- code/CMakeModules/FindSquish.cmake | 73 +--------------------- code/CMakeModules/FindVorbis.cmake | 67 ++------------------ 6 files changed, 19 insertions(+), 364 deletions(-) diff --git a/code/CMakeModules/FindFMOD.cmake b/code/CMakeModules/FindFMOD.cmake index b28f77b1e..3bdd09e8f 100644 --- a/code/CMakeModules/FindFMOD.cmake +++ b/code/CMakeModules/FindFMOD.cmake @@ -1,57 +1,9 @@ -# - Locate FMOD library -# This module defines -# FMOD_LIBRARY, the library to link against -# FMOD_FOUND, if false, do not try to link to FMOD -# FMOD_INCLUDE_DIR, where to find headers. - -IF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR) - # in cache already - SET(FMOD_FIND_QUIETLY TRUE) -ENDIF() - - -FIND_PATH(FMOD_INCLUDE_DIR - fmod.h - PATHS - $ENV{FMOD_DIR}/include - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - PATH_SUFFIXES fmod fmod3 -) +INCLUDE(FindHelpers) IF(TARGET_X64) - SET(FMOD_LIBRARY_NAMES fmod64 fmod) + SET(FMOD_BASE fmod64) ELSE() - SET(FMOD_LIBRARY_NAMES fmodvc fmod) + SET(FMOD_BASE fmodvc) ENDIF() -FIND_LIBRARY(FMOD_LIBRARY - NAMES - ${FMOD_LIBRARY_NAMES} - PATHS - $ENV{FMOD_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -IF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR) - SET(FMOD_FOUND "YES") - IF(NOT FMOD_FIND_QUIETLY) - MESSAGE(STATUS "Found FMOD: ${FMOD_LIBRARY}") - ENDIF() -ELSE() - IF(NOT FMOD_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find FMOD!") - ENDIF() -ENDIF() +FIND_PACKAGE_HELPER(FMOD fmod.h RELEASE ${FMOD_BASE} DEBUG ${FMOD_BASE}d SUFFIXES fmod3) diff --git a/code/CMakeModules/FindLuabind.cmake b/code/CMakeModules/FindLuabind.cmake index 5511379a3..dae1dbd99 100644 --- a/code/CMakeModules/FindLuabind.cmake +++ b/code/CMakeModules/FindLuabind.cmake @@ -3,6 +3,7 @@ # LUABIND_LIBRARIES, the libraries to link against # LUABIND_FOUND, if false, do not try to link to LUABIND # LUABIND_INCLUDE_DIR, where to find headers. +INCLUDE(FindHelpers) MACRO(FIND_CORRECT_LUA_VERSION) # Check Lua version linked to Luabind under Linux @@ -85,18 +86,6 @@ IF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR) SET(Luabind_FIND_QUIETLY TRUE) ENDIF() -FIND_PATH(LUABIND_INCLUDE_DIR - luabind/luabind.hpp - PATHS - $ENV{LUABIND_DIR}/include - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include -) - SET(LIBRARY_NAME_RELEASE) SET(LIBRARY_NAME_DEBUG) @@ -149,35 +138,7 @@ ENDIF() LIST(APPEND LIBRARY_NAME_RELEASE luabind libluabind) LIST(APPEND LIBRARY_NAME_DEBUG luabind_d luabindd libluabind_d libluabindd) -FIND_LIBRARY(LUABIND_LIBRARY_RELEASE - NAMES ${LIBRARY_NAME_RELEASE} - PATHS - $ENV{LUABIND_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -FIND_LIBRARY(LUABIND_LIBRARY_DEBUG - NAMES ${LIBRARY_NAME_DEBUG} - PATHS - $ENV{LUABIND_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) +FIND_PACKAGE_HELPER(Luabind luabind/luabind.hpp RELEASE ${LIBRARY_NAME_RELEASE} DEBUG ${LIBRARY_NAME_DEBUG}) FIND_PACKAGE(Boost REQUIRED) diff --git a/code/CMakeModules/FindOgg.cmake b/code/CMakeModules/FindOgg.cmake index c1f4492e1..aa2f9164c 100644 --- a/code/CMakeModules/FindOgg.cmake +++ b/code/CMakeModules/FindOgg.cmake @@ -1,49 +1,3 @@ -# - Locate Ogg library -# This module defines -# OGG_LIBRARY, the library to link against -# OGG_FOUND, if false, do not try to link to OGG -# OGG_INCLUDE_DIR, where to find headers. +INCLUDE(FindHelpers) -IF(OGG_LIBRARY AND OGG_INCLUDE_DIR) - # in cache already - SET(OGG_FIND_QUIETLY TRUE) -ENDIF() - - -FIND_PATH(OGG_INCLUDE_DIR - ogg/ogg.h - PATHS - $ENV{OGG_DIR}/include - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include -) - -FIND_LIBRARY(OGG_LIBRARY - NAMES ogg libogg - PATHS - $ENV{OGG_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -IF(OGG_LIBRARY AND OGG_INCLUDE_DIR) - SET(OGG_FOUND "YES") - IF(NOT OGG_FIND_QUIETLY) - MESSAGE(STATUS "Found Ogg: ${OGG_LIBRARY}") - ENDIF() -ELSE() - IF(NOT OGG_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find Ogg!") - ENDIF() -ENDIF() +FIND_PACKAGE_HELPER(Ogg ogg/ogg.h) diff --git a/code/CMakeModules/FindSTLport.cmake b/code/CMakeModules/FindSTLport.cmake index 68e542ea5..3b1cc1800 100644 --- a/code/CMakeModules/FindSTLport.cmake +++ b/code/CMakeModules/FindSTLport.cmake @@ -1,91 +1,5 @@ -# Look for a directory containing STLport. -# -# The following values are defined -# STLPORT_INCLUDE_DIR - where to find vector, etc. -# STLPORT_LIBRARIES - link against these to use STLport -# STLPORT_FOUND - True if the STLport is available. +INCLUDE(FindHelpers) -# also defined, but not for general use are -IF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR) - # in cache already - SET(STLPORT_FIND_QUIETLY TRUE) -ENDIF() - -FIND_PATH(STLPORT_INCLUDE_DIR - iostream - PATHS - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - PATH_SUFFIXES stlport -) - -FIND_LIBRARY(STLPORT_LIBRARY_DEBUG - NAMES - stlport_cygwin_debug - stlport_cygwin_stldebug - stlport_gcc_debug - stlport_gcc_stldebug - stlportstld_x - stlportstld_x.5.2 - stlportd - stlportd_statix - stlportd_static - PATHS - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -FIND_LIBRARY(STLPORT_LIBRARY_RELEASE - NAMES - stlport_cygwin - stlport_gcc - stlport - stlport_x - stlport_x.5.2 - stlport_statix - stlport_static - PATHS - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -IF(STLPORT_INCLUDE_DIR) - IF(STLPORT_LIBRARY_RELEASE) - SET(STLPORT_FOUND TRUE) - - SET(STLPORT_LIBRARIES ${STLPORT_LIBRARY_RELEASE}) - IF(STLPORT_LIBRARY_DEBUG) - SET(STLPORT_LIBRARIES optimized ${STLPORT_LIBRARIES} debug ${STLPORT_LIBRARY_DEBUG}) - ENDIF() - ENDIF() -ENDIF() - -IF(STLPORT_FOUND) - IF(NOT STLPORT_FIND_QUIETLY) - MESSAGE(STATUS "Found STLport: ${STLPORT_LIBRARIES}") - ENDIF() -ELSE() - IF(NOT STLPORT_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find STLport!") - ENDIF() -ENDIF() - -MARK_AS_ADVANCED(STLPORT_LIBRARY_RELEASE STLPORT_LIBRARY_DEBUG) +FIND_PACKAGE_HELPER(STLport iostream + RELEASE stlport_cygwin stlport_gcc stlport_x stlport_x.5.2 stlport_statix stlport_static + DEBUG stlport_cygwin_debug stlport_cygwin_stldebug stlport_gcc_debug stlport_gcc_stldebug stlportstld_x stlportstld_x.5.2 stlportd_statix stlportd_static) diff --git a/code/CMakeModules/FindSquish.cmake b/code/CMakeModules/FindSquish.cmake index 4242f4055..9d0928f87 100644 --- a/code/CMakeModules/FindSquish.cmake +++ b/code/CMakeModules/FindSquish.cmake @@ -1,69 +1,6 @@ -# -# Find the LibSquish includes and library -# -# This module defines -# SQUISH_INCLUDE_DIR, where to find squish.h -# SQUISH_LIBRARIES, where to find the Squish libraries. -# SQUISH_FOUND, If false, do not try to use Squish. +INCLUDE(FindHelpers) -# also defined, but not for general use are -IF(SQUISH_LIBRARIES AND SQUISH_INCLUDE_DIR) - # in cache already - SET(SQUISH_FIND_QUIETLY TRUE) -ENDIF() - -FIND_PATH(SQUISH_INCLUDE_DIR - squish.h - PATHS - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - PATH_SUFFIXES cppunit -) - -FIND_LIBRARY(SQUISH_LIBRARY_RELEASE - squish - PATHS - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -FIND_LIBRARY(SQUISH_LIBRARY_DEBUG - squishd - PATHS - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -IF(SQUISH_INCLUDE_DIR) - IF(SQUISH_LIBRARY_RELEASE) - SET(SQUISH_FOUND "YES") - SET(SQUISH_LIBRARIES "optimized;${SQUISH_LIBRARY_RELEASE}") - IF(SQUISH_LIBRARY_DEBUG) - SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_DEBUG}") - ELSE() - SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_RELEASE}") - MESSAGE("Debug Squish NOT found, using the release version!") - ENDIF() - ENDIF() -ENDIF() +FIND_PACKAGE_HELPER(Squish squish.h) IF(SQUISH_FOUND) IF(NOT SQUISH_FIND_QUIETLY) @@ -74,10 +11,4 @@ IF(SQUISH_FOUND) SET(SQUISH_COMPRESS_HAS_METRIC ON) SET(SQUISH_DEFINITIONS -DSQUISH_COMPRESS_HAS_METRIC) ENDIF() -ELSE() - IF(NOT SQUISH_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find Squish!") - ENDIF() ENDIF() - -MARK_AS_ADVANCED(SQUISH_LIBRARY_RELEASE SQUISH_LIBRARY_DEBUG) diff --git a/code/CMakeModules/FindVorbis.cmake b/code/CMakeModules/FindVorbis.cmake index 234d2d31a..b0a4ec2a6 100644 --- a/code/CMakeModules/FindVorbis.cmake +++ b/code/CMakeModules/FindVorbis.cmake @@ -1,65 +1,8 @@ -# - Locate Vorbis library -# This module defines -# VORBIS_LIBRARY, the library to link against -# VORBIS_FOUND, if false, do not try to link to VORBIS -# VORBIS_INCLUDE_DIR, where to find headers. +INCLUDE(FindHelpers) -IF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR) - # in cache already - SET(VORBIS_FIND_QUIETLY TRUE) -ENDIF() - - -FIND_PATH(VORBIS_INCLUDE_DIR - vorbis/vorbisfile.h - PATHS - $ENV{VORBIS_DIR}/include - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include -) - -FIND_LIBRARY(VORBIS_LIBRARY - NAMES vorbis libvorbis - PATHS - $ENV{VORBIS_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -FIND_LIBRARY(VORBISFILE_LIBRARY - NAMES vorbisfile libvorbisfile - PATHS - $ENV{VORBIS_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) +FIND_PACKAGE_HELPER(Vorbis vorbisenc.h) +FIND_PACKAGE_HELPER(VorbisFile vorbisfile.h SUFFIXES vorbis) -IF(VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBIS_INCLUDE_DIR) - SET(VORBIS_FOUND "YES") - SET(VORBIS_LIBRARIES ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY}) - IF(NOT VORBIS_FIND_QUIETLY) - MESSAGE(STATUS "Found Vorbis: ${VORBIS_LIBRARY}") - ENDIF() -ELSE() - IF(NOT VORBIS_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find Vorbis!") - ENDIF() +IF(VORBISFILE_FOUND) + SET(VORBIS_LIBRARIES ${VORBIS_LIBRARIES} ${VORBISFILE_LIBRARIES}) ENDIF() From 0914828ee2c2de0595d725c5be68577f6fa0abad Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:45:57 +0200 Subject: [PATCH 07/39] Fixed: Tools compilation (sheets_packer_shard requires server code) --HG-- branch : develop --- code/ryzom/tools/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/tools/CMakeLists.txt b/code/ryzom/tools/CMakeLists.txt index b97c9be8e..e42303691 100644 --- a/code/ryzom/tools/CMakeLists.txt +++ b/code/ryzom/tools/CMakeLists.txt @@ -21,7 +21,7 @@ IF(WITH_RYZOM_TOOLS) IF(WIN32) IF(MYSQL_FOUND) - ADD_SUBDIRECTORY(sheets_packer_shard) + #ADD_SUBDIRECTORY(sheets_packer_shard) ENDIF() ENDIF() ENDIF() From 9d9819f1c0b733b05802dff0a2349504d85f5eb8 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:48:33 +0200 Subject: [PATCH 08/39] Changed: Updated NeL module --HG-- branch : develop --- code/CMakeModules/FindNeL.cmake | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/code/CMakeModules/FindNeL.cmake b/code/CMakeModules/FindNeL.cmake index e75163cce..96dd90b83 100644 --- a/code/CMakeModules/FindNeL.cmake +++ b/code/CMakeModules/FindNeL.cmake @@ -13,7 +13,6 @@ # NELXXX_FOUND # NELXXX_LIBRARIES - INCLUDE(FindHelpers) # Init all variables we'll set @@ -209,6 +208,20 @@ IF(NELMISC_FOUND) LIST(APPEND NELMISC_LIBRARIES ${LIBXML2_LIBRARIES}) ENDIF() + IF(CMAKE_DL_LIBS) + LIST(APPEND NELMISC_LIBRARIES ${CMAKE_DL_LIBS}) + ENDIF() + + FIND_PACKAGE(Threads) + + IF(Threads_FOUND) + LIST(APPEND NELMISC_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) + ENDIF() + + IF(UNIX AND NOT APPLE) + LIST(APPEND NELMISC_LIBRARIES rt) + ENDIF() + LIST(REMOVE_ITEM NeL_FIND_COMPONENTS misc) LIST(APPEND NEL_MODULES_FOUND misc) @@ -262,11 +275,17 @@ FOREACH(COMPONENT ${NeL_FIND_COMPONENTS}) FIND_PACKAGE_HELPER(${_NAME} nel/${COMPONENT}/${HEADER_FILE} RELEASE nel${COMPONENT}_r nel${COMPONENT} DEBUG nel${COMPONENT}_d + DIR ${NEL_DIR} QUIET) IF(${_UPNAME}_FOUND) LIST(APPEND NEL_MODULES_FOUND ${COMPONENT}) + # all NeL libraries depend on nelmisc in static + IF(NEL_STATIC) + LIST(APPEND ${_UPNAME}_LIBRARIES ${NELMISC_LIBRARIES}) + ENDIF() + IF(COMPONENT STREQUAL "3d") IF(NEL_STATIC) # 3rd party dependencies @@ -301,7 +320,9 @@ FOREACH(COMPONENT ${NeL_FIND_COMPONENTS}) ELSEIF(COMPONENT STREQUAL "gui") FIND_PACKAGE(Luabind REQUIRED) - LIST(APPEND ${_UPNAME}_LIBRARIES ${LUABIND_LIBRARIES}) + IF(LUABIND_FOUND) + LIST(APPEND ${_UPNAME}_LIBRARIES ${LUABIND_LIBRARIES}) + ENDIF() FIND_LIBCURL() @@ -323,7 +344,6 @@ FOREACH(COMPONENT ${NeL_FIND_COMPONENTS}) LIST(APPEND CURL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) LIST(APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES}) - LIST(APPEND ${_UPNAME}_LIBRARIES ${LUABIND_LIBRARIES} ${CURL_LIBRARIES}) LIST(APPEND NEL_DEFINITIONS ${${_UPNAME}_DEFINITIONS}) ELSEIF(COMPONENT STREQUAL "sound") FIND_PACKAGE(Ogg REQUIRED) From 71b65b956449a20a25f3fd51f2eb32df215d758d Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 20:00:16 +0200 Subject: [PATCH 09/39] Fixed: Use nlUtf8ToWide macro instead of utf8ToWide function --HG-- branch : develop --- code/nel/src/misc/app_context.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/src/misc/app_context.cpp b/code/nel/src/misc/app_context.cpp index a7381d026..73c9aa1b3 100644 --- a/code/nel/src/misc/app_context.cpp +++ b/code/nel/src/misc/app_context.cpp @@ -135,7 +135,7 @@ CApplicationContext::~CApplicationContext() std::string message = toString("Instance '%s' still allocated at %p", it->first.c_str(), it->second); #ifdef NL_OS_WINDOWS - OutputDebugStringW(utf8ToWide(message)); + OutputDebugStringW(nlUtf8ToWide(message)); #else printf("%s\n", message.c_str()); #endif From 1d5580a2d6f4084d9b6f6e17ed13f4584df0d2a1 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 20 Oct 2019 22:35:05 +0300 Subject: [PATCH 10/39] Fixed: Force stop css downloads when starting to browse new url. --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 19b82f169..db2db7748 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -2586,6 +2586,7 @@ namespace NLGUI // go _URL = uri.toString(); _BrowseNextTime = true; + _WaitingForStylesheet = false; // if a BrowseTree is bound to us, try to select the node that opens this URL (auto-locate) if(!_BrowseTree.empty()) From fc9d423c94e49f9b368c76a5dc11b74461e472d8 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 20 Oct 2019 22:35:05 +0300 Subject: [PATCH 11/39] Fixed: Possible deadlock when css url not removed from stylehseet queue --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index db2db7748..98b908c7d 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -4163,7 +4163,7 @@ namespace NLGUI void CGroupHTML::renderDocument() { - if (!_StylesheetQueue.empty()) + if (!Curls.empty() && !_StylesheetQueue.empty()) { // waiting for stylesheets to finish downloading return; From fec9975f5854c1e816ff0c1504d5d7aa07527a88 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 20 Oct 2019 22:35:05 +0300 Subject: [PATCH 12/39] Fixed: Downloaded css file was not used --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 98b908c7d..23bd2e671 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -659,10 +659,12 @@ namespace NLGUI if (download.type == StylesheetType) { - // no tmpfile if file was already in cache - if (CFile::fileExists(tmpfile) && CFile::fileExists(download.dest)) + if (CFile::fileExists(tmpfile)) { - CFile::deleteFile(download.dest); + if (CFile::fileExists(download.dest)) + { + CFile::deleteFile(download.dest); + } CFile::moveFile(download.dest, tmpfile); } cssDownloadFinished(download.url, download.dest); From 691bf67c4d8e68462fd5761ffd62973caa8677f6 Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Fri, 3 Jan 2020 01:45:25 +0100 Subject: [PATCH 13/39] Changed: Updated version to 3.6.0 --- code/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index e263da274..aceb82ce3 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -60,7 +60,7 @@ SET(YEAR "2004-${CURRENT_YEAR}") SET(AUTHOR "Winch Gate and The Ryzom Core Community") SET(RYZOM_VERSION_MAJOR 3) -SET(RYZOM_VERSION_MINOR 5) +SET(RYZOM_VERSION_MINOR 6) SET(RYZOM_VERSION_PATCH 0) #----------------------------------------------------------------------------- From 7a0737e75984c758237acd1f820d95347d6760fa Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Tue, 7 Jan 2020 17:13:01 +0100 Subject: [PATCH 14/39] Added: moveCam and setCamMode lua functions --- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 44 +++++++++++++++++-- .../client/src/interface_v3/lua_ihm_ryzom.h | 2 + code/ryzom/client/src/main_loop.cpp | 15 +++++++ code/ryzom/client/src/user_entity.h | 12 +++++ 4 files changed, 69 insertions(+), 4 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index cd1df8d2f..80c36520c 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -112,6 +112,7 @@ #include "../entities.h" #include "../misc.h" #include "../gabarit.h" +#include "../view.h" #include "bot_chat_page_all.h" #include "bot_chat_page_ring_sessions.h" @@ -442,6 +443,8 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) ls.registerFunc("enableModalWindow", enableModalWindow); ls.registerFunc("getPlayerPos", getPlayerPos); ls.registerFunc("getGroundAtMouse", getGroundAtMouse), + ls.registerFunc("moveCam", moveCam), + ls.registerFunc("setCamMode", setCamMode), ls.registerFunc("getMousePos", getMousePos), ls.registerFunc("getMouseDown", getMouseDown), ls.registerFunc("getMouseMiddleDown", getMouseMiddleDown), @@ -1331,6 +1334,39 @@ int CLuaIHMRyzom::getGroundAtMouse(CLuaState &ls) return 3; } +int CLuaIHMRyzom::moveCam(CLuaState &ls) +{ + const char *funcName = "moveCam"; + CLuaIHM::checkArgCount(ls, funcName, 3); + CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); + CLuaIHM::checkArgType(ls, funcName, 2, LUA_TNUMBER); + CLuaIHM::checkArgType(ls, funcName, 3, LUA_TNUMBER); + + float x = (float)ls.toNumber(1); + float y = (float)ls.toNumber(2); + float z = (float)ls.toNumber(3); + CVector moves(x, y, z); + UserEntity->setCameraMoves(moves); + + return 0; +} + +int CLuaIHMRyzom::setCamMode(CLuaState &ls) +{ + const char *funcName = "setCamMode"; + CLuaIHM::checkArgCount(ls, funcName, 1); + + bool aiMode = ls.toBoolean(1); + + if(aiMode) + UserControls.mode(CUserControls::AIMode); + else + UserEntity->viewMode(UserEntity->viewMode()); + + return 0; +} + + // *************************************************************************** int CLuaIHMRyzom::getPlayerPos(CLuaState &ls) { @@ -2303,8 +2339,8 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) NLMISC::CAABBox bbox; instance.getShapeAABBox(bbox); - primitive->setReactionType(UMovePrimitive::Slide); - primitive->setTriggerType(UMovePrimitive::NotATrigger); + primitive->setReactionType(UMovePrimitive::DoNothing); + primitive->setTriggerType(UMovePrimitive::OverlapStairsTrigger); primitive->setAbsorbtion(0); primitive->setPrimitiveType(UMovePrimitive::_2DOrientedBox); @@ -2313,10 +2349,10 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) primitive->setCollisionMask(MaskColPlayer | MaskColNpc | MaskColDoor); primitive->setOcclusionMask(MaskColPlayer | MaskColNpc | MaskColDoor); - primitive->setObstacle(true); + primitive->setObstacle(false); - primitive->setGlobalPosition(instance.getPos(), dynamicWI); + primitive->setGlobalPosition(instance.getPos()+CVector(0, 0, 0.5f), dynamicWI); primitive->insertInWorldImage(dynamicWI); } diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h index c2d47b7ec..5103d2fcf 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -232,6 +232,8 @@ private: static std::string getRegionByAlias(uint32 alias); static float getGroundZ(float x, float y); static int getGroundAtMouse(CLuaState &ls); + static int moveCam(CLuaState &ls); + static int setCamMode(CLuaState &ls); static int getMousePos(CLuaState &ls); static int getMouseDown(CLuaState &ls); static int getMouseMiddleDown(CLuaState &ls); diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index 981bc7c72..5051fe193 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -1411,8 +1411,23 @@ bool mainLoop() // Update Camera Position/Orientation. CVector currViewPos = View.currentViewPos(); MainCam.setTransformMode(UTransformable::RotQuat); + + CVector cameraMoves = UserEntity->getCameraMoves(); + + currViewPos.z += cameraMoves.z; MainCam.setPos(currViewPos); MainCam.setRotQuat(View.currentViewQuat()); + + if (cameraMoves.x) + { + CMatrix viewMatrix; + viewMatrix = MainCam.getMatrix(); + viewMatrix.rotateZ(cameraMoves.x); + MainCam.setRotQuat(viewMatrix.getRot()); + } + + UserEntity->setCameraMoves(CVector(0, 0, 0)); + if (StereoHMD) { CMatrix camMatrix; diff --git a/code/ryzom/client/src/user_entity.h b/code/ryzom/client/src/user_entity.h index 5149b46e8..e240622c9 100644 --- a/code/ryzom/client/src/user_entity.h +++ b/code/ryzom/client/src/user_entity.h @@ -490,6 +490,16 @@ public: return _LoginName; } + CVector getCameraMoves() + { + return _CameraMoves; + } + + void setCameraMoves(CVector moves) + { + _CameraMoves = moves; + } + protected: class CSpeedFactor : public NLMISC::ICDBNode::IPropertyObserver { @@ -602,6 +612,8 @@ protected: /// Time in MS when the User started beiing in collision with anything that avoid him to do an Action (and still is). sint64 _MoveToColStartTime; + CVector _CameraMoves; + /// CSkill points observer class CSkillPointsObserver : public NLMISC::ICDBNode::IPropertyObserver From fe008c0e52f6f063da732c0f910d852f2aa71213 Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Tue, 7 Jan 2020 17:13:01 +0100 Subject: [PATCH 15/39] Added: moveCam and setCamMode lua functions --- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 36 +++++++++++++++++++ .../client/src/interface_v3/lua_ihm_ryzom.h | 2 ++ code/ryzom/client/src/main_loop.cpp | 15 ++++++++ code/ryzom/client/src/user_entity.h | 12 +++++++ 4 files changed, 65 insertions(+) diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index cd1df8d2f..547388698 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -112,6 +112,7 @@ #include "../entities.h" #include "../misc.h" #include "../gabarit.h" +#include "../view.h" #include "bot_chat_page_all.h" #include "bot_chat_page_ring_sessions.h" @@ -442,6 +443,8 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) ls.registerFunc("enableModalWindow", enableModalWindow); ls.registerFunc("getPlayerPos", getPlayerPos); ls.registerFunc("getGroundAtMouse", getGroundAtMouse), + ls.registerFunc("moveCam", moveCam), + ls.registerFunc("setCamMode", setCamMode), ls.registerFunc("getMousePos", getMousePos), ls.registerFunc("getMouseDown", getMouseDown), ls.registerFunc("getMouseMiddleDown", getMouseMiddleDown), @@ -1331,6 +1334,39 @@ int CLuaIHMRyzom::getGroundAtMouse(CLuaState &ls) return 3; } +int CLuaIHMRyzom::moveCam(CLuaState &ls) +{ + const char *funcName = "moveCam"; + CLuaIHM::checkArgCount(ls, funcName, 3); + CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); + CLuaIHM::checkArgType(ls, funcName, 2, LUA_TNUMBER); + CLuaIHM::checkArgType(ls, funcName, 3, LUA_TNUMBER); + + float x = (float)ls.toNumber(1); + float y = (float)ls.toNumber(2); + float z = (float)ls.toNumber(3); + CVector moves(x, y, z); + UserEntity->setCameraMoves(moves); + + return 0; +} + +int CLuaIHMRyzom::setCamMode(CLuaState &ls) +{ + const char *funcName = "setCamMode"; + CLuaIHM::checkArgCount(ls, funcName, 1); + + bool aiMode = ls.toBoolean(1); + + if(aiMode) + UserControls.mode(CUserControls::AIMode); + else + UserEntity->viewMode(UserEntity->viewMode()); + + return 0; +} + + // *************************************************************************** int CLuaIHMRyzom::getPlayerPos(CLuaState &ls) { diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h index c2d47b7ec..5103d2fcf 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -232,6 +232,8 @@ private: static std::string getRegionByAlias(uint32 alias); static float getGroundZ(float x, float y); static int getGroundAtMouse(CLuaState &ls); + static int moveCam(CLuaState &ls); + static int setCamMode(CLuaState &ls); static int getMousePos(CLuaState &ls); static int getMouseDown(CLuaState &ls); static int getMouseMiddleDown(CLuaState &ls); diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index 981bc7c72..5051fe193 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -1411,8 +1411,23 @@ bool mainLoop() // Update Camera Position/Orientation. CVector currViewPos = View.currentViewPos(); MainCam.setTransformMode(UTransformable::RotQuat); + + CVector cameraMoves = UserEntity->getCameraMoves(); + + currViewPos.z += cameraMoves.z; MainCam.setPos(currViewPos); MainCam.setRotQuat(View.currentViewQuat()); + + if (cameraMoves.x) + { + CMatrix viewMatrix; + viewMatrix = MainCam.getMatrix(); + viewMatrix.rotateZ(cameraMoves.x); + MainCam.setRotQuat(viewMatrix.getRot()); + } + + UserEntity->setCameraMoves(CVector(0, 0, 0)); + if (StereoHMD) { CMatrix camMatrix; diff --git a/code/ryzom/client/src/user_entity.h b/code/ryzom/client/src/user_entity.h index 5149b46e8..e240622c9 100644 --- a/code/ryzom/client/src/user_entity.h +++ b/code/ryzom/client/src/user_entity.h @@ -490,6 +490,16 @@ public: return _LoginName; } + CVector getCameraMoves() + { + return _CameraMoves; + } + + void setCameraMoves(CVector moves) + { + _CameraMoves = moves; + } + protected: class CSpeedFactor : public NLMISC::ICDBNode::IPropertyObserver { @@ -602,6 +612,8 @@ protected: /// Time in MS when the User started beiing in collision with anything that avoid him to do an Action (and still is). sint64 _MoveToColStartTime; + CVector _CameraMoves; + /// CSkill points observer class CSkillPointsObserver : public NLMISC::ICDBNode::IPropertyObserver From 34c1265bceaf1c421cb5f37b660062c898565971 Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Tue, 7 Jan 2020 18:09:33 +0100 Subject: [PATCH 16/39] Revert "Merge remote-tracking branch 'origin/ryzom/ark/features' into ryzom/ark/features" This reverts commit a6ee9fec6344ec65e0803539ee1d50f4a4964ded. --- code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 80c36520c..547388698 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -2339,8 +2339,8 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) NLMISC::CAABBox bbox; instance.getShapeAABBox(bbox); - primitive->setReactionType(UMovePrimitive::DoNothing); - primitive->setTriggerType(UMovePrimitive::OverlapStairsTrigger); + primitive->setReactionType(UMovePrimitive::Slide); + primitive->setTriggerType(UMovePrimitive::NotATrigger); primitive->setAbsorbtion(0); primitive->setPrimitiveType(UMovePrimitive::_2DOrientedBox); @@ -2349,10 +2349,10 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) primitive->setCollisionMask(MaskColPlayer | MaskColNpc | MaskColDoor); primitive->setOcclusionMask(MaskColPlayer | MaskColNpc | MaskColDoor); - primitive->setObstacle(false); + primitive->setObstacle(true); - primitive->setGlobalPosition(instance.getPos()+CVector(0, 0, 0.5f), dynamicWI); + primitive->setGlobalPosition(instance.getPos(), dynamicWI); primitive->insertInWorldImage(dynamicWI); } From 2f27af125ec76c90571c4c07822157d646bb0ffc Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Mon, 13 Jan 2020 12:28:21 +0100 Subject: [PATCH 17/39] Added: encodeURLParam --- code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp | 8 ++++++++ code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h | 1 + 2 files changed, 9 insertions(+) diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 547388698..e011f6e15 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -591,6 +591,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) LUABIND_FUNC(updateTooltipCoords), LUABIND_FUNC(isCtrlKeyDown), LUABIND_FUNC(encodeURLUnicodeParam), + LUABIND_FUNC(encodeURLParam), LUABIND_FUNC(getPlayerLevel), LUABIND_FUNC(getPlayerVpa), LUABIND_FUNC(getPlayerVpb), @@ -3772,6 +3773,13 @@ std::string CLuaIHMRyzom::encodeURLUnicodeParam(const ucstring &text) return convertToHTML(text.toUtf8()); } +// *************************************************************************** +std::string CLuaIHMRyzom::encodeURLParam(const string &text) +{ + //H_AUTO(Lua_CLuaIHM_encodeURLUnicodeParam) + return convertToHTML(text); +} + // *************************************************************************** sint32 CLuaIHMRyzom::getPlayerLevel() { diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h index 5103d2fcf..3a9eed78a 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -259,6 +259,7 @@ private: // because it would be too easy to write a key recorder ...) static bool isCtrlKeyDown(); static std::string encodeURLUnicodeParam(const ucstring &text); + static std::string encodeURLParam(const std::string &text); static sint32 getPlayerLevel(); // get max level among player skills (magi, combat, crafting ,foraging) static std::string getPlayerVpaHex(); From c22f8776f41538692396d3364a54a0c1224a27cf Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Thu, 16 Jan 2020 12:59:15 +0100 Subject: [PATCH 18/39] Added: encodeToHexa and decodeFromHexa --- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 20 +++++++++++++++++++ .../client/src/interface_v3/lua_ihm_ryzom.h | 3 +++ 2 files changed, 23 insertions(+) diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index e011f6e15..d88d08d41 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -592,6 +592,8 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) LUABIND_FUNC(isCtrlKeyDown), LUABIND_FUNC(encodeURLUnicodeParam), LUABIND_FUNC(encodeURLParam), + LUABIND_FUNC(encodeToHexa), + LUABIND_FUNC(decodeFromHexa), LUABIND_FUNC(getPlayerLevel), LUABIND_FUNC(getPlayerVpa), LUABIND_FUNC(getPlayerVpb), @@ -3780,6 +3782,24 @@ std::string CLuaIHMRyzom::encodeURLParam(const string &text) return convertToHTML(text); } + +// *************************************************************************** +std::string CLuaIHMRyzom::encodeToHexa(const string &text) +{ + return toHexa(text); +} + + + +// *************************************************************************** +std::string CLuaIHMRyzom::decodeFromHexa(const string &text) +{ + string hexa; + fromHexa(text, hexa); + return hexa; +} + + // *************************************************************************** sint32 CLuaIHMRyzom::getPlayerLevel() { diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h index 3a9eed78a..31cda63b1 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -261,6 +261,9 @@ private: static std::string encodeURLUnicodeParam(const ucstring &text); static std::string encodeURLParam(const std::string &text); + static std::string encodeToHexa(const std::string &text); + static std::string decodeFromHexa(const std::string &text); + static sint32 getPlayerLevel(); // get max level among player skills (magi, combat, crafting ,foraging) static std::string getPlayerVpaHex(); static std::string getPlayerVpbHex(); From 4b847a086a3eb5d7f2539cb71be8cd680bd29b73 Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Mon, 20 Jan 2020 14:36:42 +0100 Subject: [PATCH 19/39] Changed: made setMap command available in FINAL_VERSION --- .../client/src/interface_v3/group_map.cpp | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index a5d0c4470..ee80b3319 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -4303,6 +4303,17 @@ class CUpdateLandMarksColor : public IActionHandler{public: virtual void execute }}; REGISTER_ACTION_HANDLER (CUpdateLandMarksColor, "update_landmarks_color"); +NLMISC_COMMAND( setMap, "Change the map", "" ) +{ + if (args.size() != 1) return false; + + CInterfaceManager *pIM = CInterfaceManager::getInstance(); + CGroupMap *pMap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map")); + if (pMap != NULL) + pMap->setMap(args[0]); + + return true; +} //////////////////// // DEBUG COMMANDS // @@ -4363,17 +4374,5 @@ NLMISC_COMMAND( testRespawn, "Debug : test respawn map", "" ) return true; } -NLMISC_COMMAND( setMap, "Debug : test respawn map", "" ) -{ - if (args.size() != 1) return false; - - CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupMap *pMap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map")); - if (pMap != NULL) - pMap->setMap(args[0]); - - return true; -} - #endif From 586d84bc20b10d09244ca2bae12e549296826088 Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Wed, 22 Jan 2020 14:16:03 +0100 Subject: [PATCH 20/39] Added: getContinentSheet lua function --- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 16 ++++++++++++++++ .../client/src/interface_v3/lua_ihm_ryzom.h | 1 + 2 files changed, 17 insertions(+) diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index d88d08d41..77a46abc7 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -470,6 +470,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) ls.registerFunc("disableContextHelp", disableContextHelp); ls.registerFunc("setWeatherValue", setWeatherValue); ls.registerFunc("getWeatherValue", getWeatherValue); + ls.registerFunc("getContinentSheet", getContinentSheet); ls.registerFunc("getCompleteIslands", getCompleteIslands); ls.registerFunc("displayBubble", displayBubble); ls.registerFunc("getIslandId", getIslandId); @@ -1787,6 +1788,21 @@ int CLuaIHMRyzom::getWeatherValue(CLuaState &ls) return 1; } +int CLuaIHMRyzom::getContinentSheet(CLuaState &ls) +{ + const char *funcName = "getContinentSheet"; + CLuaIHM::checkArgCount(ls, funcName, 0); + if (ContinentMngr.cur()) + { + ls.push(ContinentMngr.cur()->SheetName); + return 1; + } + + ls.push(""); + return 1; +} + + int CLuaIHMRyzom::getUICaller(CLuaState &ls) { //H_AUTO(Lua_CLuaIHM_getUICaller) diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h index 31cda63b1..d9550d3b4 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -63,6 +63,7 @@ private: static int displayChatMessage(CLuaState &ls); static int setWeatherValue(CLuaState &ls); // first value is a boolean to say automatic, second value ranges from of to 1 and gives the weather static int getWeatherValue(CLuaState &ls); // get current real weather value (blend between server driven value & predicted value). Manual weather value is ignored + static int getContinentSheet(CLuaState &ls); static int disableContextHelpForControl(CLuaState &ls); // params: CCtrlBase*. return: none static int disableContextHelp(CLuaState &ls); static int getServerSeason(CLuaState &ls); // get the last season sent by the server From e22d271408061eba4a8be8c4e724b530c0424ffc Mon Sep 17 00:00:00 2001 From: Nimetu Date: Fri, 7 Feb 2020 11:05:49 +0200 Subject: [PATCH 21/39] Added: require-all-skills property to sbrick sheet --- .../client/src/client_sheets/sbrick_sheet.cpp | 21 +++++++++++++++++++ .../client/src/client_sheets/sbrick_sheet.h | 7 ++++++- .../src/interface_v3/sphrase_manager.cpp | 10 ++++++++- code/ryzom/client/src/sheet_manager.cpp | 2 +- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp b/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp index c60d1c03c..6eae652df 100644 --- a/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp @@ -353,6 +353,27 @@ void CSBrickSheet::build (const NLGEORGES::UFormElm &root) listSkill.clear(); splitString(skillReqStr," ",listSkill); // build the req skill array + RequiredOneOfSkills.clear(); + RequiredOneOfSkills.reserve(listSkill.size()/2); + for(i=0;i RequiredOneOfSkills; + + // For Progression, the required skills (all of them) std::vector RequiredSkills; // For Progression, the required Bricks @@ -384,6 +387,8 @@ public: s.serialEnum(ActionNature); + s.serialCont(RequiredOneOfSkills); + s.serialCont(RequiredSkills); s.serialCont(RequiredBricks); diff --git a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp index 09cc9b3fe..678291e19 100644 --- a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp +++ b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp @@ -3697,12 +3697,20 @@ void CSPhraseManager::computePhraseProgression() CReqSkillFormula brickFormula; // get all its required Skill + for(uint j=0;jRequiredOneOfSkills.size();j++) + { + CSkillValue sv; + sv.Skill= brick->RequiredOneOfSkills[j].Skill; + sv.Value= brick->RequiredOneOfSkills[j].Value; + brickFormula.orV(sv); + } + for(uint j=0;jRequiredSkills.size();j++) { CSkillValue sv; sv.Skill= brick->RequiredSkills[j].Skill; sv.Value= brick->RequiredSkills[j].Value; - brickFormula.orV(sv); + brickFormula.andV(sv); } // if not empty diff --git a/code/ryzom/client/src/sheet_manager.cpp b/code/ryzom/client/src/sheet_manager.cpp index 57de199a2..4badb2a6b 100644 --- a/code/ryzom/client/src/sheet_manager.cpp +++ b/code/ryzom/client/src/sheet_manager.cpp @@ -113,7 +113,7 @@ CTypeVersion TypeVersion [] = CTypeVersion("world", 1), CTypeVersion("weather_function_params", 2), CTypeVersion("mission_icon", 0), - CTypeVersion("sbrick", 32), + CTypeVersion("sbrick", 33), CTypeVersion("sphrase", 4), CTypeVersion("skill_tree", 5), CTypeVersion("titles", 1), From 15433b263bd4ee5607d25d1e9d8f24baa6b4d075 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 13 Feb 2020 12:55:29 +0200 Subject: [PATCH 22/39] Changed: Add proper ids to groups in webig --- code/nel/include/nel/gui/group_html.h | 4 ++++ code/nel/src/gui/group_html.cpp | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index 17a138eee..c240caa63 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -357,6 +357,10 @@ namespace NLGUI // Delete page content and prepare next page void removeContent (); + // Counter to number html elements without id attribute + uint32 getNextAutoIdSeq() { return _AutoIdSeq++; } + uint32 _AutoIdSeq; + // Current URL for relative links in page std::string _URL; // Current URL diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 23bd2e671..592b7da70 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -1443,6 +1443,7 @@ namespace NLGUI _LastRefreshTime = 0.0; _RenderNextTime = false; _WaitingForStylesheet = false; + _AutoIdSeq = 0; // Register CWidgetManager::getInstance()->registerClockMsgTarget(this); @@ -2531,6 +2532,7 @@ namespace NLGUI { // Add a new paragraph CGroupParagraph *newParagraph = new CGroupParagraph(CViewBase::TCtorParam()); + newParagraph->setId(getCurrentGroup()->getId() + ":PARAGRAPH" + toString(getNextAutoIdSeq())); newParagraph->setResizeFromChildH(true); newParagraph->setMarginLeft(getIndent()); @@ -3251,6 +3253,7 @@ namespace NLGUI _ReadingHeadTag = false; _IgnoreHeadTag = false; _IgnoreBaseUrlTag = false; + _AutoIdSeq = 0; paragraphChange (); @@ -4327,6 +4330,7 @@ namespace NLGUI if (!_GroupListAdaptor) { _GroupListAdaptor = new CGroupListAdaptor(CViewBase::TCtorParam()); // deleted by the list + _GroupListAdaptor->setId(getList()->getId() + ":GLA"); _GroupListAdaptor->setResizeFromChildH(true); getList()->addChild (_GroupListAdaptor, true); } @@ -5643,6 +5647,8 @@ namespace NLGUI { string style = elm.getAttribute("style"); string id = elm.getAttribute("id"); + if (id.empty()) + id = "DIV" + toString(getNextAutoIdSeq()); typedef pair TTmplParam; vector tmplParams; @@ -5675,10 +5681,10 @@ namespace NLGUI parentId = _Paragraph->getId(); } - CInterfaceGroup *inst = CWidgetManager::getInstance()->getParser()->createGroupInstance(templateName, this->_Id+":"+id, tmplParams); + CInterfaceGroup *inst = CWidgetManager::getInstance()->getParser()->createGroupInstance(templateName, parentId, tmplParams); if (inst) { - inst->setId(this->_Id+":"+id); + inst->setId(parentId+":"+id); inst->updateCoords(); if (haveParentDiv) { @@ -6607,6 +6613,10 @@ namespace NLGUI CGroupTable *table = new CGroupTable(TCtorParam()); table->BgColor = _CellParams.back().BgColor; + if (elm.hasNonEmptyAttribute("id")) + table->setId(getCurrentGroup()->getId() + ":" + elm.getAttribute("id")); + else + table->setId(getCurrentGroup()->getId() + ":TABLE" + toString(getNextAutoIdSeq())); // TODO: border-spacing: 2em; { @@ -6767,6 +6777,10 @@ namespace NLGUI } _Cells.back() = new CGroupCell(CViewBase::TCtorParam()); + if (elm.hasNonEmptyAttribute("id")) + _Cells.back()->setId(getCurrentGroup()->getId() + ":TD" + elm.getAttribute("id")); + else + _Cells.back()->setId(getCurrentGroup()->getId() + ":TD" + toString(getNextAutoIdSeq())); if (_Style.checkStyle("background-repeat", "repeat")) _Cells.back()->setTextureTile(true); From 8f59a71e3c828b1e50182b15f48feb955f8f715e Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 13 Feb 2020 15:39:18 +0200 Subject: [PATCH 23/39] Fixed: html button with empty formid attribute --- code/nel/include/nel/gui/group_html.h | 3 +++ code/nel/src/gui/group_html.cpp | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index c240caa63..0a4e26c79 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -680,6 +680,8 @@ namespace NLGUI std::vector Entries; }; std::vector _Forms; + // if
element has been closed or not + bool _FormOpen; // submit buttons added to from struct SFormSubmitButton @@ -950,6 +952,7 @@ namespace NLGUI //void htmlEM(const CHtmlElement &elm); void htmlFONT(const CHtmlElement &elm); void htmlFORM(const CHtmlElement &elm); + void htmlFORMend(const CHtmlElement &elm); void htmlH(const CHtmlElement &elm); void htmlHend(const CHtmlElement &elm); void htmlHEAD(const CHtmlElement &elm); diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 592b7da70..0a6a1b2c8 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -1189,7 +1189,7 @@ namespace NLGUI case HTML_DT: htmlDTend(elm); break; case HTML_EM: renderPseudoElement(":after", elm);break; case HTML_FONT: break; - case HTML_FORM: renderPseudoElement(":after", elm);break; + case HTML_FORM: htmlFORMend(elm); break; case HTML_H1://no-break case HTML_H2://no-break case HTML_H3://no-break @@ -1444,6 +1444,7 @@ namespace NLGUI _RenderNextTime = false; _WaitingForStylesheet = false; _AutoIdSeq = 0; + _FormOpen = false; // Register CWidgetManager::getInstance()->registerClockMsgTarget(this); @@ -3240,6 +3241,7 @@ namespace NLGUI _Cells.clear(); _TR.clear(); _Forms.clear(); + _FormOpen = false; _FormSubmit.clear(); _Groups.clear(); _Divs.clear(); @@ -5545,6 +5547,11 @@ namespace NLGUI std::string tooltip = elm.getAttribute("tooltip"); bool disabled = elm.hasAttribute("disabled"); + if (formId.empty() && _FormOpen) + { + formId = _Forms.back().id; + } + if (!formAction.empty()) { formAction = getAbsoluteUrl(formAction); @@ -5817,6 +5824,8 @@ namespace NLGUI // *************************************************************************** void CGroupHTML::htmlFORM(const CHtmlElement &elm) { + _FormOpen = true; + // Build the form CGroupHTML::CForm form; // id check is case sensitive and auto id's are uppercase @@ -5841,6 +5850,12 @@ namespace NLGUI renderPseudoElement(":before", elm); } + void CGroupHTML::htmlFORMend(const CHtmlElement &elm) + { + _FormOpen = false; + renderPseudoElement(":after", elm); + } + // *************************************************************************** void CGroupHTML::htmlH(const CHtmlElement &elm) { From 7856e937238589d2fb3181b7ee28bfe68fac54a0 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 13 Feb 2020 16:04:41 +0200 Subject: [PATCH 24/39] Fixed: ah:html_submit_form without caller object --- .../ryzom/client/src/interface_v3/action_handler_help.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/action_handler_help.cpp b/code/ryzom/client/src/interface_v3/action_handler_help.cpp index ac1480e0c..f15985706 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -1116,8 +1116,8 @@ class CHandlerHTMLSubmitForm : public IActionHandler return; } - sint32 x = pCaller->getEventX(); - sint32 y = pCaller->getEventY(); + sint32 x = pCaller ? pCaller->getEventX() : 0; + sint32 y = pCaller ? pCaller->getEventY() : 0; CInterfaceElement *element = CWidgetManager::getInstance()->getElementFromId(container); { @@ -1127,6 +1127,10 @@ class CHandlerHTMLSubmitForm : public IActionHandler { groupHtml->submitForm(button, x, y); } + else + { + nlwarning("CGroupHTML with id '%s' not found.", container.c_str()); + } } } }; From dfeba1426a4d33a8b0e7027dad25fe1eab854f6b Mon Sep 17 00:00:00 2001 From: Nimetu Date: Fri, 14 Feb 2020 11:18:11 +0200 Subject: [PATCH 25/39] Fixed: Invalid table cell id --- code/nel/src/gui/group_html.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 0a6a1b2c8..d34c23a73 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -6793,9 +6793,11 @@ namespace NLGUI _Cells.back() = new CGroupCell(CViewBase::TCtorParam()); if (elm.hasNonEmptyAttribute("id")) - _Cells.back()->setId(getCurrentGroup()->getId() + ":TD" + elm.getAttribute("id")); + _Cells.back()->setId(table->getId() + ":" + elm.getAttribute("id")); else - _Cells.back()->setId(getCurrentGroup()->getId() + ":TD" + toString(getNextAutoIdSeq())); + _Cells.back()->setId(table->getId() + ":TD" + toString(getNextAutoIdSeq())); + // inner cell content + _Cells.back()->Group->setId(_Cells.back()->getId() + ":CELL"); if (_Style.checkStyle("background-repeat", "repeat")) _Cells.back()->setTextureTile(true); From 6747613b0363dceabc7347859048cead9ed7f11b Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Tue, 18 Feb 2020 14:04:28 +0100 Subject: [PATCH 26/39] Added: New familly brick BSGMC --- code/ryzom/common/src/game_share/brick_families.cpp | 1 + code/ryzom/common/src/game_share/brick_families.h | 1 + 2 files changed, 2 insertions(+) diff --git a/code/ryzom/common/src/game_share/brick_families.cpp b/code/ryzom/common/src/game_share/brick_families.cpp index ead3e827b..dbf0be6f4 100644 --- a/code/ryzom/common/src/game_share/brick_families.cpp +++ b/code/ryzom/common/src/game_share/brick_families.cpp @@ -549,6 +549,7 @@ namespace BRICK_FAMILIES NL_STRING_CONVERSION_TABLE_ENTRY(BSGMBP) NL_STRING_CONVERSION_TABLE_ENTRY(BSGMBR) NL_STRING_CONVERSION_TABLE_ENTRY(BSGMBS) + NL_STRING_CONVERSION_TABLE_ENTRY(BSGMC) NL_STRING_CONVERSION_TABLE_ENTRY(BSMMA) NL_STRING_CONVERSION_TABLE_ENTRY(BSMMB) NL_STRING_CONVERSION_TABLE_ENTRY(BSMMC) diff --git a/code/ryzom/common/src/game_share/brick_families.h b/code/ryzom/common/src/game_share/brick_families.h index b916ee2bd..311ab98e6 100644 --- a/code/ryzom/common/src/game_share/brick_families.h +++ b/code/ryzom/common/src/game_share/brick_families.h @@ -660,6 +660,7 @@ namespace BRICK_FAMILIES BSGMBP, BSGMBR, BSGMBS, + BSGMC, // jewels s2e0 BeginMagicPowerParameter, BSMMA = BeginMagicPowerParameter, // sap aura From b1d18ddb538565982cd834e9623c361c7ec1e817 Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Tue, 18 Feb 2020 14:04:28 +0100 Subject: [PATCH 27/39] Added: New familly brick BSGMC --- code/ryzom/common/src/game_share/brick_families.cpp | 1 + code/ryzom/common/src/game_share/brick_families.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/code/ryzom/common/src/game_share/brick_families.cpp b/code/ryzom/common/src/game_share/brick_families.cpp index ead3e827b..684eb0d25 100644 --- a/code/ryzom/common/src/game_share/brick_families.cpp +++ b/code/ryzom/common/src/game_share/brick_families.cpp @@ -557,6 +557,7 @@ namespace BRICK_FAMILIES NL_STRING_CONVERSION_TABLE_ENTRY(BSCMB) NL_STRING_CONVERSION_TABLE_ENTRY(BSCMC) NL_STRING_CONVERSION_TABLE_ENTRY(BSCMD) + NL_STRING_CONVERSION_TABLE_ENTRY(BSGMC) NL_STRING_CONVERSION_TABLE_ENTRY(BSXCA) diff --git a/code/ryzom/common/src/game_share/brick_families.h b/code/ryzom/common/src/game_share/brick_families.h index b916ee2bd..49a73fbaa 100644 --- a/code/ryzom/common/src/game_share/brick_families.h +++ b/code/ryzom/common/src/game_share/brick_families.h @@ -675,6 +675,8 @@ namespace BRICK_FAMILIES BSCMD, // heal Focus EndPowerParameter = BSCMD, + BSGMC, // jewels s2e0 + BeginMagicPowerCredit, BSXCA = BeginMagicPowerCredit, // recast time EndMagicPowerCredit = BSXCA, From 01cb2cfdd890ab13ae5ef2070e3070d04a2c88df Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Tue, 18 Feb 2020 16:19:08 +0100 Subject: [PATCH 28/39] Fixed: check if crystallized spell have a root icon for background or add it --- code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index a5a07420f..977bda672 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -1101,6 +1101,7 @@ void CDBCtrlSheet::infoReceived() { CViewRenderer &rVR = *CViewRenderer::getInstance(); CSBrickManager *pBM= CSBrickManager::getInstance(); + bool haveRoot = false; for(uint i=0; iEnchantment.Bricks.size(); ++i) { const CSBrickSheet *brick = pBM->getBrick(itemInfo->Enchantment.Bricks[i]); @@ -1108,11 +1109,17 @@ void CDBCtrlSheet::infoReceived() { if (!brick->isRoot() && !brick->isCredit() && !brick->isParameter()) { + if (!haveRoot) + { + _EnchantIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(brick->getIconBack()), brick->IconBackColor)); + rVR.getTextureSizeFromId(_EnchantIcons.back().TextureId, _EnchantIcons.back().IconW, _EnchantIcons.back().IconH); + } _EnchantIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(brick->getIcon()), brick->IconColor)); rVR.getTextureSizeFromId(_EnchantIcons.back().TextureId, _EnchantIcons.back().IconW, _EnchantIcons.back().IconH); } else if (brick->isRoot()) { + haveRoot = true; // there should be single root icon and it should be first one _EnchantIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(brick->getIconBack()), brick->IconBackColor)); rVR.getTextureSizeFromId(_EnchantIcons.back().TextureId, _EnchantIcons.back().IconW, _EnchantIcons.back().IconH); From f9d37a390a455fe668b7951e324887ca89636cea Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Wed, 19 Feb 2020 01:41:03 +0100 Subject: [PATCH 29/39] Fixed: Only get news from npcs --- code/ryzom/client/src/game_context_menu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/game_context_menu.cpp b/code/ryzom/client/src/game_context_menu.cpp index c37c76b17..bab0c42de 100644 --- a/code/ryzom/client/src/game_context_menu.cpp +++ b/code/ryzom/client/src/game_context_menu.cpp @@ -456,10 +456,10 @@ void CGameContextMenu::update() fameValue = pLeafFame->getValue8(); } if (_TextNews) - _TextNews->setActive(selection && !canAttack() && !selection->isForageSource() && fameValue >= -30); + _TextNews->setActive(selection && !canAttack() && selection->isNPC() && fameValue >= -30); if (_TextNewsAgressive) - _TextNewsAgressive->setActive(selection && !canAttack() && !selection->isForageSource() && fameValue < -30); + _TextNewsAgressive->setActive(selection && !canAttack() && selection->isNPC() && fameValue < -30); if (_TextDuel && _TextUnDuel) From 1db03005155a512723d698be8b5189f625da1b18 Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Thu, 27 Feb 2020 17:52:55 +0100 Subject: [PATCH 30/39] Added: moveToTarget lua command and OpenArkUrl move action --- .../ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp | 13 +++++++++++++ code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h | 1 + code/ryzom/client/src/user_entity.cpp | 6 +++++- code/ryzom/client/src/user_entity.h | 1 + 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 006d45663..034a914b2 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -464,6 +464,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) ls.registerFunc("getTargetName", getTargetName); ls.registerFunc("getTargetTitleRaw", getTargetTitleRaw); ls.registerFunc("getTargetTitle", getTargetTitle); + ls.registerFunc("moveToTarget", moveToTarget); ls.registerFunc("addSearchPathUser", addSearchPathUser); ls.registerFunc("displaySystemInfo", displaySystemInfo); ls.registerFunc("displayChatMessage", displayChatMessage); @@ -1527,6 +1528,18 @@ int CLuaIHMRyzom::getTargetTitle(CLuaState &ls) return 1; } +// *************************************************************************** +int CLuaIHMRyzom::moveToTarget(CLuaState &ls) +{ + CLuaIHM::checkArgCount(ls, "moveToTarget", 0); + CEntityCL *target = getTargetEntity(); + if (!target) return 0; + + UserEntity->moveTo(UserEntity->selection(), 1.0, CUserEntity::OpenArkUrl); + return 0; +} + + // *************************************************************************** int CLuaIHMRyzom::addSearchPathUser(CLuaState &ls) { diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h index 529ef8724..78b5a2a00 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -92,6 +92,7 @@ private: static int getTargetName(CLuaState &ls); static int getTargetTitleRaw(CLuaState &ls); static int getTargetTitle(CLuaState &ls); + static int moveToTarget(CLuaState &ls); static int addSearchPathUser(CLuaState &ls); static int getClientCfgVar(CLuaState &ls); static int isPlayerFreeTrial(CLuaState &ls); diff --git a/code/ryzom/client/src/user_entity.cpp b/code/ryzom/client/src/user_entity.cpp index fd1670da0..652568255 100644 --- a/code/ryzom/client/src/user_entity.cpp +++ b/code/ryzom/client/src/user_entity.cpp @@ -1682,10 +1682,14 @@ void CUserEntity::moveToAction(CEntityCL *ent) case CUserEntity::Outpost: CLuaManager::getInstance().executeLuaScript("game:outpostBCOpenStateWindow()", 0); break; - // BuildTotem + // BuildTotem case CUserEntity::BuildTotem: buildTotem(); break; + // openArkUrl + case CUserEntity::OpenArkUrl: + CLuaManager::getInstance().executeLuaScript("game:openTargetArkUrl()", 0); + break; default: break; } diff --git a/code/ryzom/client/src/user_entity.h b/code/ryzom/client/src/user_entity.h index e240622c9..194ba931f 100644 --- a/code/ryzom/client/src/user_entity.h +++ b/code/ryzom/client/src/user_entity.h @@ -95,6 +95,7 @@ public: Outpost, BuildTotem, MissionRing, + OpenArkUrl, }; public: From 4df2489f5996afbca76bbd9cd0fe2af7f5b42b45 Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Thu, 27 Feb 2020 22:33:09 +0100 Subject: [PATCH 31/39] Changed: updated way to moveToTarget --- code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp | 8 ++++++-- code/ryzom/client/src/user_entity.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 034a914b2..f83bd7dea 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -1531,10 +1531,14 @@ int CLuaIHMRyzom::getTargetTitle(CLuaState &ls) // *************************************************************************** int CLuaIHMRyzom::moveToTarget(CLuaState &ls) { - CLuaIHM::checkArgCount(ls, "moveToTarget", 0); + CLuaIHM::checkArgCount(ls, "moveToTarget", 1); + CLuaIHM::checkArgType(ls, "url", 1, LUA_TSTRING); + + const std::string &url = ls.toString(1); CEntityCL *target = getTargetEntity(); if (!target) return 0; - + + CLuaManager::getInstance().executeLuaScript("ArkTargetUrl = [["+url+"]]", 0); UserEntity->moveTo(UserEntity->selection(), 1.0, CUserEntity::OpenArkUrl); return 0; } diff --git a/code/ryzom/client/src/user_entity.cpp b/code/ryzom/client/src/user_entity.cpp index 652568255..67a31770f 100644 --- a/code/ryzom/client/src/user_entity.cpp +++ b/code/ryzom/client/src/user_entity.cpp @@ -1688,7 +1688,7 @@ void CUserEntity::moveToAction(CEntityCL *ent) break; // openArkUrl case CUserEntity::OpenArkUrl: - CLuaManager::getInstance().executeLuaScript("game:openTargetArkUrl()", 0); + CLuaManager::getInstance().executeLuaScript("getUI('ui:interface:web_transactions'):find('html'):browse(ArkTargetUrl)", 0); break; default: break; From e349cb43996f018ef86f207c3c864cb8d2b206ce Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Tue, 3 Mar 2020 18:29:12 +0100 Subject: [PATCH 32/39] Fixed: issue with webig dyn chat --- code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp index 063b56131..075dd6f7d 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp @@ -892,7 +892,7 @@ void CGroupInSceneBubbleManager::dynChatOpen (uint32 nBotUID, uint32 nBotName, c uint32 pos, j; for (pos = 0; pos < _DynBubbles.size(); ++pos) { - if (_DynBubbles[pos].BotUID == nBotUID) + if (_DynBubbles[pos].BotUID == nBotUID && _DynBubbles[pos].BotName != 0) break; } @@ -1005,7 +1005,7 @@ void CGroupInSceneBubbleManager::webIgChatOpen (uint32 nBotUID, string text, con uint32 pos, j; for (pos = 0; pos < _DynBubbles.size(); ++pos) { - if (_DynBubbles[pos].BotUID == nBotUID) + if (_DynBubbles[pos].BotUID == nBotUID && _DynBubbles[pos].BotName == 0) break; } From 0aff3b4365ef881faca0a9cc8352d0e5e0ef837d Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Tue, 3 Mar 2020 18:26:00 +0100 Subject: [PATCH 33/39] Revert "Changed: Fix issue with webig dynChat " This reverts commit 14a375eea9f97cabb23199719cfa8022d9e907d1. --- code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp index 075dd6f7d..063b56131 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp @@ -892,7 +892,7 @@ void CGroupInSceneBubbleManager::dynChatOpen (uint32 nBotUID, uint32 nBotName, c uint32 pos, j; for (pos = 0; pos < _DynBubbles.size(); ++pos) { - if (_DynBubbles[pos].BotUID == nBotUID && _DynBubbles[pos].BotName != 0) + if (_DynBubbles[pos].BotUID == nBotUID) break; } @@ -1005,7 +1005,7 @@ void CGroupInSceneBubbleManager::webIgChatOpen (uint32 nBotUID, string text, con uint32 pos, j; for (pos = 0; pos < _DynBubbles.size(); ++pos) { - if (_DynBubbles[pos].BotUID == nBotUID && _DynBubbles[pos].BotName == 0) + if (_DynBubbles[pos].BotUID == nBotUID) break; } From 96e95c19eef7770e4d59afbc93fbbdf8e6ad94bf Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Tue, 3 Mar 2020 18:32:23 +0100 Subject: [PATCH 34/39] Changed: Fix issue with webig dynChat --- code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp index 063b56131..075dd6f7d 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp @@ -892,7 +892,7 @@ void CGroupInSceneBubbleManager::dynChatOpen (uint32 nBotUID, uint32 nBotName, c uint32 pos, j; for (pos = 0; pos < _DynBubbles.size(); ++pos) { - if (_DynBubbles[pos].BotUID == nBotUID) + if (_DynBubbles[pos].BotUID == nBotUID && _DynBubbles[pos].BotName != 0) break; } @@ -1005,7 +1005,7 @@ void CGroupInSceneBubbleManager::webIgChatOpen (uint32 nBotUID, string text, con uint32 pos, j; for (pos = 0; pos < _DynBubbles.size(); ++pos) { - if (_DynBubbles[pos].BotUID == nBotUID) + if (_DynBubbles[pos].BotUID == nBotUID && _DynBubbles[pos].BotName == 0) break; } From 9aabe0bf35acaa4ef0013f519bbb70da173a97ed Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 8 Mar 2020 09:46:21 +0200 Subject: [PATCH 35/39] Revert "Fixed: Remove blank space when an item menu are inactive" This reverts commit 10f864b234ad41f17802ad2c27ac943298bf6019. --- code/nel/src/gui/group_menu.cpp | 42 +++++++++++++-------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/code/nel/src/gui/group_menu.cpp b/code/nel/src/gui/group_menu.cpp index d09eec039..90416571c 100644 --- a/code/nel/src/gui/group_menu.cpp +++ b/code/nel/src/gui/group_menu.cpp @@ -592,14 +592,11 @@ namespace NLGUI { // compute max height of widgets on the left of text sint32 widgetMaxH = 0; - if (_Lines[k].ViewText->getActive()) - { - if (_Lines[k].UserGroupRight) widgetMaxH = _Lines[k].UserGroupRight->getHReal(); - if (_Lines[k].UserGroupLeft) widgetMaxH = std::max(widgetMaxH, _Lines[k].UserGroupLeft->getHReal()); - if (_Lines[k].CheckBox) widgetMaxH = std::max(widgetMaxH, _Lines[k].CheckBox->getHReal()); - if (_Lines[k].RightArrow) widgetMaxH = std::max(widgetMaxH, _Lines[k].RightArrow->getHReal()); - widgetMaxH = std::max(widgetMaxH, _Lines[k].ViewText->getHReal()); - } + if (_Lines[k].UserGroupRight) widgetMaxH = _Lines[k].UserGroupRight->getHReal(); + if (_Lines[k].UserGroupLeft) widgetMaxH = std::max(widgetMaxH, _Lines[k].UserGroupLeft->getHReal()); + if (_Lines[k].CheckBox) widgetMaxH = std::max(widgetMaxH, _Lines[k].CheckBox->getHReal()); + if (_Lines[k].RightArrow) widgetMaxH = std::max(widgetMaxH, _Lines[k].RightArrow->getHReal()); + widgetMaxH = std::max(widgetMaxH, _Lines[k].ViewText->getHReal()); _GroupList->setMaxH(widgetMaxH*_MaxVisibleLine+_GroupList->getSpace()*(_MaxVisibleLine-1)); if (_ScrollBar == NULL) { @@ -642,21 +639,16 @@ namespace NLGUI { // compute max height of widgets on the left of text sint32 widgetMaxH = 0; - sint32 textHReal = 0; - if (_Lines[k].ViewText->getActive()) - { - if (_Lines[k].UserGroupRight) widgetMaxH = _Lines[k].UserGroupRight->getHReal(); - if (_Lines[k].UserGroupLeft) widgetMaxH = std::max(widgetMaxH, _Lines[k].UserGroupLeft->getHReal()); - if (_Lines[k].CheckBox) widgetMaxH = std::max(widgetMaxH, _Lines[k].CheckBox->getHReal()); - if (_Lines[k].RightArrow) widgetMaxH = std::max(widgetMaxH, _Lines[k].RightArrow->getHReal()); - - textHReal = _Lines[k].ViewText->getHReal(); - } - - _Lines[k].HReal = max(widgetMaxH, textHReal); - _Lines[k].TextDY = textDYPos; + if (_Lines[k].UserGroupRight) widgetMaxH = _Lines[k].UserGroupRight->getHReal(); + if (_Lines[k].UserGroupLeft) widgetMaxH = std::max(widgetMaxH, _Lines[k].UserGroupLeft->getHReal()); + if (_Lines[k].CheckBox) widgetMaxH = std::max(widgetMaxH, _Lines[k].CheckBox->getHReal()); + if (_Lines[k].RightArrow) widgetMaxH = std::max(widgetMaxH, _Lines[k].RightArrow->getHReal()); + + sint32 textHReal= _Lines[k].ViewText->getHReal(); + _Lines[k].HReal= max(widgetMaxH, textHReal); + _Lines[k].TextDY= textDYPos; if(widgetMaxH>textHReal) - _Lines[k].TextDY += (widgetMaxH-textHReal) / 2; + _Lines[k].TextDY+= (widgetMaxH-textHReal) / 2; } } @@ -1252,7 +1244,7 @@ namespace NLGUI pV->setCaseMode(_GroupMenu->getCaseMode()); if (formatted) { - pV->setMultiLine (true); + pV->setMultiLine (true); pV->setMultiLineMaxWOnly (true); pV->setTextFormatTaged (name); } @@ -1307,9 +1299,9 @@ namespace NLGUI uint lineIndex = _Lines.size()-1; vparams.push_back(TTmplParams("id", toString("icon%d", lineIndex))); vparams.push_back(TTmplParams("sizeref", "")); - vparams.push_back(TTmplParams("icon_texture", texture)); + vparams.push_back(TTmplParams("icon_texture", texture.c_str())); //vparams.push_back(TTmplParams("icon_color", options.ColorNormal.toString())); - string lineId = toString("%s:icon", pV->getId().c_str()); + string lineId = toString("%s:icon%d", _GroupMenu->getId().c_str(), lineIndex); CInterfaceGroup *pUGLeft = CWidgetManager::getInstance()->getParser()->createGroupInstance("menu_row_icon", lineId, vparams); if (pUGLeft) From edb0c1fe73f9677764a661d775f9b97d77b6ee9a Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 8 Mar 2020 09:46:42 +0200 Subject: [PATCH 36/39] Revert "Added: New way to add icons in Contextual Menus" This reverts commit 188c3494fa533e0201837d8313802426aadd99e3. --- code/nel/include/nel/gui/group_menu.h | 6 +-- code/nel/src/gui/group_menu.cpp | 63 +++++---------------------- 2 files changed, 13 insertions(+), 56 deletions(-) diff --git a/code/nel/include/nel/gui/group_menu.h b/code/nel/include/nel/gui/group_menu.h index 70761d650..9c5b37589 100644 --- a/code/nel/include/nel/gui/group_menu.h +++ b/code/nel/include/nel/gui/group_menu.h @@ -31,7 +31,7 @@ namespace NLGUI class CViewBitmap; class CGroupList; class CGroupMenu; - class CGroupSubMenu; + /** * CViewTextMenu is an element of a sub menu @@ -50,7 +50,6 @@ namespace NLGUI _Checked = false; _Checkable = false; _CheckBox = NULL; - _ParentMenu = NULL; Over = false; } @@ -61,8 +60,6 @@ namespace NLGUI bool getCheckable() const { return _Checkable; } void setCheckable(bool c); void setCheckBox(CViewBitmap *checkBox) { _CheckBox = checkBox; } - void setParentMenu(CGroupSubMenu *parentMenu) { _ParentMenu = parentMenu; }; - void setActive (bool g); CViewBitmap * getCheckBox() const { return _CheckBox; } bool getFormatted () const { return getMultiLine (); } @@ -89,7 +86,6 @@ namespace NLGUI bool _Grayed; bool _Checked; bool _Checkable; - CGroupSubMenu *_ParentMenu; }; /** diff --git a/code/nel/src/gui/group_menu.cpp b/code/nel/src/gui/group_menu.cpp index 90416571c..c7db05e4f 100644 --- a/code/nel/src/gui/group_menu.cpp +++ b/code/nel/src/gui/group_menu.cpp @@ -114,19 +114,6 @@ namespace NLGUI OldShadowColorGrayed.A = OldColorGrayed.A = (uint8)a; } - // ------------------------------------------------------------------------------------------------ - void CViewTextMenu::setActive (bool state) - { - if (_ParentMenu) - _ParentMenu->setActive(state); - - if (_Active != state) - { - _Active = state; - invalidateCoords(); - } - } - // ------------------------------------------------------------------------------------------------ // CGroupSubMenu // ------------------------------------------------------------------------------------------------ @@ -303,9 +290,6 @@ namespace NLGUI if (cond) strCond = (const char*)cond; CXMLAutoPtr params((const char*) xmlGetProp (cur, (xmlChar*)"params")); if (params) strParams = (const char*)params; - CXMLAutoPtr icon((const char*) xmlGetProp (cur, (xmlChar*)"icon")); - if (icon) - strTexture = (const char*)icon; CXMLAutoPtr strCheckable((const char*) xmlGetProp (cur, (xmlChar*)"checkable")); bool bCheckable = false; if (strCheckable) bCheckable = convertBool (strCheckable); @@ -409,11 +393,11 @@ namespace NLGUI pVB->setSerializable( false ); pVB->setParent (this); pVB->setParentPos (parentPos); - pVB->setParentPosRef (Hotspot_BL); - pVB->setPosRef (Hotspot_BR); + pVB->setParentPosRef (Hotspot_ML); + pVB->setPosRef (Hotspot_MR); pVB->setTexture(texture); pVB->setModulateGlobalColor(false); - pVB->setX (MENU_WIDGET_X); + pVB->setX (-2); addView (pVB); return pVB; } @@ -655,14 +639,12 @@ namespace NLGUI // *** Update Text Positions // sint32 currX = 0; - sint32 maxTextW = 0; for(k = 0; k < _Lines.size(); ++k) { if (_Lines[k].ViewText) { // Setup Y _Lines[k].ViewText->setY(_Lines[k].TextDY); - maxTextW = max(maxTextW, _Lines[k].ViewText->getW()); } } @@ -676,12 +658,10 @@ namespace NLGUI // *** Setup SubMenus and CheckBoxes Positions sint32 maxViewW = 0; - for (i = 1; i < _Views.size(); ++i) { CViewBitmap *pVB = dynamic_cast(_Views[i]); if (pVB == NULL) continue; - if (pVB->getId() == ID_MENU_SUBMENU) { // Look for the next line of the menu that contains a sub menu @@ -1270,7 +1250,6 @@ namespace NLGUI _GroupList->addChild (pV); CViewBitmap *checkBox = NULL; - CViewBitmap *icon = NULL; if (checkable) { @@ -1279,6 +1258,15 @@ namespace NLGUI pV->setCheckBox(checkBox); } + CViewBitmap *icon = NULL; + if (!texture.empty()) + { + if (_GroupList->getNumChildren() == 1) + pV->setX(20); + icon = createIcon(pV, texture); + } + + tmp.ViewText = pV; tmp.Separator = NULL; tmp.AHName = ah; @@ -1292,39 +1280,12 @@ namespace NLGUI tmp.Id = id; pV->setId(_GroupMenu->getId()+":"+tmp.Id); - - { - typedef std::pair TTmplParams; - std::vector vparams; - uint lineIndex = _Lines.size()-1; - vparams.push_back(TTmplParams("id", toString("icon%d", lineIndex))); - vparams.push_back(TTmplParams("sizeref", "")); - vparams.push_back(TTmplParams("icon_texture", texture.c_str())); - //vparams.push_back(TTmplParams("icon_color", options.ColorNormal.toString())); - string lineId = toString("%s:icon%d", _GroupMenu->getId().c_str(), lineIndex); - - CInterfaceGroup *pUGLeft = CWidgetManager::getInstance()->getParser()->createGroupInstance("menu_row_icon", lineId, vparams); - if (pUGLeft) - { - tmp.UserGroupLeft = pUGLeft; - tmp.UserGroupLeftOwnership = true; - addGroup(pUGLeft); - pUGLeft->setParent(this); - pUGLeft->setParentPos(this); - pUGLeft->setParentPosRef (Hotspot_BL); - pUGLeft->setPosRef (Hotspot_BL); - pUGLeft->setX(LEFT_MENU_WIDGET_X); - } - } - _Lines.push_back (tmp); - // Add an empty sub menu by default _SubMenus.push_back (NULL); - _GroupMenu->invalidateCoords(); return pV; From 34083dee80eb0aabe3dd01d6e1d303fdd054314b Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 8 Mar 2020 09:40:58 +0200 Subject: [PATCH 37/39] Changed: Adding icon to menu elements --- code/nel/src/gui/group_menu.cpp | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/code/nel/src/gui/group_menu.cpp b/code/nel/src/gui/group_menu.cpp index c7db05e4f..e3e6d5937 100644 --- a/code/nel/src/gui/group_menu.cpp +++ b/code/nel/src/gui/group_menu.cpp @@ -375,6 +375,23 @@ namespace NLGUI if (pUG) setUserGroupRight((uint)_Lines.size()-1, pUG, true); } + // usergroup from simple icon + CXMLAutoPtr icon((const char*) xmlGetProp (cur, (xmlChar*)"icon")); + if (icon) + { + typedef std::pair TTmplParams; + std::vector vparams; + uint lineIndex = _Lines.size()-1; + vparams.push_back(TTmplParams("id", toString("icon%d", lineIndex))); + vparams.push_back(TTmplParams("sizeref", "")); + vparams.push_back(TTmplParams("icon_texture", (const char*)icon)); + //vparams.push_back(TTmplParams("icon_color", options.ColorNormal.toString())); + string lineId = toString("%s:icon", pV->getId().c_str()); + + CInterfaceGroup *pUG = CWidgetManager::getInstance()->getParser()->createGroupInstance("menu_row_icon", lineId, vparams); + if (pUG) + setUserGroupLeft((uint)_Lines.size()-1, pUG, true); + } } cur = cur->next; } @@ -567,8 +584,6 @@ namespace NLGUI CGroupFrame::updateCoords(); - bool mustUpdate = false; - if (_MaxVisibleLine > 0 && sint32(_Lines.size())>_MaxVisibleLine) { for(k = 0; k < _Lines.size(); ++k) @@ -599,7 +614,6 @@ namespace NLGUI _SelectionView->setW (-8-8-2); _ScrollBar->setSerializable( false ); addCtrl(_ScrollBar); - mustUpdate = true; } break; } @@ -648,13 +662,7 @@ namespace NLGUI } } - - - if (mustUpdate) - { - CGroupFrame::updateCoords(); - } - + CGroupFrame::updateCoords(); // *** Setup SubMenus and CheckBoxes Positions sint32 maxViewW = 0; From 8f3aaee987a8927712f59164ef84f2996418ea6f Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Tue, 10 Mar 2020 16:08:55 +0100 Subject: [PATCH 38/39] Changed: new name of Enclyclopedia window --- .../client/src/interface_v3/encyclopedia_manager.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/encyclopedia_manager.h b/code/ryzom/client/src/interface_v3/encyclopedia_manager.h index dc5e97651..b1b589b16 100644 --- a/code/ryzom/client/src/interface_v3/encyclopedia_manager.h +++ b/code/ryzom/client/src/interface_v3/encyclopedia_manager.h @@ -77,11 +77,11 @@ private: bool _Initializing; }; -#define CONT_ENCY "ui:interface:encyclopedia" -#define LIST_ENCY_ALBUM "ui:interface:encyclopedia:content:sbtree:tree_list" -#define PAGE_ENCY_ALBUM "ui:interface:encyclopedia:content:album" -#define PAGE_ENCY_THEMA "ui:interface:encyclopedia:content:theme" -#define PAGE_ENCY_HELP "ui:interface:encyclopedia:content:help" +#define CONT_ENCY "ui:interface:legacy_encyclopedia" +#define LIST_ENCY_ALBUM "ui:interface:legacy_encyclopedia:content:sbtree:tree_list" +#define PAGE_ENCY_ALBUM "ui:interface:legacy_encyclopedia:content:album" +#define PAGE_ENCY_THEMA "ui:interface:legacy_encyclopedia:content:theme" +#define PAGE_ENCY_HELP "ui:interface:legacy_encyclopedia:content:help" #endif // RY_ENCYCLOPEDIA_MANAGER_H From 1f736fc347957fe42ede0f54acddebe2a9e0f2fa Mon Sep 17 00:00:00 2001 From: Nimetu Date: Fri, 6 Mar 2020 15:28:58 +0200 Subject: [PATCH 39/39] Fixed: Scroll bar losing position when group window is minimized --- code/nel/src/gui/ctrl_scroll.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/src/gui/ctrl_scroll.cpp b/code/nel/src/gui/ctrl_scroll.cpp index e97bd8cd4..a940f6561 100644 --- a/code/nel/src/gui/ctrl_scroll.cpp +++ b/code/nel/src/gui/ctrl_scroll.cpp @@ -45,7 +45,7 @@ namespace NLGUI _Aligned = 1; _TrackPos = 0; _TrackDispPos = 0; - _TrackSize = _TrackSizeMin = 16; + _TrackSize = _TrackSizeMin = 8; _Min = 0; _Max = 100; _Value = 0;