aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_mainmenu.cpp
Commit message (Collapse)AuthorAge
* Fix absence of images when compiled with RUN_IN_PLACE=0.Ilya Zhuravlev2014-01-05
|
* Implement search tab and version pickersapier2013-12-11
|
* Fix modstore/favourites hang by adding asynchronous lua job supportsapier2013-11-29
|
* Fix invalid usage of temporary object in mainmenu json conversionsapier2013-11-11
|
* Show git hash in version string at top left corner of windowKahrl2013-09-28
|
* Fix umlauts/special character issue in lua gettextBlockMen2013-08-19
|
* Allow SIGINT to kill mainmenu againKahrl2013-08-19
|
* Add translation for main menusapier2013-08-17
| | | | Add engine.gettext() and remove gettext() calls in guiFormspecMenu.cpp
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
="hl opt">[hash] + 1 return true else if total_forceloaded >= (tonumber(core.setting_get("max_forceloaded_blocks")) or 16) then return false end total_forceloaded = total_forceloaded+1 blocks_forceloaded[hash] = 1 forceload_block(blockpos) return true end end function core.forceload_free_block(pos) local blockpos = get_blockpos(pos) local hash = core.hash_node_position(blockpos) if blocks_forceloaded[hash] == nil then return end if blocks_forceloaded[hash] > 1 then blocks_forceloaded[hash] = blocks_forceloaded[hash] - 1 else total_forceloaded = total_forceloaded-1 blocks_forceloaded[hash] = nil forceload_free_block(blockpos) end end -- Keep the forceloaded areas after restart local wpath = core.get_worldpath() local function read_file(filename) local f = io.open(filename, "r") if f==nil then return {} end local t = f:read("*all") f:close() if t=="" or t==nil then return {} end return core.deserialize(t) or {} end local function write_file(filename, table) local f = io.open(filename, "w") f:write(core.serialize(table)) f:close() end blocks_forceloaded = read_file(wpath.."/force_loaded.txt") for _, __ in pairs(blocks_forceloaded) do total_forceloaded = total_forceloaded + 1 end core.after(5, function() for hash, _ in pairs(blocks_forceloaded) do local blockpos = core.get_position_from_hash(hash) forceload_block(blockpos) end end) core.register_on_shutdown(function() write_file(wpath.."/force_loaded.txt", blocks_forceloaded) end)