From 8bd61fe0bd2a017d8c73a280902c2bfa6c77305b Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sun, 10 Mar 2024 16:33:12 +0100 Subject: [PATCH 01/20] Idk --- Util.lua | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 Util.lua diff --git a/Util.lua b/Util.lua deleted file mode 100644 index d199e34..0000000 --- a/Util.lua +++ /dev/null @@ -1,51 +0,0 @@ -local _, u = ... - --- Hex formatted as "AARRGGBB" -local COLOR = { - blue = "FF" .. "0000FF", - green = "FF" .. "00FF00", - red = "FF" .. "FF0000", - legendary = "FF" .. "A335EE", - heirloom = "FF" .. "E6CC80", - warning = "FF" .. "EED202", -} - --- Wrap the text in a color code -local function colorWrap(text, colorCode) - return "|c" .. colorCode .. text .. "|r" -end - --- Special case of the color function -local function prefix() - return colorWrap("ImbusBinds> ", COLOR.legendary) -end - --- Special print -local function bprint(msg) - print(prefix() .. msg) -end - --- Prints some separators -function u.guards() - local accum = "" - for _ = 1, 30 do - accum = accum .. "=" - end - print(colorWrap(accum, COLOR.legendary)) -end - -function u.info(msg) - bprint(colorWrap(msg, COLOR.heirloom)) -end - -function u.warn(msg) - bprint(colorWrap(msg, COLOR.warning)) -end - -function u.error(msg) - bprint(colorWrap(msg, COLOR.red)) -end - -function u.success(msg) - bprint(colorWrap(msg, COLOR.green)) -end \ No newline at end of file From 662814e30219601fed30e635577999cb1084bd86 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sun, 10 Mar 2024 16:33:22 +0100 Subject: [PATCH 02/20] idk2 --- ImbusBinds.lua | 52 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/ImbusBinds.lua b/ImbusBinds.lua index 7d838f5..88624f4 100755 --- a/ImbusBinds.lua +++ b/ImbusBinds.lua @@ -1,4 +1,54 @@ -local _, u = ... +-- local _, u = ... + +-- Hex formatted as "AARRGGBB" +local COLOR = { + blue = "FF" .. "0000FF", + green = "FF" .. "00FF00", + red = "FF" .. "FF0000", + legendary = "FF" .. "A335EE", + heirloom = "FF" .. "E6CC80", + warning = "FF" .. "EED202", +} + +-- Wrap the text in a color code +local function colorWrap(text, colorCode) + return "|c" .. colorCode .. text .. "|r" +end + +-- Special case of the color function +local function prefix() + return colorWrap("ImbusBinds> ", COLOR.legendary) +end + +-- Special print +local function bprint(msg) + print(prefix() .. msg) +end + +-- Prints some separators +function u.guards() + local accum = "" + for _ = 1, 30 do + accum = accum .. "=" + end + print(colorWrap(accum, COLOR.legendary)) +end + +function u.info(msg) + bprint(colorWrap(msg, COLOR.heirloom)) +end + +function u.warn(msg) + bprint(colorWrap(msg, COLOR.warning)) +end + +function u.error(msg) + bprint(colorWrap(msg, COLOR.red)) +end + +function u.success(msg) + bprint(colorWrap(msg, COLOR.green)) +end -- https://wowpedia.fandom.com/wiki/BindingID local myBinds = { From a1a80c4035c4740004ed5f2bcf7d5369b295365c Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sun, 10 Mar 2024 16:37:24 +0100 Subject: [PATCH 03/20] remove namespace --- ImbusBinds.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ImbusBinds.lua b/ImbusBinds.lua index 88624f4..52b74b3 100755 --- a/ImbusBinds.lua +++ b/ImbusBinds.lua @@ -26,7 +26,7 @@ local function bprint(msg) end -- Prints some separators -function u.guards() +function guards() local accum = "" for _ = 1, 30 do accum = accum .. "=" @@ -34,19 +34,19 @@ function u.guards() print(colorWrap(accum, COLOR.legendary)) end -function u.info(msg) +function info(msg) bprint(colorWrap(msg, COLOR.heirloom)) end -function u.warn(msg) +function warn(msg) bprint(colorWrap(msg, COLOR.warning)) end -function u.error(msg) +function error(msg) bprint(colorWrap(msg, COLOR.red)) end -function u.success(msg) +function success(msg) bprint(colorWrap(msg, COLOR.green)) end @@ -155,9 +155,9 @@ end local function setBindingRM(key, action) unsetBinding(action); if SetBinding(key, action) then - u.success(key .. " -> " .. action); + success(key .. " -> " .. action); else - u.error("Failed to set binding " .. key .. " to " .. action); + error("Failed to set binding " .. key .. " to " .. action); end end @@ -165,8 +165,8 @@ local function applyBindingSet(set) for key, action in pairs(set) do setBindingRM(key, action) end - u.info("Bindings set!") - u.warn("Dont forget to reload your UI.") + info("Bindings set!") + warn("Dont forget to reload your UI.") end local function enableBars() @@ -188,7 +188,7 @@ local function enableBars() end local function BindsHandler(msg, editbox) - u.guards() + guards() if msg == "" then applyBindingSet(myBinds) enableBars() @@ -197,7 +197,7 @@ local function BindsHandler(msg, editbox) applyBindingSet(cameraBinds) end SaveBindings(1) - u.guards() + guards() end -- Register the /hello command From ea094ff075e865af194561d30f2686ee6018c7a4 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sun, 10 Mar 2024 18:00:12 +0100 Subject: [PATCH 04/20] Default toxc --- ImbusBinds.toc | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 ImbusBinds.toc diff --git a/ImbusBinds.toc b/ImbusBinds.toc new file mode 100644 index 0000000..37cef83 --- /dev/null +++ b/ImbusBinds.toc @@ -0,0 +1,10 @@ +## Interface: 11200 +## Title: ImbusBinds +## Author: Imbus +## Version: 0.1.2 +## Notes: Simple addon for a sane default keybind setup +## URL: https://git.silversoft.se/Imbus/ImbusBinds +## IconTexture: Interface\Icons\Inv_qiraj_jewelglyphed + +Util.lua +ImbusBinds.lua From 46d657d02bd59ce04340bed7d2015f6376a087c8 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Fri, 16 Aug 2024 12:48:01 +0200 Subject: [PATCH 05/20] Formatting options and ignoring undefined globals error from linter --- .luarc.json | 5 +++++ .stylua.toml | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 .luarc.json create mode 100644 .stylua.toml diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 0000000..d226ba8 --- /dev/null +++ b/.luarc.json @@ -0,0 +1,5 @@ +{ + "diagnostics.disable": [ + "undefined-global" + ] +} diff --git a/.stylua.toml b/.stylua.toml new file mode 100644 index 0000000..139e939 --- /dev/null +++ b/.stylua.toml @@ -0,0 +1,6 @@ +column_width = 160 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferSingle" +call_parentheses = "None" From a3ed13202ede0ebc786e2b92bee973d06aaccfbe Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Fri, 16 Aug 2024 12:48:16 +0200 Subject: [PATCH 06/20] Reformat --- ImbusBinds.lua | 242 ++++++++++++++++++++++++------------------------- Util.lua | 40 ++++---- 2 files changed, 141 insertions(+), 141 deletions(-) diff --git a/ImbusBinds.lua b/ImbusBinds.lua index 7d838f5..d1b282a 100755 --- a/ImbusBinds.lua +++ b/ImbusBinds.lua @@ -2,154 +2,154 @@ local _, u = ... -- https://wowpedia.fandom.com/wiki/BindingID local myBinds = { - -- Movement - ["A"] = "STRAFELEFT", - ["D"] = "STRAFERIGHT", + -- Movement + ['A'] = 'STRAFELEFT', + ['D'] = 'STRAFERIGHT', - -- Character and bag toggles, since c and b are used for strafing - ["F1"] = "OPENALLBAGS", - ["F2"] = "TOGGLECHARACTER0", + -- Character and bag toggles, since c and b are used for strafing + ['F1'] = 'OPENALLBAGS', + ['F2'] = 'TOGGLECHARACTER0', - -- Action Bar 1 - ["1"] = "ACTIONBUTTON1", - ["2"] = "ACTIONBUTTON2", - ["3"] = "ACTIONBUTTON3", - ["4"] = "ACTIONBUTTON4", - ["5"] = "ACTIONBUTTON5", - ["6"] = "ACTIONBUTTON6", - ["SHIFT-1"] = "ACTIONBUTTON7", - ["SHIFT-2"] = "ACTIONBUTTON8", - ["SHIFT-3"] = "ACTIONBUTTON9", - ["SHIFT-4"] = "ACTIONBUTTON10", - ["SHIFT-5"] = "ACTIONBUTTON11", - ["SHIFT-6"] = "ACTIONBUTTON12", + -- Action Bar 1 + ['1'] = 'ACTIONBUTTON1', + ['2'] = 'ACTIONBUTTON2', + ['3'] = 'ACTIONBUTTON3', + ['4'] = 'ACTIONBUTTON4', + ['5'] = 'ACTIONBUTTON5', + ['6'] = 'ACTIONBUTTON6', + ['SHIFT-1'] = 'ACTIONBUTTON7', + ['SHIFT-2'] = 'ACTIONBUTTON8', + ['SHIFT-3'] = 'ACTIONBUTTON9', + ['SHIFT-4'] = 'ACTIONBUTTON10', + ['SHIFT-5'] = 'ACTIONBUTTON11', + ['SHIFT-6'] = 'ACTIONBUTTON12', - -- Action Bar 2 - ["BUTTON5"] = "MULTIACTIONBAR1BUTTON1", - ["BUTTON4"] = "MULTIACTIONBAR1BUTTON2", - ["SHIFT-BUTTON5"] = "MULTIACTIONBAR1BUTTON3", - ["SHIFT-BUTTON4"] = "MULTIACTIONBAR1BUTTON4", - ["CTRL-BUTTON5"] = "MULTIACTIONBAR1BUTTON5", - ["CTRL-BUTTON4"] = "MULTIACTIONBAR1BUTTON6", - ["BUTTON3"] = "MULTIACTIONBAR1BUTTON7", - ["SHIFT-BUTTON3"] = "MULTIACTIONBAR1BUTTON8", - ["CTRL-BUTTON3"] = "MULTIACTIONBAR1BUTTON9", - ["§"] = "MULTIACTIONBAR1BUTTON10", - ["SHIFT-§"] = "MULTIACTIONBAR1BUTTON11", - ["CTRL-§"] = "MULTIACTIONBAR1BUTTON12", + -- Action Bar 2 + ['BUTTON5'] = 'MULTIACTIONBAR1BUTTON1', + ['BUTTON4'] = 'MULTIACTIONBAR1BUTTON2', + ['SHIFT-BUTTON5'] = 'MULTIACTIONBAR1BUTTON3', + ['SHIFT-BUTTON4'] = 'MULTIACTIONBAR1BUTTON4', + ['CTRL-BUTTON5'] = 'MULTIACTIONBAR1BUTTON5', + ['CTRL-BUTTON4'] = 'MULTIACTIONBAR1BUTTON6', + ['BUTTON3'] = 'MULTIACTIONBAR1BUTTON7', + ['SHIFT-BUTTON3'] = 'MULTIACTIONBAR1BUTTON8', + ['CTRL-BUTTON3'] = 'MULTIACTIONBAR1BUTTON9', + ['§'] = 'MULTIACTIONBAR1BUTTON10', + ['SHIFT-§'] = 'MULTIACTIONBAR1BUTTON11', + ['CTRL-§'] = 'MULTIACTIONBAR1BUTTON12', - -- Action Bar 3 - ["Q"] = "MULTIACTIONBAR2BUTTON1", - ["E"] = "MULTIACTIONBAR2BUTTON2", - ["R"] = "MULTIACTIONBAR2BUTTON3", - ["T"] = "MULTIACTIONBAR2BUTTON4", - ["F"] = "MULTIACTIONBAR2BUTTON5", - ["G"] = "MULTIACTIONBAR2BUTTON6", - ["SHIFT-Q"] = "MULTIACTIONBAR2BUTTON7", - ["SHIFT-E"] = "MULTIACTIONBAR2BUTTON8", - ["SHIFT-R"] = "MULTIACTIONBAR2BUTTON9", - ["SHIFT-T"] = "MULTIACTIONBAR2BUTTON10", - ["SHIFT-F"] = "MULTIACTIONBAR2BUTTON11", - ["SHIFT-G"] = "MULTIACTIONBAR2BUTTON12", + -- Action Bar 3 + ['Q'] = 'MULTIACTIONBAR2BUTTON1', + ['E'] = 'MULTIACTIONBAR2BUTTON2', + ['R'] = 'MULTIACTIONBAR2BUTTON3', + ['T'] = 'MULTIACTIONBAR2BUTTON4', + ['F'] = 'MULTIACTIONBAR2BUTTON5', + ['G'] = 'MULTIACTIONBAR2BUTTON6', + ['SHIFT-Q'] = 'MULTIACTIONBAR2BUTTON7', + ['SHIFT-E'] = 'MULTIACTIONBAR2BUTTON8', + ['SHIFT-R'] = 'MULTIACTIONBAR2BUTTON9', + ['SHIFT-T'] = 'MULTIACTIONBAR2BUTTON10', + ['SHIFT-F'] = 'MULTIACTIONBAR2BUTTON11', + ['SHIFT-G'] = 'MULTIACTIONBAR2BUTTON12', - -- Action Bar 4 - ["S"] = "MULTIACTIONBAR3BUTTON1", - ["Z"] = "MULTIACTIONBAR3BUTTON2", - ["X"] = "MULTIACTIONBAR3BUTTON3", - ["C"] = "MULTIACTIONBAR3BUTTON4", - ["V"] = "MULTIACTIONBAR3BUTTON5", - ["B"] = "MULTIACTIONBAR3BUTTON6", - ["SHIFT-S"] = "MULTIACTIONBAR3BUTTON7", - ["SHIFT-Z"] = "MULTIACTIONBAR3BUTTON8", - ["SHIFT-X"] = "MULTIACTIONBAR3BUTTON9", - ["SHIFT-C"] = "MULTIACTIONBAR3BUTTON10", - ["SHIFT-V"] = "MULTIACTIONBAR3BUTTON11", - ["SHIFT-B"] = "MULTIACTIONBAR3BUTTON12", + -- Action Bar 4 + ['S'] = 'MULTIACTIONBAR3BUTTON1', + ['Z'] = 'MULTIACTIONBAR3BUTTON2', + ['X'] = 'MULTIACTIONBAR3BUTTON3', + ['C'] = 'MULTIACTIONBAR3BUTTON4', + ['V'] = 'MULTIACTIONBAR3BUTTON5', + ['B'] = 'MULTIACTIONBAR3BUTTON6', + ['SHIFT-S'] = 'MULTIACTIONBAR3BUTTON7', + ['SHIFT-Z'] = 'MULTIACTIONBAR3BUTTON8', + ['SHIFT-X'] = 'MULTIACTIONBAR3BUTTON9', + ['SHIFT-C'] = 'MULTIACTIONBAR3BUTTON10', + ['SHIFT-V'] = 'MULTIACTIONBAR3BUTTON11', + ['SHIFT-B'] = 'MULTIACTIONBAR3BUTTON12', - -- Action Bar 5 - ["CTRL-Q"] = "MULTIACTIONBAR4BUTTON1", - ["CTRL-E"] = "MULTIACTIONBAR4BUTTON2", - ["CTRL-R"] = "MULTIACTIONBAR4BUTTON3", - ["CTRL-T"] = "MULTIACTIONBAR4BUTTON4", - ["CTRL-F"] = "MULTIACTIONBAR4BUTTON5", - ["CTRL-G"] = "MULTIACTIONBAR4BUTTON6", - ["CTRL-1"] = "MULTIACTIONBAR4BUTTON7", - ["CTRL-2"] = "MULTIACTIONBAR4BUTTON8", - ["CTRL-3"] = "MULTIACTIONBAR4BUTTON9", - ["CTRL-4"] = "MULTIACTIONBAR4BUTTON10", - ["CTRL-5"] = "MULTIACTIONBAR4BUTTON11", - ["CTRL-6"] = "MULTIACTIONBAR4BUTTON12", + -- Action Bar 5 + ['CTRL-Q'] = 'MULTIACTIONBAR4BUTTON1', + ['CTRL-E'] = 'MULTIACTIONBAR4BUTTON2', + ['CTRL-R'] = 'MULTIACTIONBAR4BUTTON3', + ['CTRL-T'] = 'MULTIACTIONBAR4BUTTON4', + ['CTRL-F'] = 'MULTIACTIONBAR4BUTTON5', + ['CTRL-G'] = 'MULTIACTIONBAR4BUTTON6', + ['CTRL-1'] = 'MULTIACTIONBAR4BUTTON7', + ['CTRL-2'] = 'MULTIACTIONBAR4BUTTON8', + ['CTRL-3'] = 'MULTIACTIONBAR4BUTTON9', + ['CTRL-4'] = 'MULTIACTIONBAR4BUTTON10', + ['CTRL-5'] = 'MULTIACTIONBAR4BUTTON11', + ['CTRL-6'] = 'MULTIACTIONBAR4BUTTON12', } local cameraBinds = { - -- Remove zoom from mousewheel - ["-"] = "CAMERAZOOMOUT", - ["+"] = "CAMERAZOOMIN", + -- Remove zoom from mousewheel + ['-'] = 'CAMERAZOOMOUT', + ['+'] = 'CAMERAZOOMIN', - ["MOUSEWHEELUP"] = "STARTAUTORUN", - ["MOUSEWHEELDOWN"] = "FOLLOWTARGET", + ['MOUSEWHEELUP'] = 'STARTAUTORUN', + ['MOUSEWHEELDOWN'] = 'FOLLOWTARGET', } -- Unsets a binding, if it exists local function unsetBinding(action) - local key1, key2 = GetBindingKey(action); - if key1 then - SetBinding(key1, nil); - end - if key2 then - SetBinding(key2, nil); - end + local key1, key2 = GetBindingKey(action) + if key1 then + SetBinding(key1, nil) + end + if key2 then + SetBinding(key2, nil) + end end -- Same as SetBinding, but removes the old binding first local function setBindingRM(key, action) - unsetBinding(action); - if SetBinding(key, action) then - u.success(key .. " -> " .. action); - else - u.error("Failed to set binding " .. key .. " to " .. action); - end + unsetBinding(action) + if SetBinding(key, action) then + u.success(key .. ' -> ' .. action) + else + u.error('Failed to set binding ' .. key .. ' to ' .. action) + end end local function applyBindingSet(set) - for key, action in pairs(set) do - setBindingRM(key, action) - end - u.info("Bindings set!") - u.warn("Dont forget to reload your UI.") + for key, action in pairs(set) do + setBindingRM(key, action) + end + u.info 'Bindings set!' + u.warn 'Dont forget to reload your UI.' end local function enableBars() - SetActionBarToggles(1, 1, 1, 1); - SHOW_MULTI_ACTIONBAR_1 = 1 --Bottom Left Bar - SHOW_MULTI_ACTIONBAR_2 = 1 --Bottom Right Bar - SHOW_MULTI_ACTIONBAR_3 = 1 --Right Bar - SHOW_MULTI_ACTIONBAR_4 = 1 --Right Bar 2 - MultiActionBar_Update(); - SetCVar("alwaysShowActionBars", 1); - SetCVar("lockActionBars", 1); - SetCVar("countdownForCooldowns", 1); - SetCVar("cameraDistanceMaxZoomFactor", 2); - SetCVar("instantQuestText", 1); - SetCVar("nameplateShowAll", 1); - SetCVar("nameplateShowEnemies", 1); - SetCVar("nameplateMaxDistance", 35); - SetCVar("enableFloatingCombatText", 1); + SetActionBarToggles(1, 1, 1, 1) + SHOW_MULTI_ACTIONBAR_1 = 1 --Bottom Left Bar + SHOW_MULTI_ACTIONBAR_2 = 1 --Bottom Right Bar + SHOW_MULTI_ACTIONBAR_3 = 1 --Right Bar + SHOW_MULTI_ACTIONBAR_4 = 1 --Right Bar 2 + MultiActionBar_Update() + SetCVar('alwaysShowActionBars', 1) + SetCVar('lockActionBars', 1) + SetCVar('countdownForCooldowns', 1) + SetCVar('cameraDistanceMaxZoomFactor', 2) + SetCVar('instantQuestText', 1) + SetCVar('nameplateShowAll', 1) + SetCVar('nameplateShowEnemies', 1) + SetCVar('nameplateMaxDistance', 35) + SetCVar('enableFloatingCombatText', 1) end local function BindsHandler(msg, editbox) - u.guards() - if msg == "" then - applyBindingSet(myBinds) - enableBars() - end - if msg == "camera" then - applyBindingSet(cameraBinds) - end - SaveBindings(1) - u.guards() + u.guards() + if msg == '' then + applyBindingSet(myBinds) + enableBars() + end + if msg == 'camera' then + applyBindingSet(cameraBinds) + end + SaveBindings(1) + u.guards() end -- Register the /hello command -SLASH_BINDS1 = "/binds" -SlashCmdList["BINDS"] = BindsHandler +SLASH_BINDS1 = '/binds' +SlashCmdList['BINDS'] = BindsHandler diff --git a/Util.lua b/Util.lua index d199e34..80f06de 100644 --- a/Util.lua +++ b/Util.lua @@ -2,50 +2,50 @@ local _, u = ... -- Hex formatted as "AARRGGBB" local COLOR = { - blue = "FF" .. "0000FF", - green = "FF" .. "00FF00", - red = "FF" .. "FF0000", - legendary = "FF" .. "A335EE", - heirloom = "FF" .. "E6CC80", - warning = "FF" .. "EED202", + blue = 'FF' .. '0000FF', + green = 'FF' .. '00FF00', + red = 'FF' .. 'FF0000', + legendary = 'FF' .. 'A335EE', + heirloom = 'FF' .. 'E6CC80', + warning = 'FF' .. 'EED202', } -- Wrap the text in a color code local function colorWrap(text, colorCode) - return "|c" .. colorCode .. text .. "|r" + return '|c' .. colorCode .. text .. '|r' end -- Special case of the color function local function prefix() - return colorWrap("ImbusBinds> ", COLOR.legendary) + return colorWrap('ImbusBinds> ', COLOR.legendary) end -- Special print local function bprint(msg) - print(prefix() .. msg) + print(prefix() .. msg) end -- Prints some separators -function u.guards() - local accum = "" - for _ = 1, 30 do - accum = accum .. "=" - end - print(colorWrap(accum, COLOR.legendary)) +function u.guards() + local accum = '' + for _ = 1, 30 do + accum = accum .. '=' + end + print(colorWrap(accum, COLOR.legendary)) end function u.info(msg) - bprint(colorWrap(msg, COLOR.heirloom)) + bprint(colorWrap(msg, COLOR.heirloom)) end function u.warn(msg) - bprint(colorWrap(msg, COLOR.warning)) + bprint(colorWrap(msg, COLOR.warning)) end function u.error(msg) - bprint(colorWrap(msg, COLOR.red)) + bprint(colorWrap(msg, COLOR.red)) end function u.success(msg) - bprint(colorWrap(msg, COLOR.green)) -end \ No newline at end of file + bprint(colorWrap(msg, COLOR.green)) +end From 8a89bf0d4b8f905669237b5f34f73fd3e2c679f8 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Fri, 16 Aug 2024 14:53:36 +0200 Subject: [PATCH 07/20] Disable undefined globals and add config from SabineWren/wow-api-type-definitions --- .gitignore | 1 + .luarc.json | 19 ++++++++++++++++--- README.md | 3 +++ 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..55695a4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +wow-api-type-definitions diff --git a/.luarc.json b/.luarc.json index d226ba8..e97b3af 100644 --- a/.luarc.json +++ b/.luarc.json @@ -1,5 +1,18 @@ { - "diagnostics.disable": [ - "undefined-global" - ] + "diagnostics.globals": [ + "arg", + "arg1", + "arg2", + "arg3", + "arg4", + "arg5", + "arg6", + "arg7", + "arg8", + "arg9", + "event" + ], + "runtime.version": "Lua 5.1", + "type.inferParamType": true, + "workspace.library": ["wow-api-type-definitions"] } diff --git a/README.md b/README.md new file mode 100644 index 0000000..ce949e1 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Default keybinds + +See [wow-api-type-definitions](https://github.com/SabineWren/wow-api-type-definitions) From 0c6cc172e31b63883bcf185b9e11134d3301d5b8 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Fri, 16 Aug 2024 14:55:06 +0200 Subject: [PATCH 08/20] Notes on symbols --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index ce949e1..206139a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ # Default keybinds See [wow-api-type-definitions](https://github.com/SabineWren/wow-api-type-definitions) + +## For LSP symbols: + +Clone inside this repo: + +`git clone git@github.com:SabineWren/wow-api-type-definitions.git` From 636be3546df0c1fd71f180122694d0cb094a4a85 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Mon, 10 Feb 2025 14:39:25 +0100 Subject: [PATCH 09/20] Add support for Warmane (default) and Turtle --- ImbusBinds.toc | 10 ++++++++++ ImbusBinds_Turtle.toc | 10 ++++++++++ ImbusBinds_Warmane.toc | 10 ++++++++++ 3 files changed, 30 insertions(+) create mode 100644 ImbusBinds.toc create mode 100644 ImbusBinds_Turtle.toc create mode 100644 ImbusBinds_Warmane.toc diff --git a/ImbusBinds.toc b/ImbusBinds.toc new file mode 100644 index 0000000..596dc73 --- /dev/null +++ b/ImbusBinds.toc @@ -0,0 +1,10 @@ +## Interface: 30300 +## Title: ImbusBinds +## Author: Imbus +## Version: 0.1.2 +## Notes: Simple addon for a sane default keybind setup +## URL: https://git.silversoft.se/Imbus/ImbusBinds +## IconTexture: Interface\Icons\Inv_qiraj_jewelglyphed + +Util.lua +ImbusBinds.lua diff --git a/ImbusBinds_Turtle.toc b/ImbusBinds_Turtle.toc new file mode 100644 index 0000000..37cef83 --- /dev/null +++ b/ImbusBinds_Turtle.toc @@ -0,0 +1,10 @@ +## Interface: 11200 +## Title: ImbusBinds +## Author: Imbus +## Version: 0.1.2 +## Notes: Simple addon for a sane default keybind setup +## URL: https://git.silversoft.se/Imbus/ImbusBinds +## IconTexture: Interface\Icons\Inv_qiraj_jewelglyphed + +Util.lua +ImbusBinds.lua diff --git a/ImbusBinds_Warmane.toc b/ImbusBinds_Warmane.toc new file mode 100644 index 0000000..596dc73 --- /dev/null +++ b/ImbusBinds_Warmane.toc @@ -0,0 +1,10 @@ +## Interface: 30300 +## Title: ImbusBinds +## Author: Imbus +## Version: 0.1.2 +## Notes: Simple addon for a sane default keybind setup +## URL: https://git.silversoft.se/Imbus/ImbusBinds +## IconTexture: Interface\Icons\Inv_qiraj_jewelglyphed + +Util.lua +ImbusBinds.lua From 7eb6888888150686190a37e0a122a770b8847c64 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 22 Feb 2025 08:54:56 +0100 Subject: [PATCH 10/20] Switch action bar 1 with action bar 2 binds, for better defaults when form-switching --- ImbusBinds.lua | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/ImbusBinds.lua b/ImbusBinds.lua index d1b282a..e66197c 100755 --- a/ImbusBinds.lua +++ b/ImbusBinds.lua @@ -11,32 +11,32 @@ local myBinds = { ['F2'] = 'TOGGLECHARACTER0', -- Action Bar 1 - ['1'] = 'ACTIONBUTTON1', - ['2'] = 'ACTIONBUTTON2', - ['3'] = 'ACTIONBUTTON3', - ['4'] = 'ACTIONBUTTON4', - ['5'] = 'ACTIONBUTTON5', - ['6'] = 'ACTIONBUTTON6', - ['SHIFT-1'] = 'ACTIONBUTTON7', - ['SHIFT-2'] = 'ACTIONBUTTON8', - ['SHIFT-3'] = 'ACTIONBUTTON9', - ['SHIFT-4'] = 'ACTIONBUTTON10', - ['SHIFT-5'] = 'ACTIONBUTTON11', - ['SHIFT-6'] = 'ACTIONBUTTON12', + ['BUTTON5'] = 'BUTTON1', + ['BUTTON4'] = 'BUTTON2', + ['SHIFT-BUTTON5'] = 'BUTTON3', + ['SHIFT-BUTTON4'] = 'BUTTON4', + ['CTRL-BUTTON5'] = 'BUTTON5', + ['CTRL-BUTTON4'] = 'BUTTON6', + ['BUTTON3'] = 'BUTTON7', + ['SHIFT-BUTTON3'] = 'BUTTON8', + ['CTRL-BUTTON3'] = 'BUTTON9', + ['§'] = 'BUTTON10', + ['SHIFT-§'] = 'BUTTON11', + ['CTRL-§'] = 'BUTTON12', -- Action Bar 2 - ['BUTTON5'] = 'MULTIACTIONBAR1BUTTON1', - ['BUTTON4'] = 'MULTIACTIONBAR1BUTTON2', - ['SHIFT-BUTTON5'] = 'MULTIACTIONBAR1BUTTON3', - ['SHIFT-BUTTON4'] = 'MULTIACTIONBAR1BUTTON4', - ['CTRL-BUTTON5'] = 'MULTIACTIONBAR1BUTTON5', - ['CTRL-BUTTON4'] = 'MULTIACTIONBAR1BUTTON6', - ['BUTTON3'] = 'MULTIACTIONBAR1BUTTON7', - ['SHIFT-BUTTON3'] = 'MULTIACTIONBAR1BUTTON8', - ['CTRL-BUTTON3'] = 'MULTIACTIONBAR1BUTTON9', - ['§'] = 'MULTIACTIONBAR1BUTTON10', - ['SHIFT-§'] = 'MULTIACTIONBAR1BUTTON11', - ['CTRL-§'] = 'MULTIACTIONBAR1BUTTON12', + ['1'] = 'MULTIACTIONBAR1BUTTON1', + ['2'] = 'MULTIACTIONBAR1BUTTON2', + ['3'] = 'MULTIACTIONBAR1BUTTON3', + ['4'] = 'MULTIACTIONBAR1BUTTON4', + ['5'] = 'MULTIACTIONBAR1BUTTON5', + ['6'] = 'MULTIACTIONBAR1BUTTON6', + ['SHIFT-1'] = 'MULTIACTIONBAR1BUTTON7', + ['SHIFT-2'] = 'MULTIACTIONBAR1BUTTON8', + ['SHIFT-3'] = 'MULTIACTIONBAR1BUTTON9', + ['SHIFT-4'] = 'MULTIACTIONBAR1BUTTON10', + ['SHIFT-5'] = 'MULTIACTIONBAR1BUTTON11', + ['SHIFT-6'] = 'MULTIACTIONBAR1BUTTON12', -- Action Bar 3 ['Q'] = 'MULTIACTIONBAR2BUTTON1', From 191e3665b012338f8f73eff5390b03271e46c1cf Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 22 Feb 2025 08:59:43 +0100 Subject: [PATCH 11/20] Mistype fix --- ImbusBinds.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ImbusBinds.lua b/ImbusBinds.lua index e66197c..95a4196 100755 --- a/ImbusBinds.lua +++ b/ImbusBinds.lua @@ -11,18 +11,18 @@ local myBinds = { ['F2'] = 'TOGGLECHARACTER0', -- Action Bar 1 - ['BUTTON5'] = 'BUTTON1', - ['BUTTON4'] = 'BUTTON2', - ['SHIFT-BUTTON5'] = 'BUTTON3', - ['SHIFT-BUTTON4'] = 'BUTTON4', - ['CTRL-BUTTON5'] = 'BUTTON5', - ['CTRL-BUTTON4'] = 'BUTTON6', - ['BUTTON3'] = 'BUTTON7', - ['SHIFT-BUTTON3'] = 'BUTTON8', - ['CTRL-BUTTON3'] = 'BUTTON9', - ['§'] = 'BUTTON10', - ['SHIFT-§'] = 'BUTTON11', - ['CTRL-§'] = 'BUTTON12', + ['BUTTON5'] = 'ACTIONBUTTON1', + ['BUTTON4'] = 'ACTIONBUTTON2', + ['SHIFT-BUTTON5'] = 'ACTIONBUTTON3', + ['SHIFT-BUTTON4'] = 'ACTIONBUTTON4', + ['CTRL-BUTTON5'] = 'ACTIONBUTTON5', + ['CTRL-BUTTON4'] = 'ACTIONBUTTON6', + ['BUTTON3'] = 'ACTIONBUTTON7', + ['SHIFT-BUTTON3'] = 'ACTIONBUTTON8', + ['CTRL-BUTTON3'] = 'ACTIONBUTTON9', + ['§'] = 'ACTIONBUTTON10', + ['SHIFT-§'] = 'ACTIONBUTTON11', + ['CTRL-§'] = 'ACTIONBUTTON12', -- Action Bar 2 ['1'] = 'MULTIACTIONBAR1BUTTON1', From edb863e8fe489e0ec2f3cb287a2a5aa8e1d25c49 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 22 Feb 2025 09:08:40 +0100 Subject: [PATCH 12/20] Some help messages, default to no action --- ImbusBinds.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ImbusBinds.lua b/ImbusBinds.lua index 95a4196..dd27d45 100755 --- a/ImbusBinds.lua +++ b/ImbusBinds.lua @@ -140,16 +140,25 @@ end local function BindsHandler(msg, editbox) u.guards() if msg == '' then + u.info 'Welcome to the ImbusBinds keybinding script' + u.info 'Usage:' + u.info ' /binds set - To set general bindings' + u.info ' /binds camera - To set camera binds to +/-' + u.info ' /binds bars - Enable all action bars' + end + if msg == 'set' then applyBindingSet(myBinds) - enableBars() end if msg == 'camera' then applyBindingSet(cameraBinds) end + if msg == 'bars' then + enableBars() + end SaveBindings(1) u.guards() end --- Register the /hello command +-- Register the /binds command SLASH_BINDS1 = '/binds' SlashCmdList['BINDS'] = BindsHandler From b149abc34ebffcd2878e1de9b92631cc4d764583 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 22 Feb 2025 09:08:49 +0100 Subject: [PATCH 13/20] luarc global markings --- .luarc.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.luarc.json b/.luarc.json index e97b3af..bcd4f4d 100644 --- a/.luarc.json +++ b/.luarc.json @@ -10,7 +10,13 @@ "arg7", "arg8", "arg9", - "event" + "event", + "SetBinding", + "SetCVar", + "MultiActionBar_Update", + "SetActionBarToggles", + "SaveBindings", + "SlashCmdList" ], "runtime.version": "Lua 5.1", "type.inferParamType": true, From 7e06bbb11beb146ed937cece6271726b1882df76 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 22 Feb 2025 09:15:20 +0100 Subject: [PATCH 14/20] Info when enabling action bars --- ImbusBinds.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/ImbusBinds.lua b/ImbusBinds.lua index dd27d45..ba25b9a 100755 --- a/ImbusBinds.lua +++ b/ImbusBinds.lua @@ -154,6 +154,7 @@ local function BindsHandler(msg, editbox) end if msg == 'bars' then enableBars() + u.info("Bars set!") end SaveBindings(1) u.guards() From 7eb4efd423328f3a619bc323119e3842bad47d90 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 22 Feb 2025 09:22:52 +0100 Subject: [PATCH 15/20] Version info --- ImbusBinds.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ImbusBinds.lua b/ImbusBinds.lua index ba25b9a..1d28e75 100755 --- a/ImbusBinds.lua +++ b/ImbusBinds.lua @@ -1,4 +1,5 @@ local _, u = ... +u.version = "v0.1.4" -- https://wowpedia.fandom.com/wiki/BindingID local myBinds = { @@ -141,6 +142,7 @@ local function BindsHandler(msg, editbox) u.guards() if msg == '' then u.info 'Welcome to the ImbusBinds keybinding script' + u.info('Version: ' .. u.version) u.info 'Usage:' u.info ' /binds set - To set general bindings' u.info ' /binds camera - To set camera binds to +/-' @@ -154,7 +156,7 @@ local function BindsHandler(msg, editbox) end if msg == 'bars' then enableBars() - u.info("Bars set!") + u.info 'Bars set!' end SaveBindings(1) u.guards() From 56162b82c9a0e5706318e56c5e286d8e5212e049 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 22 Feb 2025 09:40:25 +0100 Subject: [PATCH 16/20] Better versioning --- ImbusBinds.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ImbusBinds.lua b/ImbusBinds.lua index 1d28e75..3e04252 100755 --- a/ImbusBinds.lua +++ b/ImbusBinds.lua @@ -1,5 +1,5 @@ local _, u = ... -u.version = "v0.1.4" +u.version = GetAddOnMetadata("ImbusBinds", "Version") -- https://wowpedia.fandom.com/wiki/BindingID local myBinds = { From c05d0f9ddd9bba66e512c773fae1712243b2cfae Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 22 Feb 2025 09:40:31 +0100 Subject: [PATCH 17/20] Globals --- .luarc.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.luarc.json b/.luarc.json index bcd4f4d..362cb0e 100644 --- a/.luarc.json +++ b/.luarc.json @@ -16,7 +16,8 @@ "MultiActionBar_Update", "SetActionBarToggles", "SaveBindings", - "SlashCmdList" + "SlashCmdList", + "GetAddOnMetadata" ], "runtime.version": "Lua 5.1", "type.inferParamType": true, From e4fdafb12b3d32965f03409b6c94e62420310817 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 22 Feb 2025 09:43:44 +0100 Subject: [PATCH 18/20] Versioning script --- set_version.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 set_version.sh diff --git a/set_version.sh b/set_version.sh new file mode 100644 index 0000000..3ecb147 --- /dev/null +++ b/set_version.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +if [[ $# -ne 1 ]]; then + echo "Usage: $0 " + exit 1 +fi + +SEMVER="$1" + +# Update all *.toc files +sed -i -E "s/^(## Version: ).*/\1$SEMVER/" ./*.toc + +echo "Updated all .toc files with version $SEMVER" From 295dc15844a0a8b37c75a33e85c3a3c4a971e8c8 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 22 Feb 2025 09:44:49 +0100 Subject: [PATCH 19/20] Version bumps --- ImbusBinds.toc | 2 +- ImbusBinds_Mainline.toc | 2 +- ImbusBinds_Turtle.toc | 2 +- ImbusBinds_Warmane.toc | 2 +- ImbusBinds_Wrath.toc | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ImbusBinds.toc b/ImbusBinds.toc index 596dc73..147694f 100644 --- a/ImbusBinds.toc +++ b/ImbusBinds.toc @@ -1,7 +1,7 @@ ## Interface: 30300 ## Title: ImbusBinds ## Author: Imbus -## Version: 0.1.2 +## Version: v0.1.5 ## Notes: Simple addon for a sane default keybind setup ## URL: https://git.silversoft.se/Imbus/ImbusBinds ## IconTexture: Interface\Icons\Inv_qiraj_jewelglyphed diff --git a/ImbusBinds_Mainline.toc b/ImbusBinds_Mainline.toc index 76636f0..39037e4 100755 --- a/ImbusBinds_Mainline.toc +++ b/ImbusBinds_Mainline.toc @@ -1,7 +1,7 @@ ## Interface: 100107 ## Title: ImbusBinds ## Author: Imbus -## Version: 0.1.2 +## Version: v0.1.5 ## Notes: Simple addon for a sane default keybind setup ## URL: https://git.silversoft.se/Imbus/ImbusBinds ## IconTexture: Interface\Icons\Inv_qiraj_jewelglyphed diff --git a/ImbusBinds_Turtle.toc b/ImbusBinds_Turtle.toc index 37cef83..301b869 100644 --- a/ImbusBinds_Turtle.toc +++ b/ImbusBinds_Turtle.toc @@ -1,7 +1,7 @@ ## Interface: 11200 ## Title: ImbusBinds ## Author: Imbus -## Version: 0.1.2 +## Version: v0.1.5 ## Notes: Simple addon for a sane default keybind setup ## URL: https://git.silversoft.se/Imbus/ImbusBinds ## IconTexture: Interface\Icons\Inv_qiraj_jewelglyphed diff --git a/ImbusBinds_Warmane.toc b/ImbusBinds_Warmane.toc index 596dc73..147694f 100644 --- a/ImbusBinds_Warmane.toc +++ b/ImbusBinds_Warmane.toc @@ -1,7 +1,7 @@ ## Interface: 30300 ## Title: ImbusBinds ## Author: Imbus -## Version: 0.1.2 +## Version: v0.1.5 ## Notes: Simple addon for a sane default keybind setup ## URL: https://git.silversoft.se/Imbus/ImbusBinds ## IconTexture: Interface\Icons\Inv_qiraj_jewelglyphed diff --git a/ImbusBinds_Wrath.toc b/ImbusBinds_Wrath.toc index 66186cb..11bfa00 100755 --- a/ImbusBinds_Wrath.toc +++ b/ImbusBinds_Wrath.toc @@ -1,7 +1,7 @@ ## Interface: 30403 ## Title: ImbusBinds ## Author: Imbus -## Version: 0.1.2 +## Version: v0.1.5 ## Notes: Simple addon for a sane default keybind setup ## URL: https://git.silversoft.se/Imbus/ImbusBinds ## IconTexture: Interface\Icons\Inv_qiraj_jewelglyphed From 7220c760c3e65219c44750756859370f7808a1bb Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Mon, 7 Jul 2025 12:33:28 +0200 Subject: [PATCH 20/20] Fix: chmod 655 -> 644 --- ImbusBinds.lua | 0 ImbusBinds_Mainline.toc | 0 ImbusBinds_Wrath.toc | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 ImbusBinds.lua mode change 100755 => 100644 ImbusBinds_Mainline.toc mode change 100755 => 100644 ImbusBinds_Wrath.toc diff --git a/ImbusBinds.lua b/ImbusBinds.lua old mode 100755 new mode 100644 diff --git a/ImbusBinds_Mainline.toc b/ImbusBinds_Mainline.toc old mode 100755 new mode 100644 diff --git a/ImbusBinds_Wrath.toc b/ImbusBinds_Wrath.toc old mode 100755 new mode 100644