Merge branch 'atys' into ryzom/ark/features

ryzom/ark/features
Ulukyn 5 years ago
commit 92f3c01a74

@ -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)
# VC_FOUND - True if MSVC found
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()
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()
IF(MSVC_TOOLCHAIN_VERSIONS)
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 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()
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}")
@ -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)
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,6 +50,7 @@ namespace NLGUI
_Checked = false;
_Checkable = false;
_CheckBox = NULL;
_ParentMenu = NULL;
Over = false;
}
@ -60,6 +61,8 @@ 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 (); }
@ -86,6 +89,7 @@ namespace NLGUI
bool _Grayed;
bool _Checked;
bool _Checkable;
CGroupSubMenu *_ParentMenu;
};
/**

@ -1748,7 +1748,7 @@ void CVegetableManager::swapIgRdrPassHardMode(CVegetableInstanceGroup *ig, uin
// ***************************************************************************
void CVegetableManager::setGlobalDensity(float density)
{
clamp(density, 0.f, 1.f);
clamp(density, 0.f, 100.f);
_GlobalDensity= density;
}

@ -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))
{
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,6 +114,19 @@ 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
// ------------------------------------------------------------------------------------------------
@ -290,6 +303,9 @@ 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);
@ -393,11 +409,11 @@ namespace NLGUI
pVB->setSerializable( false );
pVB->setParent (this);
pVB->setParentPos (parentPos);
pVB->setParentPosRef (Hotspot_ML);
pVB->setPosRef (Hotspot_MR);
pVB->setParentPosRef (Hotspot_BL);
pVB->setPosRef (Hotspot_BR);
pVB->setTexture(texture);
pVB->setModulateGlobalColor(false);
pVB->setX (-2);
pVB->setX (MENU_WIDGET_X);
addView (pVB);
return pVB;
}
@ -576,11 +592,14 @@ 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());
}
_GroupList->setMaxH(widgetMaxH*_MaxVisibleLine+_GroupList->getSpace()*(_MaxVisibleLine-1));
if (_ScrollBar == NULL)
{
@ -623,28 +642,35 @@ 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());
sint32 textHReal= _Lines[k].ViewText->getHReal();
_Lines[k].HReal= max(widgetMaxH, textHReal);
_Lines[k].TextDY= textDYPos;
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());
}
}
@ -658,10 +684,12 @@ namespace NLGUI
// *** 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
@ -1250,6 +1278,7 @@ namespace NLGUI
_GroupList->addChild (pV);
CViewBitmap *checkBox = NULL;
CViewBitmap *icon = NULL;
if (checkable)
{
@ -1258,15 +1287,6 @@ 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;
@ -1281,11 +1301,38 @@ 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;

@ -1094,7 +1094,8 @@ namespace NLGUI
else
mouseIn= isIn(x,y);
// if the mouse cursor is in the clip area
if(mouseIn) {
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));
@ -2405,6 +2406,7 @@ namespace NLGUI
if (_Lines.empty())
{
x = 0;
fx = 0;
}
else
{

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

@ -415,24 +415,10 @@ SystemInfoColors =
"R2_INVITE","0 255 0 255 around", // Ring invitation
};
PrintfCommands = {
"52", "15", "55 55 0 255", "28", "uiChapterV", "624",
"428", "0 0 0 255", "18", "", "624", "378",
"0 0 0 255", "14", "", "644", "278", "0 0 0 255",
"18", "", "52", "17", "255 255 255 255", "28",
"uiChapterV", "622", "430", "255 255 255 255", "18", "",
"622", "380", "255 255 255 255", "14", "", "642",
"280", "255 255 255 255", "18", ""
};
PrintfCommandsFreeTrial = {
"52", "15", "55 55 0 255", "28", "uiChapterV", "624",
"428", "0 0 0 255", "18", "", "624", "378",
"0 0 0 255", "14", "", "644", "278", "0 0 0 255",
"18", "", "52", "17", "255 255 255 255", "28",
"uiChapterV", "622", "430", "255 255 255 255", "18", "",
"622", "380", "255 255 255 255", "14", "", "642",
"280", "255 255 255 255", "18", ""
loadingTexts = {
"0", "132", "30 144 255 255", "18", "uiS2",
"0", "105", "255 188 0 255", "14", "uiS2E0",
"0", "65", "255 255 255 255", "12", "NEWS"
};
DisplayMissingAnimFile = 0;

@ -5847,7 +5847,7 @@ void CCharacterCL::animEventsProcessing(double startTime, double stopTime)
}
// Sound Process.
CSoundAnimManager* sndMngr = CSoundAnimManager::instance();
if(sndMngr && (_SoundId[MOVE] != CSoundAnimationNoId))
if(_SoundContext.Args[2] != 999 && sndMngr && (_SoundId[MOVE] != CSoundAnimationNoId))
{
_SoundContext.Position = pos();
// Look for the cluster(s) containing this character...

@ -1413,14 +1413,8 @@ void CClientConfig::setValues()
#ifndef RZ_NO_CLIENT
// printf commands in loading screens
ClientCfg.PrintfCommands.clear();
ClientCfg.PrintfCommandsFreeTrial.clear();
std::vector< std::string > printfCommands(2);
printfCommands[0] = "PrintfCommands";
printfCommands[1] = "PrintfCommandsFreeTrial";
for(uint p=0; p<2; p++)
{
CConfigFile::CVar *pc = ClientCfg.ConfigFile.getVarPtr(printfCommands[p].c_str());
ClientCfg.loadingTexts.clear();
CConfigFile::CVar *pc = ClientCfg.ConfigFile.getVarPtr("loadingTexts");
if (pc)
{
if( pc->size()%5 == 0 && pc->size() >= 5)
@ -1434,14 +1428,12 @@ void CClientConfig::setValues()
pcom.FontSize = pc->asInt(i+3);
pcom.Text = pc->asString(i+4);
if(p==0) ClientCfg.PrintfCommands.push_back( pcom );
else ClientCfg.PrintfCommandsFreeTrial.push_back( pcom );
ClientCfg.loadingTexts.push_back( pcom );
}
}
else
{
cfgWarning(("Missing or too many parameters in " + printfCommands[p]).c_str());
}
cfgWarning("Missing or too many parameters in loadingTexts");
}
}
#endif

@ -699,9 +699,7 @@ struct CClientConfig
uint FontSize;
std::string Text;
};
std::vector<SPrintfCommand> PrintfCommands;
std::vector<SPrintfCommand> PrintfCommandsFreeTrial;
std::vector<SPrintfCommand> loadingTexts;
// funny loading messages count
uint16 LoadingStringCount;

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

@ -30,10 +30,12 @@
#include "interface_v3/bot_chat_manager.h"
#include "interface_v3/guild_manager.h"
#include "interface_v3/people_interraction.h"
#include "continent_manager.h"
#include "main_loop.h"
#include "interface_v3/inventory_manager.h"
#include "motion/user_controls.h"
#include "sheet_manager.h"
#include "connection.h"
// GAME SHARE
#include "game_share/constants.h"
#include "game_share/properties.h"
@ -47,6 +49,7 @@ using namespace NLMISC;
using namespace std;
extern CContinentManager ContinentMngr;
// filter available programs depending on R2 mode
static uint32 filterAvailablePrograms(uint32 src)
@ -141,6 +144,9 @@ void CGameContextMenu::init(const std::string &srcMenuId)
_TextQuitTeam = "ui:interface:" + menuId + ":quit_team";
_TextAddToFriendList = "ui:interface:" + menuId + ":add_to_friend_list";
_TextTalk = "ui:interface:" + menuId + ":talk";
_TextInvisible = "ui:interface:" + menuId + ":invisible";
_TextInvulnerable = "ui:interface:" + menuId + ":invulnerable";
_TextGod = "ui:interface:" + menuId + ":god";
// Mission DB and Text link
@ -161,6 +167,7 @@ void CGameContextMenu::init(const std::string &srcMenuId)
// BotChat menus
_TextNews = "ui:interface:" + menuId + ":news";
_TextNewsAgressive = "ui:interface:" + menuId + ":news_aggressive";
_TextTradeItem = "ui:interface:" + menuId + ":trade_item";
_TextTradeTeleport = "ui:interface:" + menuId + ":trade_teleport";
_TextTradeFaction = "ui:interface:" + menuId + ":trade_faction";
@ -257,6 +264,18 @@ void CGameContextMenu::update()
setupContextMenuCantTalk(); // can't talk by default
bool showGMOptions = (hasPrivilegeDEV() || hasPrivilegeSGM() || hasPrivilegeGM() || hasPrivilegeVG() || hasPrivilegeSG() || hasPrivilegeEM() || hasPrivilegeEG() || hasPrivilegeOBSERVER());
if (_TextInvisible)
_TextInvisible->setActive(showGMOptions);
if (_TextInvulnerable)
_TextInvulnerable->setActive(showGMOptions);
if (_TextGod)
_TextGod->setActive(showGMOptions);
// If mode Combat (no talk, no give, no mount, no extract_rm)
if(UserEntity->isFighting())
{
@ -391,7 +410,7 @@ void CGameContextMenu::update()
if(_TextExchange)
{
// Action possible only if the client is not already busy and the selection is able to do this with you..
if(selection && selection->properties().canExchangeItem())
if(selection && selection->isPlayer() && selection->properties().canExchangeItem())
_TextExchange->setActive(!UserEntity->isBusy());
else
_TextExchange->setActive(false);
@ -415,6 +434,34 @@ void CGameContextMenu::update()
if (_TextAttack)
_TextAttack->setActive(canAttack());
// get current continent to check fame
string continent = ContinentMngr.cur()->SheetName;
sint8 fameValue = 0;
uint fameIndex;
if (continent == "lesfalaises.continent")
fameIndex = CStaticFames::getInstance().getFactionIndex("matis");
else if (continent == "fyros.continent")
fameIndex = CStaticFames::getInstance().getFactionIndex("fyros");
else if (continent == "tryker.continent")
fameIndex = CStaticFames::getInstance().getFactionIndex("tryker");
else if (continent == "lepaysmalade.continent")
fameIndex = CStaticFames::getInstance().getFactionIndex("zorai");
if (fameIndex != CStaticFames::INVALID_FACTION_INDEX)
{
CCDBNodeLeaf *pLeafFame = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:FAME:PLAYER%d:VALUE", fameIndex), false);
if (pLeafFame != NULL)
fameValue = pLeafFame->getValue8();
}
if (_TextNews)
_TextNews->setActive(selection && !canAttack() && selection->isNPC() && fameValue >= -30);
if (_TextNewsAgressive)
_TextNewsAgressive->setActive(selection && !canAttack() && selection->isNPC() && fameValue < -30);
if (_TextDuel && _TextUnDuel)
{
if ((!UserEntity->isRiding()) && (_ServerInDuel->getValue8() != 0))
@ -494,7 +541,7 @@ void CGameContextMenu::update()
{
bool invitable = false;
// User should not be flagged as invitable by himself, so no need to check that selection is not the user
if(selection && selection->properties().invitable() && propValidation.invitable() )
if(selection && selection->isPlayer() && selection->properties().invitable() && propValidation.invitable() )
{
invitable = true;
}
@ -605,6 +652,7 @@ void CGameContextMenu::update()
// Apply real activation of Talk Texts.
applyTextTalk();
}
// ***************************************************************************
@ -715,9 +763,20 @@ void CGameContextMenu::updateContextMenuMissionsOptions( bool forceHide )
{
result = NLMISC::CI18N::get("uiMissionOptionNotReceived");
}
if (result == ucstring("Qui etes-vous ?")
|| result == ucstring("Wer bist Du?")
|| result == ucstring("Who are you?")
|| result == ucstring("Quién eres tú?")
|| result == ucstring("Кто ты?"))
{
pVTM->setActive(false);
}
else
{
pVTM->setText(result);
pVTM->setActive(true);
}
}
else
{
pVTM->setText(ucstring(""));
@ -856,7 +915,7 @@ void CGameContextMenu::updateContextMenuTalkEntries(uint options)
options = std::numeric_limits<uint>::max(); // in local mode, force all options to be shown (for debug)
}
// news
_OkTextNews= ((options & (1 << BOTCHATTYPE::NewsFlag)));
_OkTextNews= true; //((options & (1 << BOTCHATTYPE::NewsFlag)));
// trade
_OkTextTradeItem= ((options & (1 << BOTCHATTYPE::TradeItemFlag)) != 0);
_OkTextTradeTeleport= ((options & (1 << BOTCHATTYPE::TradeTeleportFlag)) != 0);
@ -907,7 +966,6 @@ void CGameContextMenu::setupContextMenuTalkWithPlayer()
// ***************************************************************************
void CGameContextMenu::applyTextTalk()
{
if (_TextNews) _TextNews->setActive(_OkTextNews);
if (_TextTradeItem) _TextTradeItem->setActive(_OkTextTradeItem);
if (_TextTradeTeleport) _TextTradeTeleport->setActive(_OkTextTradeTeleport);
if (_TextTradeFaction) _TextTradeFaction->setActive(_OkTextTradeFaction);

@ -132,6 +132,7 @@ private:
// BotChat and player talk
CViewTextMenuPtr _TextNews;
CViewTextMenuPtr _TextNewsAgressive;
CViewTextMenuPtr _TextTradeItem;
CViewTextMenuPtr _TextTradeTeleport;
CViewTextMenuPtr _TextTradeFaction;
@ -155,6 +156,9 @@ private:
CViewTextMenuPtr _TextOutpostBanishPlayer;
CViewTextMenuPtr _TextOutpostBanishGuild;
CViewTextMenuPtr _TextWebPage;
CViewTextMenuPtr _TextInvisible;
CViewTextMenuPtr _TextInvulnerable;
CViewTextMenuPtr _TextGod;
CViewTextMenuPtr _TextMissionRing[BOTCHATTYPE::MaxR2MissionEntryDatabase];
// Forage source

@ -78,6 +78,7 @@ std::vector<std::pair<
/// Ring main page
string RingMainURL;
string NewsAtProgress;
void resetTextContext (const char *font, bool resetInterfaceManager)
{

@ -132,6 +132,7 @@ extern std::vector<std::pair<
extern std::string Cookie, FSAddr;
extern std::string RingMainURL;
extern std::string NewsAtProgress;
extern bool FreeTrial;
void resetTextContext (const char *font, bool resetInterfaceManager);

@ -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());
}
}
}
};
@ -2129,8 +2133,9 @@ static void setupEnchantedItem(CSheetHelpSetup &setup, ucstring &itemText)
const CItemSheet *pIS= ctrl->asItemSheet();
if(pIS && pIS->Family == ITEMFAMILY::CRYSTALLIZED_SPELL)
pPM->buildPhraseDesc(enchantInfo, itemInfo.Enchantment, 0, false, "uihelpPhraseCrystalSpellFormat");
else
else if(!pIS || pIS->Family != ITEMFAMILY::JEWELRY) {
pPM->buildPhraseDesc(enchantInfo, itemInfo.Enchantment, 0, false, "uihelpPhraseEnchantmentFormat");
}
// replace
strFindReplace(itemText, enchantTag, enchantInfo );
@ -3053,7 +3058,7 @@ void getSabrinaBrickText(CSBrickSheet *pBR, ucstring &brickText)
// Display the part this slot build.
mpInfo+= "@{T4}";
mpInfo+= RM_FABER_TYPE::toLocalString(mpSlot.FaberTypeFilter);
mpInfo+= toString("%dx ", mpSlot.Quantity) + RM_FABER_TYPE::toLocalString(mpSlot.FaberTypeFilter);
mpInfo+= "\n";
}
// replace in brickText
@ -3074,7 +3079,7 @@ void getSabrinaBrickText(CSBrickSheet *pBR, ucstring &brickText)
// Display the required item
mpInfo+= "@{T4}";
mpInfo+= STRING_MANAGER::CStringManagerClient::getItemLocalizedName(mpSlot.ItemRequired);
mpInfo+= toString("%dx ", mpSlot.Quantity) + STRING_MANAGER::CStringManagerClient::getItemLocalizedName(mpSlot.ItemRequired);
mpInfo+= "\n";
}
// replace in brickText

@ -535,6 +535,9 @@ CCtrlDraggable(param)
_SapBuffIcon = "ico_sap.tga";
_StaBuffIcon = "ico_stamina.tga";
_FocusBuffIcon = "ico_focus.tga";
_RegenText = NULL;
_RegenTextValue = 0;
}
// ----------------------------------------------------------------------------
@ -1098,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]);
@ -1105,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);
@ -2040,6 +2050,12 @@ void CDBCtrlSheet::draw()
if (!_LastSheetId)
{
_RegenTickRange = CTickRange();
if (_RegenText)
{
delete _RegenText;
_RegenText = NULL;
_RegenTextValue = 0;
}
}
else
{
@ -2066,6 +2082,36 @@ void CDBCtrlSheet::draw()
{
rVR.drawQuad(_RenderLayer + 1, regenTris[tri], backTex, CRGBA::White, false);
}
if (!_RegenText) {
_RegenText = new CViewText(CViewBase::TCtorParam());
_RegenText->setId(getId() + ":regen");
_RegenText->setParent(_Parent);
_RegenText->setOverflowText(ucstring(""));
_RegenText->setModulateGlobalColor(false);
_RegenText->setMultiLine(false);
_RegenText->setTextMode(CViewText::ClipWord);
_RegenText->setFontSizing("0", "0");
// TODO: font size / color hardcoded.
_RegenText->setFontSize(8);
_RegenText->setColor(CRGBA::White);
_RegenText->setShadow(true);
_RegenText->setActive(true);
_RegenText->updateTextContext();
}
// TODO: ticks in second hardcoded
uint32 nextValue = _RegenTickRange.EndTick > LastGameCycle ? (_RegenTickRange.EndTick - LastGameCycle) / 10 : 0;
if (_RegenTextValue != nextValue)
{
_RegenTextValue = nextValue;
_RegenText->setText(toString("%d", _RegenTextValue));
_RegenText->updateTextContext();
}
_RegenText->setXReal(_XReal+1);
_RegenText->setYReal(_YReal+2);
_RegenText->setRenderLayer(_RenderLayer+2);
_RegenText->draw();
}
}

@ -51,6 +51,7 @@ class COutpostBuildingSheet;
namespace NLGUI
{
class CViewRenderer;
class CViewText;
}
class CDBCtrlSheet;
@ -731,6 +732,8 @@ protected:
sint8 _ArmourColorIndex;
CTickRange _RegenTickRange;
NLGUI::CViewText *_RegenText;
uint32 _RegenTextValue;
/// D'n'd
sint32 _DragX, _DragY;

@ -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<CGroupMap*>(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<CGroupMap*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map"));
if (pMap != NULL)
pMap->setMap(args[0]);
return true;
}
#endif

@ -436,6 +436,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
ls.registerFunc("getDesktopIndex", getDesktopIndex);
ls.registerFunc("setLuaBreakPoint", setLuaBreakPoint);
ls.registerFunc("getMainPageURL", getMainPageURL);
ls.registerFunc("setNewsAtProgress", setNewsAtProgress);
ls.registerFunc("getCharSlot", getCharSlot);
ls.registerFunc("getServerSeason", getServerSeason);
ls.registerFunc("computeCurrSeason", computeCurrSeason);
@ -1146,6 +1147,16 @@ int CLuaIHMRyzom::getMainPageURL(CLuaState &ls)
return 1;
}
// ***************************************************************************
int CLuaIHMRyzom::setNewsAtProgress(CLuaState &ls)
{
//H_AUTO(Lua_CLuaIHM_getMainPageURL)
const char *funcName = "NewsAtProgress";
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
NewsAtProgress = ls.toString(1);
return 0;
}
// ***************************************************************************
int CLuaIHMRyzom::getCharSlot(CLuaState &ls)
{

@ -58,6 +58,7 @@ private:
static int getDesktopIndex(CLuaState &ls);
static int setLuaBreakPoint(CLuaState &ls); // set a breakpoint in lua external debugger (file, line)
static int getMainPageURL(CLuaState &ls);
static int setNewsAtProgress(CLuaState &ls);
static int getCharSlot(CLuaState &ls);
static int displaySystemInfo(CLuaState &ls);
static int displayChatMessage(CLuaState &ls);

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

@ -47,6 +47,7 @@ extern NL3D::UMaterial LoadingMaterialFull;
extern std::vector<UTextureFile*> LogoBitmaps;
extern uint TipsOfTheDayIndex;
extern ucstring TipsOfTheDay;
extern string NewsAtProgress;
extern bool UseEscapeDuringLoading;
CProgress::CProgress ()
@ -366,23 +367,27 @@ void CProgress::internalProgress (float value)
// apply text commands
if( ApplyTextCommands )
{
std::vector<CClientConfig::SPrintfCommand> printfCommands = ClientCfg.PrintfCommands;
if(FreeTrial) printfCommands = ClientCfg.PrintfCommandsFreeTrial;
std::vector<CClientConfig::SPrintfCommand> loadingTexts = ClientCfg.loadingTexts;
if( !printfCommands.empty() )
if( !loadingTexts.empty() )
{
TextContext->setHotSpot(UTextContext::MiddleBottom);
vector<CClientConfig::SPrintfCommand>::iterator itpc;
for( itpc = printfCommands.begin(); itpc != printfCommands.end(); ++itpc )
for( itpc = loadingTexts.begin(); itpc != loadingTexts.end(); ++itpc )
{
float x = 0.5f;//((*itpc).X / 1024.f);
float y = ((*itpc).Y / 768.f);
TextContext->setColor( (*itpc).Color );
TextContext->setFontSize( (uint)(16.f * fontFactor));
TextContext->setFontSize( (uint)((*itpc).FontSize * fontFactor));
// build the ucstr(s)
ucstring ucstr = CI18N::get((*itpc).Text);
string text = (*itpc).Text;
ucstring ucstr;
if (text == "NEWS")
ucstr.fromUtf8(NewsAtProgress);
else
ucstr = CI18N::get(text);
vector<ucstring> vucstr;
ucstring sep("\n");
splitUCString(ucstr,sep,vucstr);

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

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