Thread Tools Display Modes
03-05-15, 12:02 PM   #1
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
SecurePartyHeaderTemplate

Is it possible to show/hide frames with SecurePartyHeaderTemplate for 3rd party addons in combat?

I have tried to use the showParty attribute which should manually pop it when in party even in combat i think, but doesn't seem to work.
  Reply With Quote
03-05-15, 02:02 PM   #2
sticklord
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 57
I believe this is what you're looking for:

Lua Code:
  1. RegisterAttributeDriver(header, "state-visibility", "[@raid6,exists] show;hide")

Just change the condition so it fits whatever you need
  Reply With Quote
03-05-15, 03:30 PM   #3
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Thanks, i came up with a similar method, i'm just not sure how legit is this. I don't really have much experience with this secure stuff:

XML Code:
  1. <Frame name="ZPerl_Party_SecureState" inherits="SecureHandlerStateTemplate" parent="UIParent" protected="true">
  2.     <Attributes>
  3.         <Attribute name="_onstate-partymonitor" value="if newstate == 'nocombat' then elseif newstate == 'raid1' and self:GetAttribute('partyInRaid') then if not self:GetFrameRef('partyHeader'):IsShown() then self:GetFrameRef('partyHeader'):Show() end elseif newstate == 'party1' then if not self:GetFrameRef('partyHeader'):IsShown() then self:GetFrameRef('partyHeader'):Show() end else if self:GetFrameRef('partyHeader'):IsShown() then self:GetFrameRef('partyHeader'):Hide() end end"/>
  4.     </Attributes>
  5.     <Scripts>
  6.         <OnLoad>
  7.             SecureHandler_OnLoad(self)
  8.             self:SetFrameRef("partyHeader", ZPerl_Party_SecureHeader)
  9.             self:SetAttribute("partyInRaid", XPerlDB.party.inRaid)
  10.             RegisterStateDriver(self, "partymonitor", "[nocombat] nocombat; [target=raid1, exists] raid1; [target=party1, exists] party1; hide")
  11.         </OnLoad>
  12.     </Scripts>
  13. </Frame>
  Reply With Quote
03-05-15, 09:21 PM   #4
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Don't change anything on secure frames without checking if the player is in combat!
  Reply With Quote
03-06-15, 02:23 AM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Well actually you can. All you need to do is to make changes in a secure environment. That is the point.

Otherwise you just make a combat check and do the change insecure.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
03-06-15, 12:07 PM   #6
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
And can you do this only with the secure handler, or you also gotta rely on the standard out of combat handlers. Because these state drivers only trigger then the party changes, but lets say when i reload my ui while in party then its becomes hidden again.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » SecurePartyHeaderTemplate

Thread Tools
Display Modes

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