aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-11-28 13:48:33 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-11-28 13:48:33 +0100
commiteb6aca8b4a67ef55108231e71ff29a18a29bf5ae (patch)
treef891914d25cae2cdaa24392381436a287340651e /builtin
parent8de51dae97aa2fe6ea02e4cf437bfe2b2a38eb06 (diff)
parentf1d72d212a0661588be27003069abf4bd8092e55 (diff)
downloaddragonfireclient-eb6aca8b4a67ef55108231e71ff29a18a29bf5ae.tar.xz
Merged Minetest
Diffstat (limited to 'builtin')
-rw-r--r--builtin/client/chatcommands.lua5
-rw-r--r--builtin/client/register.lua8
-rw-r--r--builtin/common/after.lua6
-rw-r--r--builtin/common/tests/vector_spec.lua4
-rw-r--r--builtin/common/vector.lua6
-rw-r--r--builtin/fstk/ui.lua2
-rw-r--r--builtin/game/chat.lua22
-rw-r--r--builtin/game/falling.lua10
-rw-r--r--builtin/game/features.lua1
-rw-r--r--builtin/game/item.lua3
-rw-r--r--builtin/game/item_entity.lua5
-rw-r--r--builtin/game/misc.lua6
-rw-r--r--builtin/game/register.lua5
-rw-r--r--builtin/mainmenu/dlg_contentstore.lua96
-rw-r--r--builtin/mainmenu/dlg_create_world.lua15
-rw-r--r--builtin/mainmenu/init.lua102
-rw-r--r--builtin/mainmenu/tab_local.lua33
-rw-r--r--builtin/mainmenu/tab_settings.lua116
-rw-r--r--builtin/mainmenu/tab_simple_main.lua220
-rw-r--r--builtin/settingtypes.txt125
20 files changed, 289 insertions, 501 deletions
diff --git a/builtin/client/chatcommands.lua b/builtin/client/chatcommands.lua
index ec8fed652..a45a76dfe 100644
--- a/builtin/client/chatcommands.lua
+++ b/builtin/client/chatcommands.lua
@@ -22,6 +22,11 @@ core.register_on_sending_chat_message(function(message)
return true
end
+ -- Run core.registered_on_chatcommand callbacks.
+ if core.run_callbacks(core.registered_on_chatcommand, 5, cmd, param) then
+ return true
+ end
+
local cmd_def = core.registered_chatcommands[cmd]
if cmd_def then
core.set_last_run_mod(cmd_def.mod_origin)
diff --git a/builtin/client/register.lua b/builtin/client/register.lua
index ef48f2ee6..03dc41f71 100644
--- a/builtin/client/register.lua
+++ b/builtin/client/register.lua
@@ -4,6 +4,13 @@ core.callback_origins = {}
local getinfo = debug.getinfo
debug.getinfo = nil
+--- Runs given callbacks.
+--
+-- Note: this function is also called from C++
+-- @tparam table callbacks a table with registered callbacks, like `core.registered_on_*`
+-- @tparam number mode a RunCallbacksMode, as defined in src/script/common/c_internal.h
+-- @param ... arguments for the callback
+-- @return depends on mode
function core.run_callbacks(callbacks, mode, ...)
assert(type(callbacks) == "table")
local cb_len = #callbacks
@@ -83,6 +90,7 @@ core.registered_on_mods_loaded, core.register_on_mods_loaded = make_registration
core.registered_on_shutdown, core.register_on_shutdown = make_registration()
core.registered_on_receiving_chat_message, core.register_on_receiving_chat_message = make_registration()
core.registered_on_sending_chat_message, core.register_on_sending_chat_message = make_registration()
+core.registered_on_chatcommand, core.register_on_chatcommand = make_registration()
core.registered_on_death, core.register_on_death = make_registration()
core.registered_on_hp_modification, core.register_on_hp_modification = make_registration()
core.registered_on_damage_taken, core.register_on_damage_taken = make_registration()
diff --git a/builtin/common/after.lua b/builtin/common/after.lua
index b314711c9..e20f292f0 100644
--- a/builtin/common/after.lua
+++ b/builtin/common/after.lua
@@ -31,11 +31,13 @@ function core.after(after, func, ...)
assert(tonumber(after) and type(func) == "function",
"Invalid minetest.after invocation")
local expire = time + after
- jobs[#jobs + 1] = {
+ local new_job = {
func = func,
expire = expire,
arg = {...},
- mod_origin = core.get_last_run_mod()
+ mod_origin = core.get_last_run_mod(),
}
+ jobs[#jobs + 1] = new_job
time_next = math.min(time_next, expire)
+ return { cancel = function() new_job.func = function() end end }
end
diff --git a/builtin/common/tests/vector_spec.lua b/builtin/common/tests/vector_spec.lua
index 6f308a4a8..0f287363a 100644
--- a/builtin/common/tests/vector_spec.lua
+++ b/builtin/common/tests/vector_spec.lua
@@ -44,6 +44,10 @@ describe("vector", function()
assert.same({ x = 2, y = 4, z = 6 }, vector.add(vector.new(1, 2, 3), { x = 1, y = 2, z = 3 }))
end)
+ it("offset()", function()
+ assert.same({ x = 41, y = 52, z = 63 }, vector.offset(vector.new(1, 2, 3), 40, 50, 60))
+ end)
+
-- This function is needed because of floating point imprecision.
local function almost_equal(a, b)
if type(a) == "number" then
diff --git a/builtin/common/vector.lua b/builtin/common/vector.lua
index 1fd784ce2..d6437deda 100644
--- a/builtin/common/vector.lua
+++ b/builtin/common/vector.lua
@@ -137,6 +137,12 @@ function vector.divide(a, b)
end
end
+function vector.offset(v, x, y, z)
+ return {x = v.x + x,
+ y = v.y + y,
+ z = v.z + z}
+end
+
function vector.sort(a, b)
return {x = math.min(a.x, b.x), y = math.min(a.y, b.y), z = math.min(a.z, b.z)},
{x = math.max(a.x, b.x), y = math.max(a.y, b.y), z = math.max(a.z, b.z)}
diff --git a/builtin/fstk/ui.lua b/builtin/fstk/ui.lua
index 6d26aabf0..7eeebdd47 100644
--- a/builtin/fstk/ui.lua
+++ b/builtin/fstk/ui.lua
@@ -64,6 +64,7 @@ function ui.update()
formspec = {
"size[14,8]",
"real_coordinates[true]",
+ "set_focus[btn_reconnect_yes;true]",
"box[0.5,1.2;13,5;#000]",
("textarea[0.5,1.2;13,5;;%s;%s]"):format(
fgettext("The server has requested a reconnect:"), error_message),
@@ -82,6 +83,7 @@ function ui.update()
formspec = {
"size[14,8]",
"real_coordinates[true]",
+ "set_focus[btn_error_confirm;true]",
"box[0.5,1.2;13,5;#000]",
("textarea[0.5,1.2;13,5;;%s;%s]"):format(
error_title, error_message),
diff --git a/builtin/game/chat.lua b/builtin/game/chat.lua
index aae811794..945707623 100644
--- a/builtin/game/chat.lua
+++ b/builtin/game/chat.lua
@@ -58,6 +58,11 @@ core.register_on_chat_message(function(name, message)
param = param or ""
+ -- Run core.registered_on_chatcommands callbacks.
+ if core.run_callbacks(core.registered_on_chatcommands, 5, name, cmd, param) then
+ return true
+ end
+
local cmd_def = core.registered_chatcommands[cmd]
if not cmd_def then
core.chat_send_player(name, "-!- Invalid command: " .. cmd)
@@ -66,8 +71,17 @@ core.register_on_chat_message(function(name, message)
local has_privs, missing_privs = core.check_player_privs(name, cmd_def.privs)
if has_privs then
core.set_last_run_mod(cmd_def.mod_origin)
- local _, result = cmd_def.func(name, param)
- if result then
+ local success, result = cmd_def.func(name, param)
+ if success == false and result == nil then
+ core.chat_send_player(name, "-!- Invalid command usage")
+ local help_def = core.registered_chatcommands["help"]
+ if help_def then
+ local _, helpmsg = help_def.func(name, cmd)
+ if helpmsg then
+ core.chat_send_player(name, helpmsg)
+ end
+ end
+ elseif result then
core.chat_send_player(name, result)
end
else
@@ -1070,10 +1084,10 @@ core.register_chatcommand("last-login", {
local pauth = core.get_auth_handler().get_auth(param)
if pauth and pauth.last_login and pauth.last_login ~= -1 then
-- Time in UTC, ISO 8601 format
- return true, "Last login time was " ..
+ return true, param.."'s last login time was " ..
os.date("!%Y-%m-%dT%H:%M:%SZ", pauth.last_login)
end
- return false, "Last login time is unknown"
+ return false, param.."'s last login time is unknown"
end,
})
diff --git a/builtin/game/falling.lua b/builtin/game/falling.lua
index 714506a5f..8d044beaa 100644
--- a/builtin/game/falling.lua
+++ b/builtin/game/falling.lua
@@ -52,6 +52,7 @@ core.register_entity(":__builtin:falling_node", {
floats = false,
set_node = function(self, node, meta)
+ node.param2 = node.param2 or 0
self.node = node
meta = meta or {}
if type(meta.to_table) == "function" then
@@ -83,6 +84,9 @@ core.register_entity(":__builtin:falling_node", {
local textures
if def.tiles and def.tiles[1] then
local tile = def.tiles[1]
+ if def.drawtype == "torchlike" and def.paramtype2 ~= "wallmounted" then
+ tile = def.tiles[2] or def.tiles[1]
+ end
if type(tile) == "table" then
tile = tile.name
end
@@ -143,7 +147,11 @@ core.register_entity(":__builtin:falling_node", {
-- Rotate entity
if def.drawtype == "torchlike" then
- self.object:set_yaw(math.pi*0.25)
+ if def.paramtype2 == "wallmounted" then
+ self.object:set_yaw(math.pi*0.25)
+ else
+ self.object:set_yaw(-math.pi*0.25)
+ end
elseif (node.param2 ~= 0 and (def.wield_image == ""
or def.wield_image == nil))
or def.drawtype == "signlike"
diff --git a/builtin/game/features.lua b/builtin/game/features.lua
index a15475333..4d3c90ff0 100644
--- a/builtin/game/features.lua
+++ b/builtin/game/features.lua
@@ -17,6 +17,7 @@ core.features = {
area_store_persistent_ids = true,
pathfinder_works = true,
object_step_has_moveresult = true,
+ direct_velocity_on_players = true,
}
function core.has_feature(arg)
diff --git a/builtin/game/item.lua b/builtin/game/item.lua
index 2c43a8548..768df847b 100644
--- a/builtin/game/item.lua
+++ b/builtin/game/item.lua
@@ -538,8 +538,9 @@ function core.node_dig(pos, node, digger)
local diggername = user_name(digger)
local log = make_log(diggername)
local def = core.registered_nodes[node.name]
+ -- Copy pos because the callback could modify it
if def and (not def.diggable or
- (def.can_dig and not def.can_dig(pos, digger))) then
+ (def.can_dig and not def.can_dig(vector.new(pos), digger))) then
log("info", diggername .. " tried to dig "
.. node.name .. " which is not diggable "
.. core.pos_to_string(pos))
diff --git a/builtin/game/item_entity.lua b/builtin/game/item_entity.lua
index 20dd18044..9b1b23bfd 100644
--- a/builtin/game/item_entity.lua
+++ b/builtin/game/item_entity.lua
@@ -54,8 +54,9 @@ core.register_entity(":__builtin:item", {
local max_count = stack:get_stack_max()
local count = math.min(stack:get_count(), max_count)
local size = 0.2 + 0.1 * (count / max_count) ^ (1 / 3)
- local def = core.registered_nodes[itemname]
- local glow = def and math.floor(def.light_source / 2 + 0.5)
+ local def = core.registered_items[itemname]
+ local glow = def and def.light_source and
+ math.floor(def.light_source / 2 + 0.5)
self.object:set_properties({
is_visible = true,
diff --git a/builtin/game/misc.lua b/builtin/game/misc.lua
index 341e613c2..96a0a2dda 100644
--- a/builtin/game/misc.lua
+++ b/builtin/game/misc.lua
@@ -151,6 +151,12 @@ function core.setting_get_pos(name)
end
+-- See l_env.cpp for the other functions
+function core.get_artificial_light(param1)
+ return math.floor(param1 / 16)
+end
+
+
-- To be overriden by protection mods
function core.is_protected(pos, name)
diff --git a/builtin/game/register.lua b/builtin/game/register.lua
index 1034d4f2b..1f94a9dca 100644
--- a/builtin/game/register.lua
+++ b/builtin/game/register.lua
@@ -118,6 +118,10 @@ function core.register_item(name, itemdef)
end
itemdef.name = name
+ -- default short_description to first line of description
+ itemdef.short_description = itemdef.short_description or
+ (itemdef.description or ""):gsub("\n.*","")
+
-- Apply defaults and add to registered_* table
if itemdef.type == "node" then
-- Use the nodebox as selection box if it's not set manually
@@ -584,6 +588,7 @@ core.unregister_biome = make_wrap_deregistration(core.register_biome,
core.clear_registered_biomes, core.registered_biomes)
core.registered_on_chat_messages, core.register_on_chat_message = make_registration()
+core.registered_on_chatcommands, core.register_on_chatcommand = make_registration()
core.registered_globalsteps, core.register_globalstep = make_registration()
core.registered_playerevents, core.register_playerevent = make_registration()
core.registered_on_mods_loaded, core.register_on_mods_loaded = make_registration()
diff --git a/builtin/mainmenu/dlg_contentstore.lua b/builtin/mainmenu/dlg_contentstore.lua
index 01c42be0b..6525f6013 100644
--- a/builtin/mainmenu/dlg_contentstore.lua
+++ b/builtin/mainmenu/dlg_contentstore.lua
@@ -45,6 +45,9 @@ local filter_types_titles = {
fgettext("Texture packs"),
}
+local number_downloading = 0
+local download_queue = {}
+
local filter_types_type = {
nil,
"game",
@@ -67,12 +70,14 @@ local function download_package(param)
end
end
-local function start_install(calling_dialog, package)
+local function start_install(package)
local params = {
package = package,
filename = os.tempfolder() .. "_MODNAME_" .. package.name .. ".zip",
}
+ number_downloading = number_downloading + 1
+
local function callback(result)
if result.successful then
local path, msg = pkgmgr.install(package.type,
@@ -121,9 +126,20 @@ local function start_install(calling_dialog, package)
end
package.downloading = false
+
+ number_downloading = number_downloading - 1
+
+ local next = download_queue[1]
+ if next then
+ table.remove(download_queue, 1)
+
+ start_install(next)
+ end
+
ui.update()
end
+ package.queued = false
package.downloading = true
if not core.handle_async(download_package, params, callback) then
@@ -133,6 +149,16 @@ local function start_install(calling_dialog, package)
end
end
+local function queue_download(package)
+ local max_concurrent_downloads = tonumber(minetest.settings:get("contentdb_max_concurrent_downloads"))
+ if number_downloading < max_concurrent_downloads then
+ start_install(package)
+ else
+ table.insert(download_queue, package)
+ package.queued = true
+ end
+end
+
local function get_file_extension(path)
local parts = path:split(".")
return parts[#parts]
@@ -279,7 +305,7 @@ function store.filter_packages(query)
table.insert(keywords, word)
end
- local function matches_keywords(package, keywords)
+ local function matches_keywords(package)
for k = 1, #keywords do
local keyword = keywords[k]
@@ -296,7 +322,7 @@ function store.filter_packages(query)
store.packages = {}
for _, package in pairs(store.packages_full) do
- if (query == "" or matches_keywords(package, keywords)) and
+ if (query == "" or matches_keywords(package)) and
(filter_type == 1 or package.type == filter_types_type[filter_type]) then
store.packages[#store.packages + 1] = package
end
@@ -321,11 +347,14 @@ function store.get_formspec(dlgdata)
"formspec_version[3]",
"size[15.75,9.5]",
"position[0.5,0.55]",
+
+ "style[status;border=false]",
+
"container[0.375,0.375]",
- "field[0,0;10.225,0.8;search_string;;", core.formspec_escape(search_string), "]",
+ "field[0,0;7.225,0.8;search_string;;", core.formspec_escape(search_string), "]",
"field_close_on_enter[search_string;false]",
- "button[10.225,0;2,0.8;search;", fgettext("Search"), "]",
- "dropdown[12.6,0;2.4,0.8;type;", table.concat(filter_types_titles, ","), ";", filter_type, "]",
+ "button[7.225,0;2,0.8;search;", fgettext("Search"), "]",
+ "dropdown[9.6,0;2.4,0.8;type;", table.concat(filter_types_titles, ","), ";", filter_type, "]",
"container_end[]",
-- Page nav buttons
@@ -344,6 +373,35 @@ function store.get_formspec(dlgdata)
"container_end[]",
}
+ if number_downloading > 0 then
+ formspec[#formspec + 1] = "button[12.75,0.375;2.625,0.8;status;"
+ if #download_queue > 0 then
+ formspec[#formspec + 1] = fgettext("$1 downloading,\n$2 queued", number_downloading, #download_queue)
+ else
+ formspec[#formspec + 1] = fgettext("$1 downloading...", number_downloading)
+ end
+ formspec[#formspec + 1] = "]"
+ else
+ local num_avail_updates = 0
+ for i=1, #store.packages_full do
+ local package = store.packages_full[i]
+ if package.path and package.installed_release < package.release and
+ not (package.downloading or package.queued) then
+ num_avail_updates = num_avail_updates + 1
+ end
+ end
+
+ if num_avail_updates == 0 then
+ formspec[#formspec + 1] = "button[12.75,0.375;2.625,0.8;status;"
+ formspec[#formspec + 1] = fgettext("No updates")
+ formspec[#formspec + 1] = "]"
+ else
+ formspec[#formspec + 1] = "button[12.75,0.375;2.625,0.8;update_all;"
+ formspec[#formspec + 1] = fgettext("Update All [$1]", num_avail_updates)
+ formspec[#formspec + 1] = "]"
+ end
+ end
+
if #store.packages == 0 then
formspec[#formspec + 1] = "label[4,3;"
formspec[#formspec + 1] = fgettext("No results")
@@ -386,11 +444,13 @@ function store.get_formspec(dlgdata)
formspec[#formspec + 1] = ",0.1]"
if package.downloading then
- formspec[#formspec + 1] = "style[download;border=false]"
-
- formspec[#formspec + 1] = "button[-3.5,0;2,0.8;download;"
+ formspec[#formspec + 1] = "button[-3.5,0;2,0.8;status;"
formspec[#formspec + 1] = fgettext("Downloading...")
formspec[#formspec + 1] = "]"
+ elseif package.queued then
+ formspec[#formspec + 1] = "button[-3.5,0;2,0.8;status;"
+ formspec[#formspec + 1] = fgettext("Queued")
+ formspec[#formspec + 1] = "]"
elseif not package.path then
formspec[#formspec + 1] = "button[-3,0;1.5,0.8;install_"
formspec[#formspec + 1] = tostring(i)
@@ -485,6 +545,17 @@ function store.handle_submit(this, fields)
end
end
+ if fields.update_all then
+ for i=1, #store.packages_full do
+ local package = store.packages_full[i]
+ if package.path and package.installed_release < package.release and
+ not (package.downloading or package.queued) then
+ queue_download(package)
+ end
+ end
+ return true
+ end
+
local start_idx = (cur_page - 1) * num_per_page + 1
assert(start_idx ~= nil)
for i=start_idx, math.min(#store.packages, start_idx+num_per_page-1) do
@@ -492,7 +563,7 @@ function store.handle_submit(this, fields)
assert(package)
if fields["install_" .. i] then
- start_install(this, package)
+ queue_download(package)
return true
end
@@ -505,8 +576,9 @@ function store.handle_submit(this, fields)
end
if fields["view_" .. i] then
- local url = ("%s/packages/%s?protocol_version=%d"):format(
- core.settings:get("contentdb_url"), package.id, core.get_max_supp_proto())
+ local url = ("%s/packages/%s/%s?protocol_version=%d"):format(
+ core.settings:get("contentdb_url"),
+ package.author, package.name, core.get_max_supp_proto())
core.open_url(url)
return true
end
diff --git a/builtin/mainmenu/dlg_create_world.lua b/builtin/mainmenu/dlg_create_world.lua
index 36df23cce..7566d2409 100644
--- a/builtin/mainmenu/dlg_create_world.lua
+++ b/builtin/mainmenu/dlg_create_world.lua
@@ -61,6 +61,7 @@ local flag_checkboxes = {
fgettext("Low humidity and high heat causes shallow or dry rivers") },
},
flat = {
+ cb_caverns,
{ "hills", fgettext("Hills"), "hills" },
{ "lakes", fgettext("Lakes"), "lakes" },
},
@@ -362,10 +363,18 @@ local function create_world_buttonhandler(this, fields)
local gameindex = core.get_textlist_index("games")
if gameindex ~= nil then
+ -- For unnamed worlds use the generated name 'world<number>',
+ -- where the number increments: it is set to 1 larger than the largest
+ -- generated name number found.
if worldname == "" then
- local random_number = math.random(10000, 99999)
- local random_world_name = "Unnamed" .. random_number
- worldname = random_world_name
+ local worldnum_max = 0
+ for _, world in ipairs(menudata.worldlist:get_list()) do
+ if world.name:match("^world%d+$") then
+ local worldnum = tonumber(world.name:sub(6))
+ worldnum_max = math.max(worldnum_max, worldnum)
+ end
+ end
+ worldname = "world" .. worldnum_max + 1
end
core.settings:set("fixed_map_seed", fields["te_seed"])
diff --git a/builtin/mainmenu/init.lua b/builtin/mainmenu/init.lua
index ae9ae8853..b7e867d2e 100644
--- a/builtin/mainmenu/init.lua
+++ b/builtin/mainmenu/init.lua
@@ -22,7 +22,6 @@ mt_color_dark_green = "#25C191"
local menupath = core.get_mainmenu_path()
local basepath = core.get_builtin_path()
-local menustyle = core.settings:get("main_menu_style")
defaulttexturedir = core.get_texturepath_share() .. DIR_DELIM .. "base" ..
DIR_DELIM .. "pack" .. DIR_DELIM
@@ -39,24 +38,18 @@ dofile(menupath .. DIR_DELIM .. "textures.lua")
dofile(menupath .. DIR_DELIM .. "dlg_config_world.lua")
dofile(menupath .. DIR_DELIM .. "dlg_settings_advanced.lua")
dofile(menupath .. DIR_DELIM .. "dlg_contentstore.lua")
-if menustyle ~= "simple" then
- dofile(menupath .. DIR_DELIM .. "dlg_create_world.lua")
- dofile(menupath .. DIR_DELIM .. "dlg_delete_content.lua")
- dofile(menupath .. DIR_DELIM .. "dlg_delete_world.lua")
- dofile(menupath .. DIR_DELIM .. "dlg_rename_modpack.lua")
-end
+dofile(menupath .. DIR_DELIM .. "dlg_create_world.lua")
+dofile(menupath .. DIR_DELIM .. "dlg_delete_content.lua")
+dofile(menupath .. DIR_DELIM .. "dlg_delete_world.lua")
+dofile(menupath .. DIR_DELIM .. "dlg_rename_modpack.lua")
local tabs = {}
tabs.settings = dofile(menupath .. DIR_DELIM .. "tab_settings.lua")
tabs.content = dofile(menupath .. DIR_DELIM .. "tab_content.lua")
tabs.credits = dofile(menupath .. DIR_DELIM .. "tab_credits.lua")
-if menustyle == "simple" then
- tabs.simple_main = dofile(menupath .. DIR_DELIM .. "tab_simple_main.lua")
-else
- tabs.local_game = dofile(menupath .. DIR_DELIM .. "tab_local.lua")
- tabs.play_online = dofile(menupath .. DIR_DELIM .. "tab_online.lua")
-end
+tabs.local_game = dofile(menupath .. DIR_DELIM .. "tab_local.lua")
+tabs.play_online = dofile(menupath .. DIR_DELIM .. "tab_online.lua")
--------------------------------------------------------------------------------
local function main_event_handler(tabview, event)
@@ -71,68 +64,35 @@ local function init_globals()
-- Init gamedata
gamedata.worldindex = 0
- if menustyle == "simple" then
- local world_list = core.get_worlds()
- local world_index
-
- local found_singleplayerworld = false
- for i, world in ipairs(world_list) do
- if world.name == "singleplayerworld" then
- found_singleplayerworld = true
- world_index = i
- break
- end
- end
-
- if not found_singleplayerworld then
- core.create_world("singleplayerworld", 1)
-
- world_list = core.get_worlds()
-
- for i, world in ipairs(world_list) do
- if world.name == "singleplayerworld" then
- world_index = i
- break
- end
- end
+ menudata.worldlist = filterlist.create(
+ core.get_worlds,
+ compare_worlds,
+ -- Unique id comparison function
+ function(element, uid)
+ return element.name == uid
+ end,
+ -- Filter function
+ function(element, gameid)
+ return element.gameid == gameid
end
+ )
- gamedata.worldindex = world_index
- else
- menudata.worldlist = filterlist.create(
- core.get_worlds,
- compare_worlds,
- -- Unique id comparison function
- function(element, uid)
- return element.name == uid
- end,
- -- Filter function
- function(element, gameid)
- return element.gameid == gameid
- end
- )
-
- menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic)
- menudata.worldlist:set_sortmode("alphabetic")
-
- if not core.settings:get("menu_last_game") then
- local default_game = core.settings:get("default_game") or "minetest"
- core.settings:set("menu_last_game", default_game)
- end
+ menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic)
+ menudata.worldlist:set_sortmode("alphabetic")
- mm_texture.init()
+ if not core.settings:get("menu_last_game") then
+ local default_game = core.settings:get("default_game") or "minetest"
+ core.settings:set("menu_last_game", default_game)
end
+ mm_texture.init()
+
-- Create main tabview
local tv_main = tabview_create("maintab", {x = 12, y = 5.4}, {x = 0, y = 0})
- if menustyle == "simple" then
- tv_main:add(tabs.simple_main)
- else
- tv_main:set_autosave_tab(true)
- tv_main:add(tabs.local_game)
- tv_main:add(tabs.play_online)
- end
+ tv_main:set_autosave_tab(true)
+ tv_main:add(tabs.local_game)
+ tv_main:add(tabs.play_online)
tv_main:add(tabs.content)
tv_main:add(tabs.settings)
@@ -141,11 +101,9 @@ local function init_globals()
tv_main:set_global_event_handler(main_event_handler)
tv_main:set_fixed_size(false)
- if menustyle ~= "simple" then
- local last_tab = core.settings:get("maintab_LAST")
- if last_tab and tv_main.current_tab ~= last_tab then
- tv_main:set_tab(last_tab)
- end
+ local last_tab = core.settings:get("maintab_LAST")
+ if last_tab and tv_main.current_tab ~= last_tab then
+ tv_main:set_tab(last_tab)
end
ui.set_default("maintab")
tv_main:show()
diff --git a/builtin/mainmenu/tab_local.lua b/builtin/mainmenu/tab_local.lua
index a21cf12b1..1aee246fc 100644
--- a/builtin/mainmenu/tab_local.lua
+++ b/builtin/mainmenu/tab_local.lua
@@ -114,45 +114,44 @@ local function get_formspec(tabview, name, tabdata)
)
retval = retval ..
- "button[4,3.95;2.6,1;world_delete;".. fgettext("Delete") .. "]" ..
- "button[6.5,3.95;2.8,1;world_configure;".. fgettext("Configure") .. "]" ..
- "button[9.2,3.95;2.5,1;world_create;".. fgettext("New") .. "]" ..
- "label[4,-0.25;".. fgettext("Select World:") .. "]"..
- "checkbox[0.25,0.25;cb_creative_mode;".. fgettext("Creative Mode") .. ";" ..
+ "button[3.9,3.8;2.8,1;world_delete;".. fgettext("Delete") .. "]" ..
+ "button[6.55,3.8;2.8,1;world_configure;".. fgettext("Configure") .. "]" ..
+ "button[9.2,3.8;2.8,1;world_create;".. fgettext("New") .. "]" ..
+ "label[3.9,-0.05;".. fgettext("Select World:") .. "]"..
+ "checkbox[0,-0.20;cb_creative_mode;".. fgettext("Creative Mode") .. ";" ..
dump(core.settings:get_bool("creative_mode")) .. "]"..
- "checkbox[0.25,0.7;cb_enable_damage;".. fgettext("Enable Damage") .. ";" ..
+ "checkbox[0,0.25;cb_enable_damage;".. fgettext("Enable Damage") .. ";" ..
dump(core.settings:get_bool("enable_damage")) .. "]"..
- "checkbox[0.25,1.15;cb_server;".. fgettext("Host Server") ..";" ..
+ "checkbox[0,0.7;cb_server;".. fgettext("Host Server") ..";" ..
dump(core.settings:get_bool("enable_server")) .. "]" ..
- "textlist[4,0.25;7.5,3.7;sp_worlds;" ..
+ "textlist[3.9,0.4;7.9,3.45;sp_worlds;" ..
menu_render_worldlist() ..
";" .. index .. "]"
if core.settings:get_bool("enable_server") then
retval = retval ..
- "button[8.5,4.8;3.2,1;play;".. fgettext("Host Game") .. "]" ..
- "checkbox[0.25,1.6;cb_server_announce;" .. fgettext("Announce Server") .. ";" ..
+ "button[7.9,4.75;4.1,1;play;".. fgettext("Host Game") .. "]" ..
+ "checkbox[0,1.15;cb_server_announce;" .. fgettext("Announce Server") .. ";" ..
dump(core.settings:get_bool("server_announce")) .. "]" ..
- "label[0.25,2.2;" .. fgettext("Name/Password") .. "]" ..
- "field[0.55,3.2;3.5,0.5;te_playername;;" ..
+ "field[0.3,2.85;3.8,0.5;te_playername;" .. fgettext("Name") .. ";" ..
core.formspec_escape(core.settings:get("name")) .. "]" ..
- "pwdfield[0.55,4;3.5,0.5;te_passwd;]"
+ "pwdfield[0.3,4.05;3.8,0.5;te_passwd;" .. fgettext("Password") .. "]"
local bind_addr = core.settings:get("bind_address")
if bind_addr ~= nil and bind_addr ~= "" then
retval = retval ..
- "field[0.55,5.2;2.25,0.5;te_serveraddr;" .. fgettext("Bind Address") .. ";" ..
+ "field[0.3,5.25;2.5,0.5;te_serveraddr;" .. fgettext("Bind Address") .. ";" ..
core.formspec_escape(core.settings:get("bind_address")) .. "]" ..
- "field[2.8,5.2;1.25,0.5;te_serverport;" .. fgettext("Port") .. ";" ..
+ "field[2.85,5.25;1.25,0.5;te_serverport;" .. fgettext("Port") .. ";" ..
core.formspec_escape(core.settings:get("port")) .. "]"
else
retval = retval ..
- "field[0.55,5.2;3.5,0.5;te_serverport;" .. fgettext("Server Port") .. ";" ..
+ "field[0.3,5.25;3.8,0.5;te_serverport;" .. fgettext("Server Port") .. ";" ..
core.formspec_escape(core.settings:get("port")) .. "]"
end
else
retval = retval ..
- "button[8.5,4.8;3.2,1;play;".. fgettext("Play Game") .. "]"
+ "button[7.9,4.75;4.1,1;play;" .. fgettext("Play Game") .. "]"
end
return retval
diff --git a/builtin/mainmenu/tab_settings.lua b/builtin/mainmenu/tab_settings.lua
index 1e5264904..29744048a 100644
--- a/builtin/mainmenu/tab_settings.lua
+++ b/builtin/mainmenu/tab_settings.lua
@@ -122,56 +122,6 @@ local function antialiasing_fname_to_name(fname)
return 0
end
-local function dlg_confirm_reset_formspec(data)
- return "size[8,3]" ..
- "label[1,1;" .. fgettext("Are you sure to reset your singleplayer world?") .. "]" ..
- "button[1,2;2.6,0.5;dlg_reset_singleplayer_confirm;" .. fgettext("Yes") .. "]" ..
- "button[4,2;2.8,0.5;dlg_reset_singleplayer_cancel;" .. fgettext("No") .. "]"
-end
-
-local function dlg_confirm_reset_btnhandler(this, fields, dialogdata)
-
- if fields["dlg_reset_singleplayer_confirm"] ~= nil then
- local worldlist = core.get_worlds()
- local found_singleplayerworld = false
-
- for i = 1, #worldlist do
- if worldlist[i].name == "singleplayerworld" then
- found_singleplayerworld = true
- gamedata.worldindex = i
- end
- end
-
- if found_singleplayerworld then
- core.delete_world(gamedata.worldindex)
- end
-
- core.create_world("singleplayerworld", 1)
- worldlist = core.get_worlds()
-
- for i = 1, #worldlist do
- if worldlist[i].name == "singleplayerworld" then
- gamedata.worldindex = i
- end
- end
- end
-
- this.parent:show()
- this:hide()
- this:delete()
- return true
-end
-
-local function showconfirm_reset(tabview)
- local new_dlg = dialog_create("reset_spworld",
- dlg_confirm_reset_formspec,
- dlg_confirm_reset_btnhandler,
- nil)
- new_dlg:set_parent(tabview)
- tabview:hide()
- new_dlg:show()
-end
-
local function formspec(tabview, name, tabdata)
local tab_string =
"box[0,0;3.75,4.5;#999999]" ..
@@ -204,30 +154,26 @@ local function formspec(tabview, name, tabdata)
"box[8,0;3.75,4.5;#999999]"
local video_driver = core.settings:get("video_driver")
- local shaders_supported = video_driver == "opengl"
- local shaders_enabled = false
- if shaders_supported then
- shaders_enabled = core.settings:get_bool("enable_shaders")
+ local shaders_enabled = core.settings:get_bool("enable_shaders")
+ if video_driver == "opengl" then
tab_string = tab_string ..
"checkbox[8.25,0;cb_shaders;" .. fgettext("Shaders") .. ";"
.. tostring(shaders_enabled) .. "]"
+ elseif video_driver == "ogles2" then
+ tab_string = tab_string ..
+ "checkbox[8.25,0;cb_shaders;" .. fgettext("Shaders (experimental)") .. ";"
+ .. tostring(shaders_enabled) .. "]"
else
core.settings:set_bool("enable_shaders", false)
+ shaders_enabled = false
tab_string = tab_string ..
"label[8.38,0.2;" .. core.colorize("#888888",
fgettext("Shaders (unavailable)")) .. "]"
end
- if core.settings:get("main_menu_style") == "simple" then
- -- 'Reset singleplayer world' only functions with simple menu
- tab_string = tab_string ..
- "button[8,4.75;3.95,1;btn_reset_singleplayer;"
- .. fgettext("Reset singleplayer world") .. "]"
- else
- tab_string = tab_string ..
- "button[8,4.75;3.95,1;btn_change_keys;"
- .. fgettext("Change Keys") .. "]"
- end
+ tab_string = tab_string ..
+ "button[8,4.75;3.95,1;btn_change_keys;"
+ .. fgettext("Change Keys") .. "]"
tab_string = tab_string ..
"button[0,4.75;3.95,1;btn_advanced_settings;"
@@ -244,35 +190,23 @@ local function formspec(tabview, name, tabdata)
if shaders_enabled then
tab_string = tab_string ..
- "checkbox[8.25,0.5;cb_bumpmapping;" .. fgettext("Bump Mapping") .. ";"
- .. dump(core.settings:get_bool("enable_bumpmapping")) .. "]" ..
- "checkbox[8.25,1;cb_tonemapping;" .. fgettext("Tone Mapping") .. ";"
+ "checkbox[8.25,0.5;cb_tonemapping;" .. fgettext("Tone Mapping") .. ";"
.. dump(core.settings:get_bool("tone_mapping")) .. "]" ..
- "checkbox[8.25,1.5;cb_generate_normalmaps;" .. fgettext("Generate Normal Maps") .. ";"
- .. dump(core.settings:get_bool("generate_normalmaps")) .. "]" ..
- "checkbox[8.25,2;cb_parallax;" .. fgettext("Parallax Occlusion") .. ";"
- .. dump(core.settings:get_bool("enable_parallax_occlusion")) .. "]" ..
- "checkbox[8.25,2.5;cb_waving_water;" .. fgettext("Waving Liquids") .. ";"
+ "checkbox[8.25,1;cb_waving_water;" .. fgettext("Waving Liquids") .. ";"
.. dump(core.settings:get_bool("enable_waving_water")) .. "]" ..
- "checkbox[8.25,3;cb_waving_leaves;" .. fgettext("Waving Leaves") .. ";"
+ "checkbox[8.25,1.5;cb_waving_leaves;" .. fgettext("Waving Leaves") .. ";"
.. dump(core.settings:get_bool("enable_waving_leaves")) .. "]" ..
- "checkbox[8.25,3.5;cb_waving_plants;" .. fgettext("Waving Plants") .. ";"
+ "checkbox[8.25,2;cb_waving_plants;" .. fgettext("Waving Plants") .. ";"
.. dump(core.settings:get_bool("enable_waving_plants")) .. "]"
else
tab_string = tab_string ..
"label[8.38,0.7;" .. core.colorize("#888888",
- fgettext("Bump Mapping")) .. "]" ..
- "label[8.38,1.2;" .. core.colorize("#888888",
fgettext("Tone Mapping")) .. "]" ..
- "label[8.38,1.7;" .. core.colorize("#888888",
- fgettext("Generate Normal Maps")) .. "]" ..
- "label[8.38,2.2;" .. core.colorize("#888888",
- fgettext("Parallax Occlusion")) .. "]" ..
- "label[8.38,2.7;" .. core.colorize("#888888",
+ "label[8.38,1.2;" .. core.colorize("#888888",
fgettext("Waving Liquids")) .. "]" ..
- "label[8.38,3.2;" .. core.colorize("#888888",
+ "label[8.38,1.7;" .. core.colorize("#888888",
fgettext("Waving Leaves")) .. "]" ..
- "label[8.38,3.7;" .. core.colorize("#888888",
+ "label[8.38,2.2;" .. core.colorize("#888888",
fgettext("Waving Plants")) .. "]"
end
@@ -324,22 +258,10 @@ local function handle_settings_buttons(this, fields, tabname, tabdata)
end
return true
end
- if fields["cb_bumpmapping"] then
- core.settings:set("enable_bumpmapping", fields["cb_bumpmapping"])
- return true
- end
if fields["cb_tonemapping"] then
core.settings:set("tone_mapping", fields["cb_tonemapping"])
return true
end
- if fields["cb_generate_normalmaps"] then
- core.settings:set("generate_normalmaps", fields["cb_generate_normalmaps"])
- return true
- end
- if fields["cb_parallax"] then
- core.settings:set("enable_parallax_occlusion", fields["cb_parallax"])
- return true
- end
if fields["cb_waving_water"] then
core.settings:set("enable_waving_water", fields["cb_waving_water"])
return true
@@ -359,10 +281,6 @@ local function handle_settings_buttons(this, fields, tabname, tabdata)
core.settings:set("touchtarget", fields["cb_touchscreen_target"])
return true
end
- if fields["btn_reset_singleplayer"] then
- showconfirm_reset(this)
- return true
- end
--Note dropdowns have to be handled LAST!
local ddhandled = false
diff --git a/builtin/mainmenu/tab_simple_main.lua b/builtin/mainmenu/tab_simple_main.lua
deleted file mode 100644
index 7ec95158a..000000000
--- a/builtin/mainmenu/tab_simple_main.lua
+++ /dev/null
@@ -1,220 +0,0 @@
---Minetest
---Copyright (C) 2013 sapier
---
---This program is free software; you can redistribute it and/or modify
---it under the terms of the GNU Lesser General Public License as published by
---the Free Software Foundation; either version 2.1 of the License, or
---(at your option) any later version.
---
---This program is distributed in the hope that it will be useful,
---but WITHOUT ANY WARRANTY; without even the implied warranty of
---MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
---GNU Lesser General Public License for more details.
---
---You should have received a copy of the GNU Lesser General Public License along
---with this program; if not, write to the Free Software Foundation, Inc.,
---51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
---------------------------------------------------------------------------------
-local function get_formspec(tabview, name, tabdata)
- -- Update the cached supported proto info,
- -- it may have changed after a change by the settings menu.
- common_update_cached_supp_proto()
- local fav_selected = menudata.favorites[tabdata.fav_selected]
-
- local retval =
- "label[9.5,0;".. fgettext("Name / Password") .. "]" ..
- "field[0.25,3.35;5.5,0.5;te_address;;" ..
- core.formspec_escape(core.settings:get("address")) .."]" ..
- "field[5.75,3.35;2.25,0.5;te_port;;" ..
- core.formspec_escape(core.settings:get("remote_port")) .."]" ..
- "button[10,2.6;2,1.5;btn_mp_connect;".. fgettext("Connect") .. "]" ..
- "field[9.8,1;2.6,0.5;te_name;;" ..
- core.formspec_escape(core.settings:get("name")) .."]" ..
- "pwdfield[9.8,2;2.6,0.5;te_pwd;]"
-
-
- if tabdata.fav_selected and fav_selected then
- if gamedata.fav then
- retval = retval .. "button[7.7,2.6;2.3,1.5;btn_delete_favorite;" ..
- fgettext("Del. Favorite") .. "]"
- end
- end
-
- retval = retval .. "tablecolumns[" ..
- image_column(fgettext("Favorite"), "favorite") .. ";" ..
- image_column(fgettext("Ping"), "") .. ",padding=0.25;" ..
- "color,span=3;" ..
- "text,align=right;" .. -- clients
- "text,align=center,padding=0.25;" .. -- "/"
- "text,align=right,padding=0.25;" .. -- clients_max
- image_column(fgettext("Creative mode"), "creative") .. ",padding=1;" ..
- image_column(fgettext("Damage enabled"), "damage") .. ",padding=0.25;" ..
- image_column(fgettext("PvP enabled"), "pvp") .. ",padding=0.25;" ..
- "color,span=1;" ..
- "text,padding=1]" .. -- name
- "table[-0.05,0;9.2,2.75;favourites;"
-
- if #menudata.favorites > 0 then
- local favs = core.get_favorites("local")
- if #favs > 0 then
- for i = 1, #favs do
- for j = 1, #menudata.favorites do
- if menudata.favorites[j].address == favs[i].address and
- menudata.favorites[j].port == favs[i].port then
- table.insert(menudata.favorites, i,
- table.remove(menudata.favorites, j))
- end
- end
- if favs[i].address ~= menudata.favorites[i].address then
- table.insert(menudata.favorites, i, favs[i])
- end
- end
- end
- retval = retval .. render_serverlist_row(menudata.favorites[1], (#favs > 0))
- for i = 2, #menudata.favorites do
- retval = retval .. "," .. render_serverlist_row(menudata.favorites[i], (i <= #favs))
- end
- end
-
- if tabdata.fav_selected then
- retval = retval .. ";" .. tabdata.fav_selected .. "]"
- else
- retval = retval .. ";0]"
- end
-
- -- separator
- retval = retval .. "box[-0.28,3.75;12.4,0.1;#FFFFFF]"
-
- -- checkboxes
- retval = retval ..
- "checkbox[8.0,3.9;cb_creative;".. fgettext("Creative Mode") .. ";" ..
- dump(core.settings:get_bool("creative_mode")) .. "]"..
- "checkbox[8.0,4.4;cb_damage;".. fgettext("Enable Damage") .. ";" ..
- dump(core.settings:get_bool("enable_damage")) .. "]"
- -- buttons
- retval = retval ..
- "button[0,3.7;8,1.5;btn_start_singleplayer;" .. fgettext("Start Singleplayer") .. "]" ..
- "button[0,4.5;8,1.5;btn_config_sp_world;" .. fgettext("Config mods") .. "]"
-
- return retval
-end
-
---------------------------------------------------------------------------------
-local function main_button_handler(tabview, fields, name, tabdata)
- if fields.btn_start_singleplayer then
- gamedata.selected_world = gamedata.worldindex
- gamedata.singleplayer = true
- core.start()
- return true
- end
-
- if fields.favourites then
- local event = core.explode_table_event(fields.favourites)
- if event.type == "CHG" then
- if event.row <= #menudata.favorites then
- gamedata.fav = false
- local favs = core.get_favorites("local")
- local fav = menudata.favorites[event.row]
- local address = fav.address
- local port = fav.port
- gamedata.serverdescription = fav.description
-
- for i = 1, #favs do
- if fav.address == favs[i].address and
- fav.port == favs[i].port then
- gamedata.fav = true
- end
- end
-
- if address and port then
- core.settings:set("address", address)
- core.settings:set("remote_port", port)
- end
- tabdata.fav_selected = event.row
- end
- return true
- end
- end
-
- if fields.btn_delete_favorite then
- local current_favourite = core.get_table_index("favourites")
- if not current_favourite then return end
-
- core.delete_favorite(current_favourite)
- asyncOnlineFavourites()
- tabdata.fav_selected = nil
-
- core.settings:set("address", "")
- core.settings:set("remote_port", "30000")
- return true
- end
-
- if fields.cb_creative then
- core.settings:set("creative_mode", fields.cb_creative)
- return true
- end
-
- if fields.cb_damage then
- core.settings:set("enable_damage", fields.cb_damage)
- return true
- end
-
- if fields.btn_mp_connect or fields.key_enter then
- gamedata.playername = fields.te_name
- gamedata.password = fields.te_pwd
- gamedata.address = fields.te_address
- gamedata.port = fields.te_port
- local fav_idx = core.get_textlist_index("favourites")
-
- if fav_idx and fav_idx <= #menudata.favorites and
- menudata.favorites[fav_idx].address == fields.te_address and
- menudata.favorites[fav_idx].port == fields.te_port then
- local fav = menudata.favorites[fav_idx]
- gamedata.servername = fav.name
- gamedata.serverdescription = fav.description
-
- if menudata.favorites_is_public and
- not is_server_protocol_compat_or_error(
- fav.proto_min, fav.proto_max) then
- return true
- end
- else
- gamedata.servername = ""
- gamedata.serverdescription = ""
- end
-
- gamedata.selected_world = 0
-
- core.settings:set("address", fields.te_address)
- core.settings:set("remote_port", fields.te_port)
-
- core.start()
- return true
- end
-
- if fields.btn_config_sp_world then
- local configdialog = create_configure_world_dlg(1)
- if configdialog then
- configdialog:set_parent(tabview)
- tabview:hide()
- configdialog:show()
- end
- return true
- end
-end
-
---------------------------------------------------------------------------------
-local function on_activate(type,old_tab,new_tab)
- if type == "LEAVE" then return end
- asyncOnlineFavourites()
-end
-
---------------------------------------------------------------------------------
-return {
- name = "main",
- caption = fgettext("Main"),
- cbf_formspec = get_formspec,
- cbf_button_handler = main_button_handler,
- on_change = on_activate
-}
diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt
index 498e3f035..49a15f4ff 100644
--- a/builtin/settingtypes.txt
+++ b/builtin/settingtypes.txt
@@ -110,9 +110,9 @@ doubletap_jump (Double tap jump for fly) bool false
# enabled.
always_fly_fast (Always fly and fast) bool true
-# The time in seconds it takes between repeated right clicks when holding the right
-# mouse button.
-repeat_rightclick_time (Rightclick repetition interval) float 0.25 0.001
+# The time in seconds it takes between repeated node placements when holding
+# the place button.
+repeat_place_time (Place repetition interval) float 0.25 0.001
# Automatically jump up single-node obstacles.
autojump (Automatic jumping) bool false
@@ -182,6 +182,14 @@ keymap_jump (Jump key) key KEY_SPACE
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
keymap_sneak (Sneak key) key KEY_LSHIFT
+# Key for digging.
+# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
+keymap_dig (Dig key) key KEY_LBUTTON
+
+# Key for placing.
+# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
+keymap_place (Place key) key KEY_RBUTTON
+
# Key for opening the inventory.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
keymap_inventory (Inventory key) key KEY_KEY_I
@@ -517,8 +525,13 @@ texture_clean_transparent (Clean transparent textures) bool false
# texture autoscaling.
texture_min_size (Minimum texture size) int 64
-# Experimental option, might cause visible spaces between blocks
-# when set to higher number than 0.
+# Use multi-sample antialiasing (MSAA) to smooth out block edges.
+# This algorithm smooths out the 3D viewport while keeping the image sharp,
+# but it doesn't affect the insides of textures
+# (which is especially noticeable with transparent textures).
+# This option is experimental and might cause visible spaces between blocks
+# when set above 0.
+# A restart is required after changing this option.
fsaa (FSAA) enum 0 0,1,2,4,8,16
# Undersampling is similar to using a lower screen resolution, but it applies
@@ -545,43 +558,6 @@ shader_path (Shader path) path
# enhanced, highlights and shadows are gradually compressed.
tone_mapping (Filmic tone mapping) bool false
-[***Bumpmapping]
-
-# Enables bumpmapping for textures. Normalmaps need to be supplied by the texture pack
-# or need to be auto-generated.
-# Requires shaders to be enabled.
-enable_bumpmapping (Bumpmapping) bool false
-
-# Enables on the fly normalmap generation (Emboss effect).
-# Requires bumpmapping to be enabled.
-generate_normalmaps (Generate normalmaps) bool false
-
-# Strength of generated normalmaps.
-normalmaps_strength (Normalmaps strength) float 0.6
-
-# Defines sampling step of texture.
-# A higher value results in smoother normal maps.
-normalmaps_smooth (Normalmaps sampling) int 0 0 2
-
-[***Parallax Occlusion]
-
-# Enables parallax occlusion mapping.
-# Requires shaders to be enabled.
-enable_parallax_occlusion (Parallax occlusion) bool false
-
-# 0 = parallax occlusion with slope information (faster).
-# 1 = relief mapping (slower, more accurate).
-parallax_occlusion_mode (Parallax occlusion mode) int 1 0 1
-
-# Number of parallax occlusion iterations.
-parallax_occlusion_iterations (Parallax occlusion iterations) int 4
-
-# Overall scale of parallax occlusion effect.
-parallax_occlusion_scale (Parallax occlusion scale) float 0.08
-
-# Overall bias of parallax occlusion effect, usually scale/2.
-parallax_occlusion_bias (Parallax occlusion bias) float 0.04
-
[***Waving Nodes]
# Set to true to enable waving liquids (like water).
@@ -622,15 +598,15 @@ arm_inertia (Arm inertia) bool true
# to not waste CPU power for no benefit.
fps_max (Maximum FPS) int 60 1
-# Maximum FPS when game is paused.
-pause_fps_max (FPS in pause menu) int 20 1
+# Maximum FPS when the window is not focused, or when the game is paused.
+fps_max_unfocused (FPS when unfocused or paused) int 20 1
# Open the pause menu when the window's focus is lost. Does not pause if a formspec is
# open.
pause_on_lost_focus (Pause on lost window focus) bool false
# View distance in nodes.
-viewing_range (Viewing range) int 100 20 4000
+viewing_range (Viewing range) int 190 20 4000
# Camera 'near clipping plane' distance in nodes, between 0 and 0.25
# Only works on GLES platforms. Most users will not need to change this.
@@ -694,8 +670,8 @@ texture_path (Texture path) path
# The rendering back-end for Irrlicht.
# A restart is required after changing this.
# Note: On Android, stick with OGLES1 if unsure! App may fail to start otherwise.
-# On other platforms, OpenGL is recommended, and it’s the only driver with
-# shader support currently.
+# On other platforms, OpenGL is recommended.
+# Shaders are supported by OpenGL (desktop only) and OGLES2 (experimental)
video_driver (Video driver) enum opengl null,software,burningsvideo,direct3d8,direct3d9,opengl,ogles1,ogles2
# Radius of cloud area stated in number of 64 node cloud squares.
@@ -783,7 +759,7 @@ mesh_generation_interval (Mapblock mesh generation delay) int 0 0 50
# Size of the MapBlock cache of the mesh generator. Increasing this will
# increase the cache hit %, reducing the data being copied from the main
# thread, thus reducing jitter.
-meshgen_block_cache_size (Mapblock mesh generator's MapBlock cache size in MB) int 20 0 1000
+meshgen_block_cache_size (Mapblock mesh generator's MapBlock cache size in MB) int 40 0 1000
# Enables minimap.
enable_minimap (Minimap) bool true
@@ -1014,7 +990,7 @@ client_unload_unused_data_timeout (Mapblock unload timeout) int 600
# Maximum number of mapblocks for client to be kept in memory.
# Set to -1 for unlimited amount.
-client_mapblock_limit (Mapblock limit) int 5000
+client_mapblock_limit (Mapblock limit) int 7500
# Whether to show the client debug info (has the same effect as hitting F5).
show_debug (Show debug info) bool false
@@ -1073,7 +1049,7 @@ ipv6_server (IPv6 server) bool false
# Maximum number of blocks that are simultaneously sent per client.
# The maximum total count is calculated dynamically:
# max_total = ceil((#clients + max_users) * per_client / 4)
-max_simultaneous_block_sends_per_client (Maximum simultaneous block sends per client) int 40
+max_simultaneous_block_sends_per_client (Maximum simultaneous block sends per client) int 128
# To reduce lag, block transfers are slowed down when a player is building something.
# This determines how long they are slowed down after placing or removing a node.
@@ -1173,17 +1149,17 @@ ask_reconnect_on_crash (Ask to reconnect after crash) bool false
# Setting this larger than active_block_range will also cause the server
# to maintain active objects up to this distance in the direction the
# player is looking. (This can avoid mobs suddenly disappearing from view)
-active_object_send_range_blocks (Active object send range) int 4
+active_object_send_range_blocks (Active object send range) int 8
# The radius of the volume of blocks around every player that is subject to the
# active block stuff, stated in mapblocks (16 nodes).
# In active blocks objects are loaded and ABMs run.
# This is also the minimum range in which active objects (mobs) are maintained.
# This should be configured together with active_object_send_range_blocks.
-active_block_range (Active block range) int 3
+active_block_range (Active block range) int 4
# From how far blocks are sent to clients, stated in mapblocks (16 nodes).
-max_block_send_distance (Max block send distance) int 10
+max_block_send_distance (Max block send distance) int 12
# Maximum number of forceloaded mapblocks.
max_forceloaded_blocks (Maximum forceloaded blocks) int 16
@@ -1256,10 +1232,10 @@ movement_gravity (Gravity) float 9.81
[**Advanced]
# Handling for deprecated Lua API calls:
-# - legacy: (try to) mimic old behaviour (default for release).
-# - log: mimic and log backtrace of deprecated call (default for debug).
+# - none: Do not log deprecated calls
+# - log: mimic and log backtrace of deprecated call (default).
# - error: abort on usage of deprecated call (suggested for mod developers).
-deprecated_lua_api_handling (Deprecated Lua API handling) enum legacy legacy,log,error
+deprecated_lua_api_handling (Deprecated Lua API handling) enum log none,log,error
# Number of extra blocks that can be loaded by /clearobjects at once.
# This is a trade-off between sqlite transaction overhead and
@@ -1286,6 +1262,10 @@ active_block_mgmt_interval (Active block management interval) float 2.0
# Length of time between Active Block Modifier (ABM) execution cycles
abm_interval (ABM interval) float 1.0
+# The time budget allowed for ABMs to execute on each step
+# (as a fraction of the ABM Interval)
+abm_time_budget (ABM time budget) float 0.2 0.1 0.9
+
# Length of time between NodeTimer execution cycles
nodetimer_interval (NodeTimer interval) float 0.2
@@ -1446,12 +1426,6 @@ curl_file_download_timeout (cURL file download timeout) int 300000
# Makes DirectX work with LuaJIT. Disable if it causes troubles.
high_precision_fpu (High-precision FPU) bool true
-# Changes the main menu UI:
-# - Full: Multiple singleplayer worlds, game choice, texture pack chooser, etc.
-# - Simple: One singleplayer world, no game or texture pack choosers. May be
-# necessary for smaller screens.
-main_menu_style (Main menu style) enum full full,simple
-
# Replaces the default main menu with a custom one.
main_menu_script (Main menu script) string
@@ -1471,7 +1445,7 @@ mg_name (Mapgen name) enum v7 v7,valleys,carpathian,v5,flat,fractal,singlenode,v
water_level (Water level) int 1
# From how far blocks are generated for clients, stated in mapblocks (16 nodes).
-max_block_generate_distance (Max block generate distance) int 8
+max_block_generate_distance (Max block generate distance) int 10
# Limit of map generation, in nodes, in all 6 directions from (0, 0, 0).
# Only mapchunks completely within the mapgen limit are generated.
@@ -1481,7 +1455,7 @@ mapgen_limit (Map generation limit) int 31000 0 31000
# Global map generation attributes.
# In Mapgen v6 the 'decorations' flag controls all decorations except trees
# and junglegrass, in all other mapgens this flag controls all decorations.
-mg_flags (Mapgen flags) flags caves,dungeons,light,decorations,biomes caves,dungeons,light,decorations,biomes,nocaves,nodungeons,nolight,nodecorations,nobiomes
+mg_flags (Mapgen flags) flags caves,dungeons,light,decorations,biomes,ores caves,dungeons,light,decorations,biomes,ores,nocaves,nodungeons,nolight,nodecorations,nobiomes,noores
[*Biome API temperature and humidity noise parameters]
@@ -1872,7 +1846,7 @@ mgcarpathian_np_dungeons (Dungeon noise) noise_params_3d 0.9, 0.5, (500, 500, 50
# Map generation attributes specific to Mapgen Flat.
# Occasional lakes and hills can be added to the flat world.
-mgflat_spflags (Mapgen Flat specific flags) flags nolakes,nohills lakes,hills,nolakes,nohills
+mgflat_spflags (Mapgen Flat specific flags) flags nolakes,nohills,nocaverns lakes,hills,caverns,nolakes,nohills,nocaverns
# Y of flat ground.
mgflat_ground_level (Ground level) int 8
@@ -1916,6 +1890,15 @@ mgflat_hill_threshold (Hill threshold) float 0.45
# Controls steepness/height of hills.
mgflat_hill_steepness (Hill steepness) float 64.0
+# Y-level of cavern upper limit.
+mgflat_cavern_limit (Cavern limit) int -256
+
+# Y-distance over which caverns expand to full size.
+mgflat_cavern_taper (Cavern taper) int 256
+
+# Defines full size of caverns, smaller values create larger caverns.
+mgflat_cavern_threshold (Cavern threshold) float 0.7
+
# Lower Y limit of dungeons.
mgflat_dungeon_ymin (Dungeon minimum Y) int -31000
@@ -1936,6 +1919,9 @@ mgflat_np_cave1 (Cave1 noise) noise_params_3d 0, 12, (61, 61, 61), 52534, 3, 0.5
# Second of two 3D noises that together define tunnels.
mgflat_np_cave2 (Cave2 noise) noise_params_3d 0, 12, (67, 67, 67), 10325, 3, 0.5, 2.0
+# 3D noise defining giant caverns.
+mgflat_np_cavern (Cavern noise) noise_params_3d 0, 1, (384, 128, 384), 723, 5, 0.63, 2.0
+
# 3D noise that determines number of dungeons per mapchunk.
mgflat_np_dungeons (Dungeon noise) noise_params_3d 0.9, 0.5, (500, 500, 500), 0, 2, 0.8, 2.0
@@ -2178,15 +2164,15 @@ chunksize (Chunk size) int 5
enable_mapgen_debug_info (Mapgen debug) bool false
# Maximum number of blocks that can be queued for loading.
-emergequeue_limit_total (Absolute limit of queued blocks to emerge) int 512
+emergequeue_limit_total (Absolute limit of queued blocks to emerge) int 1024
# Maximum number of blocks to be queued that are to be loaded from file.
# This limit is enforced per player.
-emergequeue_limit_diskonly (Per-player limit of queued blocks load from disk) int 64
+emergequeue_limit_diskonly (Per-player limit of queued blocks load from disk) int 128
# Maximum number of blocks to be queued that are to be generated.
# This limit is enforced per player.
-emergequeue_limit_generate (Per-player limit of queued blocks to generate) int 64
+emergequeue_limit_generate (Per-player limit of queued blocks to generate) int 128
# Number of emerge threads to use.
# Value 0:
@@ -2213,6 +2199,9 @@ contentdb_url (ContentDB URL) string https://content.minetest.net
# so see a full list at https://content.minetest.net/help/content_flags/
contentdb_flag_blacklist (ContentDB Flag Blacklist) string nonfree, desktop_default
+# Maximum number of concurrent downloads. Downloads exceeding this limit will be queued.
+contentdb_max_concurrent_downloads (ContentDB Max Concurrent Downloads) int 3
+
[Cheat Menu]
# Font to use for cheat menu