Quantcast
How to hide "ClassNameplateManaBarFrame" using OUF? - WoWInterface
Thread Tools Display Modes
04-13-20, 06:27 AM   #1
Lybrial
A Black Drake
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 86
How to hide "ClassNameplateManaBarFrame" using OUF?

Hi,

im using oUF to create my namepaltes but I have a problem with my personal resource nameplate.



As you can see on this picture there are three bars.
- The first is the health bar I created.
- The second is the power bar I created.
- The third is the default blizzard ClassNameplateManaBarFrame

I thought using oUF would cause ClassNameplateManaBarFrame to be hidden or something else.

Lua Code:
  1. _G.ClassNameplateManaBarFrame:Hide();

Does not keep it hidden.

Any ideas?
  Reply With Quote
04-13-20, 04:39 PM   #2
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 121
Originally Posted by Lybrial View Post
Hi,

im using oUF to create my namepaltes but I have a problem with my personal resource nameplate.



As you can see on this picture there are three bars.
- The first is the health bar I created.
- The second is the power bar I created.
- The third is the default blizzard ClassNameplateManaBarFrame

I thought using oUF would cause ClassNameplateManaBarFrame to be hidden or something else.

Lua Code:
  1. _G.ClassNameplateManaBarFrame:Hide();

Does not keep it hidden.

Any ideas?
I don't use oUF myself. But it sounds like something is trigger it to show again. Some sort of refresh or what not. You can try to review the code and see if anything is doing that.

Otherwise there are several methods to overwrite the Show method for frames. Though I tend to avoid doing that unless absolutely necessary.

This is JUST an example. Again I normally avoid doing such things.

Code:
_G.ClassNameplateManaBarFrame:SetScript("OnShow", function() return end)
You could also try overwriting the frames Show function. i.e
Code:
_G.ClassNameplateManaBarFrame.Show = function(self) self:Hide() end
There is also another method but again it's a bit redundant. However it has the benefit that are using a hooksecurefunc (which is better programming practice).

Code:
hooksecurefunc(_G.ClassNameplateManaBarFrame, "Show", function(self) self:Hide() end)
etc.. etc.. etc..

The cleanest solution would be to review the oUF code to determine what keeps showing it and disabling it there.
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }
  Reply With Quote
04-13-20, 08:44 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,732
I moved your thread to the oUF section of the forums. Folks here might have an idea.
__________________
"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
04-16-20, 10:02 AM   #4
Lybrial
A Black Drake
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 86
Originally Posted by Xruptor View Post
The cleanest solution would be to review the oUF code to determine what keeps showing it and disabling it there.
You are right. I created a bug-ticket in ouf git. For now I will do the following:

Lua Code:
  1. local function temporaryBugFix()
  2.     _G.ClassNameplateManaBarFrame.Show = _G.ClassNameplateManaBarFrame.Hide;
  3.     _G.DeathKnightResourceOverlayFrame.Show = _G.DeathKnightResourceOverlayFrame.Hide;
  4. end

But that leads to another strange error:

Lua Code:
  1. 4x [ADDON_ACTION_BLOCKED] AddOn 'Lybrial_NamePlates' tried to call secure function 'SetTargetClampingInsets()'.
  2. [string "@!BugGrabber\BugGrabber.lua"]:519: in function <!BugGrabber\BugGrabber.lua:519>
  3. [string "=[C]"]: in function `SetTargetClampingInsets'
  4. [string "@Blizzard_NamePlates\Blizzard_NamePlates.lua"]:274: in function `SetupClassNameplateBars'
  5. [string "@Blizzard_NamePlates\Blizzard_NamePlates.lua"]:96: in function `OnNamePlateAdded'
  6. [string "@Blizzard_NamePlates\Blizzard_NamePlates.lua"]:51: in function <...eBlizzard_NamePlates\Blizzard_NamePlates.lua:42>
  7. [string "=[C]"]: ?

But I can live with that for now
  Reply With Quote
04-16-20, 10:14 AM   #5
Lybrial
A Black Drake
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 86
This is better to avoid the error:

Lua Code:
  1. local function temporaryBugFix()
  2.     hooksecurefunc(_G.ClassNameplateManaBarFrame, "Show", function(self) self:Hide() end);
  3.     hooksecurefunc(_G.DeathKnightResourceOverlayFrame, "Show", function(self) self:Hide() end);
  4. end
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » How to hide "ClassNameplateManaBarFrame" using OUF?

Thread Tools
Display Modes

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