Slight restructure and more cvars

This commit is contained in:
Imbus 2023-10-29 11:15:45 +01:00
parent 51686d0f32
commit 243e1e83e8

View file

@ -1,22 +1,3 @@
local function unsetBinding(action)
local key1, key2 = GetBindingKey(action);
if key1 then
SetBinding(key1, nil);
end
if key2 then
SetBinding(key2, nil);
end
end
local function setBindingRM(key, action)
unsetBinding(action);
if SetBinding(key, action) then
print("Set binding " .. key .. " to " .. action);
else
print("Failed to set binding " .. key .. " to " .. action);
end
end
-- https://wowpedia.fandom.com/wiki/BindingID
local myBinds = {
-- Movement
@ -102,6 +83,26 @@ local myBinds = {
["CTRL-6"] = "MULTIACTIONBAR4BUTTON12",
}
local function unsetBinding(action)
local key1, key2 = GetBindingKey(action);
if key1 then
SetBinding(key1, nil);
end
if key2 then
SetBinding(key2, nil);
end
end
local function setBindingRM(key, action)
unsetBinding(action);
if SetBinding(key, action) then
print("Set binding " .. key .. " to " .. action);
else
print("Failed to set binding " .. key .. " to " .. action);
end
end
local function setAllBinds()
for key, action in pairs(myBinds) do
setBindingRM(key, action)
@ -119,6 +120,8 @@ local function enableBars()
SetCVar("alwaysShowActionBars", 1);
SetCVar("lockActionBars", 1);
SetCVar("countdownForCooldowns", 1);
SetCVar("autoLootDefault", 1);
SetCVar("cameraDistanceMaxZoomFactor", 2);
end
local function BindsHandler(msg, editbox)