WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   @Led: Stuf question (https://www.wowinterface.com/forums/showthread.php?t=36715)

Zagrei 11-12-10 05:31 PM

@Led: Stuf question
 
Led, last I checked you use StUF for your unitframes. However, I wasn't aware that StUF had a HP Deficit option... how did you do this? Wait... you probably just set the backdrop color to classcolored, and the statusbar to the black/dark color... d'oh :P

Now I just wish I could achieve an oUF_Nin effect with StUF :o Sadly, StUF's author isn't responding to me asking for the feature to be added :P It's in StUF_Raid, after all! I can't port it over, no matter how hard I try =/

/meaningless post

Blinky12 11-12-10 05:54 PM

Quote:

Originally Posted by Zagrei (Post 217552)
Led, last I checked you use StUF for your unitframes. However, I wasn't aware that StUF had a HP Deficit option... how did you do this? Wait... you probably just set the backdrop color to classcolored, and the statusbar to the black/dark color... d'oh :P

Now I just wish I could achieve an oUF_Nin effect with StUF :o Sadly, StUF's author isn't responding to me asking for the feature to be added :P It's in StUF_Raid, after all! I can't port it over, no matter how hard I try =/

/meaningless post

I think it does have a HP deficit option, if i remember correctly.

Zagrei 11-12-10 06:10 PM

Quote:

Originally Posted by Blinky12 (Post 217554)
I think it does have a HP deficit option, if i remember correctly.

In StUF_Raid, there is a "Fade on Loss" option. This option is mysteriously absent in the normal StUF unitframes. I use StUF exclusively, and I have looked literally everywhere :P I tried coding the option into StUF, but I never got further than getting the "Fade on Loss" check-box into the options panel; it didn't actually do anything. Oh well, I'll live with what I have for now :)

Blinky12 11-12-10 06:37 PM

Quote:

Originally Posted by Zagrei (Post 217555)
In StUF_Raid, there is a "Fade on Loss" option. This option is mysteriously absent in the normal StUF unitframes. I use StUF exclusively, and I have looked literally everywhere :P I tried coding the option into StUF, but I never got further than getting the "Fade on Loss" check-box into the options panel; it didn't actually do anything. Oh well, I'll live with what I have for now :)

I think if you tick something like "Health Gradient" it does it and you can change the colours using the general options.

Zagrei 11-12-10 07:00 PM

Quote:

Originally Posted by Blinky12 (Post 217559)
I think if you tick something like "Health Gradient" it does it and you can change the colours using the general options.

I should have been more clear: I meant coloring the HP bar for health deficit, and not for health that you already have. Led has a Classcolored HP deficit, which is ultimately what I would like to replicate in StUF, except with a transparent foreground with classcolored HP deficit, which at this moment, isn't available in StUF unit frames. It works in Stuf Raid, though.

iradex 11-12-10 07:35 PM

Im using Stuf, tried to create some nice Unitframes, but, where i can get nice borders, textures , like Led or Zagrei to use? And where i put them, so Stuf can read them?

Taryble 11-13-10 10:43 AM

Just search for "border" or "texture", there's several collections of statusbar and border textures on this site.

For how to get them into WoW, in your addons folder should be an addon named "SharedMedia". If you don't have it, download it now. Inside that addon's folder is a file called "Instructions for MyMedia.txt", all you have to do is follow the instructions in that file. :-)

Zagrei 11-13-10 01:02 PM

Quote:

Originally Posted by iradex (Post 217567)
Im using Stuf, tried to create some nice Unitframes, but, where i can get nice borders, textures , like Led or Zagrei to use? And where i put them, so Stuf can read them?

I personally don't use the built-in border system in StUF for my borders, I add them to the bars through a SetBackdrop call via LUA. I can explain that if need be :)

iradex 11-13-10 01:20 PM

Quote:

Originally Posted by Zagrei (Post 217630)
I personally don't use the built-in border system in StUF for my borders, I add them to the bars through a SetBackdrop call via LUA. I can explain that if need be :)

Would be awsome! I can do this SetBackdrop to other things, like nameplates, bag addons, etc.. ?

Zagrei 11-13-10 03:51 PM

Quote:

Originally Posted by iradex (Post 217633)
Would be awsome! I can do this SetBackdrop to other things, like nameplates, bag addons, etc.. ?

Pretty much. I use it for sThreatMeter, Headline, StUF, TinyDPS, iMinimap, my personal ExpBar addon, I made a backdrop for my actionbars, and probably a few other places as well.

FOR STUF:
Around line 200 of 'bars.lua', change this:
Code:

if db.fade and not f.barfade then
f.barfade = f:CreateTexture(nil, "BORDER")
end

-- five second rule mana tick

to this:
Code:

if db.fade and not f.barfade then
f.barfade = f:CreateTexture(nil, "BORDER")
end

local bg = CreateFrame("Frame", nil, f)
bg:SetBackdrop({
        bgFile = 'Interface\\ChatFrame\\ChatFrameBackground',
        edgeFile = 'Interface\\ChatFrame\\ChatFrameBackground',
        edgeSize = 1,
})
bg:SetBackdropColor(0, 0, 0, .4)
bg:SetBackdropBorderColor(0, 0, 0)
bg:SetFrameLevel(0)
bg:SetPoint("TOPLEFT", f, -1, 1)
bg:SetPoint("BOTTOMRIGHT", f, 1, -1)

-- five second rule mana tick


The ONLY difference, obviously, is the SetBackdrop call. What you do is this:

-You find the frame you want to put the backdrop on
-Find it's name (in this case, 'f')
-Insert the frame's name into the highlighted areas
-/reloadui ingame, and see if it worked! (LOL)

To clarify, the following code is what you use in all of the addons. Don't forget to change the frame names to match the frame you want to attach it to!

Code:

local bg = CreateFrame("Frame", nil, f)
bg:SetBackdrop({
        bgFile = 'Interface\\ChatFrame\\ChatFrameBackground',
        edgeFile = 'Interface\\ChatFrame\\ChatFrameBackground',
        edgeSize = 1,
})
bg:SetBackdropColor(0, 0, 0, .4)
bg:SetBackdropBorderColor(0, 0, 0)
bg:SetFrameLevel(0)
bg:SetPoint("TOPLEFT", f, -1, 1)
bg:SetPoint("BOTTOMRIGHT", f, 1, -1)

You may not always try the right frame the first time, but that just takes trial and error. You'll get the hang of it quickly ;) Lemme know if you need more help/explanation!

iradex 11-13-10 05:17 PM

I love you!!!! :banana:

Its perfect, i tried and it worked, to discover the frame name, im using this command

Code:

/script ChatFrame1:AddMessage(GetMouseFocus():GetName())
Pretty nice! I just need to find now good textures :) Thanks for your time and help!!

Unkn 11-13-10 06:07 PM

Quote:

I love you!!!!

Its perfect, i tried and it worked, to discover the frame name, im using this command

Code:
/script ChatFrame1:AddMessage(GetMouseFocus():GetName())
Pretty nice! I just need to find now good textures Thanks for your time and help!!
Try /fstack and mouseover any frame. You wont have to constantly hit enter and look at your chat window to find the frame name. You'll have a tooltip pop up that will show you the name of every frame you are currently mousing over. And it stays up till you turn it off again.

And yes I'm with the op here, I'd love to have a class colored health deficit with transparent health bar on the main frames of Stuf not only the raid frames. Right now I have a set up similar to Led, with dark grey healthbar and class colored background.

I'd love to know if anyone has figured out a way to make this happen with stuf. :)

Zagrei 11-13-10 07:51 PM

Quote:

Originally Posted by Unkn (Post 217666)
I'd love to know if anyone has figured out a way to make this happen with stuf. :)

The newest version of StUF has that option built in now! YAY, the author heard my plea :D

iradex 11-14-10 06:37 AM

Hey Zagrei, im trying to put SetBackdrop on target frame, i'm putting the code after the player frame code, i changed the frame name, but when i reload, al the screen is a bit dark, the target frame is correct, but all the screen is a bit dark, what i'm doing wrong? :(




\/ Agree with Led, i'm newb too, and it's look awesome the effect!!!!

Led ++ 11-14-10 07:25 AM

Wel lZAgrei I guess you already answered your own question so now it's my turn.


PLEEAAAAASSEEEEEEE tell me in DETAIL how you managed to get the ouf_nin look?!!?,8!!?,?!!!?! I NEEEEEEEEEED to have it ^^

I'm a total newb at lua so please, tell me step by step what I have to edit in the .lua to get the effect you have ^^

And does it work for raid frames too?

Zagrei 11-14-10 01:01 PM

Quote:

Originally Posted by Led ++ (Post 217713)
Wel lZAgrei I guess you already answered your own question so now it's my turn.


PLEEAAAAASSEEEEEEE tell me in DETAIL how you managed to get the ouf_nin look?!!?,8!!?,?!!!?! I NEEEEEEEEEED to have it ^^

I'm a total newb at lua so please, tell me step by step what I have to edit in the .lua to get the effect you have ^^

And does it work for raid frames too?

All right, all right! Haha :P Scroll up a bit, and you'll see that I posted a guide for the LUA :P Once you have pasted that in, just check the "Fill on Loss" and "Reverse Direction" boxes, and set the backdrop opacity to 0%. THEN, set the statusbar color to class, and set its opacity to 100%. /reloadui, and it's done!

You know what, I'll make your life easy! Click HERE for my LUA post :P

P.S. In StUF's case, the frame's name IS 'f'. The code I posted is directly from my bars.lua file :)


As far as StUF_Raid goes, it USED to work perfectly. Now, I'm not too sure... I'll get back to you on that. You can test it yourself, too.

Zagrei 11-14-10 01:06 PM

Quote:

Originally Posted by iradex (Post 217710)
Hey Zagrei, im trying to put SetBackdrop on target frame, i'm putting the code after the player frame code, i changed the frame name, but when i reload, al the screen is a bit dark, the target frame is correct, but all the screen is a bit dark, what i'm doing wrong? :(




\/ Agree with Led, i'm newb too, and it's look awesome the effect!!!!

For the frame name, it's actually just 'f'. I should have been more clear: the frame's name isn't just what you see ingame, it's what is in the LUA. If you scroll up a bit more in bars.lua, you'll see all of this:

Code:

        local function CreateBar(unit, uf, name, db)  -- create status bars for health or power
                local f = uf[name]
                local ishp = (name == "hpbar")
                if db.hide then
                        if f then
                                f:Hide()
                                Stuf:RegisterElementRefresh(uf, name, (ishp and "healthelements") or "powerelements", nil)
                        end
                        return
                end
                if not f then
                        f = Stuf:CreateBase(unit, uf, name, db)
                        f.bg = f:CreateTexture(nil, "BACKGROUND")
                        f.bg:SetAllPoints(f)
                        f.barbase = CreateFrame("Frame", nil, uf)
                        f.bar = f:CreateTexture(nil, "ARTWORK")

In short, that creates and styles the frames. So, by attaching the border/backdrop to 'f', you are attaching it to all StUF bars. This means that HP and Power bars have their own separate border and backdrop, so they can be moved around and resized at will :D REALLY nifty.

Does that help?

iradex 11-14-10 01:27 PM

It helped :D Worked! Btw, i tried to do the effect that Led want, and when i reload, my bar still all black.

Zagrei 11-14-10 01:46 PM

Quote:

Originally Posted by iradex (Post 217746)
It helped :D Worked! Btw, i tried to do the effect that Led want, and when i reload, my bar still all black.

So, you set the opacity of the backdrop to 0%, and the opacity of the bar to 100%? By the way, the options I'm referring to are the ones in Player/Target/Whatever>Heath/Power Bar. What you are trying to do is remove any color aside from the Deficit health. That way, it is all pretty and transparent, except for the health you are missing. Does that work? Also, did you leave
Code:

bg:SetBackdropColor(0, 0, 0, .4)
the same? The little .4 at the end is what sets the alpha, and the 0's are the color.

NOTE: The reason that you have to reload the UI after any changes is because when you enter config mode OR make a change to a statusbar, it layers a second transparent layer on top of the current one, making it darker. Eventually, after enough changes, it will just be solid black. Just fyi :)

iradex 11-14-10 02:06 PM

Now working!!! Really thanks Zagrei, you're just pr0 :D


All times are GMT -6. The time now is 09:44 AM.

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