Go to Page... |
Thread Tools | Display Modes |
12-17-22, 06:48 AM | #1 |
(lua) Reduce target debuff max row size
Hello everyone,
I'm currently trying to learn .lua and to mess with my interface but I'm currently blocked with what I want to achieve. Long story short, I updated the target debuff size with the following code : Code:
hooksecurefunc("TargetFrame_UpdateDebuffAnchor", function(_, debuff) debuff:SetSize(28, 28) end) I checked the following resource : tomrus88/BlizzardInterfaceCode I noticed two things :
My guess is that I need to either:
Unfortunately, I don't know if this is the right approach or if it's possible to achieve this with hooksecurefunc (ie: by hooking the UpdateAuras function) If you have any idea or any ways of achieving this, I would be amazing ! Thanks a lot and have a nice week-end |
|
12-18-22, 01:46 AM | #2 | |
I had a request to do something similar for someone else and this is what I came up with.
Lua Code:
Blizzard's code basically runs an accumulator that adds up the frame size for each individual buff icon in a row. Ones cast by the player are larger than others. When adding an icon would result in a longer row by pixel length than configured, it's pushed to a new row. The first two rows are configured to "dodge" the ToT frame by having a shorter defined width. At its core, this example does a simple index-to-grid calculation since all the buff icons have a uniform size. The ToT frame "dodging" is handled by padding the index at the end of the configured rows to skip to a new row. In the end, the first buff retains its anchor while the rest copy it and apply an offset according to the prior calculation. Two other things that added complexity to this was mapping the buff buttons to their associated entry in the presorted aura lists and carrying over the shortened row rules between the buff/debuff groups. Looking into how this works. As configured, the ToT frame dodging has the first 2 rows configured with a row count of 4 while the rest are configured for a length of 6. If the ToT frame isn't shown, all rows get the length of 6. If the ToT frame is shown, it takes the zero-based index position, integer divides by 4 (the configured length of the shortened rows), clamps the result by 2 (the configured number of shortened rows), multiplies that by the pad length (configured normal minus short row lengths; 6-4=2), and adds it back into the index position. From there, both routes go through modulo and integer divide operations to convert index to (X,Y) coordinate offsets.
__________________
WoWInterface AddOns
|
||
WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » (lua) Reduce target debuff max row size |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|