WoWInterface (
-   Lua/XML Help (
-   -   SecurePartyHeaderTemplate (

Resike 03-05-15 12:02 PM

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.

sticklord 03-05-15 02:02 PM

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:p

Resike 03-05-15 03:30 PM

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",
  10.             RegisterStateDriver(self, "partymonitor", "[nocombat] nocombat; [target=raid1, exists] raid1; [target=party1, exists] party1; hide")
  11.         </OnLoad>
  12.     </Scripts>
  13. </Frame>

Duugu 03-05-15 09:21 PM

Don't change anything on secure frames without checking if the player is in combat! :)

zork 03-06-15 02:23 AM

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.

Resike 03-06-15 12:07 PM

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.

All times are GMT -6. The time now is 03:19 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI