示例#1
0
void CMeshNodePanel::SetActive(bool bActive)
{
	mCreateMeshNodeWindow.SetVisible(bActive);
	mNodeInfoWindow.SetVisible(bActive);
	mInstanceNodeWindow.SetVisible(bActive);

	EditorScene* scene = EditorScene::getInstance();

	if (bActive)
	{
		SNodeInfo* info = mCreateMeshNodeWindow.GetSelectedItemNodeInfo();
		if (!info)
			return;

		if (info->Category == COLLECTION_CATEGORY)
			mInstanceNodeWindow.SetVisible(true);
		else {
			mInstanceNodeWindow.SetVisible(false);
			scene->SelectObject(info->Id);
		}
			
		ShowNodeInfo(info);
	}
	else
	{
		scene->CancelSelectObject();
	}
}
示例#2
0
void CInstanceInfoWindow::OnClickDeleteButton()
{
	int id = GetSelectedListItemId(mInstancesListBox);
	if (id == -1)
		return;

	int ret = MessageBoxA(mParentHwnd, "Are you sure to delete instance?", "Delete Confirm", MB_OKCANCEL);
	if (ret == IDCANCEL)
		return;

	EditorScene* scene = EditorScene::getInstance();
	scene->DeleteNode(id);
	scene->CancelSelectObject();

	int itemIndex = ListBox_GetCurSel(mInstancesListBox);
	if (itemIndex != LB_ERR)
	{
		ListBox_DeleteString(mInstancesListBox, itemIndex);
	}
}