aboutsummaryrefslogtreecommitdiff
path: root/src/script/common/c_content.cpp
Commit message (Expand)AuthorAge
...
* Don't corrupt stepheight when setting other propertiesCiaran Gultnieks2014-11-26
* Add option 'eased' to NoiseParamsSmallJoker2014-11-13
* Add Generator Element Management frameworkkwolekr2014-11-12
* Split up mapgen.cppkwolekr2014-11-01
* Custom collision boxes node property.RealBadAngel2014-10-19
* Add meshnode drawtype.RealBadAngel2014-10-18
* Use "core" namespace internallyShadowNinja2014-05-08
* Remove lua_State parameter from LuaError::LuaErrorShadowNinja2014-03-15
* Revert "Make sure we get a stacktrace for as many lua errors as possible"ShadowNinja2014-03-15
* Make sure we get a stacktrace for as many lua errors as possibleSfan52014-03-15
* Update set_mapgen_params and set_gen_notify Lua API to use new flag formatkwolekr2014-03-08
* Add minetest.set_noiseparam_defaults() Lua APIkwolekr2014-02-15
* Define strlcpy on platforms that do not have itkwolekr2014-02-09
* Add capability to read table flag fields from Lua APIkwolekr2014-02-09
* Make flag strings clear specified flag with 'no' prefixkwolekr2014-02-08
* Schematic: Read slice probability table from schematic descriptorskwolekr2014-01-19
* Add maximum recursion depth to read_json_valueShadowNinja2014-01-11
* Rename get_json_value to read_json_valueShadowNinja2014-01-11
* Fix InventoryList reading orderShadowNinja2013-12-30
* Don't throw a error when writing JSON failsShadowNinja2013-12-18
* Add 'minetest.write_json'ShadowNinja2013-12-18
* Handle LuaErrors in Lua -> C++ calls on LuaJITShadowNinja2013-12-18
* Shaders rework.RealBadAngel2013-12-03
* Optimize table creationShadowNinja2013-11-30
* fixed array limit check when reading Lua specialtiles tableMetaDucky2013-11-16
* Pass a errfunc to lua_pcall to get a tracebackShadowNinja2013-11-15
* Add offset to automatic_face_movement_dirPilzAdam2013-09-10
* Add minetest.parse_json, engine.parse_jsonKahrl2013-09-02
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
* Add support for entities to automatic face movement directionsapier2013-08-13
* Decoration: Fix schematic probability mess with new MTS file versionkwolekr2013-08-11
* Add support for different drowning damage and allow drowning in other nodetypesBlockMen2013-08-06
* Add support for setting stepheight for entitiessapier2013-07-30
* Weather supportproller2013-07-27
* Add an option to disable object <-> object collision for Lua entitiesPilzAdam2013-07-20
* Add liquid_range to nodedefPilzAdam2013-07-20
* Make range of tools configureablePilzAdam2013-07-20
* Leveled nodeboxproller2013-07-13
* Decoration: Add Schematic decoration typekwolekr2013-06-22
* Add drowningPilzAdam2013-06-19
* Move scriptapi to separate folder (by sapier)sapier2013-05-25
nitial_text = L""; } } /* Remove stuff */ removeChildren(); /* Calculate new sizes and positions */ core::rect<s32> rect( screensize.X/2 - 580/2, screensize.Y/2 - 300/2, screensize.X/2 + 580/2, screensize.Y/2 + 300/2 ); DesiredRect = rect; recalculateAbsolutePosition(false); v2s32 size = rect.getSize(); /* Add stuff */ { core::rect<s32> rect(0, 0, 300, 30); rect = rect + v2s32(size.X/2-300/2, size.Y/2-30/2-25); gui::IGUIElement *e = Environment->addEditBox(text.c_str(), rect, true, this, 256); Environment->setFocus(e); irr::SEvent evt; evt.EventType = EET_KEY_INPUT_EVENT; evt.KeyInput.Key = KEY_END; evt.KeyInput.PressedDown = true; e->OnEvent(evt); } changeCtype(""); { core::rect<s32> rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25); Environment->addButton(rect, this, 257, wgettext("Proceed")); } changeCtype("C"); } void GUITextInputMenu::drawMenu() { gui::IGUISkin* skin = Environment->getSkin(); if (!skin) return; video::IVideoDriver* driver = Environment->getVideoDriver(); video::SColor bgcolor(140,0,0,0); driver->draw2DRectangle(bgcolor, AbsoluteRect, &AbsoluteClippingRect); gui::IGUIElement::draw(); } void GUITextInputMenu::acceptInput() { if(m_dest) { gui::IGUIElement *e = getElementFromId(256); if(e != NULL) { m_dest->gotText(e->getText()); } delete m_dest; m_dest = NULL; } } bool GUITextInputMenu::OnEvent(const SEvent& event) { if(event.EventType==EET_KEY_INPUT_EVENT) { if(event.KeyInput.Key==KEY_ESCAPE && event.KeyInput.PressedDown) { quitMenu(); return true; } if(event.KeyInput.Key==KEY_RETURN && event.KeyInput.PressedDown) { acceptInput(); quitMenu(); return true; } } if(event.EventType==EET_GUI_EVENT) { if(event.GUIEvent.EventType==gui::EGET_ELEMENT_FOCUS_LOST && isVisible()) { if(!canTakeFocus(event.GUIEvent.Element)) { dstream<<"GUITextInputMenu: Not allowing focus change." <<std::endl; // Returning true disables focus change return true; } } if(event.GUIEvent.EventType==gui::EGET_BUTTON_CLICKED) { switch(event.GUIEvent.Caller->getID()) { case 257: acceptInput(); quitMenu(); // quitMenu deallocates menu return true; } } if(event.GUIEvent.EventType==gui::EGET_EDITBOX_ENTER) { switch(event.GUIEvent.Caller->getID()) { case 256: acceptInput(); quitMenu(); // quitMenu deallocates menu return true; } } } return Parent ? Parent->OnEvent(event) : false; }