From 2859693c1e30cb1ff418eb95c071551080f3b3b9 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 22 Oct 2020 20:56:07 +0800 Subject: [PATCH] Remove OtherCharAccess toggle from Scenario window when MD5 checks are disabled, close kaetemi/ryzomclassic#151 --- nel/include/nel/gui/interface_element.h | 4 +++- nel/src/gui/interface_element.cpp | 8 ++++++++ ryzom/common/data_common/r2/r2_ui_scenario.lua | 7 +++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/nel/include/nel/gui/interface_element.h b/nel/include/nel/gui/interface_element.h index 47025f155..60f6ae7b8 100644 --- a/nel/include/nel/gui/interface_element.h +++ b/nel/include/nel/gui/interface_element.h @@ -382,7 +382,6 @@ namespace NLGUI void dummySet(const std::string &value); public: - // export some properties REFLECT_EXPORT_START(CInterfaceElement, CReflectable) REFLECT_BOOL ("active", getActive, setActive); @@ -397,6 +396,7 @@ namespace NLGUI REFLECT_SINT32 ("h_real", getHReal, dummySet); REFLECT_STRING ("id", getIdByValue, dummySet); REFLECT_STRING ("sizeref", getSizeRefAsString, setSizeRef); + REFLECT_STRING ("posparent", getPosParent, setPosParent); REFLECT_LUA_METHOD("updateCoords", luaUpdateCoords); REFLECT_LUA_METHOD("invalidateCoords", luaInvalidateCoords); REFLECT_LUA_METHOD("invalidateContent", luaInvalidateContent); @@ -523,6 +523,8 @@ namespace NLGUI void parseSizeParent( const std::string &id ); void setSizeParent( const std::string &id ); void getSizeParent( std::string &id ) const; + + std::string getPosParent() const; void setSerializable( bool b ){ serializable = b; } bool IsSerializable() const{ return serializable; } diff --git a/nel/src/gui/interface_element.cpp b/nel/src/gui/interface_element.cpp index cf5646077..4d21555e7 100644 --- a/nel/src/gui/interface_element.cpp +++ b/nel/src/gui/interface_element.cpp @@ -437,6 +437,14 @@ namespace NLGUI parseSizeRef(sizeref.c_str()); } + // ------------------------------------------------------------------------------------------------ + std::string CInterfaceElement::getPosParent() const + { + std::string id; + getPosParent(id); + return id; + } + // ------------------------------------------------------------------------------------------------ std::string CInterfaceElement::getSizeRefAsString() const { diff --git a/ryzom/common/data_common/r2/r2_ui_scenario.lua b/ryzom/common/data_common/r2/r2_ui_scenario.lua index d627ab7b7..5a925d9a4 100644 --- a/ryzom/common/data_common/r2/r2_ui_scenario.lua +++ b/ryzom/common/data_common/r2/r2_ui_scenario.lua @@ -78,6 +78,13 @@ function r2.ScenarioWindow:initScenarioWindow() for k, type in pairs(tmp) do lockCB:addText(type) end + + if config.CheckR2ScenarioMD5 == 0 then + local lockGrp = scenarioWnd:find("locked") + local titleGrp = scenarioWnd:find("title") + lockGrp.active = false -- Hide lock group + titleGrp.posparent = lockGrp.posparent -- Rearrange + end end