• 0

    posted a message on kgPanels Offical Thread
    Thx for your replies, but that's not really what i need. I basically ned an if statement which checks whether Grid and Bartender4 frames are visible or not (something like if Omen.Anchor then ...).

    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from newb »

    Hello
    i've been trying to script my kgpanels all day today, but it did not work for me. I've Been using code posted on this thread but could not get it work for me, so i decided to ask for help.
    So here it goes:

    OnLoad
    self:RegisterEvent("PLAYER_ENTERING_WORLD")
    self:RegisterEvent("PARTY_MEMBERS_CHANGED")
    self:RegisterEvent("RAID_ROSTER_UPDATE")

    OnEvent
    local rmems = GetNumRaidMembers()
    
    self:Hide()
    
    if (rmems > 0 and rmems < 11) then
      self:SetWidth(15)
      self:Show()
    end
    
    if (rmems > 0 and rmems < 26) then
      self:SetWidth(278)
      self:Show()
    end
    
    if (rmems > 0 and rmems < 41) then
      self:SetWidth(398)
      self:Show()
    end

    here i tried to make a panel to become visible adjust it's size when i join raid (only) groups of different sizes (i'm using Grid). It becomes visible when i join raid, but it does not resize - it is always of the same default size i set before starting scripting on it. I cannot see the flaw in my code.

    And third thing is that i have a hunter as one of my chars, and i want his pet bar to have a separate panel that is only visible for a hunter, but is on the same layout (using Bartender4 here). I created it, set it invisible, but now cannot make it appear when i log on my hunter.

    Seems this is all for now. Waiting for your answers.

    Thanks


    bump. thx
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    No worries, i can wait :)
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    ^1^T^SP8^T^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Sbg_insets^T^Sr^S-2^St^S-2^Sl^S+2^Sb^S+2^t^Svflip^b^StileSize^N0^Sbg_texture^SSolid^Sanchor^SUIParent^Slevel^N0^Sscripts^T^SEVENT^Slocal~`class~`=~`PLAYER_CLASS~Jif~`class~`==~`"HUNTER"~`then~J~`~`~`~`~`~`self:Show()~Jelse~J~`~`~`~`~`~`self:Hide()~Jend^SLOAD^Sself:RegisterEvent("PLAYER_ENTERING_WORLD")^t^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sx^N0^SjustifyH^SCENTER^Sfont^SBlizzard^Scolor^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N12^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N0^Sg^N0^Sr^N0^t^Sborder_texture^SSkinner~`EditBox/ScrollBar~`Border^Sx^F-5318884815011840^f-45^Swidth^F4531085807452160^f-44^Sy^F-8521356362645504^f-44^Sbg_color^T^Sa^N1^Sb^F5510286602900374^f-55^Sg^F6216733603272213^f-55^Sr^F5651576002974740^f-55^t^Sbg_alpha^N1^Sborder_edgeSize^N14^Sheight^F8580582837583872^f-48^Smouse^b^Srotation^N0^Stiling^b^t^SP9^T^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Sbg_insets^T^Sr^S-2^St^S-2^Sl^S+2^Sb^S+2^t^Svflip^b^StileSize^N0^Sbg_texture^SSolid^Sanchor^SUIParent^Slevel^N0^Sscripts^T^SLOAD^Sself:Hide()^t^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sx^N0^SjustifyH^SCENTER^Sfont^SBlizzard^Scolor^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N12^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N0^Sg^N0^Sr^N0^t^Sborder_texture^SSkinner~`EditBox/ScrollBar~`Border^Sx^F-4648867467362304^f-44^Swidth^F8888444482748416^f-48^Sy^F-8572896439959552^f-44^Sbg_color^T^Sa^N1^Sb^F5510286602900374^f-55^Sg^F6216733603272213^f-55^Sr^F5651576002974740^f-55^t^Sbg_alpha^N1^Sborder_edgeSize^N14^Sheight^F8606973264134144^f-48^Smouse^b^Srotation^N0^Stiling^b^t^SP7^T^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Sbg_insets^T^Sr^S-2^St^S-2^Sl^S+2^Sb^S+2^t^Svflip^b^StileSize^N0^Sbg_texture^SSolid^Sanchor^SUIParent^Slevel^N0^Sscripts^T^SEVENT^Slocal~`pmems~`=~`GetNumPartyMembers()~Jlocal~`rmems~`=~`GetNumRaidMembers()~J~Jself:Hide()~J~Jif~`(pmems~`>~`0)~`then~J~`~`~`~`~`self:Show()~Jend~J~Jif~`(rmems~`>~`0)~`then~J~`~`~`~`~`self:Show()~Jend^SUPDATE^S^SLOAD^Sself:RegisterEvent("PLAYER_ENTERING_WORLD")~Jself:RegisterEvent("PARTY_MEMBERS_CHANGED")~Jself:RegisterEvent("RAID_ROSTER_UPDATE")^t^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sx^N0^SjustifyH^SCENTER^Sfont^SBlizzard^Scolor^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N12^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N0^Sg^N0^Sr^N0^t^Sborder_texture^SSkinner~`EditBox/ScrollBar~`Border^Sx^F-5612662314500096^f-43^Swidth^F7790584269897729^f-45^Sy^F-6263920830447616^f-44^Sbg_color^T^Sa^N1^Sb^F5510286602900374^f-55^Sg^F6216733603272213^f-55^Sr^F5651576002974740^f-55^t^Sbg_alpha^N1^Sborder_edgeSize^N14^Sheight^F5199039121326080^f-45^Smouse^b^Srotation^N0^Stiling^b^t^SP6^T^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sparent^SGridFramelayout^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Sbg_insets^T^Sr^S-2^St^S-2^Sl^S+2^Sb^S+2^t^Svflip^b^StileSize^N0^Sbg_texture^SSolid^Sanchor^SGridFrameLayout^Slevel^N0^Sscripts^T^SEVENT^Slocal~`rmems~`=~`GetNumRaidMembers()~J~Jself:Hide()~J~Jif~`(rmems~`>~`0~`and~`rmems~`<~`11)~`then~J~`~`~`~`~`self:SetWidth(15)~J~`~`~`~`~`self:SetHeight(178)~J~`~`~`~`~`self:Show()~Jend~J~Jif~`(rmems~`>~`0~`and~`rmems~`<~`26)~`then~J~`~`~`~`~`self:SetWidth(278)~J~`~`~`~`~`self:Show()~Jend~J~Jif~`(rmems~`>~`0~`and~`rmems~`<~`41)~`then~J~`~`~`~`~`self:SetWidth(398)~J~`~`~`~`~`self:Show()~Jend^SUPDATE^S^SLOAD^Sself:RegisterEvent("PLAYER_ENTERING_WORLD")~Jself:RegisterEvent("PARTY_MEMBERS_CHANGED")~Jself:RegisterEvent("RAID_ROSTER_UPDATE")^t^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sx^N0^SjustifyH^SCENTER^Sfont^SBlizzard^Scolor^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N12^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N0^Sg^N0^Sr^N0^t^Sborder_texture^SSkinner~`EditBox/ScrollBar~`Border^Sx^S549^Swidth^S398^Sy^S-342^Sbg_color^T^Sa^N1^Sb^F5510286602900374^f-55^Sg^F6216733603272213^f-55^Sr^F5651576002974740^f-55^t^Sbg_alpha^N1^Sborder_edgeSize^N14^Sheight^S178^Smouse^b^Srotation^N0^Stiling^b^t^SP5^T^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Sbg_insets^T^Sr^S-2^St^S-2^Sl^S+2^Sb^S+2^t^Svflip^b^StileSize^N0^Sbg_texture^SSolid^Sanchor^SUIParent^Slevel^N0^Sscripts^T^t^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sx^N0^SjustifyH^SCENTER^Sfont^SBlizzard^Scolor^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N12^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N0^Sg^N0^Sr^N0^t^Sborder_texture^SSkinner~`EditBox/ScrollBar~`Border^Sx^F-5274838314778624^f-53^Swidth^F6965952159678465^f-45^Sy^F-7274096601595904^f-44^Sbg_color^T^Sa^N1^Sb^F5510286602900374^f-55^Sg^F6216733603272213^f-55^Sr^F5651576002974740^f-55^t^Sbg_alpha^N1^Sborder_edgeSize^N14^Sheight^F4633344146931712^f-47^Smouse^b^Srotation^N0^Stiling^b^t^SP4^T^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Sbg_insets^T^Sr^S-2^St^S-2^Sl^S+2^Sb^S+2^t^Svflip^b^StileSize^N0^Sbg_texture^SSolid^Sanchor^SUIParent^Slevel^N0^Sscripts^T^t^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sx^N0^SjustifyH^SCENTER^Sfont^SBlizzard^Scolor^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N12^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N0^Sg^N0^Sr^N0^t^Sborder_texture^SSkinner~`EditBox/ScrollBar~`Border^Sx^N9.1552734375e-005^Swidth^F4926634578673664^f-43^Sy^F-7944109587169280^f-44^Sbg_color^T^Sa^N1^Sb^F5510286602900374^f-55^Sg^F6216733603272213^f-55^Sr^F5651576002974740^f-55^t^Sbg_alpha^N1^Sborder_edgeSize^N14^Sheight^F4798267133001728^f-47^Smouse^b^Srotation^N0^Stiling^b^t^SP2^T^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Sbg_insets^T^Sr^S-2^St^S-2^Sl^S+2^Sb^S+2^t^Svflip^b^StileSize^N0^Sbg_texture^SSolid^Sanchor^SUIParent^Slevel^N0^Sscripts^T^t^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sx^N0^SjustifyH^SCENTER^Sfont^SBlizzard^Scolor^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N12^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N0^Sg^N0^Sr^N0^t^Sborder_texture^SSkinner~`EditBox/ScrollBar~`Border^Sx^F5875511771267072^f-43^Swidth^F5687762913067010^f-45^Sy^N-516.60979616642^Sbg_color^T^Sa^N1^Sb^F5510286602900374^f-55^Sg^F6216733603272213^f-55^Sr^F5651576002974740^f-55^t^Sbg_alpha^N1^Sborder_edgeSize^N14^Sheight^F5776285947133952^f-45^Smouse^b^Srotation^N0^Stiling^b^t^SP3^T^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Sbg_insets^T^Sr^S-2^St^S-2^Sl^S+2^Sb^S+2^t^Svflip^b^StileSize^N0^Sbg_texture^SSolid^Sanchor^SUIParent^Slevel^N0^Sscripts^T^t^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sx^N0^SjustifyH^SCENTER^Sfont^SBlizzard^Scolor^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N12^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N0^Sg^N0^Sr^N0^t^Sborder_texture^SSkinner~`EditBox/ScrollBar~`Border^Sx^F8205114380648449^f-44^Swidth^F8244130668871679^f-45^Sy^F-4544150080847872^f-43^Sbg_color^T^Sa^N1^Sb^F5510286602900374^f-55^Sg^F6216733603272213^f-55^Sr^F5651576002974740^f-55^t^Sbg_alpha^N1^Sborder_edgeSize^N14^Sheight^F5776287020875776^f-45^Smouse^b^Srotation^N0^Stiling^b^t^SP1^T^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Sbg_insets^T^Sb^S+2^St^S-2^Sl^S+2^Sr^S-2^t^Svflip^b^StileSize^N0^Sscripts^T^t^Sanchor^SUIParent^Slevel^N0^Sbg_texture^SSolid^Sbg_blend^SBLEND^Sy^N-516.02357172966^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Sborder_color^T^Sa^N1^Sr^N0^Sg^N0^Sb^N0^t^Sborder_texture^SSkinner~`EditBox/ScrollBar~`Border^Sbg_color^T^Sa^N1^Sr^F5651576002974740^f-55^Sg^F6216733603272213^f-55^Sb^F5510286602900374^f-55^t^Swidth^F6849952072335361^f-44^Srotation^N0^Sx^F-4875645675896832^f-43^Sbg_alpha^N1^Sborder_edgeSize^N14^Sheight^F5763089660116991^f-45^Smouse^b^Stext^T^Sy^N0^Sfont^SBlizzard^SjustifyH^SCENTER^Sx^N0^Scolor^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N12^t^Stiling^b^t^t^^


    Here's my layout. I need to script P6-P9 frames. P6 is my raid frame (a.k.a Grid background), P7 is Omen's background. P8 is pet bar frame and P9 is Stance bar frame (stealth button for my rogue). I want P6 to appear only when i'm in raid and resize according to raid size, P7 to appear only when i togle Omen, P8 when i play hunter or mage and P9 when i play rogue. As i've said, i'm new to such scripting so any help would be appreciated.
    Thanks.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    All frames are parented to UIParent, if it's this what you have asked for.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Hello
    i've been trying to script my kgpanels all day today, but it did not work for me. I've Been using code posted on this thread but could not get it work for me, so i decided to ask for help.
    So here it goes:

    OnLoad
    self:RegisterEvent("PLAYER_ENTERING_WORLD")
    self:RegisterEvent("PARTY_MEMBERS_CHANGED")
    self:RegisterEvent("RAID_ROSTER_UPDATE")

    OnEvent
    local rmems = GetNumRaidMembers()
    
    self:Hide()
    
    if (rmems > 0 and rmems < 11) then
       self:SetWidth(15)
       self:Show()
    end
    
    if (rmems > 0 and rmems < 26) then
       self:SetWidth(278)
       self:Show()
    end
    
    if (rmems > 0 and rmems < 41) then
       self:SetWidth(398)
       self:Show()
    end

    here i tried to make a panel to become visible adjust it's size when i join raid (only) groups of different sizes. It becomes visible when i join raid, but it does not resize - it is always of the same default size i set before starting scripting on it. I cannot see the flaw in my code.

    OnLoad
    self:RegisterEvent("PLAYER_ENTERING_WORLD")
    self:RegisterEvent("PARTY_MEMBERS_CHANGED")
    self:RegisterEvent("RAID_ROSTER_UPDATE")

    OnEvent
    local pmems = GetNumPartyMembers()
    local rmems = GetNumRaidMembers()
    
    self:Hide()
    
    if (pmems > 0) then
       self:Show()
    end
    
    if (rmems > 0) then
       self:Show()
    end


    here i tried to make a panel (Omen background) to pop up when i join party or raid. Similar code, but the panel is always visible. Again cannot see the flaw. If possible could you please provide me with code where this panel appears only hwen i toggle omen?

    And third thing is that i haev a hunter as one of my chars, and i want his pet bar to have a separate panel that is only visible for a hunter, but is on the same layout. I created it, set it invisible, but now cannot make it appear when i log on my hunter.

    Seems this is all for now. Waiting for your answers.

    Thanks
    Posted in: General AddOns
  • To post a comment, please or register a new account.