Buff orientation?
How would I go about making the buffs go from Left to Right, instead of Right to Left?
I am curious because I moved my buffs to the left side, and I'd like to anchor it to the left so that if I get more buffs, it goes to the right. Thank you. |
Does anyone know about doing this? Is it possible?
:) |
I would start by looking in Blizzard's function BuffButton_UpdateAnchors in FrameXML/BuffFrame.lua.It shows the way how the default interface handles this and provides a good start for modifying it.
Maybe just copying this function in your addon and replacing "LEFT" with "RIGHT" (and the other way round) should do it? Ah, and don't forget to change the X-offset in the SetPoint's. Code:
So |
Ah, yes. I forgot about the WoW Dev Network. Thanks for your help.
I'll try that out and see what I can come up with. Thanks again. |
Just do the opposite setpoint, "LEFT" becomes "RIGHT" and you x would be x = x * -1
|
I've tried both.
Cargor: How would I set it up so that I could use getglobal and buttonName? Specifically, I get this error: Code:
[2008/07/21 14:10:33-1191-x1]: cLayouts-1.0\cLayouts.lua:41: attempt to index global 'button' (a nil value) Code:
local buttonName = button:GetName(); Like this: By default the buffs are like this (with the arrow showing the direction in which each buff adds). <---#3--#2--#1 I want them to go like this #1--#2--#3---> Changing the setpoint will only change the area in which it is anchored, not the "orientation" of which the buffs are growing. Thank you for your responses. I will try messing with the code to see what I can come up with. |
I would call the entire BuffButton_UpdateAnchors function and make the following changes:
Code:
function BuffButton_UpdateAnchors(buttonName, index, filter) Code:
buff:SetPoint("RIGHT", getglobal(buttonName..(index-1)), "LEFT", -5, 0); Code:
buff:SetPoint("LEFT", getglobal(buttonName..(index-1)), "RIGHT", 5, 0); |
Code:
cLayouts-1.0\cLayouts.lua:43: attempt to index global 'button' (a nil value) Thanks for your reply Taffu. :) Current code: Code:
local buttonName = button:GetName(); |
You only need the function posted by Taffu and not the first three lines before.
So removing Code:
local buttonName = button:GetName(); There are also a lot of RIGHT's and TOPRIGHT's left in the function which could also be changed to LEFT or TOPLEFT. For example notice the fourth last line ;) I came up with this: Code:
function BuffButton_UpdateAnchors(buttonName, index, filter) |
Okay I have no errors now, but I still have the buffs to the right.
Although, the buffs do have the right orientation now. I have also changed the wording like you have shown. This is what I have: Code:
function BuffButton_UpdateAnchors(buttonName, index, filter) |
Sorry for the double post, but that one will get cluttered.
I am successful on moving the frame (with the x and y coords) and the right orientation, but I'd like to see if there is a better way. Like I said, if I do not touch the coords, it is still to the right. I'm trying to find a better way, so that if people with different resolutions use this addon, it's not off the screen because the coords are too high or low. (This is why Blizz made Anchors for one reason.) So, if you see any reason why the anchors aren't putting the buff frame to the left, please let me know. Thanks for all your help. |
How do you move the frame?
The upper code was only for changing the direction, not for moving the frame. When I'm remembering right, it is done with: Code:
TemporaryEnchantFrame:ClearAllPoints() |
There's a lot of things that you have to be sure of before doing this. The reason you don't need to call the locals is because the function I posted is ripped right out of Blizzards UI structure.
One thing is, do you want to continue with the Temporary Enchants frame to be part of the BuffFrame? Same with Debuffs...do you want those in identical positions, just mirrored, as they originally come (below Buffs). For instance, within the function: Code:
if ( (index > 1) and (mod(index, BUFFS_PER_ROW) == 1) ) then Code:
if ( (index > 1) and (mod(index, BUFFS_PER_ROW) == 1) ) then You can change this however you need to, to build a custom growth system for the BuffButtons (and same with the Debuffs). Remember to move the entire BuffFrame to the location want as well. It really all depends on what you want to do. If you want to take "exactly" what Blizzard defaults to the right side adjacent the Minimap, you simply need to reverse all the growth structure anchors for all the applicable frames. If you want to seperate them, this can be done simply by seperating them and using different anchor points in relation to where they're going to be seated in your UI. |
I am just looking to move the whole "buffs" frame. (This means both Good and Bad buffs [debuffs].)
I originally has the Temp. code Cargor has posted, but I thought that was not needed with this new code. I believe I can just add that and I will be just fine. Thanks for the wonderful help. |
All times are GMT -6. The time now is 10:08 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI