WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   BG Color Troubles (https://www.wowinterface.com/forums/showthread.php?t=23031)

Druidicbeast 04-28-09 05:13 PM

BG Color Troubles
 
Hey, after speaking with Haste on IRC he suggested posting here for better help. For the life of me I am unable to figure out what I have done wrong here. Basically my BG Color for my status bars changes on me from what I "want" to a solid black color. It does however fix itself "at random" when I do a /reloadui though.

Solid Black BG - Unwanted
http://img402.imageshack.us/img402/5...2809185119.jpg

Colored/Shaded BG - How I want it to look 100% of the time
http://img402.imageshack.us/img402/5...2809185514.jpg

LUA File - Please excuse the poor excuse I have created for an lua file, it's quite embarassing. I am still in the process of learning and when I went to paste it none of the indents came with it =(.

http://www.pastey.net/113249

Any help is greatly appreciated, and don't be shy to throw some pointers or other suggestions my way =)

p3lim 04-28-09 08:07 PM

line 188: make that global into a local, also set the layer to 'BACKGROUND'
line 217: set the layer to 'BACKGROUND'
line 249: set the layer to 'BACKGROUND'

Druidicbeast 04-28-09 11:55 PM

Quote:

Originally Posted by p3lim (Post 131902)
line 188: make that global into a local, also set the layer to 'BACKGROUND'
line 217: set the layer to 'BACKGROUND'
line 249: set the layer to 'BACKGROUND'

Ok I changed the lines of code accordingly and still had the same issue. Your response is greatly appreciated; however, it was recommended to me to take a different approach to achieve the same results. I have since scrapped that old code and replaced it with

Code:

self:SetBackdrop({
bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=],
insets = {top = -3, left = -3, bottom = -3, right = -3}
})
self:SetBackdropColor(0, 0, 0, 1)

So far this seems to be working. I do however have a small issue when it comes to my Death Knight. Upon first load and/or reload of UI the Runic Power bar appears colored as 100%. When combat starts the bar drops back down to the amount of Runic Power I currently have. Not sure if this issue is even related or if my code is so terrible I have another bug =(.

Back to work I guess =P

zork 04-29-09 04:52 AM

Are you using oUF_Smooth?

What I am aware of is that if you target some kind of npc with ManaMax = 0 and after that targeting a warrior or someone else with 0 rage the power bar is completly filled.

Btw you may fix this by setting the statusbarvalue to 0 at startup, just add self.Power:SetValue(0) after you created the powerbar.

Druidicbeast 04-29-09 07:25 AM

Quote:

Originally Posted by zork (Post 131983)
Are you using oUF_Smooth?

What I am aware of is that if you target some kind of npc with ManaMax = 0 and after that targeting a warrior or someone else with 0 rage the power bar is completly filled.

Btw you may fix this by setting the statusbarvalue to 0 at startup, just add self.Power:SetValue(0) after you created the powerbar.

Thank you very much for the help. Yes I am using oUF_Smooth. I am at work at the moment, but I will try to add this when I get home tonight and post an update. Thank you again.

Druidicbeast 04-29-09 05:13 PM

Ok gave this a try now that I am home from work, with no luck :(

Here is what happens - With your line added
Both player and target (myself) have full runic power bars.
When another unit is selected then myself again the target bar drops to 0

Without your code
Regardless of who is targeted or when the power bar always shows as being full UNTIL some ability is used that alters the current power (ie. using Death and Decay to generate RP).

Hope this helps some.

Gotai 04-29-09 07:39 PM

It's an issue with SmoothUpdate. I posted a fix in the comments in the hope people would find it there: http://pastey.net/111986

If that doesn't fix it, please let me know, if possible with a way to reproduce it.

Edit: That pastey is meant to replace the current SmoothUpdate file if that wasn't clear.

Druidicbeast 04-29-09 07:52 PM

Quote:

Originally Posted by Gotai (Post 132147)
It's an issue with SmoothUpdate. I posted a fix in the comments in the hope people would find it there: http://pastey.net/111986

If that doesn't fix it, please let me know, if possible with a way to reproduce it.

Edit: That pastey is meant to replace the current SmoothUpdate file if that wasn't clear.

tyvm for your reply. I am testing it out now. BRB with an update.

Edit: That looks like it did the trick, it appears to be working great now. I also left out the above mentioned
Code:

self.Power:SetValue(0)
tyvm again ;)

Edit2: Ok this isn't a huge deal, but I am noticing when I have smooth on it will never let my RP = 0. It always stays at 1/100. When I turn off smooth the bar resets to 0.

Edit3: Ok so I added the
Code:

self.Power:SetValue(0)
Works perfect now, sorry about that. No more edits I promise

zork 04-30-09 02:42 AM

Some questions.

Why bar:SetValue_(value) and not bar:SetValue(value) ?
Does SetValue_ even work, what does it?

Other than that...
if cur == value or abs(cur - value) < 2 then
or
if cur == value or abs(new - value) < 2 then
and why?

Gotai 04-30-09 08:29 AM

Of course it works, otherwise I wouldn't post it. ;)

local function SmoothBar(self, bar)
bar.SetValue_ = bar.SetValue
bar.SetValue = Smooth
end

When you set smoothing for a bar, this function is ran. SetValue_ is a reference to the old SetValue function and bypasses the smoothing. The smoothing has a margin of 2, which was causing bars to not fill completely. The final SetValue_(value) makes sure that after smoothing the bar is set to value.

Your second question... *shrug*
We were trying to fix the bars filling across the screen issue at the time, so I had multiple versions/possible fixes running. Could be it's left over from another test, could be I had some other reason for it. I can't really remember. The second is used in oUF_Caellian and I haven't seen any odd behaviour.


All times are GMT -6. The time now is 01:27 AM.

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