Thread Tools Display Modes
04-28-09, 05:13 PM   #1
Druidicbeast
A Fallenroot Satyr
Join Date: Feb 2008
Posts: 24
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 =)
  Reply With Quote
04-28-09, 08:07 PM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
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'
  Reply With Quote
04-28-09, 11:55 PM   #3
Druidicbeast
A Fallenroot Satyr
Join Date: Feb 2008
Posts: 24
Originally Posted by p3lim View Post
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
  Reply With Quote
04-29-09, 04:52 AM   #4
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
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.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 04-29-09 at 04:57 AM.
  Reply With Quote
04-29-09, 07:25 AM   #5
Druidicbeast
A Fallenroot Satyr
Join Date: Feb 2008
Posts: 24
Originally Posted by zork View Post
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.

Last edited by Druidicbeast : 04-29-09 at 08:57 AM.
  Reply With Quote
04-29-09, 05:13 PM   #6
Druidicbeast
A Fallenroot Satyr
Join Date: Feb 2008
Posts: 24
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.
  Reply With Quote
04-29-09, 07:39 PM   #7
Gotai
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 5
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.
  Reply With Quote
04-29-09, 07:52 PM   #8
Druidicbeast
A Fallenroot Satyr
Join Date: Feb 2008
Posts: 24
Originally Posted by Gotai View Post
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

Last edited by Druidicbeast : 04-29-09 at 08:09 PM.
  Reply With Quote
04-30-09, 02:42 AM   #9
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
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?
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
04-30-09, 08:29 AM   #10
Gotai
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 5
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.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » BG Color Troubles


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off