Beispiel #1
0
/***********************************************************
handle send button event
***********************************************************/
bool ChatBox::HandleSend (const CEGUI::EventArgs& e)
{
    CEGUI::PushButton * bch = static_cast<CEGUI::PushButton *>
		(CEGUI::WindowManager::getSingleton().getWindow("Chat/bChannel"));
	std::string curChannel = bch->getProperty("Text").c_str();

	CEGUI::Editbox * bed = static_cast<CEGUI::Editbox *>
		(CEGUI::WindowManager::getSingleton().getWindow("Chat/edit"));


	std::string currText = bed->getProperty("Text").c_str();
	if(currText != "")
	{
		SendText(curChannel, currText);
		bed->setProperty("Text", "");
	}

    return true;
}
Beispiel #2
0
/***********************************************************
handle event when list is selected
***********************************************************/
bool CommunityBox::HandleCPOk (const CEGUI::EventArgs& e)
{
	CEGUI::Editbox * bed = static_cast<CEGUI::Editbox *>
	(CEGUI::WindowManager::getSingleton().getWindow("Chat/AddFriendName/edit"));

	std::string strc = bed->getProperty("Text").c_str();

	if(strc != "")
	{
		ThreadSafeWorkpile::getInstance()->AddFriend(strc);

		bed->setProperty("Text", "");
		_myChooseName->hide();
	}
	else
	{
		bed->activate();
	}

	return true;
}
Beispiel #3
0
/***********************************************************
handle event when list is selected
***********************************************************/
bool ChatBox::HandleCPOk (const CEGUI::EventArgs& e)
{
	CEGUI::Editbox * bed = static_cast<CEGUI::Editbox *>
	(CEGUI::WindowManager::getSingleton().getWindow("Chat/choosePlayerName/edit"));

	std::string strc = bed->getProperty("Text").c_str();

	if(strc != "")
	{
		AddWhisperChanel(strc);
		bed->setProperty("Text", "");
		_myChooseName->hide();
		_myChat->setEnabled(true);
	}
	else
	{
		bed->activate();
	}

	return true;
}