Thread Tools Display Modes
11-07-22, 06:54 AM   #1
Deadlyz
A Wyrmkin Dreamwalker
 
Deadlyz's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 55
Removing shield from the protected casts.

Hello!

I'd like to disable the shield texture for protected casts.

The old classic texture looks terrible with the new UI and Blizzard didn't even bother to position it properly.

Looking for a bored Addon Author to help me!

Thanks in advance!
__________________

My last movie: Rogue Sweethearts
  Reply With Quote
11-07-22, 10:55 AM   #2
L3n1n
A Fallenroot Satyr
 
L3n1n's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 20
Didn't test but it should work.

Lua Code:
  1. TargetFrameSpellBar:HookScript("OnShow", function(self)
  2.     if self.BorderShield:IsShown() then
  3.         self.BorderShield:Hide()
  4.     end
  5. end)

Last edited by L3n1n : 11-07-22 at 04:39 PM. Reason: syntax error
  Reply With Quote
11-07-22, 02:39 PM   #3
Deadlyz
A Wyrmkin Dreamwalker
 
Deadlyz's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 55
Originally Posted by L3n1n View Post
Didn't test but it should work.

Lua Code:
  1. TargetFrameSpellBar:HookScript("OnShow", function(self)
  2.     if self.BorderShield:IsShown() then
  3.         self.BorderShield:Hide()
  4.     else
  5. end)
Thanks! I'm getting an error though
Lua Code:
  1. 3x FrameXML\Bindings.xml:1 Interface/AddOns/NoShield/NoShield.lua:1 Interface/AddOns/NoShield/NoShield.lua:5: unexpected symbol near ')'
__________________

My last movie: Rogue Sweethearts
  Reply With Quote
11-07-22, 04:40 PM   #4
L3n1n
A Fallenroot Satyr
 
L3n1n's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 20
I did mistake, replace "else" to "end".
  Reply With Quote
11-08-22, 01:38 AM   #5
Deadlyz
A Wyrmkin Dreamwalker
 
Deadlyz's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 55
Originally Posted by L3n1n View Post
I did mistake, replace "else" to "end".
Thanks! It works now, but somehow only hides shields randomly.

__________________

My last movie: Rogue Sweethearts

Last edited by Deadlyz : 11-08-22 at 01:42 AM.
  Reply With Quote
11-08-22, 06:07 AM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
You could try IsVisible() in addition to IsShown()
https://wowpedia.fandom.com/wiki/API...Region_IsShown


You could try just having the Hide() line. Seeing as the function is to show the frame, rather than check if it is shown first just tell it to hide it regardless as your code runs after their code. The test on whether it is Shown or not may be returning false for some reason. But the above may rectify this scenario.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
11-08-22, 06:54 AM   #7
Deadlyz
A Wyrmkin Dreamwalker
 
Deadlyz's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 55
Originally Posted by Xrystal View Post
You could try IsVisible() in addition to IsShown()
https://wowpedia.fandom.com/wiki/API...Region_IsShown


You could try just having the Hide() line. Seeing as the function is to show the frame, rather than check if it is shown first just tell it to hide it regardless as your code runs after their code. The test on whether it is Shown or not may be returning false for some reason. But the above may rectify this scenario.
Thanks!

The final version of the code for anyone interested
Lua Code:
  1. TargetFrameSpellBar.BorderShield:SetTexture(0)
  2. FocusFrameSpellBar.BorderShield:SetTexture(0)
__________________

My last movie: Rogue Sweethearts
  Reply With Quote
11-08-22, 06:02 PM   #8
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,324
Originally Posted by Deadlyz View Post
Thanks! It works now, but somehow only hides shields randomly.

The problem is, when a cast stops, the frame is still "Shown" for the duration it's fading. When another spell is cast, OnShow doesn't fire because it never was hidden in the first place.



Originally Posted by Xrystal View Post
You could try IsVisible() in addition to IsShown()
https://wowpedia.fandom.com/wiki/API...Region_IsShown
:IsVisible() implies :IsShown(). The difference is :IsVisible() checks inherited visibility from the parent where :IsShown() only checks the object's shown state.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
11-09-22, 07:24 AM   #9
Deadlyz
A Wyrmkin Dreamwalker
 
Deadlyz's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 55
Originally Posted by SDPhantom View Post
The problem is, when a cast stops, the frame is still "Shown" for the duration it's fading. When another spell is cast, OnShow doesn't fire because it never was hidden in the first place.




:IsVisible() implies :IsShown(). The difference is :IsVisible() checks inherited visibility from the parent where :IsShown() only checks the object's shown state.
Thanks for the explanation
__________________

My last movie: Rogue Sweethearts
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Removing shield from the protected casts.


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