You're going to need to make 3 eePanels, and have each one parented to grid, and give each one a unique texture. Then create a fourth panel to hold a script to modify the 3 previous eePanels. You would have to take the script on the first page for hiding/showing a frame in a raid, and add it as a script. However, instead of just showing/hiding the THIS panel, you would need to do an if then, elseif, elseif, else end statement to modify the visibility of the 3 other panels.
The first if would check to see if the number of party members was greater than 1 and the number of raid members was less than 6, and show the first panel and hide the other two. The first elseif would check if there was more than 5 raid members, but less than 15 raid members. The second elseif would check if there were more than 14 raid members. The else statement would hide all the panels because none of the other conditions were met (probably don't need this since the panels are parented to Grid, but it can't hurt).
Ok i've tried numerous scripts but to no avail. I therefore just tried your original script for hiding a frame when not in a raid and got this error:
(String" if GetNumPartyMembers() > 4 or GetNumRaidMembers() > 0 then..."):2: unexpected symbol near'
The scripts i've tried were as follows:
"if then GetNumPartyMembers() > 1 or GetNumRaidMembers() < 6 then
Grid BG 5 Man:Show()
elseif GetNumPartyMembers() > 5 or GetNumRaidMembers() < 11 then
Grid BG 10 Man:Show()
elseif GetNumPartyMembers() > 10 or GetNumRaidMembers() < 16 then
Grid BG 15 Man:Show()
elseif GetNumPartyMembers() > 15 or GetNumRaidMembers() < 26 then
Grid BG 25 Man:Show()
else GetNumPartyMembers() > 25 or GetNumRaidMembers() < 41 then
Grid BG 40 Man:Show()
end
end"
and also
"if GetNumPartyMembers() > 1 or GetNumRaidMembers() < 6 If then
eePanel10:Show(Grid BG 5 Man)
elseif
GetNumPartyMembers() > 5 or GetNumRaidMembers() < 11 If then
eePanel10:Show(Grid BG 10 Man)
elseif
GetNumPartyMembers() > 10 or GetNumRaidMembers() < 16 If then
eePanel10:Show(Grid BG 15 Man)
elseif
GetNumPartyMembers() > 15 or GetNumRaidMembers() < 26 If then
eePanel10:Show(Grid Bg 25 Man)
elseif
GetNumPartyMembers() > 25 or GetNumRaidMembers() < 41 If then
eePanel10:Show(Grid Bg 40 Man)
Else end
end"
Unfortunately I have been unable to get any of my scripts to work and neither the original one posted. Any help would be greatly appreciated again
Lua is case sensitive, so end is different than End, etc.
If the example code for hiding/showing a frame isn't working for you, you probably copy&pasted it wrong as I've tested that script.
Here's your original code, modified. Like I said, you'll need a different panel for each texture. I'll pretend these panels are named eePanel1-eePanel5 (you might be able to just hide all the frames, then just show the frame you want, but that might cause the texture to flicker off/on)
function eePanels2:RaidPanelVisibility(self, event, ...)
if GetNumPartyMembers() > 1 and GetNumRaidMembers() < 6 then
eePanel1:Show()
eePanel2:Hide()
eePanel3:Hide()
eePanel4:Hide()
eePanel5:Hide()
elseif GetNumRaidMembers() > 5 and GetNumRaidMembers() < 11 then
eePanel2:Show()
eePanel1:Hide()
eePanel3:Hide()
eePanel4:Hide()
eePanel5:Hide()
elseif GetNumRaidMembers() > 10 and GetNumRaidMembers() < 16 then
eePanel3:Show()
eePanel1:Hide()
eePanel2:Hide()
eePanel4:Hide()
eePanel5:Hide()
elseif GetNumRaidMembers() > 15 and GetNumRaidMembers() < 26 then
eePanel4:Show()
eePanel1:Hide()
eePanel2:Hide()
eePanel3:Hide()
eePanel5:Hide()
elseif GetNumRaidMembers() > 25 and GetNumRaidMembers() < 41 then
eePanel5:Show()
eePanel1:Hide()
eePanel2:Hide()
eePanel3:Hide()
eePanel4:Hide()
end
end
eePanels2:RegisterEvent("PLAYER_ENTERING_WORLD", eePanels2.RaidPanelVisibility)
eePanels2:RegisterEvent("PARTY_MEMBERS_CHANGED", eePanels2.RaidPanelVisibility)
eePanels2:RegisterEvent("RAID_ROSTER_UPDATE", eePanels2.RaidPanelVisibility
-- Create a new ace2 addon for hooking
THIS_Hook = AceLibrary("AceAddon-2.0"):new("AceHook-2.1")
-- Create a function to resize the eePanel when the hooked frame is resized
function THIS_Hook:OnSizeChanged(frame, ...)
THIS:SetHeight(frame:GetHeight() + 15) --Note: The "+ 15" is to have a lil gap between panel side and actual text area. Same reason i have my BGPanel width set to 105%.
end
-- Hook to the frame we want to resize against (ChatFrame1 here)
THIS_Hook:HookScript(ChatFrame1, "OnSizeChanged")
-- Create a new ace2 addon for hooking
THIS_Hook = AceLibrary("AceAddon-2.0"):new("AceHook-2.1")
-- Create a function to resize the eePanel when the hooked frame is resized
function THIS_Hook:OnSizeChanged(frame, ...)
THIS:SetHeight(frame:GetHeight()+10)
end
-- Hook to the frame we want to resize against (ChatFrame1 here)
THIS_Hook:HookScript(eePanelX, "OnSizeChanged") --the eePanelX is the eepanel you want to spy
Does this work for docked frames, it seems that it doesn't resize properly.
Docked Chat frames are when you have one window with multiple tabs on it and clicking each tab changes to that frame. It seems that it works on ChatFrame1 but not 3-5 (2 is Combat log: not docked).
Docked Chat frames are when you have one window with multiple tabs on it and clicking each tab changes to that frame. It seems that it works on ChatFrame1 but not 3-5 (2 is Combat log: not docked).
try adding this to the script:
THIS_Hook:HookScript(ChatFrame3, "OnSizeChanged")
THIS_Hook:HookScript(ChatFrame4, "OnSizeChanged")
THIS_Hook:HookScript(ChatFrame5, "OnSizeChanged")
like that it will monitor every chatframe.
Note: im a total noob in coding and dont know if this will work.. just an idea i had.
Docked Chat frames are when you have one window with multiple tabs on it and clicking each tab changes to that frame. It seems that it works on ChatFrame1 but not 3-5 (2 is Combat log: not docked).
Because each chat frame is separate. When you change chat tabs, that chat frame is shown and the rest are hidden.
You'll either have to make separate, parented eePanels for each chat frame and give them all resize scripts, or you'll need to set the parent to UIParent but anchor it to one of the docked chat frames, and do as Coldfury suggested above. Be warned that things would act weird if you undocked a chat frame doing the latter method.
Quote from Aestil »
Sometimes it feels like the panels load before the elements they are attatched too?
The easiest way to do this is probably to open up the eePanels2.toc file, and append the addon name used by your script to the OptionalDeps field. If you update eePanels2 often, you might want to set the file properties of the .toc to readonly so its not overridden when you update; just make sure you remember you've done so.
Lua is case sensitive, so end is different than End, etc.
If the example code for hiding/showing a frame isn't working for you, you probably copy&pasted it wrong as I've tested that script.
Here's your original code, modified. Like I said, you'll need a different panel for each texture. I'll pretend these panels are named eePanel1-eePanel5 (you might be able to just hide all the frames, then just show the frame you want, but that might cause the texture to flicker off/on)
function eePanels2:RaidPanelVisibility(self, event, ...)
if GetNumPartyMembers() > 1 and GetNumRaidMembers() < 6 then
eePanel1:Show()
eePanel2:Hide()
eePanel3:Hide()
eePanel4:Hide()
eePanel5:Hide()
elseif GetNumRaidMembers() > 5 and GetNumRaidMembers() < 11 then
eePanel2:Show()
eePanel1:Hide()
eePanel3:Hide()
eePanel4:Hide()
eePanel5:Hide()
elseif GetNumRaidMembers() > 10 and GetNumRaidMembers() < 16 then
eePanel3:Show()
eePanel1:Hide()
eePanel2:Hide()
eePanel4:Hide()
eePanel5:Hide()
elseif GetNumRaidMembers() > 15 and GetNumRaidMembers() < 26 then
eePanel4:Show()
eePanel1:Hide()
eePanel2:Hide()
eePanel3:Hide()
eePanel5:Hide()
elseif GetNumRaidMembers() > 25 and GetNumRaidMembers() < 41 then
eePanel5:Show()
eePanel1:Hide()
eePanel2:Hide()
eePanel3:Hide()
eePanel4:Hide()
end
end
eePanels2:RegisterEvent("PLAYER_ENTERING_WORLD", eePanels2.RaidPanelVisibility)
eePanels2:RegisterEvent("PARTY_MEMBERS_CHANGED", eePanels2.RaidPanelVisibility)
eePanels2:RegisterEvent("RAID_ROSTER_UPDATE", eePanels2.RaidPanelVisibility
Hi Evil Thanks for this, i have updated my configs using your code:
works a treat many thanks
* Small 'bug?' i came across was even though i had named all the panels individually..the script still worked them off thir original panel names, i.e. Grid BG 1 was eepanel number 3 when i entered Grid BG 1 it removed a different eepanel texture that was eepanel 3 when created. But apart from that it all works fine :)
You'll either have to make separate, parented eePanels for each chat frame and give them all resize scripts, or you'll need to set the parent to UIParent but anchor it to one of the docked chat frames, and do as Coldfury suggested above. Be warned that things would act weird if you undocked a chat frame doing the latter method.
I actually had it the first way you explained when I first posted the question. Through trial and error I came up with a solution. Still keep the hook on the respective ChatFrameX but when you resize, instead of "frame" put in ChatFrame1 for all the eePanels on all the ChatFrames that are docked.
I just figured out this so i tough maybe other ppl will find it useful.
If you are using Minichat, and have some panels with border using 1 panel for the bg, and 1 panel for the border.
and you want ur panels to minimize with the chat parent ur bgpanel to ChatFrameX, "Anchor to"&"Anchor from" set as middle.Here's the Lua script.
-- Create a new ace2 addon for hooking
THIS_Hook = AceLibrary("AceAddon-2.0"):new("AceHook-2.1")
-- Create a function to resize the eePanel when the hooked frame is resized
function THIS_Hook:OnSizeChanged(frame, ...)
THIS:SetHeight(frame:GetHeight() + 15) --Note: The "+ 15" is to have a lil gap between panel side and actual text area. Same reason i have my BGPanel width set to 105%.
end
-- Hook to the frame we want to resize against (ChatFrame1 here)
THIS_Hook:HookScript(ChatFrame1, "OnSizeChanged")
Then, parent ur "BorderPanel" to eePanelX(the BGpanel). Anchors in middle too. Set the panel width to fit the desired border since we are not touching it with the script.
And here's the script.
-- Create a new ace2 addon for hooking
THIS_Hook = AceLibrary("AceAddon-2.0"):new("AceHook-2.1")
-- Create a function to resize the eePanel when the hooked frame is resized
function THIS_Hook:OnSizeChanged(frame, ...)
THIS:SetHeight(frame:GetHeight()+10)
end
-- Hook to the frame we want to resize against (ChatFrame1 here)
THIS_Hook:HookScript(eePanelX, "OnSizeChanged") --the eePanelX is the eepanel you want to spy
Everything should work.
ie:
anyway, hope it helps
Ok ive just tried this and it looks like everything is shot and doesnt align well at all
i have a BackGround Panel Parented to Chatframe1 and 4 Panels Making the border top, bottem, left and right but soon as i Parent the BG Panel there is large gaps and alignment goes totaly out (will post a screen shot ASAP)
To both of the above questions: to do "borders" like that, you just nest 2 (or three) panels on top of one another by making the inner panel's inset size and level larger than the panel below it.
I created two Panels (Background, Border) for my ChatFrame1 with AddOn: Minichat.
Then I applied the Lua-Scripts form Coldfury to resize the panels when expanding/minimizing Minichat.
Everything worked fine till i did a /reload.
Now everytime after /reload or relog the 2 panels of chatframe1 are having the wrong size and I'm getting this error:
[2007/09/04 16:39:01-1-x1]: <string>:"-- Create a new ace2 addon for hooking...":10: AceHook-2.1: Bad argument #2 to `HookScript' (table expected, got nil)
FuBar-33424\libs\AceLibrary\AceLibrary.lua:133: in function <...nterface\AddOns\FuBar\libs\AceLibrary\AceLibrary.lua:86>
(tail call): ?:
AceHook-2.1-40869 (FuBar):437: in function `HookScript'
<string>:"-- Create a new ace2 addon for hooking...":10: in main chunk
<in C code>: in function `RunScript'
eePanels2-2.0\core.lua:2004: in function `ChangeScript'
eePanels2-2.0\core.lua:517: in function `CreatePanel'
eePanels2-2.0\core.lua:376: in function `InitPanels'
eePanels2-2.0\core.lua:350: in function <Interface\AddOns\eePanels2\core.lua:349>
<in C code>: in function `pcall'
AceAddon-2.0-46764 (FuBar):24: in function <...face\AddOns\FuBar\libs\AceAddon-2.0\AceAddon-2.0.lua:23>
AceAddon-2.0-46764 (FuBar):999: in function `ManualEnable'
AceAddon-2.0-46764 (FuBar):927: in function <...face\AddOns\FuBar\libs\AceAddon-2.0\AceAddon-2.0.lua:920>
<in C code>: ?
AceEvent-2.0-44693 (FuBar):262: in function `TriggerEvent'
AceEvent-2.0-44693 (FuBar):955: in function <...face\AddOns\FuBar\libs\AceEvent-2.0\AceEvent-2.0.lua:948>
---
If I just open the script and don't edit anything, just open and close it everythings fine again.
Since I am no Lua expert I'm not able to reproduce the failure with the message above.
Do you have a script for each panel? Is the code all in one script?
One of the frames/panels aren't created yet when the script is being called. I'm thinking that you have 2 panels, say eePanel1 and eePanel2. Your probably referencing eePanel2 in your eePanel1 script. The problem is that eePanel2 hasn't been created yet.
I suggest you use the auto-resize script in the second post of this thread, and use it for both panels. Assuming you're just using nested panels with different inset sizes, it should work fine. Just change ChatFrame1 to the name of the chat frame you're attaching it to.
Very nice. I have two questions, first, how did you get the hotkeys for your spells to be in the upper right corner, and move around the text in general. Second, how did you do the border around your spells?
[2007/09/04 19:26:13-705-x1]: <string>:"-- Create a new ace2 addon for hooking...":11: AceHook-2.1: Bad argument #2 to `HookScript' (table expected, got nil)
Ace2\AceLibrary\AceLibrary.lua:133: in function <Interface\AddOns\Ace2\AceLibrary\AceLibrary.lua:86>
(tail call): ?:
AceHook-2.1-40869 (Ace2):437: in function `HookScript'
<string>:"-- Create a new ace2 addon for hooking...":11: in main chunk
<in C code>: in function `RunScript'
eePanels2-2.0\core.lua:2004: in function `ChangeScript'
eePanels2-2.0\core.lua:517: in function `CreatePanel'
eePanels2-2.0\core.lua:376: in function `InitPanels'
eePanels2-2.0\core.lua:350: in function <Interface\AddOns\eePanels2\core.lua:349>
<in C code>: in function `pcall'
AceAddon-2.0-46764 (Ace2):24: in function <Interface\AddOns\Ace2\AceAddon-2.0\AceAddon-2.0.lua:23>
AceAddon-2.0-46764 (Ace2):999: in function `ManualEnable'
AceAddon-2.0-46764 (Ace2):927: in function <Interface\AddOns\Ace2\AceAddon-2.0\AceAddon-2.0.lua:920>
<in C code>: ?
AceEvent-2.0-44693 (Ace2):262: in function `TriggerEvent'
AceEvent-2.0-44693 (Ace2):955: in function <Interface\AddOns\Ace2\AceEvent-2.0\AceEvent-2.0.lua:948>
---
wat i do rong?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Ok i've tried numerous scripts but to no avail. I therefore just tried your original script for hiding a frame when not in a raid and got this error:
(String" if GetNumPartyMembers() > 4 or GetNumRaidMembers() > 0 then..."):2: unexpected symbol near'
The scripts i've tried were as follows:
"if then GetNumPartyMembers() > 1 or GetNumRaidMembers() < 6 then
Grid BG 5 Man:Show()
elseif GetNumPartyMembers() > 5 or GetNumRaidMembers() < 11 then
Grid BG 10 Man:Show()
elseif GetNumPartyMembers() > 10 or GetNumRaidMembers() < 16 then
Grid BG 15 Man:Show()
elseif GetNumPartyMembers() > 15 or GetNumRaidMembers() < 26 then
Grid BG 25 Man:Show()
else GetNumPartyMembers() > 25 or GetNumRaidMembers() < 41 then
Grid BG 40 Man:Show()
end
end"
and also
"if GetNumPartyMembers() > 1 or GetNumRaidMembers() < 6 If then
eePanel10:Show(Grid BG 5 Man)
elseif
GetNumPartyMembers() > 5 or GetNumRaidMembers() < 11 If then
eePanel10:Show(Grid BG 10 Man)
elseif
GetNumPartyMembers() > 10 or GetNumRaidMembers() < 16 If then
eePanel10:Show(Grid BG 15 Man)
elseif
GetNumPartyMembers() > 15 or GetNumRaidMembers() < 26 If then
eePanel10:Show(Grid Bg 25 Man)
elseif
GetNumPartyMembers() > 25 or GetNumRaidMembers() < 41 If then
eePanel10:Show(Grid Bg 40 Man)
Else end
end"
Unfortunately I have been unable to get any of my scripts to work and neither the original one posted. Any help would be greatly appreciated again
Thanks Drum
If the example code for hiding/showing a frame isn't working for you, you probably copy&pasted it wrong as I've tested that script.
Here's your original code, modified. Like I said, you'll need a different panel for each texture. I'll pretend these panels are named eePanel1-eePanel5 (you might be able to just hide all the frames, then just show the frame you want, but that might cause the texture to flicker off/on)
Does this work for docked frames, it seems that it doesn't resize properly.
I notice that some panels just dont' seem to work sometimes. Is there a 'reload the eepanels' command?
To force it to load after all other UI elements are loaded? Sometimes it feels like the panels load before the elements they are attatched too?
try adding this to the script:
THIS_Hook:HookScript(ChatFrame3, "OnSizeChanged")
THIS_Hook:HookScript(ChatFrame4, "OnSizeChanged")
THIS_Hook:HookScript(ChatFrame5, "OnSizeChanged")
like that it will monitor every chatframe.
Note: im a total noob in coding and dont know if this will work.. just an idea i had.
Because each chat frame is separate. When you change chat tabs, that chat frame is shown and the rest are hidden.
You'll either have to make separate, parented eePanels for each chat frame and give them all resize scripts, or you'll need to set the parent to UIParent but anchor it to one of the docked chat frames, and do as Coldfury suggested above. Be warned that things would act weird if you undocked a chat frame doing the latter method.
The easiest way to do this is probably to open up the eePanels2.toc file, and append the addon name used by your script to the OptionalDeps field. If you update eePanels2 often, you might want to set the file properties of the .toc to readonly so its not overridden when you update; just make sure you remember you've done so.
Hi Evil Thanks for this, i have updated my configs using your code:
works a treat many thanks
* Small 'bug?' i came across was even though i had named all the panels individually..the script still worked them off thir original panel names, i.e. Grid BG 1 was eepanel number 3 when i entered Grid BG 1 it removed a different eepanel texture that was eepanel 3 when created. But apart from that it all works fine :)
I actually had it the first way you explained when I first posted the question. Through trial and error I came up with a solution. Still keep the hook on the respective ChatFrameX but when you resize, instead of "frame" put in ChatFrame1 for all the eePanels on all the ChatFrames that are docked.
Ok ive just tried this and it looks like everything is shot and doesnt align well at all
i have a BackGround Panel Parented to Chatframe1 and 4 Panels Making the border top, bottem, left and right but soon as i Parent the BG Panel there is large gaps and alignment goes totaly out (will post a screen shot ASAP)
How do I configure EEpanels to get boarders like that?
Then I applied the Lua-Scripts form Coldfury to resize the panels when expanding/minimizing Minichat.
Everything worked fine till i did a /reload.
Now everytime after /reload or relog the 2 panels of chatframe1 are having the wrong size and I'm getting this error:
If I just open the script and don't edit anything, just open and close it everythings fine again.
Since I am no Lua expert I'm not able to reproduce the failure with the message above.
:(
P.S. Sorry for my bad english
One of the frames/panels aren't created yet when the script is being called. I'm thinking that you have 2 panels, say eePanel1 and eePanel2. Your probably referencing eePanel2 in your eePanel1 script. The problem is that eePanel2 hasn't been created yet.
I suggest you use the auto-resize script in the second post of this thread, and use it for both panels. Assuming you're just using nested panels with different inset sizes, it should work fine. Just change ChatFrame1 to the name of the chat frame you're attaching it to.
Here is a screenshot of how I got it btw.
Very nice. I have two questions, first, how did you get the hotkeys for your spells to be in the upper right corner, and move around the text in general. Second, how did you do the border around your spells?
Thanks
Ace2\AceLibrary\AceLibrary.lua:133: in function <Interface\AddOns\Ace2\AceLibrary\AceLibrary.lua:86>
(tail call): ?:
AceHook-2.1-40869 (Ace2):437: in function `HookScript'
<string>:"-- Create a new ace2 addon for hooking...":11: in main chunk
<in C code>: in function `RunScript'
eePanels2-2.0\core.lua:2004: in function `ChangeScript'
eePanels2-2.0\core.lua:517: in function `CreatePanel'
eePanels2-2.0\core.lua:376: in function `InitPanels'
eePanels2-2.0\core.lua:350: in function <Interface\AddOns\eePanels2\core.lua:349>
<in C code>: in function `pcall'
AceAddon-2.0-46764 (Ace2):24: in function <Interface\AddOns\Ace2\AceAddon-2.0\AceAddon-2.0.lua:23>
AceAddon-2.0-46764 (Ace2):999: in function `ManualEnable'
AceAddon-2.0-46764 (Ace2):927: in function <Interface\AddOns\Ace2\AceAddon-2.0\AceAddon-2.0.lua:920>
<in C code>: ?
AceEvent-2.0-44693 (Ace2):262: in function `TriggerEvent'
AceEvent-2.0-44693 (Ace2):955: in function <Interface\AddOns\Ace2\AceEvent-2.0\AceEvent-2.0.lua:948>
---
wat i do rong?