aboutsummaryrefslogtreecommitdiff
path: root/games/devtest/mods
Commit message (Expand)AuthorAge
* DevTest: Fix broken PNG texturesWuzzy2022-05-17
* Support packing arbitrary graphs (#12289)Jude Melton-Houghton2022-05-10
* Fix cooking and fuel crafts with aliasesJude Melton-Houghton2022-05-10
* Async environment for mods to do concurrent tasks (#11131)sfan52022-05-02
* DevTest: Fix armorball sprite (#12228)Wuzzy2022-04-28
* DevTest: Add more test weapons and armorball modes (#11870)Wuzzy2022-04-24
* Remove reference to a removed file in devtest (followup to #12157)Dmitry Kostenko2022-04-07
* Enable shadows by default in devtest (#12157)x20482022-04-07
* Store vector metatable in registryJude Melton-Houghton2022-03-29
* Add API to control shadow intensity from the game/mod (#11944)x20482022-03-26
* FormspecMenu: make drawing of backgrounds less hacky (#9517)DS2022-02-22
* Add TGA test nodes to devtest (#11978)Nils Dagsson Moskopp2022-02-22
* Use absolute value for bouncy in collision (#11969)pecksin2022-02-16
* Allow to set the displayed item count and its alignment via meta (#8448)DS2022-02-10
* Add padding[] element to formspecs (#11821)Vincent Robinson2021-12-30
* Restructure devtest's unittests and run them in CI (#11859)sfan52021-12-18
* Fix number of tool uses being off by 1..32767 (#11110)Wuzzy2021-10-31
* Add no_texture.png as fallback for unspecified texturesWuzzy2021-10-20
* Add embedded PNG texture modifier (#11498)hecks2021-10-13
* Split liquid_viscosity to liquid_viscosity and move_resistance (#10810)Wuzzy2021-10-01
* Add a simple PNG image encoder with Lua API (#11485)hecks2021-07-29
* Add bold, italic and monospace font styling for HUD text elements (#11478)sfan52021-07-27
* Add wallmounted support for plantlike and plantlike_rooted nodes (#11379)Wuzzy2021-07-15
* Fix rotation for falling mesh degrotate nodes (#11159)Wuzzy2021-04-28
* Fix devtest Lua errorsfan52021-04-21
* Put torch/signlike node on floor if no paramtype2 (#11074)Wuzzy2021-04-20
* Devtest: Remove testnodes_show_fallback_imageWuzzy2021-04-05
* Degrotate support for mesh nodes (#7840)Vitaliy2021-03-30
* DevTest: Formspec tests, children getter, better lighttool (#10918)Wuzzy2021-03-16
* Devtest: Fix missing log level in minetest.log (#11068)Wuzzy2021-03-15
* Allow overwriting media files of dependencies (#10752)DS2021-02-23
* Fix wrong reported item counts for inventory actions using Shift-Move (#10930)Lars Müller2021-02-21
* Add nametag background setting and object property (#10937)rubenwardy2021-02-17
* Fix short_description fallback order (#10943)rubenwardy2021-02-17
* Fix animation_image support in scroll containersJean-Patrick Guerrero2021-02-08
* Devtest: Remove bumpmap/parallax occl. test nodes (#10902)Wuzzy2021-02-04
* Fix list spacing and size (again) (#10869)Vincent Robinson2021-02-02
* devtest: Fix deprecated alpha usagesfan52021-01-29
* Drop never documented 'alpha' property from nodedefsfan52021-01-29
* Make hypertext and textarea have proper scroll event propagation. (#10860)Vincent Robinson2021-01-23
* FormSpec: Add list spacing, slot size, and noclip (#10083)Vincent Robinson2021-01-23
* Allow "liquid" and "flowingliquid" drawtypes even if liquidtype=none (#10737)Wuzzy2021-01-21
* Add on_deactivate callback for luaentities (#10723)hecks2021-01-02
* DevTest: Add food item to test food replacement (#10642)Wuzzy2020-12-18
* Semi-transparent background for nametags (#10152)Zughy2020-12-14
* Various documentation fixes (#10692)SmallJoker2020-12-10
* Fix falling image of torchlike if paramtype2="none" (#10612)Wuzzy2020-11-15
* Add model[] formspec element (#10320)SmallJoker2020-11-04
* Shaders for Android (GLES 2) (#10506)Vitaliy2020-10-25
* Devtest: Automatically enable zoom capability (#10493)Paramat2020-10-20
class="hl opt">{ m_allow_focus_removal = allow; } bool GUIModalMenu::canTakeFocus(gui::IGUIElement *e) { return (e && (e == this || isMyChild(e))) || m_allow_focus_removal; } void GUIModalMenu::draw() { if (!IsVisible) return; video::IVideoDriver *driver = Environment->getVideoDriver(); v2u32 screensize = driver->getScreenSize(); if (screensize != m_screensize_old) { m_screensize_old = screensize; regenerateGui(screensize); } drawMenu(); } /* This should be called when the menu wants to quit. WARNING: THIS DEALLOCATES THE MENU FROM MEMORY. Return immediately if you call this from the menu itself. (More precisely, this decrements the reference count.) */ void GUIModalMenu::quitMenu() { allowFocusRemoval(true); // This removes Environment's grab on us Environment->removeFocus(this); m_menumgr->deletingMenu(this); this->remove(); #ifdef HAVE_TOUCHSCREENGUI if (g_touchscreengui && m_touchscreen_visible) g_touchscreengui->show(); #endif } void GUIModalMenu::removeChildren() { const core::list<gui::IGUIElement *> &children = getChildren(); core::list<gui::IGUIElement *> children_copy; for (gui::IGUIElement *i : children) { children_copy.push_back(i); } for (gui::IGUIElement *i : children_copy) { i->remove(); } } bool GUIModalMenu::preprocessEvent(const SEvent &event) { #ifdef __ANDROID__ // clang-format off // display software keyboard when clicking edit boxes if (event.EventType == EET_MOUSE_INPUT_EVENT && event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN) { gui::IGUIElement *hovered = Environment->getRootGUIElement()->getElementFromPoint( core::position2d<s32>(event.MouseInput.X, event.MouseInput.Y)); if ((hovered) && (hovered->getType() == irr::gui::EGUIET_EDIT_BOX)) { bool retval = hovered->OnEvent(event); if (retval) Environment->setFocus(hovered); std::string field_name = getNameByID(hovered->getID()); // read-only field if (field_name.empty()) return retval; m_jni_field_name = field_name; std::string message = gettext("Enter "); std::string label = wide_to_utf8(getLabelByID(hovered->getID())); if (label.empty()) label = "text"; message += gettext(label) + ":"; // single line text input int type = 2; // multi line text input if (((gui::IGUIEditBox *)hovered)->isMultiLineEnabled()) type = 1; // passwords are always single line if (((gui::IGUIEditBox *)hovered)->isPasswordBox()) type = 3; porting::showInputDialog(gettext("ok"), "", wide_to_utf8(((gui::IGUIEditBox *)hovered)->getText()), type); return retval; } } if (event.EventType == EET_TOUCH_INPUT_EVENT) { SEvent translated; memset(&translated, 0, sizeof(SEvent)); translated.EventType = EET_MOUSE_INPUT_EVENT; gui::IGUIElement *root = Environment->getRootGUIElement(); if (!root) { errorstream << "GUIModalMenu::preprocessEvent" << " unable to get root element" << std::endl; return false; } gui::IGUIElement *hovered = root->getElementFromPoint( core::position2d<s32>(event.TouchInput.X, event.TouchInput.Y)); translated.MouseInput.X = event.TouchInput.X; translated.MouseInput.Y = event.TouchInput.Y; translated.MouseInput.Control = false; bool dont_send_event = false; if (event.TouchInput.touchedCount == 1) { switch (event.TouchInput.Event) { case ETIE_PRESSED_DOWN: m_pointer = v2s32(event.TouchInput.X, event.TouchInput.Y); translated.MouseInput.Event = EMIE_LMOUSE_PRESSED_DOWN; translated.MouseInput.ButtonStates = EMBSM_LEFT; m_down_pos = m_pointer; break; case ETIE_MOVED: m_pointer = v2s32(event.TouchInput.X, event.TouchInput.Y); translated.MouseInput.Event = EMIE_MOUSE_MOVED; translated.MouseInput.ButtonStates = EMBSM_LEFT; break; case ETIE_LEFT_UP: translated.MouseInput.Event = EMIE_LMOUSE_LEFT_UP; translated.MouseInput.ButtonStates = 0; hovered = root->getElementFromPoint(m_down_pos); // we don't have a valid pointer element use last // known pointer pos translated.MouseInput.X = m_pointer.X; translated.MouseInput.Y = m_pointer.Y; // reset down pos m_down_pos = v2s32(0, 0); break; default: dont_send_event = true; // this is not supposed to happen errorstream << "GUIModalMenu::preprocessEvent" << " unexpected usecase Event=" << event.TouchInput.Event << std::endl; } } else if ((event.TouchInput.touchedCount == 2) && (event.TouchInput.Event == ETIE_PRESSED_DOWN)) { hovered = root->getElementFromPoint(m_down_pos); translated.MouseInput.Event = EMIE_RMOUSE_PRESSED_DOWN; translated.MouseInput.ButtonStates = EMBSM_LEFT | EMBSM_RIGHT; translated.MouseInput.X = m_pointer.X; translated.MouseInput.Y = m_pointer.Y; if (hovered) { hovered->OnEvent(translated); } translated.MouseInput.Event = EMIE_RMOUSE_LEFT_UP; translated.MouseInput.ButtonStates = EMBSM_LEFT; if (hovered) { hovered->OnEvent(translated); } dont_send_event = true; } // ignore unhandled 2 touch events ... accidental moving for example else if (event.TouchInput.touchedCount == 2) { dont_send_event = true; } else if (event.TouchInput.touchedCount > 2) { errorstream << "GUIModalMenu::preprocessEvent" << " to many multitouch events " << event.TouchInput.touchedCount << " ignoring them" << std::endl; } if (dont_send_event) { return true; } // check if translated event needs to be preprocessed again if (preprocessEvent(translated)) { return true; } if (hovered) { grab(); bool retval = hovered->OnEvent(translated); if (event.TouchInput.Event == ETIE_LEFT_UP) { // reset pointer m_pointer = v2s32(0, 0); } drop(); return retval; } } // clang-format on #endif return false; } #ifdef __ANDROID__ bool GUIModalMenu::hasAndroidUIInput() { // no dialog shown if (m_jni_field_name.empty()) { return false; } // still waiting if (porting::getInputDialogState() == -1) { return true; } // no value abort dialog processing if (porting::getInputDialogState() != 0) { m_jni_field_name.clear(); return false; } return true; } #endif