Skip to content

Commit

Permalink
add setting to disable swapping mode w/ modifier keys
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxionary committed Oct 11, 2019
1 parent c6d911e commit ee81969
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ local path = minetest.get_modpath"replacer"
dofile(path.."/check_owner.lua")

replacer = {}
replacer.settings = {}
replacer.settings.enable_hot_switching = minetest.settings:get_bool("replacer.enable_hot_switching", true)

replacer.blacklist = {};

Expand Down Expand Up @@ -123,8 +125,7 @@ minetest.register_tool("replacer:replacer", {
local has_give = minetest.check_player_privs(name, "give")
local modes_available = has_give or creative_enabled

if keys.aux1
and modes_available then
if keys.aux1 and modes_available and replacer.settings.enable_hot_switching then
-- Change Mode when holding the fast key
local node, mode = get_data(itemstack)
mode = modes[modes[mode]%#modes+1]
Expand Down Expand Up @@ -533,7 +534,7 @@ function replacer.replace(itemstack, user, pt, right_clicked)
if node_toreplace.name == nnd.name
and node_toreplace.param1 == nnd.param1
and node_toreplace.param2 == nnd.param2 then
inform(name, "Nothing to replace.")
--inform(name, "Nothing to replace.")
return
end

Expand Down
1 change: 1 addition & 0 deletions settingtypes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
replacer.enable_hot_switching (Allow creative users to switch tool type) bool true

0 comments on commit ee81969

Please sign in to comment.