Infinite extra hidden Action Bars with unique KeyBinding
If you had experience in it, i would like to know if it's possible to make 24x4 (96) frames (buttons) and assign each with unique Key Bindings (F[x], F[x]+CTRL, F[x]+SHIFT, F[x]+CTRL+SHIFT) with total of 24 F buttons (F1-F24)?
Lua Code:
So for example i drag spell with name "Cold Blood" in to frame 62 (that assigned with F16+CTRL) and then i can use it with this keybind. I use AutoHotKey Script to assign additional F13-F24 keys. I don't require this frames(buttons) to show in or out of combat, i just need the ability to assign 96 combinations of Key Presses to 96 different Frame Buttons without affecting original Blizzards Action Bars. Will appreciate for any information about buttons (frames) and key assignment to it. |
Untested but this should be close. I used macro attribute instead of spell so it is more generic this way
Lua Code:
|
Quote:
|
Thanks for the correction, I have been programming in C again lately so my brain is used to think that things like 3/4 should result in 0 instead of 0.75.
|
I think C still outputs that as a float if not type-casted, integer divide should be backslash (\).
Anyway, I decided to take a crack at my own version which replicates the table structure the OP suggested. Lua Code:
|
Thank you, very appreciate, this code snippets was very helpfully from you guys Banknorris and SDPhantom (thanks for simpler version, it's more clear for me now).
I figure out how to make buttons and bind them due to your help. Only thing that still complicated and hard for me: make this buttons read drag-and-drop abilities/macros. (Example: I got simple [ButtonCTRLF2] with KeyBind CTRL+F2, and with empty [SetAttribute] and I'd like to make this button "read" drag-and-dropped abilities or macros, and then this button will change Icon and will cast spell by id or macros by name that I dropped. I spend lot's of time and hours reading different codes including Blizzard's Action Bars or Button Forge to get at least minimal Ideas how to implement it, and I realize that without external help, I wont be able to to finish my AddOn, I will very appreciate any help, ideas or thoughts. |
I'm assuming you know about setting anchors, size, and textures to make your buttons visible at the very least. After taking care of that, you need to make sure the button can receive mouse events by calling button:EnableMouse(true). Next, you need to register a function to the button's OnReceiveDrag handler. From there, you need to check GetCursorInfo() for what the cursor is holding. Be sure to use ClearCursor() to reset the cursor if you applied the item dragged on the button.
Lua Code:
|
Quote:
Also you can securely receive a drag and set the attributes even in combat if you use the template for it. |
Quote:
|
For visible buttons, you should do two things:
(1) parent them to the UIParent, so they scale correctly and get hidden with Alt-Z, and (2) additionally inherit from the ActionButtonTemplate so they have all the textures and regions normal action buttons have, saving you the trouble of creating them all by hand, and making your buttons automatically compatible with any functions and addons that work with action buttons. Code:
local button=CreateFrame("Button", name, UIParent, "ActionButtonTemplate,SecureActionButtonTemplate") |
Thank you SDPhantom, semlar and Phanx, you saved my day, I very appreciate your help.
Thank you for this addition: Quote:
Quote:
Quote:
Lua Code:
Also i changed: Lua Code:
Lua Code:
I got one more thing that I can't figure out by myself, it's about binding. I would like to use bindings.xml with my AddOn, to control Binding keys with Blizzards UI. (I know that i can build my own binding UI or make binding with lua another way, but i would like to make this happen with Blizzards binding UI window) So I build a file bindings.xml: Code:
<Bindings> ADVANCEDLAYOUTBUTTON1ACTION1 got for example 2 keys: CTRL+F1 and ALT+CTRL+F1 So i think the code should looks like this: Lua Code:
Looks like I got problem with logic and doing something wrong, could you please point me. |
If you create a button from ActionButtonTemplate, you should call ActionButton_OnLoad(btn) to do the init job, or you should use btn:RegisterForDrag("LeftButton", "RightButton") to make sure the drag & receive working.
For binding, you may try SetOverrideBindingClick, it won't clear your ADVANCEDLAYOUTBUTTON1ACTION1's key, and you should use UPDATE_BINDINGS event to update those bindings. |
All times are GMT -6. The time now is 01:12 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI