Added customizable keybindings, improved freecam, added special inventory keybind (by default ender inventory)

This commit is contained in:
Elias Fleckenstein
2020-07-18 20:01:17 +02:00
parent 83f59484d3
commit 5a8610c2f4
21 changed files with 146 additions and 34 deletions

View File

@@ -1,23 +1,24 @@
function core.parse_pos(param)
local p = {}
local playerpos = core.localplayer:get_pos()
p.x, p.y, p.z = string.match(param, "^([~|%d.-]+)[, ] *([~|%d.-]+)[, ] *([~|%d.-]+)$")
for k, v in pairs(p) do
if p[k] == "~" then
p[k] = 0
p[k] = playerpos[k]
else
p[k] = tonumber(v)
end
end
if p.x and p.y and p.z then
return true, p
return true, vector.round(p)
end
return false, "Invalid position (" .. param .. ")"
end
function core.parse_relative_pos(param)
local success, pos = core.parse_pos(param)
local success, pos = core.parse_pos(param:gsub("~", "0"))
if success then pos = vector.round(vector.add(core.localplayer:get_pos(), pos)) end
return success, pos
end
core.anticheat_protection = minetest.settings:get_bool("anticheat_protection")
core.anticheat_protection = minetest.settings:get_bool("anticheat_protection") ~= false

View File

@@ -186,6 +186,10 @@ keymap_sneak (Sneak key) key KEY_LSHIFT
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
keymap_inventory (Inventory key) key KEY_KEY_I
# Key for opening the special inventory.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
keymap_special_inventory (Special inventory key) key KEY_KEY_O
# Key for moving fast in fast mode.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
keymap_special1 (Special key) key KEY_KEY_E
@@ -266,6 +270,22 @@ keymap_drop (Drop item key) key KEY_KEY_Q
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
keymap_zoom (View zoom key) key KEY_KEY_Z
# Key for toggling X-Ray.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
keymap_toggle_xray (Xray key) key KEY_KEY_X
# Key for toggling Fullbright.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
keymap_toggle_fullbright (Fullbright key) key KEY_KEY_F
# Key for toggling Killaura.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
keymap_toggle_killaura (Killaura key) key KEY_KEY_G
# Key for toggling Freecam.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
keymap_toggle_freecam (Freecam key) key KEY_KEY_L
# Key for selecting the first hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
keymap_slot1 (Hotbar slot 1 key) key KEY_KEY_1
@@ -2206,10 +2226,10 @@ contentdb_flag_blacklist (ContentDB Flag Blacklist) string nonfree, desktop_defa
fullbright (Fullbright) bool false
# Enable xray, requires fullbright
xray (Xray) bool false
xray (X-Ray) bool false
# Texture to apply xray
xray_node (XrayTexture) string default:stone
xray_node (X-RayTexture) string default:stone
# Make the Client think it has all privs
priv_bypass (PrivBypass) bool true