Skip to content

Commit

Permalink
Clarify hotbuild keybind collision warning (FAForever#6217)
Browse files Browse the repository at this point in the history
  • Loading branch information
lL1l1 authored May 30, 2024
1 parent fb6fe4a commit 4b7d025
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions changelog/snippets/other.6217.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- (#6217) Clarify warning when Hotbuild hotkeys collide with other hotkeys.
23 changes: 12 additions & 11 deletions lua/keymap/keymapper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,19 @@ function GenerateHotbuildModifiers()
local altModKey = "Alt-" .. key
local shiftModBinding = keyDetails[shiftModKey]
local altModBinding = keyDetails[altModKey]
if not shiftModBinding and not altModBinding then
modifiers[shiftModKey] = info.action
modifiers[altModKey] = info.action
elseif not shiftModBinding then
modifiers[shiftModKey] = info.action
WARN('Hotbuild key '..altModKey..' is already bound to action "'..altModBinding.name..'" under "'..altModBinding.category..'" category')
elseif not altModBinding then
modifiers[altModKey] = info.action
WARN('Hotbuild key '..shiftModKey..' is already bound to action "'..shiftModBinding.name..'" under "'..shiftModBinding.category..'" category')

if shiftModBinding then
WARN(string.format('Shift modifier for Hotbuild action "%s" (%s) is already bound to action "%s" (%s)\nThe Shift modifier of the Hotbuild action will not work!'
, info.name, key, shiftModBinding.name, shiftModKey))
else
WARN('Hotbuild key '..shiftModKey..' is already bound to action "'..shiftModBinding.name..'" under "'..shiftModBinding.category..'" category')
WARN('Hotbuild key '..altModKey..' is already bound to action "'..altModBinding.name..'" under "'..altModBinding.category..'" category')
modifiers[shiftModKey] = info.action
end

if altModBinding then
WARN(string.format('Alt modifier for Hotbuild action "%s" (%s) is already bound to action "%s" (%s)\nThe Alt modifier of the Hotbuild action will not work!'
, info.name, key, altModBinding.name, altModKey))
else
modifiers[altModKey] = info.action
end
end
end
Expand Down

0 comments on commit 4b7d025

Please sign in to comment.