When i click in my exit button nothing happens.
This is my code:
cGUIInterface.cpp
bool cGUIInterface::handleQuit(const CEGUI::EventArgs& e)
{
vendorWindow->hide();
return true;
}
void cGUIInterface::vendorMenu()
{
mGUISystem->setDefaultMouseCursor((CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
if (!loadGUILayout)
{
loadGUILayout = CEGUI::WindowManager::getSingleton().loadWindowLayout((CEGUI::utf8*)"DFgui.layout");
mGUISystem->setGUISheet(loadGUILayout);
}
loadGUILayout->hide();
vendorWindow = winMgr->getWindow((CEGUI::utf8*)"MainWindow");
vendorWindow->show();
winMgr->getWindow((CEGUI::utf8*)"QuitButton")->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&cGUIInterface::handleQuit, this));
}
and this is my OgreNewtFrameListener code:
Code: Select all
if( ms.buttonDown( MB_Left ) )
{
if (timer2 <= 0.0)
{
if(FPSmode)
{
Ray ray = mBulletGraph->fireCameraRay(0.5,0.5);
mBullet->update(evt.timeSinceLastFrame, mPlayerCollision, 1000, 5000, 10, ray.getOrigin(), ray.getDirection(), true, mWorld);
timer2 = 0.5;
}
else
{
CEGUI::Point mousePos = CEGUI::MouseCursor::getSingleton().getPosition();
CEGUI::System::getSingleton().injectMouseButtonDown(CEGUI::LeftButton);
Ray ray = mBulletGraph->fireCameraRay(mousePos.d_x/float(ms.width), mousePos.d_y/float(ms.height));
mBullet->update(evt.timeSinceLastFrame, mPlayerCollision, 1000, 5000, 10, ray.getOrigin(), ray.getDirection(), false, mWorld);
timer2 = 0.5;
}
}
}
but when i click quit never enters in the handlequit function :s
Thanks in advance!