From 559a301ddd625f8c4665ca7d50bf674a61cf6adc Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 5 Mar 2016 12:46:47 +0100 Subject: [PATCH] Merge with develop --- code/CMakeModules/FindLuabind.cmake | 78 ++++-- code/nel/include/nel/gui/dbgroup_combo_box.h | 3 + code/nel/include/nel/gui/group_html.h | 24 ++ code/nel/include/nel/gui/group_menu.h | 1 + code/nel/src/gui/dbgroup_combo_box.cpp | 25 +- code/nel/src/gui/group_html.cpp | 261 +++++++++++++++++- code/nel/src/gui/group_menu.cpp | 11 + .../data/gamedev/interfaces_v3/inventory.xml | 245 +++++++++++++++- .../gamedev/interfaces_v3/login_widgets.xml | 19 ++ .../gamedev/interfaces_v3/names_fyros.lua | 4 +- .../gamedev/interfaces_v3/names_matis.lua | 6 +- .../gamedev/interfaces_v3/names_tryker.lua | 4 +- .../gamedev/interfaces_v3/names_zorai.lua | 6 +- .../gamedev/interfaces_v3/out_v2_appear.lua | 175 ++++++------ .../gamedev/interfaces_v3/out_v2_appear.xml | 11 +- .../data/gamedev/interfaces_v3/widgets.xml | 20 ++ code/ryzom/client/src/http_client_curl.cpp | 2 +- 17 files changed, 752 insertions(+), 143 deletions(-) diff --git a/code/CMakeModules/FindLuabind.cmake b/code/CMakeModules/FindLuabind.cmake index 6795a5089..4219c56ed 100644 --- a/code/CMakeModules/FindLuabind.cmake +++ b/code/CMakeModules/FindLuabind.cmake @@ -9,38 +9,64 @@ MACRO(FIND_CORRECT_LUA_VERSION) IF(LUABIND_LIBRARY_RELEASE MATCHES "\\.so") INCLUDE(CheckDepends) - SET(LUA52_LIBRARY "liblua5.2") - CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA52_LIBRARY LUALIB_FOUND) - - IF(NOT LUALIB_FOUND) - # fedora (v20) - SET(LUA52_LIBRARY "liblua-5.2") - CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA52_LIBRARY LUALIB_FOUND) - ENDIF(NOT LUALIB_FOUND) - - IF(LUALIB_FOUND) - MESSAGE(STATUS "Luabind is using Lua 5.2") - FIND_PACKAGE(Lua52 REQUIRED) - ELSE(LUALIB_FOUND) - SET(LUA51_LIBRARY "liblua5.1") - CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA51_LIBRARY LUALIB_FOUND) + # check for Lua 5.3 + SET(LUA53_LIBRARIES liblua5.3 liblua-5.3 liblua.so.5.3) + FOREACH(_LIB ${LUA53_LIBRARIES}) + CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA53_LIBRARY LUALIB_FOUND) IF(LUALIB_FOUND) - MESSAGE(STATUS "Luabind is using Lua 5.1") - FIND_PACKAGE(Lua51 REQUIRED) - ELSE(LUALIB_FOUND) - SET(LUA50_LIBRARY "liblua5.0") - CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA50_LIBRARY LUALIB_FOUND) + MESSAGE(STATUS "Luabind is using Lua 5.3") + FIND_PACKAGE(Lua53 REQUIRED) + BREAK() + ENDIF() + ENDFOREACH() + IF(NOT LUALIB_FOUND) + # check for Lua 5.2 + SET(LUA52_LIBRARIES liblua5.2 liblua-5.2 liblua.so.5.2) + + FOREACH(_LIB ${LUA52_LIBRARIES}) + CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA52_LIBRARY LUALIB_FOUND) + IF(LUALIB_FOUND) + MESSAGE(STATUS "Luabind is using Lua 5.2") + FIND_PACKAGE(Lua52 REQUIRED) + BREAK() + ENDIF() + ENDFOREACH() + ENDIF() + + IF(NOT LUALIB_FOUND) + # check for Lua 5.1 + SET(LUA51_LIBRARIES liblua5.1 liblua-5.1 liblua.so.5.1) + + FOREACH(_LIB ${LUA51_LIBRARIES}) + CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA51_LIBRARY LUALIB_FOUND) + IF(LUALIB_FOUND) + MESSAGE(STATUS "Luabind is using Lua 5.1") + FIND_PACKAGE(Lua51 REQUIRED) + BREAK() + ENDIF() + ENDFOREACH() + ENDIF() + + IF(NOT LUALIB_FOUND) + # check for Lua 5.0 + SET(LUA50_LIBRARIES liblua5.0 liblua-5.0 liblua.so.5.0) + + FOREACH(_LIB ${LUA50_LIBRARIES}) + CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA50_LIBRARY LUALIB_FOUND) IF(LUALIB_FOUND) MESSAGE(STATUS "Luabind is using Lua 5.0") FIND_PACKAGE(Lua50 REQUIRED) - ELSE(LUALIB_FOUND) - MESSAGE(FATAL_ERROR "Can't determine Lua version used by Luabind") - ENDIF(LUALIB_FOUND) - ENDIF(LUALIB_FOUND) - ENDIF(LUALIB_FOUND) - ELSE(LUABIND_LIBRARY_RELEASE MATCHES "\\.so") + BREAK() + ENDIF() + ENDFOREACH() + ENDIF() + + IF(NOT LUALIB_FOUND) + MESSAGE(FATAL_ERROR "Can't determine Lua version used by Luabind") + ENDIF() + ELSE() # TODO: find a way to detect Lua version IF(WITH_LUA53) FIND_PACKAGE(Lua53 REQUIRED) diff --git a/code/nel/include/nel/gui/dbgroup_combo_box.h b/code/nel/include/nel/gui/dbgroup_combo_box.h index e7be1de4b..1aac8bb1f 100644 --- a/code/nel/include/nel/gui/dbgroup_combo_box.h +++ b/code/nel/include/nel/gui/dbgroup_combo_box.h @@ -63,6 +63,8 @@ namespace NLGUI uint getTextId(uint i) const; uint getTextPos(uint nId) const; const ucstring &getTexture(uint i) const; + void setGrayed(uint i, bool g); + const bool getGrayed(uint i) const; void removeText(uint nPos); uint getNumTexts() const {return (uint)_Texts.size();} void sortText(); @@ -132,6 +134,7 @@ namespace NLGUI sint32 _NotLinkedToDBSelection; std::vector > _Texts; std::vector _Textures; + std::vector _Grayed; // Action Handler called on combo click std::string _AHOnSelectStart; diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index 5cc632a4e..635136220 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -34,6 +34,7 @@ namespace NLGUI class CCtrlButton; class CCtrlScroll; class CGroupList; + class CGroupMenu; class CDBGroupComboBox; class CGroupParagraph; @@ -189,6 +190,7 @@ namespace NLGUI std::string DefaultFormTextGroup; std::string DefaultFormTextAreaGroup; std::string DefaultFormSelectGroup; + std::string DefaultFormSelectBoxMenuGroup; std::string DefaultCheckBoxBitmapNormal; std::string DefaultCheckBoxBitmapPushed; std::string DefaultCheckBoxBitmapOver; @@ -345,6 +347,7 @@ namespace NLGUI // Add a combo box in the current paragraph CDBGroupComboBox *addComboBox(const std::string &templateName, const char *name); + CGroupMenu *addSelectBox(const std::string &templateName, const char *name); // Add a button in the current paragraph. actionHandler, actionHandlerParams and tooltip can be NULL. CCtrlButton *addButton(CCtrlButton::EType type, const std::string &name, const std::string &normalBitmap, const std::string &pushedBitmap, @@ -409,6 +412,10 @@ namespace NLGUI double _TimeoutValue; // the timeout in seconds double _ConnectingTimeout; sint _RedirectsRemaining; + // Automatic page refresh + double _LastRefreshTime; + double _NextRefreshTime; + std::string _RefreshUrl; // minimal embeded lua script support // Note : any embeded script is executed immediately after the closing @@ -626,6 +633,10 @@ namespace NLGUI TextArea = NULL; Checkbox = NULL; ComboBox = NULL; + SelectBox = NULL; + sbRBRef = NULL; + sbMultiple = false; + sbOptionDisabled = -1; InitialSelection = 0; } @@ -644,6 +655,19 @@ namespace NLGUI // Combobox group CDBGroupComboBox *ComboBox; + // Combobox with multiple selection or display size >= 2 + CGroupMenu *SelectBox; + + // Single or multiple selections for SelectBox + bool sbMultiple; + + // Marks OPTION element as disabled + // Only valid when parsing html + sint sbOptionDisabled; + + // First radio button in SelectBox if single selection + CCtrlBaseButton *sbRBRef; + // select values (for the