oUF_Phanx edit
So im looking for a way to make all the buffs and debuffs show on the target frame, and not just the filtered ones.
|
Open oUF_Phanx\Frames.lua and search for elseif unit == "target" then. Slightly below that you will find 2 lines containing:
Code:
self.Debuffs.CustomFilter = ns.CustomAuraFilters.target Code:
self.Buffs.CustomFilter = ns.CustomAuraFilters.target |
Thanks it worked:) I was messing around in auras.lua and could not get it to work.
I have another question tho. I'm trying to make the castbar to turn red, and fade out(almost like the default castbar) I tried to add something like this in function.lua line 425 Code:
function ns.PostCastStop(self, unit, name, rank, castid) |
Simply adding a "fadeOut" key to the frame doesn't do anything. You would need to write some additional code to animate the opacity of the castbar to achieve that. I'd suggest using the animation API but I don't have time to write the actual code for you. If you have another layout that already does this, you'd need to find and copy the rest of the code it uses to handle fading.
Also, the code you posted is only not raising an error because it's never actually run. You need to attach it to the castbar so oUF will run it when the active cast stops. Find the line in Frames.lua that sets "Castbar.PostCastStart = ns.PostCastStart" and add a similar line attaching your PostCastStop function. However, your PostCastStop function as written will not work, and will raise an error about passing a nil value to "unpack". Most likely you should just change "unpack(self.CompleteColor)" to just hardcode the color you want, eg. "self:SetStatusBarColor(1, 0, 0)". |
Not able to tell much about that without seeing further code. Have you registered your callback handler with oUF? What reacts to changing castbar.fadeOut? Is CompleteColor defined?
Edit: don't start writing something and go watch tv inbetween :) |
This is the code i was copying from:
Code:
local addon, ns = ... Now i don't know if any of this has to do with fade-out effect, but there is not much else about castbar in the layout(oUF_Fail). I tired to add ns.OnCastbarUpdate, ns.PostCastStop ect. in frame.lua, and set the CompleteColor to just some random color. End result is: nothing happens:S Tbh i'm kida confused:S |
Correct me if I missed something but the layout you pointed at does not have any fading effects whatsoever.
|
It's in the OnCastbarUpdate function, which I assume is used as "castbar.OnUpdate = ns.cast.OnCastbarUpdate" in the actual frame creation code. However, I'm not really sure how that would produce a reasonably visible effect, as the code simply reduces the alpha by 20% in each OnUpdate -- assuming you start at 100%, it would only take 5 frame draws to completely hide the frame. Even at 30 FPS, that means the bar is disappearing in 1/6th of a second. At 60 FPS, it's disappearing in 1/10th of a second. It would be better to use an actual animation so your fade duration wasn't dependent on your framerate. But, it should work as written, assuming you attach the relevant functions to the castbar on frame creation.
On a side note, the "local currentTime = GetTime()" line in the OnCastBarUpdate is just a wasted function call, since the variable is never used. Also, I have no idea why "cast" is defined as a frame, instead of a simple table; if a container object isn't a visible UI, and you're not registering for events or setting scripts, it should just be a table. :confused: |
Yes it in the OnUpdate function. And the fade-out effect looks normal to me. Takes about a second to fade out. It may be better to use animation as you mentioned, but i'm clueless on how to use it so its out of the question.
This is the closest thing i have to seeing a fadeout effect: Code:
function ns.OnCastbarUpdate(self, elapsed) I also tried to implement a cast failed color and channel tick marks. Code:
Castbar.PostCastFailed = ns.PostCastFailed i frames.lua and Code:
if self.casting then So to sum it up, this is what i'm trying to achieve: fade-out effect, channel tick marks, interrupt/failed color and successful cast color. |
Oh, I read that as 0.2, not 0.02, so yeah, that will produce a visible effect. I'll try to look into your actual code issues sometime in the next few days.
|
I would very much appreciate that. I can't figure out how OnUpdate and the fading code works. Which means i won't be able to see if my "cast complete" and "interrupt" color-change code works.
I added this to Frames.lua to get a spark effect: Code:
local Spark = Castbar:CreateTexture(nil, "OVERLAY") Edit: Ok think i fixed the spark problem with SetDrawLayer. |
After much trial and error, i kinda abandon the attempt to make the bar fade:/ No biggy.
I have another problem though that i hope someone can help me with:P I made a custom border that i want to apply only on the buffs/debuffs(or better yet, only the debuffs). How would i go about making this possible? Would i have to create a new function in Border.lua? |
No; if you want a different border on your buffs, just apply that in Functions.lua, in the PostCreateIcon function, and remove the AddBorder call in the same location.
|
Clearly i'm doing something wrong because the result is not satisfying
Top picture is with the added code, and the bellow picture is original(i use another main border as you can see) If i did it right, they should have looked the same:P I basically removed line 317 - "ns.CreateBorder" and added something like this: Code:
button.overlay:SetTexture("Interface\\AddOns\\oUF_Phanx\\Media\\SimpleSquare") |
Your "below" picture is missing, but based on your code the problem is that you are not sizing the texture correctly, and your texcoords are wrong for the border texture; it's not an icon.
Code:
local size = button:GetWidth() / (46/64) |
I used the default one so it would be easier to explain:o
The "below" picture i posted is the second row of buffs(It is to differen pictuers). Anyway applying your code gives me this: But i think i fixed it with making a new function in Border.lua:P (function ns.CreateBuffBorder ect..) just a copy of ns.CreateBorder. Now, how do i only apply it to the debuffs:confused: |
Well, that's what happens when you post some useless fake snippet instead of your actual code -- you get answers that aren't relevant to your goal. In this case, the code I posted was specific to the texture file you indicated you were using. :rolleyes:
If the texture you actually want to use fills the entire canvas, just use the code you originally posted, but get rid of the texcoords -- your overlay texture isn't an icon texture, so it shouldn't need to be trimmed like an icon texture. If it doesn't look right, post a screenshot and your actual code. |
I don't think I explained myself very well:o I'l try again.
Everything is default(forget the pictures i posted). I took the default border(SimpleSquare) and added a inner glow effect to it in Photoshop. Now i want to use this new border but only on the debuffs. So far i have managed to set it on the auras by adding this in Border.lua: (basically just a copy/paste) Code:
function ns.CreateBuffBorder(self, size, offset, parent, layer) |
If you're just modifying the existing texture, you don't even need to replicate the CreateBorder function. Just change the texture in PostCreateAuraIcon, immediately after the call to CreateBorder:
Code:
ns.CreateBorder(button, 12) |
Thanks for your help Phanx:) Works perfectly.
|
All times are GMT -6. The time now is 08:20 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI