WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   Fading frames until I mouseover (https://www.wowinterface.com/forums/showthread.php?t=58111)

Igrac813 07-20-20 04:42 PM

Fading frames until I mouseover
 
I have been playing around with /run RegisterStateDriver(Minimap, "visibility", "[combat] hide; show") and it has helped a lot to clean up my frames in combat.

It got me thinking that I would like to hide a lot of frames even when out of combat to have a more immersive look.

Is there an easy script to run that can target frames to hide until I mouseover?

I did see some threads https://www.wowinterface.com/forums/...ad.php?t=55800 like this one but they were a bit over my head. Should I read some articles on how to run these programming type codes? If so let me know. I don't mind doing the reading. It's just a lot at once.

LudiusMaximus 07-21-20 01:23 PM

Something like that?

Code:

local myFrame = PlayerFrame -- Your frame here.
myFrame:SetAlpha(0)
myFrame:HookScript("OnEnter", function(self) self:SetAlpha(1) end)
myFrame:HookScript("OnLeave", function(self) self:SetAlpha(0) end)


Igrac813 07-21-20 01:50 PM

That is what I am looking for I believe.
How would I go about executing that code?

LudiusMaximus 07-21-20 01:58 PM

Quote:

Originally Posted by Igrac813 (Post 336429)
How would I go about executing that code?

If you want to run it in game or as a macro, precede the code with /run and paste it into the console. You can simply ignore every line break.

Or create your own addon that gets executed after every UI reload.
You can simply paste the code here and get your first addon:
https://addon.bool.no

Tim 07-22-20 12:19 PM

Code:

do
  for _, frame in pairs({
      "PlayerFrame",
      "TargetFrame", -- you can keep adding more frames
  }) do
      frame:SetAlpha(0)
      frame:HookScript("OnEnter", function(self) self:SetAlpha(1) end)
      frame:HookScript("OnLeave", function(self) self:SetAlpha(0) end)
  end
end



All times are GMT -6. The time now is 02:22 AM.

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