Permalink
Browse files

Added optional ctrl key to dequeue units

Ctrl key queues 20 units by default
  • Loading branch information...
CommonPlayer committed Jan 7, 2019
1 parent afaf802 commit aa56a59a5cba4eae972d95fd7f4a833032ef94cc
Showing with 5 additions and 1 deletion.
  1. +5 −1 LuaUI/Widgets_Evo/game_buildHotkeys.lua
@@ -121,6 +121,8 @@ local function updateWidgetVar()
WG.buildHotkeys.hasUpdated = true
end

local sGetConfigInt = Spring.GetConfigInt

function widget:CommandsChanged()
updateCommands = true
end
@@ -202,8 +204,10 @@ function widget:KeyPress(key, mods, isRepeat)
hotkeyTargetDisabled()
else
local alt, ctrl, meta, shift = sGetModKeyState()
local rmb = 1
if sGetConfigInt("evo_ctrl_dequeue", 1) == 1 then rmb, ctrl = ctrl and 3 or 1, false end
local index = sGetCmdDescIndex(matches[i].id)
sSetActiveCommand(index, 1, true, false, alt, ctrl, meta, shift)
sSetActiveCommand(index, rmb, true, false, alt, ctrl, meta, shift)
shortenHotkeyText()
updateWidgetVar()
end

0 comments on commit aa56a59

Please sign in to comment.