mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-25 08:16:16 +00:00
CHANGED: #1471 Controls are now serialized into the XML output file when saving.
This commit is contained in:
parent
8e7c4f262f
commit
652683dd18
5 changed files with 30 additions and 4 deletions
|
@ -46,6 +46,8 @@ namespace NLGUI
|
|||
xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const;
|
||||
xmlNodePtr serializeGroup( xmlNodePtr parentNode, const char *type ) const;
|
||||
xmlNodePtr serializeSubGroups( xmlNodePtr parentNode ) const;
|
||||
xmlNodePtr serializeControls( xmlNodePtr parentNode ) const;
|
||||
xmlNodePtr serializeViews( xmlNodePtr parentNode ) const;
|
||||
|
||||
virtual uint32 getMemory ();
|
||||
|
||||
|
|
|
@ -396,6 +396,9 @@ namespace NLGUI
|
|||
if( node == NULL )
|
||||
return NULL;
|
||||
|
||||
if( xmlGetProp( node, BAD_CAST "type" ) == NULL )
|
||||
xmlSetProp( node, BAD_CAST "type", BAD_CAST "button" );
|
||||
|
||||
xmlNewProp( node, BAD_CAST "button_type", BAD_CAST getTypeString().c_str() );
|
||||
xmlNewProp( node, BAD_CAST "pushed", BAD_CAST toString( _Pushed ).c_str() );
|
||||
xmlNewProp( node, BAD_CAST "over_when_pushed", BAD_CAST toString( _OverWhenPushed ).c_str() );
|
||||
|
|
|
@ -385,6 +385,9 @@ namespace NLGUI
|
|||
xmlNodePtr node = CCtrlBaseButton::serialize( parentNode, type );
|
||||
if( node == NULL )
|
||||
return NULL;
|
||||
|
||||
if( xmlGetProp( node, BAD_CAST "type" ) == NULL )
|
||||
xmlSetProp( node, BAD_CAST "type", BAD_CAST "text_button" );
|
||||
|
||||
std::string tex;
|
||||
tex = CViewRenderer::getInstance()->getTextureNameFromId( _TextureIdNormal[ 0 ] );
|
||||
|
|
|
@ -798,6 +798,9 @@ namespace NLGUI
|
|||
if( node == NULL )
|
||||
return NULL;
|
||||
|
||||
if( xmlGetProp( node, BAD_CAST "type" ) == NULL )
|
||||
xmlSetProp( node, BAD_CAST "type", BAD_CAST "tab_button" );
|
||||
|
||||
xmlNewProp( node, BAD_CAST "group", BAD_CAST _AssociatedGroup.c_str() );
|
||||
|
||||
return node;
|
||||
|
|
|
@ -672,6 +672,7 @@ namespace NLGUI
|
|||
return NULL;
|
||||
|
||||
serializeSubGroups( node );
|
||||
serializeControls( node );
|
||||
|
||||
return node;
|
||||
}
|
||||
|
@ -716,15 +717,29 @@ namespace NLGUI
|
|||
|
||||
xmlNodePtr CInterfaceGroup::serializeSubGroups( xmlNodePtr parentNode ) const
|
||||
{
|
||||
xmlNodePtr node = parentNode;
|
||||
|
||||
std::vector< CInterfaceGroup* >::const_iterator itr;
|
||||
for( itr = _ChildrenGroups.begin(); itr != _ChildrenGroups.end(); ++itr )
|
||||
{
|
||||
(*itr)->serialize( node, "group" );
|
||||
(*itr)->serialize( parentNode, "group" );
|
||||
}
|
||||
|
||||
return node;
|
||||
return parentNode;
|
||||
}
|
||||
|
||||
xmlNodePtr CInterfaceGroup::serializeControls( xmlNodePtr parentNode ) const
|
||||
{
|
||||
std::vector< CCtrlBase* >::const_iterator itr;
|
||||
for( itr = _Controls.begin(); itr != _Controls.end(); ++itr )
|
||||
{
|
||||
(*itr)->serialize( parentNode, "ctrl" );
|
||||
}
|
||||
|
||||
return parentNode;
|
||||
}
|
||||
|
||||
xmlNodePtr CInterfaceGroup::serializeViews( xmlNodePtr parentNode ) const
|
||||
{
|
||||
return parentNode;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue