WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Add a script LUA to Domino Bar Addon Hotkeys (https://www.wowinterface.com/forums/showthread.php?t=57616)

Noresa 10-19-19 05:25 PM

Add a script LUA to Domino Bar Addon Hotkeys [Solved]
 
Hello Guys,

I've bought a SteelSeries Mice with 15 Buttons and to use all of them I had to put most of the Mousebuttons on Numpad Keys, it works well but the Hotkey Text is annoying and I am looking for a way to customize it in the Dominos Actionbar Addon.

I want the HM, UP, PU, En, PD changed to something like G1, G2, G3, G4.

I looked around in the Internet and found a script, this one:
Code:

local function updatehotkey(self, actionButtonType)
    local hotkey = _G[self:GetName() .. 'HotKey']
    local text = hotkey:GetText()

    text = string.gsub(text, '(s%-)', 'S')
    text = string.gsub(text, '(a%-)', 'A')
    text = string.gsub(text, '(c%-)', 'C')
    text = string.gsub(text, '(Mouse Button )', 'M')
    text = string.gsub(text, '(Middle Mouse)', 'M3')
    text = string.gsub(text, '(Num Pad )', 'G')
    text = string.gsub(text, '(Page Up)', 'G1')
    text = string.gsub(text, '(Page Down)', 'G2')
    text = string.gsub(text, '(Spacebar)', 'SpB')
    text = string.gsub(text, '(Insert)', 'G3')
    text = string.gsub(text, '(Home)', 'G4')
        text = string.gsub(text, '(F5)', 'MBD')
    text = string.gsub(text, '(F6)', 'MDB1')
    text = string.gsub(text, '(F7)', 'MDB2')

    hotkey:SetText(text)
end
hooksecurefunc("ActionButton_UpdateHotkeys", updatehotkey)

So I loaded the Script and it works like a Charm with the Blizzard Custom UI Bars, but sadly it is not working with Dominos. I guess Dominos overrides the Blizzard Bars and therefore the Custom Keybindings Texts are not working anymore.

My question to you is now, what can I do to combine these two Addons, the one created with the help of the Script and Dominos.
I started looking at the Dominos .lua file for the Action bar and put the code in, but that didn't work of course, because the file is filled with a lot of Code and I am not sure where to begin.

Can you give me some advice on how to do that or is that way over my head?
I am happy about any advice.

Regards.

Noresa 10-21-19 06:33 PM

I am not sure if bumping my own Thread is allowed, but I found a "working" solution, not for Dominos but for the ElvUI ActionBars.

To summerize it fast:
I went into the
Code:

C:\Program Files (x86)\World of Warcraft\_retail_\Interface\AddOns\ElvUI\Modules\ActionBars
Folder of ElvUI, opened the "ActionsBars.lua" and added my Keybindings manually to the AB:FixKeybindText(button) function. ElvUI already had some custom text modifications for some Keybindings (for Example the Numpad+ Button was shown as N+ instead of NPLUS.
So I just added the Buttons I am using for my Steelseries 500 and gave them a Binding Text that is understable to me. For the interested ones below is the code snippet of my custom Binding Texts:
Code:

                text = gsub(text, 'F3', "DU");
                text = gsub(text, 'F5', "DO2");
                text = gsub(text, 'F6', "DU2");
                text = gsub(text, 'F7', "DU1");
                text = gsub(text, 'F8', "DU");
                text = gsub(text, 'F9', "DO1");
                text = gsub(text, 'F10', "MID");
                text = gsub(text, 'F11', "MO2");
                text = gsub(text, 'F12', "MO1");
                text = gsub(text, 'Hm', "DO3");
                text = gsub(text, 'M3', "Mid");

Sadly I am bound to ElvUI now, maybe I just go back to Default and live with it, I dunno, maybe I find a solutiuon for Dominos or Bartender.

Regards


EDIT: Actually it is really simple for Bartender and Dominos too. Just open up the
Code:

C:\Program Files (x86)\World of Warcraft\_retail_\Interface\AddOns\Dominos\libs\LibKeyBound-1.0\LibKeyBound-1.0.lua
File and create your Custom Hotkey Text in the "function LibKeyBound:ToShortKey(key)
" segment.


All times are GMT -6. The time now is 03:58 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI