Merge branch 'atys' into ryzom/ui/improvements

fix-media-player
Ulukyn 5 years ago
commit ff5d4e941c

@ -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)
#-----------------------------------------------------------------------------

@ -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)

@ -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)

@ -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}")
@ -154,7 +87,7 @@ IF(NOT EXISTS "${MSVC_REDIST_DIR}")
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})

@ -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)

@ -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)

@ -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)

@ -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)

@ -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()

@ -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

@ -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 <other flags>
# 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")

@ -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()

@ -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
@ -676,6 +680,8 @@ namespace NLGUI
std::vector<CEntry> Entries;
};
std::vector<CForm> _Forms;
// if <FORM> element has been closed or not
bool _FormOpen;
// submit buttons added to from
struct SFormSubmitButton
@ -946,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);

@ -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;
};
/**

@ -45,7 +45,7 @@ namespace NLGUI
_Aligned = 1;
_TrackPos = 0;
_TrackDispPos = 0;
_TrackSize = _TrackSizeMin = 16;
_TrackSize = _TrackSizeMin = 8;
_Min = 0;
_Max = 100;
_Value = 0;

@ -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);
@ -1187,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
@ -1441,6 +1443,8 @@ namespace NLGUI
_LastRefreshTime = 0.0;
_RenderNextTime = false;
_WaitingForStylesheet = false;
_AutoIdSeq = 0;
_FormOpen = false;
// Register
CWidgetManager::getInstance()->registerClockMsgTarget(this);
@ -2529,6 +2533,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());
@ -2586,6 +2591,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())
@ -3235,6 +3241,7 @@ namespace NLGUI
_Cells.clear();
_TR.clear();
_Forms.clear();
_FormOpen = false;
_FormSubmit.clear();
_Groups.clear();
_Divs.clear();
@ -3248,6 +3255,7 @@ namespace NLGUI
_ReadingHeadTag = false;
_IgnoreHeadTag = false;
_IgnoreBaseUrlTag = false;
_AutoIdSeq = 0;
paragraphChange ();
@ -4162,7 +4170,7 @@ namespace NLGUI
void CGroupHTML::renderDocument()
{
if (!_StylesheetQueue.empty())
if (!Curls.empty() && !_StylesheetQueue.empty())
{
// waiting for stylesheets to finish downloading
return;
@ -4218,6 +4226,8 @@ namespace NLGUI
removeContent();
endBuild();
success = false;
}
else
{
@ -4322,6 +4332,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);
}
@ -5536,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);
@ -5638,6 +5654,8 @@ namespace NLGUI
{
string style = elm.getAttribute("style");
string id = elm.getAttribute("id");
if (id.empty())
id = "DIV" + toString(getNextAutoIdSeq());
typedef pair<string, string> TTmplParam;
vector<TTmplParam> tmplParams;
@ -5670,10 +5688,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)
{
@ -5806,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
@ -5830,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)
{
@ -6602,6 +6628,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;
{
@ -6762,6 +6792,12 @@ namespace NLGUI
}
_Cells.back() = new CGroupCell(CViewBase::TCtorParam());
if (elm.hasNonEmptyAttribute("id"))
_Cells.back()->setId(table->getId() + ":" + elm.getAttribute("id"));
else
_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);

@ -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);
@ -391,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<std::string, std::string> TTmplParams;
std::vector<TTmplParams> 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;
}
@ -409,11 +410,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;
}
@ -583,8 +584,6 @@ namespace NLGUI
CGroupFrame::updateCoords();
bool mustUpdate = false;
if (_MaxVisibleLine > 0 && sint32(_Lines.size())>_MaxVisibleLine)
{
for(k = 0; k < _Lines.size(); ++k)
@ -592,14 +591,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)
{
@ -618,7 +614,6 @@ namespace NLGUI
_SelectionView->setW (-8-8-2);
_ScrollBar->setSerializable( false );
addCtrl(_ScrollBar);
mustUpdate = true;
}
break;
}
@ -642,54 +637,39 @@ 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;
}
}
// *** 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());
}
}
if (mustUpdate)
{
CGroupFrame::updateCoords();
}
CGroupFrame::updateCoords();
// *** Setup SubMenus and CheckBoxes Positions
sint32 maxViewW = 0;
for (i = 1; i < _Views.size(); ++i)
{
CViewBitmap *pVB = dynamic_cast<CViewBitmap *>(_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
@ -1278,7 +1258,6 @@ namespace NLGUI
_GroupList->addChild (pV);
CViewBitmap *checkBox = NULL;
CViewBitmap *icon = NULL;
if (checkable)
{
@ -1287,6 +1266,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;
@ -1301,38 +1289,11 @@ namespace NLGUI
pV->setId(_GroupMenu->getId()+":"+tmp.Id);
{
typedef std::pair<std::string, std::string> TTmplParams;
std::vector<TTmplParams> 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));
//vparams.push_back(TTmplParams("icon_color", options.ColorNormal.toString()));
string lineId = toString("%s:icon", pV->getId().c_str());
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;

@ -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("<CViewText::parse> 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,6 +2406,7 @@ namespace NLGUI
if (_Lines.empty())
{
x = 0;
fx = 0;
}
else
{
@ -2542,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;

@ -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

@ -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<listSkill.size()/2;i++)
{
CSkillValue sv;
sv.Skill= SKILLS::toSkill(listSkill[i*2]);
fromString(listSkill[i*2+1], sv.Value);
// keep only whats work
if(sv.Skill!=SKILLS::unknown)
{
RequiredOneOfSkills.push_back(sv);
}
}
// parse the sheet str
skillReqStr.clear();
TRANSLATE_VAL(skillReqStr, "Basics.LearnRequiresSkills");
while(strFindReplace(skillReqStr, ":", " "));
listSkill.clear();
splitString(skillReqStr," ",listSkill);
// build the req skill array
RequiredSkills.clear();
RequiredSkills.reserve(listSkill.size()/2);
for(i=0;i<listSkill.size()/2;i++)

@ -236,7 +236,10 @@ public:
// The Action Nature
ACTNATURE::TActionNature ActionNature;
// For Progression, the required skill
// For Progression, the required skills (at least one)
std::vector<CSkillValue> RequiredOneOfSkills;
// For Progression, the required skills (all of them)
std::vector<CSkillValue> RequiredSkills;
// For Progression, the required Bricks
@ -384,6 +387,8 @@ public:
s.serialEnum(ActionNature);
s.serialCont(RequiredOneOfSkills);
s.serialCont(RequiredSkills);
s.serialCont(RequiredBricks);

@ -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)

@ -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());
}
}
}
};

@ -1101,6 +1101,7 @@ void CDBCtrlSheet::infoReceived()
{
CViewRenderer &rVR = *CViewRenderer::getInstance();
CSBrickManager *pBM= CSBrickManager::getInstance();
bool haveRoot = false;
for(uint i=0; i<itemInfo->Enchantment.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);

@ -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

@ -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;
}

@ -4322,6 +4322,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<CGroupMap*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map"));
if (pMap != NULL)
pMap->setMap(args[0]);
return true;
}
//=========================================================================================================
// toggle user landmarks visibility
@ -4409,17 +4420,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<CGroupMap*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map"));
if (pMap != NULL)
pMap->setMap(args[0]);
return true;
}
#endif

@ -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"
@ -443,6 +444,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),
@ -461,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);
@ -468,6 +472,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);
@ -589,6 +594,9 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
LUABIND_FUNC(updateTooltipCoords),
LUABIND_FUNC(isCtrlKeyDown),
LUABIND_FUNC(encodeURLUnicodeParam),
LUABIND_FUNC(encodeURLParam),
LUABIND_FUNC(encodeToHexa),
LUABIND_FUNC(decodeFromHexa),
LUABIND_FUNC(getPlayerLevel),
LUABIND_FUNC(getPlayerVpa),
LUABIND_FUNC(getPlayerVpb),
@ -1342,6 +1350,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)
{
@ -1487,6 +1528,22 @@ int CLuaIHMRyzom::getTargetTitle(CLuaState &ls)
return 1;
}
// ***************************************************************************
int CLuaIHMRyzom::moveToTarget(CLuaState &ls)
{
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;
}
// ***************************************************************************
int CLuaIHMRyzom::addSearchPathUser(CLuaState &ls)
{
@ -1759,6 +1816,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)
@ -3747,6 +3819,31 @@ 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);
}
// ***************************************************************************
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()
{

@ -64,6 +64,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
@ -91,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);
@ -233,6 +235,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);
@ -258,6 +262,10 @@ 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 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();

@ -3697,12 +3697,20 @@ void CSPhraseManager::computePhraseProgression()
CReqSkillFormula brickFormula;
// get all its required Skill
for(uint j=0;j<brick->RequiredOneOfSkills.size();j++)
{
CSkillValue sv;
sv.Skill= brick->RequiredOneOfSkills[j].Skill;
sv.Value= brick->RequiredOneOfSkills[j].Value;
brickFormula.orV(sv);
}
for(uint j=0;j<brick->RequiredSkills.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

@ -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;

@ -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),

@ -1686,6 +1686,10 @@ void CUserEntity::moveToAction(CEntityCL *ent)
case CUserEntity::BuildTotem:
buildTotem();
break;
// openArkUrl
case CUserEntity::OpenArkUrl:
CLuaManager::getInstance().executeLuaScript("getUI('ui:interface:web_transactions'):find('html'):browse(ArkTargetUrl)", 0);
break;
default:
break;
}

@ -95,6 +95,7 @@ public:
Outpost,
BuildTotem,
MissionRing,
OpenArkUrl,
};
public:
@ -490,6 +491,16 @@ public:
return _LoginName;
}
CVector getCameraMoves()
{
return _CameraMoves;
}
void setCameraMoves(CVector moves)
{
_CameraMoves = moves;
}
protected:
class CSpeedFactor : public NLMISC::ICDBNode::IPropertyObserver
{
@ -602,6 +613,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

@ -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)

@ -675,6 +675,8 @@ namespace BRICK_FAMILIES
BSCMD, // heal Focus
EndPowerParameter = BSCMD,
BSGMC, // jewels s2e0
BeginMagicPowerCredit,
BSXCA = BeginMagicPowerCredit, // recast time
EndMagicPowerCredit = BSXCA,

@ -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()

Loading…
Cancel
Save