1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Formspec textlist: Black Irrlicht magic to detect fake doubleclicks

This commit is contained in:
Kahrl 2013-08-15 21:46:55 +02:00
parent 7921fe2cd1
commit d8337034b5
2 changed files with 66 additions and 10 deletions

View file

@ -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);