コード例 #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
ファイル: CLightPanel.cpp プロジェクト: Wu1994/GameFinal
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
ファイル: CLightPanel.cpp プロジェクト: Wu1994/GameFinal
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);
		}
	}

}