WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   How to hide "ClassNameplateManaBarFrame" using OUF? (https://www.wowinterface.com/forums/showthread.php?t=57932)

Lybrial 04-13-20 06:27 AM

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?

Xruptor 04-13-20 04:39 PM

Quote:

Originally Posted by Lybrial (Post 335632)
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.

Seerah 04-13-20 08:44 PM

I moved your thread to the oUF section of the forums. Folks here might have an idea.

Lybrial 04-16-20 10:02 AM

Quote:

Originally Posted by Xruptor (Post 335639)
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

Lybrial 04-16-20 10:14 AM

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


All times are GMT -6. The time now is 08:43 AM.

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