From a0e7fb6e2a136e64739edef6c78a9d3ed2c6cfc0 Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 6 Apr 2019 11:31:42 +0200 Subject: [PATCH] actionbar: abbreviate mouse button keybinds --- modules/actionbar.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/actionbar.lua b/modules/actionbar.lua index 9deda792..6b80deed 100644 --- a/modules/actionbar.lua +++ b/modules/actionbar.lua @@ -19,6 +19,20 @@ pfUI:RegisterModule("actionbar", function () if f.Hide then f:Hide() end end + -- also abbreviate mouse buttons + local OrigGetBindingText = GetBindingText + local function GetBindingText(msg, mod, abbrev) + local txt = OrigGetBindingText(msg, mod, abbrev) + if abbrev then + txt = string.gsub(txt, _G[string.format("%s%s", mod, "BUTTON3")], "MB3") + txt = string.gsub(txt, _G[string.format("%s%s", mod, "BUTTON4")], "MB4") + txt = string.gsub(txt, _G[string.format("%s%s", mod, "BUTTON5")], "MB5") + txt = string.gsub(txt, _G[string.format("%s%s", mod, "MOUSEWHEELDOWN")], "MWD") + txt = string.gsub(txt, _G[string.format("%s%s", mod, "MOUSEWHEELUP")], "MWU") + end + return txt + end + kill(MainMenuBar) local blizzard_elements = { MultiBarBottomLeft,