Browse Source

added console function call OnMouseDown

capnlove 12 years ago
parent
commit
037992d
1 changed files with 9 additions and 0 deletions
  1. 9 0
      engine/source/gui/buttons/guiButtonBaseCtrl.cc

+ 9 - 0
engine/source/gui/buttons/guiButtonBaseCtrl.cc

@@ -202,6 +202,15 @@ void GuiButtonBaseCtrl::onMouseDown(const GuiEvent &event)
    mouseLock();
    mDepressed = true;
 
+   if (mUseMouseEvents)
+   {
+       char buf[3][32];
+       dSprintf(buf[0], 32, "%d", event.modifier);
+       dSprintf(buf[1], 32, "%d %d", event.mousePoint.x, event.mousePoint.y);
+       dSprintf(buf[2], 32, "%d", event.mouseClickCount);
+       Con::executef(this, 4, "onMouseDown", buf[0], buf[1], buf[2]);
+   }
+
    //update
    setUpdate();
 }