Thread Tools Display Modes
12-16-22, 01:00 PM   #1
DireKnack
A Murloc Raider
Join Date: Mar 2010
Posts: 4
Collapse BuffFrame

Hello,
I'm trying to make the BuffFrame default state be collapsed instead of having to collapse it manually every time I login or the UI is reloaded.

I'm very new to LUA but have been trying to figure it out with the following link:
https://github.com/tomrus88/Blizzard.../BuffFrame.lua

I've been trying with:
Lua Code:
  1. hooksecurefunc(BuffFrameMixin, "OnLoad", function()
  2.         self.isExpanded = false
  3.     end)

and also:
Lua Code:
  1. hooksecurefunc(AuraFrameMixin, "IsExpanded", function()
  2.         self.isExpanded = false
  3.     end)

I was also thinking that it could be as easy as updating a variable and tried not hooking? The following seems to collapse the BuffFrame but gives an error and breaks the buffs.
Lua Code:
  1. BuffFrame.CollapseAndExpandButton.SetChecked = false
Lua Code:
  1. Interface/FrameXML/BuffFrame.lua:365: attempt to call method 'SetChecked' (a boolean value)
  2. Count: 2
  3.  
  4. Call Stack:
  5. [string "=[C]"]: in function `SetChecked'
  6. [string "@Interface/FrameXML/BuffFrame.lua"]:365: in function `RefreshCollapseExpandButtonState'
  7. [string "@Interface/FrameXML/BuffFrame.lua"]:381: in function `UpdateAuraButtons'
  8. [string "@Interface/FrameXML/BuffFrame.lua"]:256: in function `Update'
  9. [string "@Interface/FrameXML/BuffFrame.lua"]:354: in function `Update'
  10. [string "@Interface/FrameXML/BuffFrame.lua"]:168: in function <Interface/FrameXML/BuffFrame.lua:166>
  11. [string "=[C]"]: ?


If I'm way off base I'm happy to do more research and am hoping to be pointed in the right direction thank you in advance for any guidance!
  Reply With Quote
12-16-22, 07:19 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
You might want to take a look at the first line in this function
https://www.townlong-yak.com/framexm...fFrame.lua#798
And maybe hook into that function.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
12-16-22, 10:54 PM   #3
DireKnack
A Murloc Raider
Join Date: Mar 2010
Posts: 4
Thank you so much for looking at this for me! I realize now the BuffFrame.lua thing I was looking at online wasn't up to date (even though it showed updated yesterday) so thank you for linking the townlong-yak one. I will just extract the Blizzard files going forward so I'm not wasting time.

I was able to get it working with the following:

Lua Code:
  1. BuffFrame.CollapseAndExpandButton:SetChecked(false)
  2.     BuffFrame.CollapseAndExpandButton:UpdateOrientation()
  3.     BuffFrame:SetBuffsExpandedState()

I hope none of this is bad practice? >.<

It shows toggled hidden on login and on reload. Also seems to toggle normally without generating LUA errors.
  Reply With Quote
12-17-22, 07:42 AM   #4
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
The tomrus88 project you were looking at is up-to-date, just too up-to-date for your current usage. They uploaded all the PTR changes yesterday and BuffFrame.lua has some significant changes in it.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Collapse BuffFrame


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