WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   I would like to remove default nameplate's buff frame (https://www.wowinterface.com/forums/showthread.php?t=56810)

seyan777 10-28-18 02:18 AM

I would like to remove default nameplate's buff frame
 
Hi,

I would like to remove default nameplate's buff frame and make myself a custom buff frame.

Lua Code:
  1. local function ModifyNamePlate()
  2.     NamePlateDriverFrame:HookScript("OnEvent", function(self, event, ...)
  3.         if (event == "NAME_PLATE_CREATED") then
  4.             local nameplate = ...
  5.             if (nameplate and nameplate.UnitFrame) then
  6.                 local buffFrame = nameplate.UnitFrame.BuffFrame
  7.                 if (buffFrame) then
  8.                     buffFrame:UnregisterAllEvents()
  9.                     buffFrame = nil
  10.                 end
  11.             end
  12.         end
  13.     end)
  14. end

I thought this would remove the frame, but it didn't...

What would have I done wrong :confused:?

seyan777 10-29-18 12:18 AM

I've been doing some further research on those nameplate addons, but could have not found any solution...

It would have been easier to understand if it gave me some errors, but it is not even throwing one :confused:

jeruku 10-29-18 01:08 PM

Hiding the buff frame will hide the frames and make it stop responding to events.
Lua Code:
  1. nameplate.UnitFrame.BuffFrame:Hide()

seyan777 10-29-18 04:36 PM

Quote:

Originally Posted by jeruku (Post 330679)
Hiding the buff frame will hide the frames and make it stop responding to events.
Lua Code:
  1. nameplate.UnitFrame.BuffFrame:Hide()

So, it won't give any affects on CPU usage?!

jeruku 10-29-18 06:29 PM

It should lower usage as it is no longer drawing or in need of processing.

seyan777 10-29-18 08:24 PM

Quote:

Originally Posted by jeruku (Post 330684)
It should lower usage as it is no longer drawing or in need of processing.

Sweet!

Thanks a lot jeruku :)


All times are GMT -6. The time now is 04:34 AM.

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