aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
Commit message (Expand)AuthorAge
* Add Lua interface to HTTPFetchRequestJeija2016-02-22
* Ignore spaces in secure.trusted_mods settingJeija2016-02-19
* Require request_insecure_environment to be called from the mod's main scopeShadowNinja2016-02-19
* v2d & aabbox3d<f32> & sky cleanupsnerzhul2016-02-11
* Add '/clearobjects quick'Kahrl2016-02-11
* Don't print whole json data buffer to errorstream on errorest312016-01-28
* Make ItemStack:set_count(0) clear the item stacksfan52016-01-15
* Add option to give every object a nametagBlockMen2015-12-15
* Fix threshold typeest312015-12-07
* Mapgen: Add propagate_shadow bool to calcLightingparamat2015-12-07
* Fix spelling of noise_thresholdJun Zhang2015-12-06
* Add LuaSecureRandomest312015-11-08
* Add server side ncurses terminalest312015-11-06
* Schematics: Add core.place_schematic_on_vmanip APIkwolekr2015-11-05
* Add callback parameter for core.emerge_area()kwolekr2015-11-02
* SAPI: Fix seed parameter truncation for LuaPseudoRandom constructorkwolekr2015-10-26
* SAPI: Move core.get_us_time() to Util modulekwolekr2015-10-26
* SAPI: Throw runtime error instead of if l_get_mapgen_object called in incorre...kwolekr2015-10-25
* SAPI: Mark all Lua API functions requiring envlockkwolekr2015-10-25
* Correct comment in l_util.cppest312015-10-26
* ABMs: Make catch-up behaviour optionalparamat2015-10-18
* Remove wstrgettextest312015-10-18
* Rename macros with two leading underscoresShadowNinja2015-10-14
* Refactor loggingShadowNinja2015-10-14
* Allow setting chunksize in core.set_mapgen_paramskwolekr2015-10-04
* Hide mapgens from main menu not intended for end userskwolekr2015-10-04
* Add emerge completion callback mechanismkwolekr2015-10-04
* Define and use limit constants for Irrlicht fixed-width typeskwolekr2015-10-04
* Add get_biome_id(biome_name) callbackDuane Robertson2015-10-02
* Add /emergeblocks command and core.emerge_area() Lua APIkwolekr2015-09-23
* Various style cleanups + unused code removalest312015-09-19
* Ore: Add puff ore typekwolekr2015-09-17
* Ore: Add ore sheet column height range selectionkwolekr2015-09-13
* Areastore: fix "attempt to index a number value"est312015-09-03
* l_mainmenu.h: remove unused l_get_dirlist functionest312015-08-30
* Push error handler afresh each time lua_pcall is usedKahrl2015-08-27
* Use numeric indices and raw table access with LUA_REGISTRYINDEXKahrl2015-08-27
* SAPI: Disable unlockable time profilingkwolekr2015-08-18
* SEnv: Remove static_exists from ActiveObjects in deleted blockskwolekr2015-08-16
* minimap: Add ability to disable from serverkwolekr2015-08-13
* SAPI: Track last executed mod and include in error messageskwolekr2015-08-12
* Improve Script CPP API diagnosticskwolekr2015-08-05
* Biome API: Make fallback biome stone and water, disable fillerparamat2015-08-03
* Add AreaStore data structureest312015-07-27
* Fix MSVC number conversion warningSmallJoker2015-07-25
* Fix minetest.get_(all)_craft_recipe(s) regressionest312015-07-25
* Cleanup server addparticle(spawner) by merge two identical functions.Loic Blot2015-07-25
* Optional reconnect functionalityest312015-07-23
* Added get_player_velocity() method. Fixes #1176Elia Argentieri2015-07-20
* Refactor particle code to remove the while loopsTeTpaAka2015-07-18
t:") .. "]textlist[0.2,0.8;11.5,3.5;;" .. formspec .. "]button[6,4.6;3,0.5;btn_reconnect_no;" .. fgettext("Main menu") .. "]" .. "button[3,4.6;3,0.5;btn_reconnect_yes;" .. fgettext("Reconnect") .. "]" elseif gamedata ~= nil and gamedata.errormessage ~= nil then formspec = wordwrap_quickhack(gamedata.errormessage) local error_title if string.find(gamedata.errormessage, "ModError") then error_title = fgettext("An error occured in a Lua script, such as a mod:") else error_title = fgettext("An error occured:") end formspec = "size[12,5]" .. "label[0.5,0;" .. error_title .. "]textlist[0.2,0.8;11.5,3.5;;" .. formspec .. "]button[4.5,4.6;3,0.5;btn_error_confirm;" .. fgettext("Ok") .. "]" else local active_toplevel_ui_elements = 0 for key,value in pairs(ui.childlist) do if (value.type == "toplevel") then local retval = value:get_formspec() if retval ~= nil and retval ~= "" then active_toplevel_ui_elements = active_toplevel_ui_elements +1 formspec = formspec .. retval end end end -- no need to show addons if there ain't a toplevel element if (active_toplevel_ui_elements > 0) then for key,value in pairs(ui.childlist) do if (value.type == "addon") then local retval = value:get_formspec() if retval ~= nil and retval ~= "" then formspec = formspec .. retval end end end end if (active_toplevel_ui_elements > 1) then core.log("warning", "more than one active ui ".. "element, self most likely isn't intended") end if (active_toplevel_ui_elements == 0) then core.log("warning", "no toplevel ui element ".. "active; switching to default") ui.childlist[ui.default]:show() formspec = ui.childlist[ui.default]:get_formspec() end end core.update_formspec(formspec) end -------------------------------------------------------------------------------- function ui.handle_buttons(fields) for key,value in pairs(ui.childlist) do local retval = value:handle_buttons(fields) if retval then ui.update() return end end end -------------------------------------------------------------------------------- function ui.handle_events(event) for key,value in pairs(ui.childlist) do if value.handle_events ~= nil then local retval = value:handle_events(event) if retval then return retval end end end end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- initialize callbacks -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- core.button_handler = function(fields) if fields["btn_reconnect_yes"] then gamedata.reconnect_requested = false gamedata.errormessage = nil gamedata.do_reconnect = true core.start() return elseif fields["btn_reconnect_no"] or fields["btn_error_confirm"] then gamedata.errormessage = nil gamedata.reconnect_requested = false ui.update() return end if ui.handle_buttons(fields) then ui.update() end end -------------------------------------------------------------------------------- core.event_handler = function(event) if ui.handle_events(event) then ui.update() return end if event == "Refresh" then ui.update() return end end