My mouse click code works perfectly fine but my problem is when they click on the chat window it still moves the character? How can I check to see if any GUI is selected this way I can prevent my code being called? Here it is at the moment.
Code: Select all
if (event.EventType == EET_MOUSE_INPUT_EVENT)
{
switch(event.MouseInput.Event)
{
case EMIE_LMOUSE_PRESSED_DOWN:
Mouse.down = true;
Mouse.cursorX = event.MouseInput.X;
Mouse.cursorY = event.MouseInput.Y;
if (_inGame)
game->MouseLClicked(event.MouseInput.X, event.MouseInput.Y);
break;
case EMIE_RMOUSE_PRESSED_DOWN:
Mouse.cursorX = event.MouseInput.X;
Mouse.cursorY = event.MouseInput.Y;
if (_inGame)
game->MouseRClicked(event.MouseInput.X, event.MouseInput.Y);
break;
case EMIE_LMOUSE_LEFT_UP:
case EMIE_RMOUSE_LEFT_UP:
Mouse.down = false;
break;