mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-31 18:31:04 +00:00
Merge branch 'master' into master
This commit is contained in:
commit
8a841aee59
328 changed files with 8044 additions and 10079 deletions
|
@ -69,7 +69,7 @@ local function build_chatcommands_formspec(name, sel, copy)
|
|||
description = cmds[2].description
|
||||
if copy then
|
||||
local msg = S("Command: @1 @2",
|
||||
core.colorize("#0FF", "/" .. cmds[1]), cmds[2].params)
|
||||
core.colorize("#0FF", (INIT == "client" and "." or "/") .. cmds[1]), cmds[2].params)
|
||||
if INIT == "client" then
|
||||
core.display_chat_message(msg)
|
||||
else
|
||||
|
|
41
builtin/common/math.lua
Normal file
41
builtin/common/math.lua
Normal file
|
@ -0,0 +1,41 @@
|
|||
--[[
|
||||
Math utils.
|
||||
--]]
|
||||
|
||||
function math.hypot(x, y)
|
||||
return math.sqrt(x * x + y * y)
|
||||
end
|
||||
|
||||
function math.sign(x, tolerance)
|
||||
tolerance = tolerance or 0
|
||||
if x > tolerance then
|
||||
return 1
|
||||
elseif x < -tolerance then
|
||||
return -1
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
function math.factorial(x)
|
||||
assert(x % 1 == 0 and x >= 0, "factorial expects a non-negative integer")
|
||||
if x >= 171 then
|
||||
-- 171! is greater than the biggest double, no need to calculate
|
||||
return math.huge
|
||||
end
|
||||
local v = 1
|
||||
for k = 2, x do
|
||||
v = v * k
|
||||
end
|
||||
return v
|
||||
end
|
||||
|
||||
function math.round(x)
|
||||
if x < 0 then
|
||||
local int = math.ceil(x)
|
||||
local frac = x - int
|
||||
return int - ((frac <= -0.5) and 1 or 0)
|
||||
end
|
||||
local int = math.floor(x)
|
||||
local frac = x - int
|
||||
return int + ((frac >= 0.5) and 1 or 0)
|
||||
end
|
|
@ -3,6 +3,7 @@
|
|||
--------------------------------------------------------------------------------
|
||||
-- Localize functions to avoid table lookups (better performance).
|
||||
local string_sub, string_find = string.sub, string.find
|
||||
local math = math
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function basic_dump(o)
|
||||
|
@ -220,47 +221,6 @@ function string:trim()
|
|||
return self:match("^%s*(.-)%s*$")
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function math.hypot(x, y)
|
||||
return math.sqrt(x * x + y * y)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function math.sign(x, tolerance)
|
||||
tolerance = tolerance or 0
|
||||
if x > tolerance then
|
||||
return 1
|
||||
elseif x < -tolerance then
|
||||
return -1
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function math.factorial(x)
|
||||
assert(x % 1 == 0 and x >= 0, "factorial expects a non-negative integer")
|
||||
if x >= 171 then
|
||||
-- 171! is greater than the biggest double, no need to calculate
|
||||
return math.huge
|
||||
end
|
||||
local v = 1
|
||||
for k = 2, x do
|
||||
v = v * k
|
||||
end
|
||||
return v
|
||||
end
|
||||
|
||||
function math.round(x)
|
||||
if x < 0 then
|
||||
local int = math.ceil(x)
|
||||
local frac = x - int
|
||||
return int - ((frac <= -0.5) and 1 or 0)
|
||||
end
|
||||
local int = math.floor(x)
|
||||
local frac = x - int
|
||||
return int + ((frac >= 0.5) and 1 or 0)
|
||||
end
|
||||
|
||||
local formspec_escapes = {
|
||||
["\\"] = "\\\\",
|
||||
["["] = "\\[",
|
||||
|
@ -702,6 +662,7 @@ function core.privs_to_string(privs, delim)
|
|||
list[#list + 1] = priv
|
||||
end
|
||||
end
|
||||
table.sort(list)
|
||||
return table.concat(list, delim)
|
||||
end
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
_G.core = {}
|
||||
_G.vector = {metatable = {}}
|
||||
|
||||
dofile("builtin/common/math.lua")
|
||||
dofile("builtin/common/vector.lua")
|
||||
dofile("builtin/common/misc_helpers.lua")
|
||||
|
||||
|
|
16
builtin/common/tests/math_spec.lua
Normal file
16
builtin/common/tests/math_spec.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
_G.core = {}
|
||||
dofile("builtin/common/math.lua")
|
||||
|
||||
describe("math", function()
|
||||
it("round()", function()
|
||||
assert.equal(0, math.round(0))
|
||||
assert.equal(10, math.round(10.3))
|
||||
assert.equal(11, math.round(10.5))
|
||||
assert.equal(11, math.round(10.7))
|
||||
assert.equal(-10, math.round(-10.3))
|
||||
assert.equal(-11, math.round(-10.5))
|
||||
assert.equal(-11, math.round(-10.7))
|
||||
assert.equal(0, math.round(0.49999999999999994))
|
||||
assert.equal(0, math.round(-0.49999999999999994))
|
||||
end)
|
||||
end)
|
|
@ -1,4 +1,5 @@
|
|||
_G.core = {}
|
||||
dofile("builtin/common/math.lua")
|
||||
dofile("builtin/common/vector.lua")
|
||||
dofile("builtin/common/misc_helpers.lua")
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
_G.vector = {}
|
||||
dofile("builtin/common/math.lua")
|
||||
dofile("builtin/common/vector.lua")
|
||||
|
||||
describe("vector", function()
|
||||
|
@ -113,12 +114,35 @@ describe("vector", function()
|
|||
assert.equal(vector.new(0, 1, -1), a:round())
|
||||
end)
|
||||
|
||||
it("ceil()", function()
|
||||
local a = vector.new(0.1, 0.9, -0.5)
|
||||
assert.equal(vector.new(1, 1, 0), vector.ceil(a))
|
||||
assert.equal(vector.new(1, 1, 0), a:ceil())
|
||||
end)
|
||||
|
||||
it("sign()", function()
|
||||
local a = vector.new(-120.3, 0, 231.5)
|
||||
assert.equal(vector.new(-1, 0, 1), vector.sign(a))
|
||||
assert.equal(vector.new(-1, 0, 1), a:sign())
|
||||
assert.equal(vector.new(0, 0, 1), vector.sign(a, 200))
|
||||
assert.equal(vector.new(0, 0, 1), a:sign(200))
|
||||
end)
|
||||
|
||||
it("abs()", function()
|
||||
local a = vector.new(-123.456, 0, 13)
|
||||
assert.equal(vector.new(123.456, 0, 13), vector.abs(a))
|
||||
assert.equal(vector.new(123.456, 0, 13), a:abs())
|
||||
end)
|
||||
|
||||
it("apply()", function()
|
||||
local i = 0
|
||||
local f = function(x)
|
||||
i = i + 1
|
||||
return x + i
|
||||
end
|
||||
local f2 = function(x, opt1, opt2, opt3)
|
||||
return x + opt1 + opt2 + opt3
|
||||
end
|
||||
local a = vector.new(0.1, 0.9, -0.5)
|
||||
assert.equal(vector.new(1, 1, 0), vector.apply(a, math.ceil))
|
||||
assert.equal(vector.new(1, 1, 0), a:apply(math.ceil))
|
||||
|
@ -126,6 +150,9 @@ describe("vector", function()
|
|||
assert.equal(vector.new(0.1, 0.9, 0.5), a:apply(math.abs))
|
||||
assert.equal(vector.new(1.1, 2.9, 2.5), vector.apply(a, f))
|
||||
assert.equal(vector.new(4.1, 5.9, 5.5), a:apply(f))
|
||||
local b = vector.new(1, 2, 3)
|
||||
assert.equal(vector.new(4, 5, 6), vector.apply(b, f2, 1, 1, 1))
|
||||
assert.equal(vector.new(4, 5, 6), b:apply(f2, 1, 1, 1))
|
||||
end)
|
||||
|
||||
it("combine()", function()
|
||||
|
@ -469,4 +496,13 @@ describe("vector", function()
|
|||
assert.True(vector.in_area(vector.new(-10, -10, -10), vector.new(-10, -10, -10), vector.new(10, 10, 10)))
|
||||
assert.False(vector.in_area(vector.new(-10, -10, -10), vector.new(10, 10, 10), vector.new(-11, -10, -10)))
|
||||
end)
|
||||
|
||||
it("random_in_area()", function()
|
||||
local min = vector.new(-100, -100, -100)
|
||||
local max = vector.new(100, 100, 100)
|
||||
for i = 1, 1000 do
|
||||
local random = vector.random_in_area(min, max)
|
||||
assert.True(vector.in_area(random, min, max))
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
|
|
@ -5,6 +5,7 @@ Note: The vector.*-functions must be able to accept old vectors that had no meta
|
|||
|
||||
-- localize functions
|
||||
local setmetatable = setmetatable
|
||||
local math = math
|
||||
|
||||
vector = {}
|
||||
|
||||
|
@ -97,18 +98,26 @@ function vector.floor(v)
|
|||
end
|
||||
|
||||
function vector.round(v)
|
||||
return fast_new(
|
||||
math.round(v.x),
|
||||
math.round(v.y),
|
||||
math.round(v.z)
|
||||
)
|
||||
return vector.apply(v, math.round)
|
||||
end
|
||||
|
||||
function vector.apply(v, func)
|
||||
function vector.ceil(v)
|
||||
return vector.apply(v, math.ceil)
|
||||
end
|
||||
|
||||
function vector.sign(v, tolerance)
|
||||
return vector.apply(v, math.sign, tolerance)
|
||||
end
|
||||
|
||||
function vector.abs(v)
|
||||
return vector.apply(v, math.abs)
|
||||
end
|
||||
|
||||
function vector.apply(v, func, ...)
|
||||
return fast_new(
|
||||
func(v.x),
|
||||
func(v.y),
|
||||
func(v.z)
|
||||
func(v.x, ...),
|
||||
func(v.y, ...),
|
||||
func(v.z, ...)
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -387,6 +396,14 @@ function vector.random_direction()
|
|||
return fast_new(x/l, y/l, z/l)
|
||||
end
|
||||
|
||||
function vector.random_in_area(min, max)
|
||||
return fast_new(
|
||||
math.random(min.x, max.x),
|
||||
math.random(min.y, max.y),
|
||||
math.random(min.z, max.z)
|
||||
)
|
||||
end
|
||||
|
||||
if rawget(_G, "core") and core.set_read_vector and core.set_push_vector then
|
||||
local function read_vector(v)
|
||||
return v.x, v.y, v.z
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
local BASE_SPACING = 0.1
|
||||
local function get_scroll_btn_width()
|
||||
return core.settings:get_bool("enable_touch") and 0.8 or 0.5
|
||||
return core.settings:get_bool("touch_gui") and 0.8 or 0.5
|
||||
end
|
||||
|
||||
local function buttonbar_formspec(self)
|
||||
|
|
|
@ -221,6 +221,7 @@ core.register_chatcommand("haspriv", {
|
|||
return true, S("No online player has the \"@1\" privilege.",
|
||||
param)
|
||||
else
|
||||
table.sort(players_with_priv)
|
||||
return true, S("Players online with the \"@1\" privilege: @2",
|
||||
param,
|
||||
table.concat(players_with_priv, ", "))
|
||||
|
|
|
@ -42,6 +42,7 @@ core.features = {
|
|||
node_interaction_actor = true,
|
||||
moveresult_new_pos = true,
|
||||
override_item_remove_fields = true,
|
||||
hotbar_hud_element = true,
|
||||
}
|
||||
|
||||
function core.has_feature(arg)
|
||||
|
|
|
@ -251,11 +251,31 @@ register_builtin_hud_element("minimap", {
|
|||
position = {x = 1, y = 0},
|
||||
alignment = {x = -1, y = 1},
|
||||
offset = {x = -10, y = 10},
|
||||
size = {x = 256, y = 256},
|
||||
size = {x = 0, y = -25},
|
||||
},
|
||||
show_elem = function(player, flags)
|
||||
local proto_ver = core.get_player_information(player:get_player_name()).protocol_version
|
||||
-- Don't add a minimap for clients which already have it hardcoded in C++.
|
||||
return flags.minimap and
|
||||
core.get_player_information(player:get_player_name()).protocol_version >= 44
|
||||
return flags.minimap and proto_ver >= 44
|
||||
end,
|
||||
update_def = function(player, elem_def)
|
||||
local proto_ver = core.get_player_information(player:get_player_name()).protocol_version
|
||||
-- Only use percentage when the client supports it.
|
||||
elem_def.size = proto_ver >= 45 and {x = 0, y = -25} or {x = 256, y = 256}
|
||||
end,
|
||||
})
|
||||
|
||||
--- Hotbar
|
||||
|
||||
register_builtin_hud_element("hotbar", {
|
||||
elem_def = {
|
||||
type = "hotbar",
|
||||
position = {x = 0.5, y = 1},
|
||||
direction = 0,
|
||||
alignment = {x = 0, y = -1},
|
||||
offset = {x = 0, y = -4}, -- Extra padding below.
|
||||
},
|
||||
show_elem = function(player, flags)
|
||||
return flags.hotbar
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -42,6 +42,7 @@ local scriptdir = core.get_builtin_path()
|
|||
local commonpath = scriptdir .. "common" .. DIR_DELIM
|
||||
local asyncpath = scriptdir .. "async" .. DIR_DELIM
|
||||
|
||||
dofile(commonpath .. "math.lua")
|
||||
dofile(commonpath .. "vector.lua")
|
||||
dofile(commonpath .. "strict.lua")
|
||||
dofile(commonpath .. "serialize.lua")
|
||||
|
|
|
@ -181,7 +181,7 @@ local function get_info_formspec(text)
|
|||
return table.concat({
|
||||
"formspec_version[6]",
|
||||
"size[15.75,9.5]",
|
||||
core.settings:get_bool("enable_touch") and "padding[0.01,0.01]" or "position[0.5,0.55]",
|
||||
core.settings:get_bool("touch_gui") and "padding[0.01,0.01]" or "position[0.5,0.55]",
|
||||
|
||||
"label[4,4.35;", text, "]",
|
||||
"container[0,", H - 0.8 - 0.375, "]",
|
||||
|
@ -212,7 +212,7 @@ local function get_formspec(dlgdata)
|
|||
local formspec = {
|
||||
"formspec_version[6]",
|
||||
"size[15.75,9.5]",
|
||||
core.settings:get_bool("enable_touch") and "padding[0.01,0.01]" or "position[0.5,0.55]",
|
||||
core.settings:get_bool("touch_gui") and "padding[0.01,0.01]" or "position[0.5,0.55]",
|
||||
|
||||
"style[status,downloading,queued;border=false]",
|
||||
|
||||
|
@ -463,7 +463,7 @@ end
|
|||
local function handle_events(event)
|
||||
if event == "DialogShow" then
|
||||
-- On touchscreen, don't show the "MINETEST" header behind the dialog.
|
||||
mm_game_theme.set_engine(core.settings:get_bool("enable_touch"))
|
||||
mm_game_theme.set_engine(core.settings:get_bool("touch_gui"))
|
||||
|
||||
-- If ContentDB is already loaded, auto-install packages here.
|
||||
do_auto_install()
|
||||
|
|
|
@ -22,13 +22,13 @@ end
|
|||
|
||||
|
||||
local function get_loading_formspec()
|
||||
local ENABLE_TOUCH = core.settings:get_bool("enable_touch")
|
||||
local w = ENABLE_TOUCH and 14 or 7
|
||||
local TOUCH_GUI = core.settings:get_bool("touch_gui")
|
||||
local w = TOUCH_GUI and 14 or 7
|
||||
|
||||
local formspec = {
|
||||
"formspec_version[3]",
|
||||
"size[", w, ",9.05]",
|
||||
ENABLE_TOUCH and "padding[0.01,0.01]" or "position[0.5,0.55]",
|
||||
TOUCH_GUI and "padding[0.01,0.01]" or "position[0.5,0.55]",
|
||||
"label[3,4.525;", fgettext("Loading..."), "]",
|
||||
}
|
||||
return table.concat(formspec)
|
||||
|
@ -110,18 +110,18 @@ local function get_formspec(data)
|
|||
message_bg = mt_color_orange
|
||||
end
|
||||
|
||||
local ENABLE_TOUCH = core.settings:get_bool("enable_touch")
|
||||
local TOUCH_GUI = core.settings:get_bool("touch_gui")
|
||||
|
||||
local w = ENABLE_TOUCH and 14 or 7
|
||||
local w = TOUCH_GUI and 14 or 7
|
||||
local padded_w = w - 2*0.375
|
||||
local dropdown_w = ENABLE_TOUCH and 10.2 or 4.25
|
||||
local dropdown_w = TOUCH_GUI and 10.2 or 4.25
|
||||
local button_w = (padded_w - 0.25) / 3
|
||||
local button_pad = button_w / 2
|
||||
|
||||
local formspec = {
|
||||
"formspec_version[3]",
|
||||
"size[", w, ",9.05]",
|
||||
ENABLE_TOUCH and "padding[0.01,0.01]" or "position[0.5,0.55]",
|
||||
TOUCH_GUI and "padding[0.01,0.01]" or "position[0.5,0.55]",
|
||||
"style[title;border=false]",
|
||||
"box[0,0;", w, ",0.8;#3333]",
|
||||
"button[0,0;", w, ",0.8;title;", fgettext("Install $1", package.title) , "]",
|
||||
|
|
85
builtin/mainmenu/credits.json
Normal file
85
builtin/mainmenu/credits.json
Normal file
|
@ -0,0 +1,85 @@
|
|||
{
|
||||
"#": "https://github.com/orgs/minetest/teams/engine/members",
|
||||
"core_developers": [
|
||||
"Perttu Ahola (celeron55) <celeron55@gmail.com> [Project founder]",
|
||||
"sfan5 <sfan5@live.de>",
|
||||
"ShadowNinja <shadowninja@minetest.net>",
|
||||
"Nathanaëlle Courant (Nore/Ekdohibs) <nore@mesecons.net>",
|
||||
"Loic Blot (nerzhul/nrz) <loic.blot@unix-experience.fr>",
|
||||
"Andrew Ward (rubenwardy) <rw@rubenwardy.com>",
|
||||
"Krock/SmallJoker <mk939@ymail.com>",
|
||||
"Lars Hofhansl <larsh@apache.org>",
|
||||
"v-rob <robinsonvincent89@gmail.com>",
|
||||
"Desour/DS",
|
||||
"srifqi",
|
||||
"Gregor Parzefall (grorp)",
|
||||
"Lars Müller (luatic)"
|
||||
],
|
||||
"previous_core_developers": [
|
||||
"BlockMen",
|
||||
"Maciej Kasatkin (RealBadAngel) [RIP]",
|
||||
"Lisa Milne (darkrose) <lisa@ltmnet.com>",
|
||||
"proller",
|
||||
"Ilya Zhuravlev (xyz) <xyz@minetest.net>",
|
||||
"PilzAdam <pilzadam@minetest.net>",
|
||||
"est31 <MTest31@outlook.com>",
|
||||
"kahrl <kahrl@gmx.net>",
|
||||
"Ryan Kwolek (kwolekr) <kwolekr@minetest.net>",
|
||||
"sapier",
|
||||
"Zeno",
|
||||
"Auke Kok (sofar) <sofar@foo-projects.org>",
|
||||
"Aaron Suen <warr1024@gmail.com>",
|
||||
"paramat",
|
||||
"Pierre-Yves Rollo <dev@pyrollo.com>",
|
||||
"hecks",
|
||||
"Jude Melton-Houghton (TurkeyMcMac) [RIP]",
|
||||
"Hugues Ross <hugues.ross@gmail.com>",
|
||||
"Dmitry Kostenko (x2048) <codeforsmile@gmail.com>"
|
||||
],
|
||||
"#": "Currently only https://github.com/orgs/minetest/teams/triagers/members",
|
||||
"core_team": [
|
||||
"Zughy [Issue triager]",
|
||||
"wsor [Issue triager]",
|
||||
"Hugo Locurcio (Calinou) [Issue triager]"
|
||||
],
|
||||
"#": "For updating active/previous contributors, see the script in ./util/gather_git_credits.py",
|
||||
"contributors": [
|
||||
"cx384",
|
||||
"numzero",
|
||||
"AFCMS",
|
||||
"sfence",
|
||||
"Wuzzy",
|
||||
"ROllerozxa",
|
||||
"JosiahWI",
|
||||
"OgelGames",
|
||||
"David Heidelberg",
|
||||
"1F616EMO",
|
||||
"HybridDog",
|
||||
"Bradley Pierce (Thresher)",
|
||||
"savilli",
|
||||
"Stvk imension",
|
||||
"y5nw",
|
||||
"chmodsayshello",
|
||||
"jordan4ibanez",
|
||||
"superfloh247"
|
||||
],
|
||||
"previous_contributors": [
|
||||
"Nils Dagsson Moskopp (erlehmann) <nils@dieweltistgarnichtso.net> [Minetest logo]",
|
||||
"red-001 <red-001@outlook.ie>",
|
||||
"Giuseppe Bilotta",
|
||||
"HybridDog",
|
||||
"ClobberXD",
|
||||
"Dániel Juhász (juhdanad) <juhdanad@gmail.com>",
|
||||
"MirceaKitsune <mirceakitsune@gmail.com>",
|
||||
"Jean-Patrick Guerrero (kilbith)",
|
||||
"MoNTE48",
|
||||
"Constantin Wenger (SpeedProg)",
|
||||
"Ciaran Gultnieks (CiaranG)",
|
||||
"Paul Ouellette (pauloue)",
|
||||
"stujones11",
|
||||
"Rogier <rogier777@gmail.com>",
|
||||
"Gregory Currie (gregorycu)",
|
||||
"JacobF",
|
||||
"Jeija <jeija@mesecons.net>"
|
||||
]
|
||||
}
|
|
@ -126,7 +126,7 @@ local function get_formspec(data)
|
|||
local retval =
|
||||
"size[11.5,7.5,true]" ..
|
||||
"label[0.5,0;" .. fgettext("World:") .. "]" ..
|
||||
"label[1.75,0;" .. data.worldspec.name .. "]"
|
||||
"label[1.75,0;" .. core.formspec_escape(data.worldspec.name) .. "]"
|
||||
|
||||
if mod.is_modpack or mod.type == "game" then
|
||||
local info = core.formspec_escape(
|
||||
|
|
|
@ -110,7 +110,7 @@ local function load()
|
|||
local change_keys = {
|
||||
query_text = "Controls",
|
||||
requires = {
|
||||
keyboard_mouse = true,
|
||||
touch_controls = false,
|
||||
},
|
||||
get_formspec = function(self, avail_w)
|
||||
local btn_w = math.min(avail_w, 3)
|
||||
|
@ -324,8 +324,6 @@ local function check_requirements(name, requires)
|
|||
local special = {
|
||||
android = PLATFORM == "Android",
|
||||
desktop = PLATFORM ~= "Android",
|
||||
touchscreen_gui = core.settings:get_bool("enable_touch"),
|
||||
keyboard_mouse = not core.settings:get_bool("enable_touch"),
|
||||
shaders_support = shaders_support,
|
||||
shaders = core.settings:get_bool("enable_shaders") and shaders_support,
|
||||
opengl = video_driver == "opengl",
|
||||
|
@ -457,13 +455,13 @@ local function get_formspec(dialogdata)
|
|||
|
||||
local extra_h = 1 -- not included in tabsize.height
|
||||
local tabsize = {
|
||||
width = core.settings:get_bool("enable_touch") and 16.5 or 15.5,
|
||||
height = core.settings:get_bool("enable_touch") and (10 - extra_h) or 12,
|
||||
width = core.settings:get_bool("touch_gui") and 16.5 or 15.5,
|
||||
height = core.settings:get_bool("touch_gui") and (10 - extra_h) or 12,
|
||||
}
|
||||
|
||||
local scrollbar_w = core.settings:get_bool("enable_touch") and 0.6 or 0.4
|
||||
local scrollbar_w = core.settings:get_bool("touch_gui") and 0.6 or 0.4
|
||||
|
||||
local left_pane_width = core.settings:get_bool("enable_touch") and 4.5 or 4.25
|
||||
local left_pane_width = core.settings:get_bool("touch_gui") and 4.5 or 4.25
|
||||
local left_pane_padding = 0.25
|
||||
local search_width = left_pane_width + scrollbar_w - (0.75 * 2)
|
||||
|
||||
|
@ -477,7 +475,7 @@ local function get_formspec(dialogdata)
|
|||
local fs = {
|
||||
"formspec_version[6]",
|
||||
"size[", tostring(tabsize.width), ",", tostring(tabsize.height + extra_h), "]",
|
||||
core.settings:get_bool("enable_touch") and "padding[0.01,0.01]" or "",
|
||||
core.settings:get_bool("touch_gui") and "padding[0.01,0.01]" or "",
|
||||
"bgcolor[#0000]",
|
||||
|
||||
-- HACK: this is needed to allow resubmitting the same formspec
|
||||
|
@ -652,15 +650,15 @@ local function buttonhandler(this, fields)
|
|||
write_settings_early()
|
||||
end
|
||||
|
||||
-- enable_touch is a checkbox in a setting component. We handle this
|
||||
-- touch_controls is a checkbox in a setting component. We handle this
|
||||
-- setting differently so we can hide/show pages using the next if-statement
|
||||
if fields.enable_touch ~= nil then
|
||||
local value = core.is_yes(fields.enable_touch)
|
||||
core.settings:set_bool("enable_touch", value)
|
||||
if fields.touch_controls ~= nil then
|
||||
local value = core.is_yes(fields.touch_controls)
|
||||
core.settings:set_bool("touch_controls", value)
|
||||
write_settings_early()
|
||||
end
|
||||
|
||||
if fields.show_advanced ~= nil or fields.enable_touch ~= nil then
|
||||
if fields.show_advanced ~= nil or fields.touch_controls ~= nil then
|
||||
local suggested_page_id = update_filtered_pages(dialogdata.query)
|
||||
|
||||
dialogdata.components = nil
|
||||
|
|
|
@ -15,96 +15,6 @@
|
|||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
-- https://github.com/orgs/minetest/teams/engine/members
|
||||
|
||||
local core_developers = {
|
||||
"Perttu Ahola (celeron55) <celeron55@gmail.com> [Project founder]",
|
||||
"sfan5 <sfan5@live.de>",
|
||||
"ShadowNinja <shadowninja@minetest.net>",
|
||||
"Nathanaëlle Courant (Nore/Ekdohibs) <nore@mesecons.net>",
|
||||
"Loic Blot (nerzhul/nrz) <loic.blot@unix-experience.fr>",
|
||||
"Andrew Ward (rubenwardy) <rw@rubenwardy.com>",
|
||||
"Krock/SmallJoker <mk939@ymail.com>",
|
||||
"Lars Hofhansl <larsh@apache.org>",
|
||||
"v-rob <robinsonvincent89@gmail.com>",
|
||||
"Desour/DS",
|
||||
"srifqi",
|
||||
"Gregor Parzefall (grorp)",
|
||||
"Lars Müller (luatic)",
|
||||
}
|
||||
|
||||
-- currently only https://github.com/orgs/minetest/teams/triagers/members
|
||||
|
||||
local core_team = {
|
||||
"Zughy [Issue triager]",
|
||||
"wsor [Issue triager]",
|
||||
"Hugo Locurcio (Calinou) [Issue triager]",
|
||||
}
|
||||
|
||||
-- For updating active/previous contributors, see the script in ./util/gather_git_credits.py
|
||||
|
||||
local active_contributors = {
|
||||
"cx384",
|
||||
"numzero",
|
||||
"AFCMS",
|
||||
"sfence",
|
||||
"Wuzzy",
|
||||
"ROllerozxa",
|
||||
"JosiahWI",
|
||||
"OgelGames",
|
||||
"David Heidelberg",
|
||||
"1F616EMO",
|
||||
"HybridDog",
|
||||
"Bradley Pierce (Thresher)",
|
||||
"savilli",
|
||||
"Stvk imension",
|
||||
"y5nw",
|
||||
"chmodsayshello",
|
||||
"jordan4ibanez",
|
||||
"superfloh247",
|
||||
}
|
||||
|
||||
local previous_core_developers = {
|
||||
"BlockMen",
|
||||
"Maciej Kasatkin (RealBadAngel) [RIP]",
|
||||
"Lisa Milne (darkrose) <lisa@ltmnet.com>",
|
||||
"proller",
|
||||
"Ilya Zhuravlev (xyz) <xyz@minetest.net>",
|
||||
"PilzAdam <pilzadam@minetest.net>",
|
||||
"est31 <MTest31@outlook.com>",
|
||||
"kahrl <kahrl@gmx.net>",
|
||||
"Ryan Kwolek (kwolekr) <kwolekr@minetest.net>",
|
||||
"sapier",
|
||||
"Zeno",
|
||||
"Auke Kok (sofar) <sofar@foo-projects.org>",
|
||||
"Aaron Suen <warr1024@gmail.com>",
|
||||
"paramat",
|
||||
"Pierre-Yves Rollo <dev@pyrollo.com>",
|
||||
"hecks",
|
||||
"Jude Melton-Houghton (TurkeyMcMac) [RIP]",
|
||||
"Hugues Ross <hugues.ross@gmail.com>",
|
||||
"Dmitry Kostenko (x2048) <codeforsmile@gmail.com>",
|
||||
}
|
||||
|
||||
local previous_contributors = {
|
||||
"Nils Dagsson Moskopp (erlehmann) <nils@dieweltistgarnichtso.net> [Minetest logo]",
|
||||
"red-001 <red-001@outlook.ie>",
|
||||
"Giuseppe Bilotta",
|
||||
"HybridDog",
|
||||
"ClobberXD",
|
||||
"Dániel Juhász (juhdanad) <juhdanad@gmail.com>",
|
||||
"MirceaKitsune <mirceakitsune@gmail.com>",
|
||||
"Jean-Patrick Guerrero (kilbith)",
|
||||
"MoNTE48",
|
||||
"Constantin Wenger (SpeedProg)",
|
||||
"Ciaran Gultnieks (CiaranG)",
|
||||
"Paul Ouellette (pauloue)",
|
||||
"stujones11",
|
||||
"Rogier <rogier777@gmail.com>",
|
||||
"Gregory Currie (gregorycu)",
|
||||
"JacobF",
|
||||
"Jeija <jeija@mesecons.net>",
|
||||
}
|
||||
|
||||
local function prepare_credits(dest, source)
|
||||
local string = table.concat(source, "\n") .. "\n"
|
||||
|
@ -120,6 +30,13 @@ local function prepare_credits(dest, source)
|
|||
table.insert(dest, string)
|
||||
end
|
||||
|
||||
local function get_credits()
|
||||
local f = assert(io.open(core.get_mainmenu_path() .. "/credits.json"))
|
||||
local json = core.parse_json(f:read("*all"))
|
||||
f:close()
|
||||
return json
|
||||
end
|
||||
|
||||
return {
|
||||
name = "about",
|
||||
caption = fgettext("About"),
|
||||
|
@ -133,30 +50,32 @@ return {
|
|||
"<tag name=gray color=#aaa>",
|
||||
}
|
||||
|
||||
local credits = get_credits()
|
||||
|
||||
table.insert_all(hypertext, {
|
||||
"<heading>", fgettext_ne("Core Developers"), "</heading>\n",
|
||||
})
|
||||
prepare_credits(hypertext, core_developers)
|
||||
prepare_credits(hypertext, credits.core_developers)
|
||||
table.insert_all(hypertext, {
|
||||
"\n",
|
||||
"<heading>", fgettext_ne("Core Team"), "</heading>\n",
|
||||
})
|
||||
prepare_credits(hypertext, core_team)
|
||||
prepare_credits(hypertext, credits.core_team)
|
||||
table.insert_all(hypertext, {
|
||||
"\n",
|
||||
"<heading>", fgettext_ne("Active Contributors"), "</heading>\n",
|
||||
})
|
||||
prepare_credits(hypertext, active_contributors)
|
||||
prepare_credits(hypertext, credits.contributors)
|
||||
table.insert_all(hypertext, {
|
||||
"\n",
|
||||
"<heading>", fgettext_ne("Previous Core Developers"), "</heading>\n",
|
||||
})
|
||||
prepare_credits(hypertext, previous_core_developers)
|
||||
prepare_credits(hypertext, credits.previous_core_developers)
|
||||
table.insert_all(hypertext, {
|
||||
"\n",
|
||||
"<heading>", fgettext_ne("Previous Contributors"), "</heading>\n",
|
||||
})
|
||||
prepare_credits(hypertext, previous_contributors)
|
||||
prepare_credits(hypertext, credits.previous_contributors)
|
||||
|
||||
hypertext = table.concat(hypertext):sub(1, -2)
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ function singleplayer_refresh_gamebar()
|
|||
|
||||
local btnbar = buttonbar_create(
|
||||
"game_button_bar",
|
||||
core.settings:get_bool("enable_touch") and {x = 0, y = 7.25} or {x = 0, y = 7.475},
|
||||
core.settings:get_bool("touch_gui") and {x = 0, y = 7.25} or {x = 0, y = 7.475},
|
||||
{x = 15.5, y = 1.25},
|
||||
"#000000",
|
||||
game_buttonbar_button_handler)
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
#
|
||||
# # This is a comment
|
||||
# #
|
||||
# # Requires: shaders, enable_dynamic_shadows, !touchscreen_gui
|
||||
# # Requires: shaders, enable_dynamic_shadows, !touch_controls
|
||||
# name (Readable name) type type_args
|
||||
#
|
||||
# A requirement can be the name of a boolean setting or an engine-defined value.
|
||||
|
@ -72,7 +72,6 @@
|
|||
# * shaders_support (a video driver that supports shaders, may not be enabled)
|
||||
# * shaders (both enable_shaders and shaders_support)
|
||||
# * desktop / android
|
||||
# * touchscreen_gui / keyboard_mouse
|
||||
# * opengl / gles
|
||||
# * You can negate any requirement by prepending with !
|
||||
#
|
||||
|
@ -92,7 +91,7 @@ camera_smoothing (Camera smoothing) float 0.0 0.0 0.99
|
|||
|
||||
# Smooths rotation of camera when in cinematic mode, 0 to disable. Enter cinematic mode by using the key set in Controls.
|
||||
#
|
||||
# Requires: keyboard_mouse
|
||||
# Requires: !touch_controls
|
||||
cinematic_camera_smoothing (Camera smoothing in cinematic mode) float 0.7 0.0 0.99
|
||||
|
||||
# If enabled, you can place nodes at the position (feet + eye level) where you stand.
|
||||
|
@ -113,7 +112,7 @@ always_fly_fast (Always fly fast) bool true
|
|||
# The time in seconds it takes between repeated node placements when holding
|
||||
# the place button.
|
||||
#
|
||||
# Requires: keyboard_mouse
|
||||
# Requires: !touch_controls
|
||||
repeat_place_time (Place repetition interval) float 0.25 0.16 2.0
|
||||
|
||||
# The minimum time in seconds it takes between digging nodes when holding
|
||||
|
@ -132,62 +131,60 @@ safe_dig_and_place (Safe digging and placing) bool false
|
|||
|
||||
# Invert vertical mouse movement.
|
||||
#
|
||||
# Requires: keyboard_mouse
|
||||
# Requires: !touch_controls
|
||||
invert_mouse (Invert mouse) bool false
|
||||
|
||||
# Mouse sensitivity multiplier.
|
||||
#
|
||||
# Requires: keyboard_mouse
|
||||
# Requires: !touch_controls
|
||||
mouse_sensitivity (Mouse sensitivity) float 0.2 0.001 10.0
|
||||
|
||||
# Enable mouse wheel (scroll) for item selection in hotbar.
|
||||
#
|
||||
# Requires: keyboard_mouse
|
||||
# Requires: !touch_controls
|
||||
enable_hotbar_mouse_wheel (Hotbar: Enable mouse wheel for selection) bool true
|
||||
|
||||
# Invert mouse wheel (scroll) direction for item selection in hotbar.
|
||||
#
|
||||
# Requires: keyboard_mouse
|
||||
# Requires: !touch_controls
|
||||
invert_hotbar_mouse_wheel (Hotbar: Invert mouse wheel direction) bool false
|
||||
|
||||
[*Touchscreen]
|
||||
|
||||
# Enables touchscreen mode, allowing you to play the game with a touchscreen.
|
||||
#
|
||||
# Requires: !android
|
||||
enable_touch (Enable touchscreen) bool true
|
||||
# Enables the touchscreen controls, allowing you to play the game with a touchscreen.
|
||||
touch_controls (Enable touchscreen controls) bool true
|
||||
|
||||
# Touchscreen sensitivity multiplier.
|
||||
#
|
||||
# Requires: touchscreen_gui
|
||||
# Requires: touch_controls
|
||||
touchscreen_sensitivity (Touchscreen sensitivity) float 0.2 0.001 10.0
|
||||
|
||||
# The length in pixels after which a touch interaction is considered movement.
|
||||
#
|
||||
# Requires: touchscreen_gui
|
||||
# Requires: touch_controls
|
||||
touchscreen_threshold (Movement threshold) int 20 0 100
|
||||
|
||||
# The delay in milliseconds after which a touch interaction is considered a long tap.
|
||||
#
|
||||
# Requires: touchscreen_gui
|
||||
# Requires: touch_controls
|
||||
touch_long_tap_delay (Threshold for long taps) int 400 100 1000
|
||||
|
||||
# Use crosshair to select object instead of whole screen.
|
||||
# If enabled, a crosshair will be shown and will be used for selecting object.
|
||||
#
|
||||
# Requires: touchscreen_gui
|
||||
# Requires: touch_controls
|
||||
touch_use_crosshair (Use crosshair for touch screen) bool false
|
||||
|
||||
# Fixes the position of virtual joystick.
|
||||
# If disabled, virtual joystick will center to first-touch's position.
|
||||
#
|
||||
# Requires: touchscreen_gui
|
||||
# Requires: touch_controls
|
||||
fixed_virtual_joystick (Fixed virtual joystick) bool false
|
||||
|
||||
# Use virtual joystick to trigger "Aux1" button.
|
||||
# If enabled, virtual joystick will also tap "Aux1" button when out of main circle.
|
||||
#
|
||||
# Requires: touchscreen_gui
|
||||
# Requires: touch_controls
|
||||
virtual_joystick_triggers_aux1 (Virtual joystick triggers Aux1 button) bool false
|
||||
|
||||
# The gesture for punching players/entities.
|
||||
|
@ -200,7 +197,7 @@ virtual_joystick_triggers_aux1 (Virtual joystick triggers Aux1 button) bool fals
|
|||
# Known from the classic Minetest mobile controls.
|
||||
# Combat is more or less impossible.
|
||||
#
|
||||
# Requires: touchscreen_gui
|
||||
# Requires: touch_controls
|
||||
touch_punch_gesture (Punch gesture) enum short_tap short_tap,long_tap
|
||||
|
||||
|
||||
|
@ -687,6 +684,10 @@ language (Language) enum ,be,bg,ca,cs,da,de,el,en,eo,es,et,eu,fi,fr,gd,gl,hu,i
|
|||
|
||||
[**GUI]
|
||||
|
||||
# When enabled, the GUI is optimized to be more usable on touchscreens.
|
||||
# Whether this is enabled by default depends on your hardware form-factor.
|
||||
touch_gui (Optimize GUI for touchscreens) bool false
|
||||
|
||||
# Scale GUI by a user specified value.
|
||||
# Use a nearest-neighbor-anti-alias filter to scale the GUI.
|
||||
# This will smooth over some of the rough edges, and blend
|
||||
|
@ -735,6 +736,12 @@ hud_scaling (HUD scaling) float 1.0 0.5 20
|
|||
# Mods may still set a background.
|
||||
show_nametag_backgrounds (Show name tag backgrounds by default) bool true
|
||||
|
||||
# Whether to show the client debug info (has the same effect as hitting F5).
|
||||
show_debug (Show debug info) bool false
|
||||
|
||||
# Radius to use when the block bounds HUD feature is set to near blocks.
|
||||
show_block_bounds_radius_near (Block bounds HUD radius) int 4 0 1000
|
||||
|
||||
[**Chat]
|
||||
|
||||
# Maximum number of recent chat messages to show
|
||||
|
@ -1848,11 +1855,11 @@ shader_path (Shader path) path
|
|||
# The rendering back-end.
|
||||
# Note: A restart is required after changing this!
|
||||
# OpenGL is the default for desktop, and OGLES2 for Android.
|
||||
# Shaders are supported by everything but OGLES1.
|
||||
video_driver (Video driver) enum ,opengl,opengl3,ogles1,ogles2
|
||||
video_driver (Video driver) enum ,opengl,opengl3,ogles2
|
||||
|
||||
# Distance in nodes at which transparency depth sorting is enabled
|
||||
# Use this to limit the performance impact of transparency depth sorting
|
||||
# Distance in nodes at which transparency depth sorting is enabled.
|
||||
# Use this to limit the performance impact of transparency depth sorting.
|
||||
# Set to 0 to disable it entirely.
|
||||
transparency_sorting_distance (Transparency Sorting Distance) int 16 0 128
|
||||
|
||||
# Radius of cloud area stated in number of 64 node cloud squares.
|
||||
|
@ -2012,9 +2019,6 @@ client_unload_unused_data_timeout (Mapblock unload timeout) float 600.0 0.0
|
|||
# Set to -1 for unlimited amount.
|
||||
client_mapblock_limit (Mapblock limit) int 7500 -1 2147483647
|
||||
|
||||
# Whether to show the client debug info (has the same effect as hitting F5).
|
||||
show_debug (Show debug info) 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)
|
||||
|
@ -2024,9 +2028,8 @@ max_simultaneous_block_sends_per_client (Maximum simultaneous block sends per cl
|
|||
# This determines how long they are slowed down after placing or removing a node.
|
||||
full_block_send_enable_min_time_from_building (Delay in sending blocks after building) float 2.0 0.0
|
||||
|
||||
# Maximum number of packets sent per send step, if you have a slow connection
|
||||
# try reducing it, but don't reduce it to a number below double of targeted
|
||||
# client number.
|
||||
# Maximum number of packets sent per send step in the low-level networking code.
|
||||
# You generally don't need to change this, however busy servers may benefit from a higher number.
|
||||
max_packets_per_iteration (Max. packets per iteration) int 1024 1 65535
|
||||
|
||||
# Compression level to use when sending mapblocks to the client.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue