From d8337034b532638d246227d850154ee6b21c7ac9 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Thu, 15 Aug 2013 21:46:55 +0200 Subject: Formspec textlist: Black Irrlicht magic to detect fake doubleclicks --- src/guiFormSpecMenu.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/guiFormSpecMenu.h') diff --git a/src/guiFormSpecMenu.h b/src/guiFormSpecMenu.h index 84124afc3..28f11d2e7 100644 --- a/src/guiFormSpecMenu.h +++ b/src/guiFormSpecMenu.h @@ -228,9 +228,9 @@ public: void updateSelectedItem(); ItemStack verifySelectedItem(); - void acceptInput(int evttype=-1); + void acceptInput(); bool OnEvent(const SEvent& event); - + int getListboxIndex(std::string listboxname); protected: @@ -272,6 +272,12 @@ protected: ItemStack m_selected_content_guess; InventoryLocation m_selected_content_guess_inventory; + // WARNING: BLACK IRRLICHT MAGIC, see checkListboxClick() + std::wstring m_listbox_click_fname; + int m_listbox_click_index; + u32 m_listbox_click_time; + bool m_listbox_doubleclick; + v2s32 m_pointer; gui::IGUIStaticText *m_tooltip_element; @@ -301,6 +307,10 @@ private: fs_key_pendig current_keys_pending; + // Determine whether listbox click was double click + // (Using some black Irrlicht magic) + bool checkListboxClick(std::wstring wlistboxname, int eventtype); + void parseElement(parserData* data,std::string element); void parseSize(parserData* data,std::string element); -- cgit v1.2.3