aboutsummaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
Commit message (Expand)AuthorAge
* Fix doc and forceloading crash.Novatux2014-01-12
* Add InvRef::get/set_lists()ShadowNinja2014-01-11
* Add forceloadingNovatux2014-01-11
* Deepcopy pointed_thing for after_place_node, give it to on_rightclick too.Novatux2014-01-11
* Document "wielditem" visualShadowNinja2014-01-08
* Pass pointed_thing to after_place_nodeShadowNinja2014-01-06
* Bump version to 0.4.9kwolekr2014-01-01
* Don't throw a error when writing JSON failsShadowNinja2013-12-18
* Add 'minetest.write_json'ShadowNinja2013-12-18
* Add map feature generation notify Lua APIkwolekr2013-12-14
* Remove support for optdepends.txtShadowNinja2013-12-13
* Make line_of_sight return blocking node positionstujones112013-12-12
* Add 'on_prejoinplayer' callbackkaeza2013-12-12
* Fix small mistake in Lua API docssfan52013-12-06
* Use a table in set_physics_override()PilzAdam2013-12-03
* Add sneak and sneak_glitch to set_physics_override()PilzAdam2013-12-03
* Decoration: Add schematic Y-slice probability supportkwolekr2013-12-01
* Add documentation for minetest.swap_nodeNovatux2013-11-30
* LuaVoxelManip: Add area parameters back to calc_lighting and set_lighting, ma...kwolekr2013-11-30
* LuaVoxelManip: Add get_light_data() and set_light_data()kwolekr2013-11-30
* Rollback fixes and get_node_actionsShadowNinja2013-11-27
* Bump version to 0.4.8kwolekr2013-11-24
* Fix invalid listname and listsize not handled correctly in set_sizesapier2013-11-16
* Fix "TODO read modinfo" in modmanager to improve ui usabilitysapier2013-11-10
* Fix typo in lua_api.txtPilzAdam2013-11-08
* Add wrapper for minetest.rotate_and_place.4Evergreen42013-11-07
* Add 6d facedir rotation prediction routineVanessa Ezekowitz2013-11-06
* Reworked formspecs and kahrl's hexcolor parserBlockMen2013-11-03
* Add basic protection support to builtinShadowNinja2013-11-02
* Add a callback: minetest.register_on_craft(itemstack, player,Novatux2013-11-01
* Remove vector metatable settingShadowNinja2013-10-17
* Add tool callbackNovatux2013-10-16
* Add support for parameter 'visual_scale' for drawtypes 'signlike' and 'torchl...Sokomine2013-10-14
* Add set_name(), set_count(), set_wear() and set_metadata() to Lua ItemStackPilzAdam2013-09-28
* Allow to manually specify param2 in minetest.item_place() and return successPilzAdam2013-09-28
* Add option to scale image to percentage valuesBlockMen2013-09-20
* Fix comments about length of server stepShadowNinja2013-09-17
* Add offset to automatic_face_movement_dirPilzAdam2013-09-10
* Allow non-string arguments for minetest.is_yes()PilzAdam2013-09-10
* Add Settings interface for LuaPilzAdam2013-09-10
* Add minetest.get_gametime() API function, that returns the number of seconds ...Novatux2013-09-08
* Use player:set_hotbar_image() instead of hardcoded hotbar.pngPilzAdam2013-09-05
* Add minetest.parse_json, engine.parse_jsonKahrl2013-09-02
* Add translation for main menusapier2013-08-17
* Fix documentation about colors in formspecSfan52013-08-15
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
* Fix typosPilzAdam2013-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
ass="hl kwc">std::string &name, float value) { MutexAutoLock lock(m_mutex); int &count = m_avgcounts[name]; assert(count != -2); count = MYMAX(count, 0) + 1; m_data[name] += value; } void Profiler::clear() { MutexAutoLock lock(m_mutex); for (auto &it : m_data) { it.second = 0; } m_avgcounts.clear(); m_start_time = porting::getTimeMs(); } float Profiler::getValue(const std::string &name) const { auto numerator = m_data.find(name); if (numerator == m_data.end()) return 0.f; auto denominator = m_avgcounts.find(name); if (denominator != m_avgcounts.end()) { if (denominator->second >= 1) return numerator->second / denominator->second; } return numerator->second; } int Profiler::getAvgCount(const std::string &name) const { auto n = m_avgcounts.find(name); if (n != m_avgcounts.end() && n->second >= 1) return n->second; return 1; } u64 Profiler::getElapsedMs() const { return porting::getTimeMs() - m_start_time; } int Profiler::print(std::ostream &o, u32 page, u32 pagecount) { GraphValues values; getPage(values, page, pagecount); char num_buf[50]; for (const auto &i : values) { o << " " << i.first << " "; if (i.second == 0) { o << std::endl; continue; } s32 space = 44 - i.first.size(); for (s32 j = 0; j < space; j++) { if ((j & 1) && j < space - 1) o << "."; else o << " "; } porting::mt_snprintf(num_buf, sizeof(num_buf), "% 4ix % 3g", getAvgCount(i.first), i.second); o << num_buf << std::endl; } return values.size(); } void Profiler::getPage(GraphValues &o, u32 page, u32 pagecount) { MutexAutoLock lock(m_mutex); u32 minindex, maxindex; paging(m_data.size(), page, pagecount, minindex, maxindex); for (const auto &i : m_data) { if (maxindex == 0) break; maxindex--; if (minindex != 0) { minindex--; continue; } o[i.first] = i.second / getAvgCount(i.first); } }