Thread Tools Display Modes
08-24-13, 06:29 AM   #1
squelchywelchy
A Murloc Raider
 
squelchywelchy's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 5
sqwNameplates - Unable to hide 'Spell Shadow'

Heeeeelp,

I'm dumb at the best of times but have developed a self inflicted bald patch overnight due to my constantly scratching my head for like 10hrs trying to fathom out why the heck I can not hide the damn 'Spell Shadow' on the castbar.

I hid the spell text without any real issue, but am totally stumped by the shadow. Was wondering if maybe its something to do with Parenting as I had to Parent the Spell Icon in order for that to not show??

main body of my code is as follows :

-- Original nameplate
nameplate.children = {}--orig
local child = nameplate.children--orig
nameplate.regions = {}--orig
local reg = nameplate.regions--orig



frame.barFrame, frame.nameFrame = frame:GetChildren()
child.healthBar, child.castBar = frame.barFrame:GetChildren()--orig
reg.nameText = frame.nameFrame:GetRegions()--orig
reg.threatGlow, reg.healthBorder, reg.highlightTexture, reg.levelText, reg.boss, reg.raid, reg.dragon = frame.barFrame:GetRegions()


-- frame.name = frame.nameFrame:GetRegions()--sqw added
--_, reg.castBorder, reg.shield, reg.spellIcon = child.castBar:GetRegions()--orig


_, reg.castBorder, reg.shield, reg.spellIcon, frame.nameText, frame.nameTextShadow = child.castBar:GetRegions()--sqw1



--_, reg.castBorder, reg.shield, reg.spellIcon, frame.name, frame.nameShadow = castBar:GetRegions()--sqw2



frame.nameText:Hide() --** SPELL NAME HIDDEN BUT CAN'T HIDE SHADOW AAARGH




child.healthBar:SetStatusBarTexture( INVISIBLE_TEXTURE )
child.castBar:SetStatusBarTexture( INVISIBLE_TEXTURE )

--for index,region in pairs( reg ) do region:SetParent( nameplate ) end --*****remmed out else Healers Have To Die breaks *****


reg.threatGlow:SetTexCoord( 0, 0, 0, 0 )
reg.healthBorder:SetTexCoord( 0, 0, 0, 0 )
reg.castBorder:SetTexCoord( 0, 0, 0, 0 )
reg.shield:SetTexCoord( 0, 0, 0, 0 )
nameplate.highlight = reg.highlightTexture
nameplate.highlight:SetTexture( LSM:Fetch( "statusbar", "Doc" ) )
nameplate.highlight:SetVertexColor( 1,1,1,0.6 )
reg.nameText:SetWidth( 000.1 )--orig
--frame.nameText:SetWidth( 000.1 )
reg.levelText:SetWidth( 000.1 )
reg.boss:SetTexCoord( 0, 0, 0, 0 )
reg.raid:SetAlpha( 0 )
reg.dragon:SetTexCoord( 0, 0, 0, 0 )


Addon link : http://www.wowinterface.com/download...ameplates.html


If anyone has the time to cast their eye over the coding and offer constructive suggestions, even if they result in a total over-haul of the code then I would be extremely grateful.

Many thanks,
Tim
  Reply With Quote
08-24-13, 08:21 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Don't be to hard on yourself.

Here is my nameplate reference:
http://code.google.com/p/rothui/sour...2/core.lua#211

Lua Code:
  1. --the gathering
  2.     plate.barFrame, plate.nameFrame = plate:GetChildren()
  3.     plate.healthbar, plate.castbar = plate.barFrame:GetChildren()
  4.     plate.threat, plate.border, plate.highlight, plate.level, plate.boss, plate.raid, plate.dragon = plate.barFrame:GetRegions()
  5.     plate.name = plate.nameFrame:GetRegions()
  6.     plate.healthbar.texture = plate.healthbar:GetRegions()
  7.     plate.castbar.texture, plate.castbar.border, plate.castbar.shield, plate.castbar.icon, plate.castbar.name, plate.castbar.nameShadow = plate.castbar:GetRegions()
  8.     plate.castbar.icon.layer, plate.castbar.icon.sublevel = plate.castbar.icon:GetDrawLayer()

First thing I would try to do is:

Lua Code:
  1. plate.castbar.nameShadow:SetTexture(nil)

Next would be:

Lua Code:
  1. plate.castbar.nameShadow:Hide()

Another option is to create a pastebin frame and reparent the texture to that frame via:

Lua Code:
  1. plate.castbar.nameShadow:SetParent(pastebin)

It may possible that the nameShadow texture gets updated via CastbarOnShow. But you can catch that event via:

Lua Code:
  1. local function NamePlateCastbarOnShow(castbar)
  2.    print(castbar.nameShadow:GetTexture())
  3. end
  4.  
  5. plate.castbar:HookScript("OnShow", NamePlateCastbarOnShow)

Hope that helps.
__________________
| 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 : 08-24-13 at 08:27 AM.
  Reply With Quote
08-24-13, 09:35 AM   #3
squelchywelchy
A Murloc Raider
 
squelchywelchy's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 5
Talking Zork Rocks!

Zork you do not realize how pleased you have made me.

I spent hours trying different coding combinations in an attempt to crack the problem and you hit it immediately on its head with your first suggestion.

Thank you loads
  Reply With Quote
08-24-13, 10:33 AM   #4
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
You are welcome.
__________________
| 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
08-24-13, 12:16 PM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
crosspost: http://forums.wowace.com/showthread.php?t=20712
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-25-13, 06:15 AM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
It looks like your problem has already been solved, but in the future please use [code] tags around sections of code you post on forums, so the indentation is preserved and the forums don't insert unwanted whitespace (such as linebreaks, or even plain spaces in the middle of longer "words").
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » sqwNameplates - Unable to hide 'Spell Shadow'


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