diff --git a/changes.txt b/changes.txt index f3d696ca..27a6c48e 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,7 @@ Changes in 1.8 (??.??.2011) + - Add IGUIEnvironment::getHovered to get the element most recently known to be under the mouse cursor + - Add support for bsp brush entities. Written by Hendu. - Add IGUIComboBox::setMaxSelectionRows and IGUIComboBox::getMaxSelectionRows diff --git a/include/IGUIEnvironment.h b/include/IGUIEnvironment.h index 80b4a301..4dee5c2b 100644 --- a/include/IGUIEnvironment.h +++ b/include/IGUIEnvironment.h @@ -80,6 +80,10 @@ public: /** \return Pointer to the element with focus. */ virtual IGUIElement* getFocus() const = 0; + //! Returns the element which was last under the mouse cursor + /** \return Pointer to the element under the mouse. */ + virtual IGUIElement* getHovered() const = 0; + //! Removes the focus from an element. /** Causes a EGET_ELEMENT_FOCUS_LOST event. If the event is absorbed then the focus will not be changed. diff --git a/source/Irrlicht/CGUIEnvironment.cpp b/source/Irrlicht/CGUIEnvironment.cpp index 28f15f82..61f1a9e5 100644 --- a/source/Irrlicht/CGUIEnvironment.cpp +++ b/source/Irrlicht/CGUIEnvironment.cpp @@ -296,6 +296,12 @@ IGUIElement* CGUIEnvironment::getFocus() const return Focus; } +//! returns the element last known to be under the mouse cursor +IGUIElement* CGUIEnvironment::getHovered() const +{ + return Hovered; +} + //! removes the focus from an element bool CGUIEnvironment::removeFocus(IGUIElement* element) @@ -397,7 +403,6 @@ bool CGUIEnvironment::OnEvent(const SEvent& event) return ret; } - // void CGUIEnvironment::OnPostRender( u32 time ) { diff --git a/source/Irrlicht/CGUIEnvironment.h b/source/Irrlicht/CGUIEnvironment.h index a65e8fe1..e6940cfc 100644 --- a/source/Irrlicht/CGUIEnvironment.h +++ b/source/Irrlicht/CGUIEnvironment.h @@ -192,6 +192,9 @@ public: //! Returns the element with the focus virtual IGUIElement* getFocus() const; + //! Returns the element last known to be under the mouse + virtual IGUIElement* getHovered() const; + //! Adds an element for fading in or out. virtual IGUIInOutFader* addInOutFader(const core::rect* rectangle=0, IGUIElement* parent=0, s32 id=-1);