From 760438421355a3d53008da3a5684d58ca185b0db Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Mon, 13 Aug 2012 02:28:24 +0200 Subject: [PATCH] CHANGED: #1471 CGroupModal fields can now be serialized. --- code/nel/include/nel/gui/group_modal.h | 1 + code/nel/src/gui/group_modal.cpp | 27 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/code/nel/include/nel/gui/group_modal.h b/code/nel/include/nel/gui/group_modal.h index 83e3a217a..c2d3fb28c 100644 --- a/code/nel/include/nel/gui/group_modal.h +++ b/code/nel/include/nel/gui/group_modal.h @@ -55,6 +55,7 @@ namespace NLGUI std::string getProperty( const std::string &name ) const; void setProperty( const std::string &name, const std::string &value ); + xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const; virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); virtual void updateCoords (); diff --git a/code/nel/src/gui/group_modal.cpp b/code/nel/src/gui/group_modal.cpp index edbb3c11e..c8083893c 100644 --- a/code/nel/src/gui/group_modal.cpp +++ b/code/nel/src/gui/group_modal.cpp @@ -208,6 +208,33 @@ namespace NLGUI } + + xmlNodePtr CGroupModal::serialize( xmlNodePtr parentNode, const char *type ) const + { + xmlNodePtr node = CGroupFrame::serialize( parentNode, type ); + if( node == NULL ) + return NULL; + + xmlSetProp( node, BAD_CAST "type", BAD_CAST "modal" ); + xmlSetProp( node, BAD_CAST "mouse_pos", BAD_CAST NLMISC::toString( SpawnOnMousePos ).c_str() ); + xmlSetProp( node, BAD_CAST "exit_click_out", BAD_CAST NLMISC::toString( ExitClickOut ).c_str() ); + xmlSetProp( node, BAD_CAST "exit_click_l", BAD_CAST NLMISC::toString( ExitClickL ).c_str() ); + xmlSetProp( node, BAD_CAST "exit_click_r", BAD_CAST NLMISC::toString( ExitClickR ).c_str() ); + + if( ExitClickL == ExitClickR ) + xmlSetProp( node, BAD_CAST "exit_click_b", BAD_CAST NLMISC::toString( ExitClickL ).c_str() ); + + xmlSetProp( node, BAD_CAST "force_inside_screen", BAD_CAST NLMISC::toString( ForceInsideScreen ).c_str() ); + xmlSetProp( node, BAD_CAST "category", BAD_CAST Category.c_str() ); + xmlSetProp( node, BAD_CAST "onclick_out", BAD_CAST OnClickOut.c_str() ); + xmlSetProp( node, BAD_CAST "onclick_out_params", BAD_CAST OnClickOutParams.c_str() ); + xmlSetProp( node, BAD_CAST "onpostclick_out", BAD_CAST OnPostClickOut.c_str() ); + xmlSetProp( node, BAD_CAST "onpostclick_out_params", BAD_CAST OnPostClickOutParams.c_str() ); + xmlSetProp( node, BAD_CAST "exit_key_pushed", BAD_CAST NLMISC::toString( ExitKeyPushed ).c_str() ); + + return node; + } + // *************************************************************************** bool CGroupModal::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) {