bool CEditorCondition::Serialize(CArchive &ar, CChronoEventEditor* Ed)
{
	CString ExpectedName = "CEditorCondition";
	int     Version      = 2;

	if (!SerializeClassHeader(ExpectedName, Version, ar))
		return false;

	if( ar.IsLoading())
	{
		m_visible = true;
		m_Valid = true;
		ar >> mid;
		ar >> cndID;
		ar >> oid;
		if(Ed)	Ed->RegisterObjectID(oid, ar);
		ar >> m_Negate;
		ar >> m_Family >> m_FamilyName;

		ar >> m_rect_default;
		ar >> m_select_default;
		ar >> m_select_default;
		ar >> m_Anim.Space;
		ar // //m_Text - note: must call EventSheetEditor::ReformatCondition 
			>> m_Object >> m_Script;
		m_Anim.m_bDestroyed = false;

		m_Text = "";

		int size = 0;
		ar >> size;
		for (int i = 0; i < size; i++)
		{
			CEditorParam* Param = new CEditorParam;
			Param->Serialize(ar, Ed);
 			params.push_back(Param);
		}

		if (oid != -1)
		{
			CString name = "";
			ar >> name;
			OINFO* o = GetOINFO(name);
			if (!o)
			{
				CErrorDlg Dlg;
				Dlg.Error("Error in condition.", "An invalid object in a condition was referenced.");

				return false;
			}

			DLLIndex = o->oID;
		}
Esempio n. 2
0
bool CEditorAction::Serialize(CArchive &ar, CChronoEventEditor* Ed )
{
	CString ExpectedName = "CEditorAction";
	int     Version      = 2;

	if (!SerializeClassHeader(ExpectedName, Version, ar))
		return false;

	if(ar.IsLoading())
	{
		m_visible = true;
		m_Valid = true;
		ar >> m_Family >> m_FamilyName;	
		ar >> actID;
		ar >> oid;

		if(Ed) Ed->RegisterObjectID(oid, ar);
		ar >> m_rect_default;
		ar >> m_select_default;
		ar >> m_Anim.Space;
		m_Anim.m_bDestroyed = false;
		ar //>> m_Text - note: must call EventSheetEditor::ReformatAction 
			>> m_Object >> m_Script;
		ar >> mid;

		m_Text = "";

		int size = 0;
		ar >> size;
		for (int i = 0; i < size; i++)
		{
			CEditorParam* Param = new CEditorParam;
			Param->Serialize(ar, Ed);
			params.push_back(Param);
		}

		CString name = "";
		ar >> name;
		OINFO* o = GetOINFO(name);

		if(o)
			DLLIndex = o->oID;
		else
			DLLIndex = -1;

		if(Version >= 2)
			ar >> m_bEnabled;
		else