Skip to content

Commit

Permalink
Merge branch 'v0.4.x-dev' into arcade-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetro48 committed Mar 24, 2024
2 parents ce44e98 + fb3ff3f commit cd1a212
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions scene/stick_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,21 @@ function StickConfigScene:render()
end

function StickConfigScene:rebind(binding)
local input_type = configurable_inputs[self.input_state]
if binding == nil then
self.new_input[configurable_inputs[self.input_state]] = nil
self.set_inputs[configurable_inputs[self.input_state]] = "erased"
self.new_input[input_type] = nil
self.set_inputs[input_type] = "erased"
return true
end
if self:mutexCheck(configurable_inputs[self.input_state], binding) then
self.set_inputs[configurable_inputs[self.input_state]] = "<provide an other joystick input>"
if self:mutexCheck(input_type, binding) then
self.set_inputs[input_type] = "<provide an other joystick input>"
return false
end
self.set_inputs[configurable_inputs[self.input_state]] = self:formatBinding(binding)
self.new_input[configurable_inputs[self.input_state]] = binding
self.set_inputs[input_type] = self:formatBinding(binding)
self.new_input[input_type] = binding
if input_type == "left" or input_type == "right" or input_type == "up" or input_type == "down" then
self.new_input["menu_"..input_type] = binding
end
return true
end

Expand Down

0 comments on commit cd1a212

Please sign in to comment.