Add keyinvert setting

This commit is contained in:
Hybrid Dog 2017-09-08 20:36:36 +02:00
parent f2e3338265
commit 9de8d39af6
2 changed files with 6 additions and 1 deletions

@ -9,6 +9,8 @@ if minetest.settings:get_bool("item_drop.enable_item_pickup") ~= false then
minetest.settings:get("item_drop.pickup_age")) or 0.5
local key_triggered = minetest.settings:get_bool(
"item_drop.enable_pickup_key") ~= false
local key_invert = minetest.settings:get_bool(
"item_drop.pickup_keyinvert") or false
local keytype
if key_triggered then
keytype = minetest.settings:get("item_drop.pickup_keytype") or "Use"
@ -104,7 +106,7 @@ if minetest.settings:get_bool("item_drop.enable_item_pickup") ~= false then
keys_pressed = control.sneak and control.RMB
end
if not keys_pressed
if keys_pressed == key_invert
or (damage_enabled and player:get_hp() <= 0) then
return
end

@ -7,6 +7,9 @@ item_drop.enable_item_drop (Enable item drops) bool true
#Use a key to pick up items
item_drop.enable_pickup_key (Use pickup key) bool true
#Collect items when the key is not pressed instead of when it is pressed
item_drop.pickup_keyinvert (Invert pickup key) bool false
#What keytype to use as pickup key
item_drop.pickup_keytype (Pickup keytype) enum Use Use,Sneak,LeftAndRight,RMB,SneakAndRMB