Example #1
0
ENUMTYPE CSequence::GetEnumType()
{
	// this check done first to cope with sequences named (eg) "TORSO_" but not having an entry in anims.h
	//	to match this (which a strcmp won't detect). This shouldn't really be necessary since the menu system only
	//	allows you to pick valid ones from anims.h, but it copes with people editing ascii files by hand (or alerts
	//	people to entries being subsequently deleted from anims.h after use)
	//
	if (ValidEnum())
	{	
		return GetEnumTypeFromString(GetEnum());
	}
	
	return ET_INVALID;
}
Example #2
0
void CAnimPicker::FillListBoxes()
{
	// fill in the enum list boxes...
	//
	CListBox* boxLegs = (CListBox*)GetDlgItem(IDC_LIST_LEGS);
	CListBox* boxTorso= (CListBox*)GetDlgItem(IDC_LIST_TORSO);
	CListBox* boxBoth = (CListBox*)GetDlgItem(IDC_LIST_BOTH);
	CListBox* boxFace = (CListBox*)GetDlgItem(IDC_LIST_FACE);
	CListBox* boxVM = (CListBox*)GetDlgItem(IDC_LIST_VM);
	boxLegs->ResetContent();
	boxTorso->ResetContent();
	boxBoth->ResetContent();
	boxFace->ResetContent();
	boxVM->ResetContent();

	CModel* theModel = ghAssimilateView->GetDocument()->GetCurrentUserSelectedModel();
	ASSERT(theModel);
	if (theModel)
	{
		for (int i=0; ; i++)
		{
			LPCSTR p = ((CAssimilateApp*)AfxGetApp())->GetEnumEntry(i);	
			if (!p)
				break;

			CString string = p;			

			if (theModel->AnimEnumInUse(p))
			{
				if (m_bFilterOutUsed)
					continue;
				string.Insert(0,sEnumUsedString);
			}			

			if (IsEnumSeperator(p))
			{
				string = StripSeperatorStart(p);
				string.Insert(0,sEnumSeperatorString_Prefix);
				string+=sEnumSeperatorString_Suffix;
			}

			CListBox* listBoxPtr = NULL;		
			switch (GetEnumTypeFromString(p))	// note (p), *not* (string)
			{			
				case ET_BOTH:	listBoxPtr = boxBoth;	break;
				case ET_TORSO:	listBoxPtr = boxTorso;	break;
				case ET_LEGS:	listBoxPtr = boxLegs;	break;
				case ET_FACE:	listBoxPtr = boxFace;	break;
				case ET_VM:		listBoxPtr = boxVM;		break;
				default:		ASSERT(0);				break;	
			}
			if (listBoxPtr)
			{
				// keep an index to the original enum for comment-diving reasons...
				//
				int iIndex = listBoxPtr->InsertString(-1,string);
				listBoxPtr->SetItemData(iIndex,(DWORD)p);
			}
		}
	}
}