diff --git a/lovely/keybind.toml b/lovely/keybind.toml index 179d1ba0..5f0c1b0e 100644 --- a/lovely/keybind.toml +++ b/lovely/keybind.toml @@ -37,7 +37,7 @@ pattern = "function Controller:key_release_update(key, dt)" position = "after" payload = ''' for _, keybind in pairs(SMODS.Keybinds) do - if keybind.action and keybind.key_pressed == key then + if keybind.action and keybind.key_pressed == key and keybind.event == 'released' then local execute = true for _, other_key in pairs(keybind.held_keys) do if not self.held_keys[other_key] then @@ -80,27 +80,3 @@ for _, keybind in pairs(SMODS.Keybinds) do end end ''' - -# Controller:key_release_update -[[patches]] -[patches.pattern] -target = 'engine/controller.lua' -pattern = "function Controller:key_release_update(key, dt)" -position = "after" -payload = ''' -for _, keybind in pairs(SMODS.Keybinds) do - if keybind.action and keybind.key_pressed == key and keybind.event == 'released' 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() - end - end -end -''' -match_indent = true \ No newline at end of file diff --git a/src/game_object.lua b/src/game_object.lua index 30700af8..6f52a7d0 100644 --- a/src/game_object.lua +++ b/src/game_object.lua @@ -426,12 +426,15 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj. local file_path = type(self.path) == 'table' and ((G.SETTINGS.real_language and self.path[G.SETTINGS.real_language]) or self.path[G.SETTINGS.language] or self.path['default'] or self.path['en-us']) or self.path if file_path == 'DEFAULT' then return end + local prev_path = self.full_path self.full_path = (self.mod and self.mod.path or SMODS.path) .. 'assets/sounds/' .. file_path + if prev_path == self.full_path then return end self.data = NFS.read('data', self.full_path) self.decoder = love.sound.newDecoder(self.data) self.should_stream = string.find(self.key, 'music') or string.find(self.key, 'stream') or string.find(self.key, 'ambient') self.sound = love.audio.newSource(self.decoder, self.should_stream and 'stream' or 'static') + if prev_path then G.SOUND_MANAGER.channel:push({ type = 'stop' }) end G.SOUND_MANAGER.channel:push({ type = 'sound_source', sound_code = self.sound_code, data = self.data, should_stream = self.should_stream, per = self.pitch, vol = self.volume }) end, register_global = function(self) diff --git a/version.lua b/version.lua index 316bf19b..12e01fda 100644 --- a/version.lua +++ b/version.lua @@ -1 +1 @@ -return "1.0.0~ALPHA-1227b-STEAMODDED" +return "1.0.0~ALPHA-1228a-STEAMODDED"