update std rules & add player.destroy binding
This commit is contained in:
@@ -13,6 +13,7 @@ camera.mode="key:f4"
|
||||
player.noclip="key:n"
|
||||
player.flight="key:f"
|
||||
player.attack="mouse:left"
|
||||
player.destroy="mouse:left"
|
||||
player.build="mouse:right"
|
||||
player.pick="mouse:middle"
|
||||
player.drop="key:q"
|
||||
|
||||
@@ -61,7 +61,7 @@ function submit(text)
|
||||
if name == nil then
|
||||
name = text
|
||||
end
|
||||
if not rules.get("cheat-commands") and table.has(console.cheats, name) then
|
||||
if not rules.get("allow-cheats") and table.has(console.cheats, name) then
|
||||
console.log("cheat commands are disabled")
|
||||
document.prompt.text = ""
|
||||
document.prompt.focused = true
|
||||
|
||||
@@ -33,7 +33,7 @@ console.add_command(
|
||||
local str = "Available commands:"
|
||||
|
||||
for i,k in ipairs(commands) do
|
||||
if rules.get("cheat-commands") or not table.has(console.cheats, k) then
|
||||
if rules.get("allow-cheats") or not table.has(console.cheats, k) then
|
||||
str = str .. "\n " .. build_scheme(console.get_command_info(k))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -229,7 +229,10 @@ function _rules.create(name, value, handler)
|
||||
end
|
||||
|
||||
function _rules.unlisten(name, id)
|
||||
local rule = _rules.get_rule(name)
|
||||
local rule = _rules.rules[name]
|
||||
if rule == nil then
|
||||
return
|
||||
end
|
||||
rule.listeners[utf8.encode(id)] = nil
|
||||
end
|
||||
|
||||
@@ -237,7 +240,7 @@ function _rules.clear()
|
||||
_rules.rules = {}
|
||||
_rules.nextid = 1
|
||||
|
||||
_rules.create("cheat-commands", true)
|
||||
_rules.create("allow-cheats", true)
|
||||
end
|
||||
|
||||
function __vc_create_hud_rules()
|
||||
@@ -250,9 +253,12 @@ function __vc_create_hud_rules()
|
||||
_rules.create("allow-noclip", true, function(value)
|
||||
input.set_enabled("player.noclip", value)
|
||||
end)
|
||||
_rules.create("allow-destruct", true, function(value)
|
||||
_rules.create("allow-attack", true, function(value)
|
||||
input.set_enabled("player.attack", value)
|
||||
end)
|
||||
_rules.create("allow-destroy", true, function(value)
|
||||
input.set_enabled("player.destroy", value)
|
||||
end)
|
||||
_rules.create("allow-cheat-movement", true, function(value)
|
||||
input.set_enabled("movement.cheat", value)
|
||||
end)
|
||||
|
||||
+2
-1
@@ -29,7 +29,8 @@ movement.crouch=Crouch
|
||||
movement.cheat=Cheat
|
||||
hud.inventory=Inventory
|
||||
player.pick=Pick Block
|
||||
player.attack=Attack / Break
|
||||
player.attack=Attack
|
||||
player.destroy=Destroy
|
||||
player.build=Place Block
|
||||
player.fast_interaction=Accelerated interaction
|
||||
player.flight=Flight
|
||||
|
||||
+2
-1
@@ -91,7 +91,8 @@ movement.crouch=Красться
|
||||
movement.cheat=Чит
|
||||
hud.inventory=Инвентарь
|
||||
player.pick=Подобрать Блок
|
||||
player.attack=Атаковать / Сломать
|
||||
player.attack=Атаковать
|
||||
player.destroy=Сломать
|
||||
player.build=Поставить Блок
|
||||
player.fast_interaction=Ускоренное взаимодействие
|
||||
player.flight=Полёт
|
||||
|
||||
Reference in New Issue
Block a user