oUF

99.9k Downloads

oUF - Player Frame Location Lua

Noixion opened this issue ยท 10 comments

commented

Sorta like the title is posted.. i am wondering where is the lua code for player frame . i'm having slight issue ATM and seems like author of oUF_Donut is being a slacker lol (or just ignoring it)

ok so here issue.. seems like there an "Invisable frame" player frame from click it that i am able to click on and it selects me. Before you ask, yes i use ** self:EnableMouse(false) ** in spawn.lua (oUF_Donut) didnt fix the issue i also added a custom code (i posted it at the bottom of this question)
so not sure how to make the "Invisable" Player frame none clickable. (if that make sense).

Thank you!.

Image of what i'm talking about
http://i.imgur.com/30J9inb.jpg

Is the post i made to oUF_Donut
http://www.wowinterface.com/downloads/fileinfo.php?id=22273#comments

--Custom code i am talking about-- Note everything from lib:CreateFrameStack(self) is custom code

local function CreateUnitTemplate(self)
self.template = tmp:GetTemplateByName(self.cfg.template)
self:SetSize(256,256)
self:SetScale(self.cfg.scale or 1)
self:SetBackdrop(cfg.backdrop)
--self:RegisterForClicks("AnyDown")
--self:SetScript("OnEnter", UnitFrame_OnEnter)
--self:SetScript("OnLeave", UnitFrame_OnLeave)
self:EnableMouse(false)

lib:CreateFrameStack(self)

self:SetScript("OnUpdate", function(self) 
if UnitCanAttack("player", "target") and UnitHealth("target") > 0 then 
    self:SetAlpha(1) 
    else 
    self:SetAlpha(0) 
    end 
end)

end

commented

--self:RegisterForClicks("AnyDown")

As far as I know, any button element (which unitframes basically are) default to having "LeftButtonUp" registered, so to disable it you'd have to set it to nil.
:EnableMouse(false) might override this behavior though.

Either way, this is not an issue with oUF, rather the layout, and your best bet is to ask on the WowInterface or WowAce forums for help.

commented

the :EnableMouse(false) doesnt override it .. since its not working at all atm going to try changing
--self:RegisterForClicks("AnyDown")
to
--self:RegisterForClicks("nil")

If i am reading what you said right.

commented

You're still commenting it out, and nil is a type, not a string.
http://www.lua.org/pil/2.html

commented

ok seems like its something else making it do it, disabled all my addons and it worked.. but now with 1 addon turn on that interracts with it.. seems like it just disregards that . thank you p3lim

commented

Sorry i am extreamly horrible with lua >.<

Well i keep both ... just change
--self:RegisterForClicks("AnyDown")
to
--self:RegisterForClicks("nil")

local function CreateUnitTemplate(self)
self.template = tmp:GetTemplateByName(self.cfg.template)
self:SetSize(256,256)
self:SetScale(self.cfg.scale or 1)
self:SetBackdrop(cfg.backdrop)
--self:RegisterForClicks("nil")
--self:SetScript("OnEnter", UnitFrame_OnEnter)
--self:SetScript("OnLeave", UnitFrame_OnLeave)
self:EnableMouse(false)

lib:CreateFrameStack(self)

self:SetScript("OnUpdate", function(self) 
if UnitCanAttack("player", "target") and UnitHealth("target") > 0 then 
    self:SetAlpha(1) 
    else 
    self:SetAlpha(0) 
    end 
end)

end

commented

sadly this issue is still happening i'm still getting invisible frame.

commented

I'm unable to recreate this using oUF_Donut from WoWInterface. I made the following changes to core/spawn.lua:

diff --git a/core/spawn.lua b/core/spawn.lua
index 1a27be8..5d0cd5c 100644
--- a/core/spawn.lua
+++ b/core/spawn.lua
@@ -21,13 +21,17 @@
     self.template = tmp:GetTemplateByName(self.cfg.template)
     self:SetSize(256,256)
     self:SetScale(self.cfg.scale or 1)
-    --self:SetBackdrop(cfg.backdrop)
-    self:RegisterForClicks("AnyDown")
-    self:SetScript("OnEnter", UnitFrame_OnEnter)
-    self:SetScript("OnLeave", UnitFrame_OnLeave)
+    self:EnableMouse(false)

     lib:CreateFrameStack(self)

+    self:SetScript("OnUpdate", function(self)
+      if UnitCanAttack("player", "target") and UnitHealth("target") > 0 then
+        self:SetAlpha(1)
+      else
+        self:SetAlpha(0)
+      end
+    end)
   end
commented

The problem is that Clique calls WrapScript on the OnEnter and OnLeave of the frame, which in turn runs frame:EnableMouse(true) in the background. Poked cladhaire about it, but I dont' know if there's an easy workaround for him to implement in Clique.

A workaround I could introduce is a way to prevent oUF from registering the frames with Clique. KInda backwards tho'.

commented

i copied everything you posted and made my spawn.lua same as your post and now the donut isnt there at all.. oUF_Donut was customized. you wont have issue with oUF_Donut from Wowinterface.

I made sure i redownloaded oUF and Clique before i added the "Reproduce" part. without changing anything you can find donut 2 ways...

  1. Go to a target dummy and target it -
  2. Mouse around on right side you will come accross the invisible frame, Posted here http://i.imgur.com/36M3h3Z.jpg?2 Note that in that image i am targeting a Dummy make the donut appear

TO help reproduce the issue.
-Current version of Clique
-Current version of oUF

You will need everything that is there. might help reproduce the problem.

commented

Thats what i thought. it was clique doing it.. thanks haste i slap that on his forums both on Wowinterface and bug report site, on curse forge he has yet to respond in both direction.. he does have option in clique to disable click events (but i believe its bug). its not overly big deal its just how i set up this UI and frame was in the way i can work pass it for now till update on clique is sent out (since patch is soon and probably break the addon). thank you very much you prove the issue was within clique itself and not oUF_Donut.. if its too much trouble to then dont bother doing work around dont want you to stress over it to much... Like i said the option in clique to disable the mouse event (ignore mouse click i take it) for oUF_Donut seems to be bug (along with few other things i noticed). if you do write a work around can it be 2nd option so that way NOT EVERYONE has to download the update of it. rather just avoid you having to deal with an issue from everyone vs 1 person. If that make sense

spent 2 weeks trying get answers and figure out what addon between them 2 was issue.