예제 #1
0
void CCreateLightNodeWindow::OnClickListItem()
{
	int itemIndex = ListBox_GetCurSel(mLightNodesList);
	if (itemIndex != LB_ERR)
	{
		u32 id = ListBox_GetItemData(mLightNodesList, itemIndex);
		EditorScene* scene = EditorScene::getInstance();
		EditorWindow* window = EditorWindow::getInstance();

		scene->SelectLight(id);
		window->ShowNodeInfo(id);
		SetFocus(mParentHwnd);
	}
}
예제 #2
0
void CLightPanel::MouseDoubleClicked(int sx, int sy)
{
	EditorScene* scene = EditorScene::getInstance();
	EditorWindow* window = EditorWindow::getInstance();
	if (!scene)
		return;

	E_MOUSE_STATE mouseState = window->GetMouseState();
	if (mouseState == EMS_PICKING)
	{
		int id = scene->SelectLight(sx, sy);
		if (id != -1)
		{
			scene->FocusSelectedLight();
			mCreateLightNodeWindow.SelectListItem(id);
		}
	}
}
예제 #3
0
void CLightPanel::MouseLeftButtonDown(int sx, int sy)
{
	EditorScene* scene = EditorScene::getInstance();
	EditorWindow* window = EditorWindow::getInstance();
	if (!scene)
		return;

	E_MOUSE_STATE mouseState = window->GetMouseState();

	if (mouseState == EMS_ADD_LIGHT)
	{
		char text[256];
		mCreateLightNodeWindow.GetNodeName(text);

		u32 id = scene->AddLightNode(text);
		if (id == -1)
			return;

		window->SetMouseState(EMS_PICKING);
		mCreateLightNodeWindow.EnableControl(IDC_CREATE_LIGHT_BTN, TRUE);
		mCreateLightNodeWindow.AddListItem(id);
		mCreateLightNodeWindow.SelectListItem(id);
		ShowNodeInfo(id);
	}
	else if (mouseState == EMS_PICKING)
	{
		//int id = scene->SelectObject(sx, sy);
		int id = scene->SelectLight(sx, sy);
		if (id != -1)
		{
			mCreateLightNodeWindow.SelectListItem(id);
			ShowNodeInfo(id);
		}
	}

}