47 lines
1 KiB
TOML
47 lines
1 KiB
TOML
[manifest]
|
|
version = "1.0.0"
|
|
dump_lua = true
|
|
priority = 0
|
|
|
|
# Check all registered keybinds
|
|
# inserted inside Controller:key_press_update
|
|
|
|
[[patches]]
|
|
[patches.pattern]
|
|
target = 'engine/controller.lua'
|
|
pattern = "if not _RELEASE_MODE then"
|
|
position = "before"
|
|
payload = '''
|
|
for _, keybind in pairs(SMODS.Keybinds) do
|
|
if keybind.action and keybind.key_pressed == key then
|
|
local execute = true
|
|
for _, other_key in pairs(keybind.held_keys) do
|
|
if not self.held_keys[other_key] then
|
|
execute = false
|
|
break
|
|
end
|
|
end
|
|
if execute then
|
|
keybind.action(self)
|
|
end
|
|
end
|
|
end
|
|
'''
|
|
match_indent = true
|
|
overwrite = false
|
|
|
|
[[patches]]
|
|
[patches.regex]
|
|
target = 'engine/controller.lua'
|
|
pattern = 'if key == "r"'
|
|
position = 'at'
|
|
line_prepend = '$indent'
|
|
payload = '''
|
|
if key == 'm' then
|
|
if self.held_key_times[key] > 1.1 then
|
|
SMODS.save_all_config()
|
|
SMODS.restart_game()
|
|
else
|
|
self.held_key_times[key] = self.held_key_times[key] + dt
|
|
end
|
|
elseif key == "r"''' |