GridCustomLayouts
An extension for Grid.
GridLayoutLayouts.lua file contains many "Layouts" to arrange the unit buttons. Sometimes we may find it doesn't meet the needs.
This extension makes it possible to add new layouts in game. And it simplified the code to describe a layout.
Click "Grid - Layouts - Custom Layouts" to bring up a edit frame.
Each line stands for a Unit Button Group. The Grammer is:
attribute1=value1;attribute2=value2;...;attributeN=valueN;
List of the attributes
================================================
showRaid = [BOOLEAN] - true if the header should be shown while in a raid
showParty = [BOOLEAN] - true if the header should be shown while in a party and not in a raid
showPlayer = [BOOLEAN] - true if the header should show the player when not in a raid
showSolo = [BOOLEAN] - true if the header should be shown while not in a group (implies showPlayer)
nameList = [STRING] - a comma separated list of player names (not used if 'groupFilter' is set)
groupFilter = [1-8, STRING] - a comma seperated list of raid group numbers and/or uppercase class names and/or uppercase roles
strictFiltering = [BOOLEAN] - if true, then characters must match both a group and a class from the groupFilter list
sortMethod = ["INDEX", "NAME"] - defines how the group is sorted (Default: "INDEX")
sortDir = ["ASC", "DESC"] - defines the sort order (Default: "ASC")
groupBy = [nil, "GROUP", "CLASS", "ROLE"] - specifies a "grouping" type to apply before regular sorting (Default: nil)
groupingOrder = [STRING] - specifies the order of the groupings (ie. "1,2,3,4,5,6,7,8")
maxColumns = [NUMBER] - maximum number of columns the header will create (Default: 1)
unitsPerColumn = [NUMBER or nil] - maximum units that will be displayed in a singe column, nil is infinate (Default: nil)
The simplify is:
You don't need the entire class/role name, just the start part of it :
WARLOCK or WARLOC or WARL or WL -> "WARLOCK"
WARRIOR or WARR -> "WARRIOR"
MAINT or MT -> "MAINTANK"
MAINA or MA -> "MAINASSIST"
5/2 -> unitsPerColumn="5";maxColumns="2"
PET -> isPetGroup=true
INDEX or NAME -> sortMethod="INDEX" or sortMethod="NAME"
ASC or DESC -> sortDir="ASC" or sortDir="DESC"
STRICT -> strictFiltering="true"
GROUP or CLASS or ROLE -> groupBy="GROUP" or groupBy="CLASS" or groupBy="ROLE"
You don't need to write "groupFilter=", for example:
1,2,3,4,5 is just the same as groupFilter="1,2,3,4,5"
WARR,PAL,DRU is just the same as groupFilter="WARRIOR,PALADIN,DRUID"
If the group name is not group ids and not class or role names, for example:
Abcde,Xyz will be parsed to nameList="Abcde,Xyz"
That's all. A little complicated though. Advanced user only :(
Actually, I don't use this much, just put it here for sharing.
Attribute: noRepeat = true
Now you can add a NOREPEAT(NOREP,NOR and NR is just the same) attribute to non-pet group header, for example
WARRIOR,PAL;NOREPEAT 1;NOREPEAT 2;NOREPEAT 3;NOREPEAT 4;NOREPEAT 5;NOREPEAT Someone,Anotherone
In the above layout, the first group will contains WARRIORs and PALADINs, but not Someone or Anotherone.
And the next 5 groups will contains team 1-5 members, but not Someone or Anotherone, neither any WARRIORs or PALs.
Actually, group headers with NOREPEAT are parsed to specified nameList groups, therefore the 'groupBy' attribute will be ignore.
I think if I still have wow client on my harddisk, I would keep it usable.
Thanks for your inspiring comment... I never thought this mod so helpful(shy:).
I think your problem is an usage problem of recent Grid versions. The layout of each "party_state" is set seperately. In menu "Grid - Layout" there are "Solo Layout, Raid Layout, Heroic Layout, etc". When you save CustomLayouts, it only set your layout of CURRENT party_state. If your raid leader changes difficulty to heroic, Grid will change the layout to the former one you use in that party_state.
If that is the situation, you just need to manually choose the layout in Grid - Layout menu. Hope this helpful.
And I made a patch of origin GridLayout.lua, It solves dc in combat, and add a FORCE LAYOUT menu, which will be used by Grid unless it is set to NONE. I post it here: GridLayout.lua
bug report: been noticing that CustomLayouts arent being recalled by Grid. the Customlayout is still saved, but when joining a heroic raid for instance, the unit frames do not reflect the CustomLayout. usually just toggling between a default layout and then back to the CustomLayout fixes this but tonight i had to delete all custom layouts, re-log, then re-type, save, and choose my CustomLayout.
once again, thanks very very much for your efforts. ive been promoting your addon to all my guild members.
Warbaby.... thank you sooooo much!!! these examples worked perfectly for what i wanted. and thanks for this addon. i got half my guild using it now.
Grid is now a perfect fit for my UI.
woot thanks Warbaby.. this sounds like exactly what i want. will try it when i get home from work.
much appreciated.
1. 每次login进去的时候都会提示以下错误:GridCustomLayouts.lua:328: bad argument #1 to 'pairs' (table expected, got nil)
2. 每次login进去都会把grid的位置重置到屏幕的正中间。
3. 在CustomLayout中增添一个新的layout,例如叫test1,可以实现NOREPEAT的功能。但是当logout再login之后,在Grid的选择layout的下拉框中就找不到test1了,虽然在CustomLayout的编辑器中还有test1存在,但它不再存在于Grid的layout选择当中。如果我logout之前选择的是test1,下次login进来的时候Grid的frame就不见了,因为layout选项那一栏是空白的,Grid找不到test1。
我用的Grid version 1.30100.2009041601
发现如果用了NOREPEAT属性,就无法按照小组或者职业顺序排序了,看了一下暴雪的代码,似乎没法解决。
Yes, for example :
2 GROUPS, one has 15 units, another has 10 units. The first 5 units of GROUP 1 are in "raid group 1", etc. And the units in GROUP 2 are sorted by their CLASS.
This layout shows only 1 GROUP, but in 2 column (it looks just like there are 2 GROUPs). The first COLUMN shows 13 units, and the second shows 12 units(assume that you are in a 25 raid). And they are sorted by raid group. (The 3rd group is divided into 2 columns).
Oh, actually, by using "groupBy=GROUP" and "groupingOrder=3,2,1,4,5" attribute, you can specify the order of the groups, and the last group may be left out. But you can never specify to individual person.
oh ive very sure i have a misunderstanding lol.. this stuff is all very foreign to me. I love Grid but for all its customizability i cant fathom why it doesnt include a more user-defined layout. im assuming there are good reasons why not but i dont understand them.
so basically youre saying - with your addon - the best i can do is create 2 columns of 10 and i cant specify which 5 of the raid will be left out? if so, can you tell me if this is will ever be implemented? or is it an inherent impossibility due to Grid or something?
thanks very much for your reply
edit ok i read your reply a bit closer... so i can make 2 GROUPs which will show units for all 25 players in a Heroic Raid but i can organize them by raid group 1,2,3, etc?
至于自由拖动那是锦上添花,确实未必需要。
加油!
另外测试了一下,不可能实现完全自由的布局。暴雪的机制只提供按照名字(字母顺序)或者按照团队ID进行排列。即使提供了nameList="D,C,A,B", 顺序也无法控制。所以插件功能基本不会增加了
I think you have a misunderstanding with maxColumns and unitsPerColumn.
They are not layout-level attributes, they are group-level (or header-level).
So, a single line with only "maxColumns=3;unitsPerColumn=10" will be illegal, because it doesn't have any groupFilters or nameLists.
An example:
The above layout means that you have two GROUPs.
The first one has 2 columns. Each of the column has 10 buttons. So there will be at max 2*10 units, the rest ones will not be shown. The order who will be shown and who will not, can't be specified.
The second one will show the first 5 units of the 4 tank Classes. Also, you don't know who will be ommited.
Need help with a Heroic Raid custom layout. Im not familiar with these commands and im getting errors trying to create three columns - two of them 10-unit columns, one of them 5 units.
I created my Custom Layout and then tried entering:
"maxColumns=3;unitsPerColumn=10"
and
"maxColumns=3
unitsPerColumn=10"
i got an error message and Grid made one single column of 20 or so raid units.
Any help would be greatly appreciated.
你说的情况也是我遇到的,不然不会想到编写这个插件。最近我也确实没再用这个,主要原因也是因为单位重复的问题。如果能够完全实现NOREPEAT属性的功能,我想这个插件的意义会大大提高。之前没有什么人关注,也就没有什么修改的动力。我最初发在这里http://bbs.cwowaddon.com/thread-5580-1-4.html
实际上,WoLK的小队概念已经很弱了,有时候跟团长说说,调调位置,比什么来的都快。。。
至于全自由拖动的问题,这个实际上仅仅是界面的问题,无非就是像默认团队面板那样,把25个人的按钮拖动后,生成全部是nameList的layout。只是我觉得这个意义不太大,每次团队换人都要重新设置,太麻烦。而且,做界面太费事了哈
目前的考虑,就是把NOREPEAT属性完善了,看看实际效果再说了。
你回复中提到的正是我希望的效果。之所以有这样的想法,是因为以下的原因。我是一个治疗,在一个25人的团队中,有时候我只需要集中治疗5个人,这5个人可能分别分布在1-5组中。如果按照grid的默认排列(5x5),他们之间可能相隔比较远,不方便查看和点击。所以如果这5个人能够集中放在一个header下面,排列在其他所有组之前,会有很大帮助。例如
nameList="Aa,Bb,Cc,Dd,Ee"
1;NOREPEAT
2;NOREPEAT
3;NOREPEAT
4;NOREPEAT
5;NOREPEAT
两个典型的可以使用到以上布局的首领战是:(1)Naxx的4DK,在后场组。(2)奥杜尔的索林姆,在通道组。后场组和通道组都远离main raid group,所以能够把这些人集中在一个header下面,就不需要在整个grid frame中寻找他们了。
在以上的基础上,如果还能有些附加的功能就好了。例如可以右键单击某人的unit,然后选择他到nameList那一组。因为有些人的名字不方便输入(法文、德文、希腊文字符...)。还有就是能够始终默认把自己放在nameList的最前面。
更完美的就是能够随意拖放unit。例如一个5x5的frame,可以用滑鼠拖放来自由布局,不受分组或是职业的限制,就好像在Windows的桌面上能随意拖放图标的位置,Windows会自动根据图标拖放的位置自动重新排序布局。再进一步就是可以随意改变frame的格局,一个5x5的frame,可以通过拖拉边框而自动变成10x3,4x7等等的格局。
在Grid的框架下,是不是无法实现这些功能?似乎是没有类似功能的Grid附件。我没有编写addon的经验,只是根据自己使用的感觉说出一些想法,所以以上说的设想可能过于复杂,甚至脱离实际,请勿见笑。不敢占用你太多的宝贵时间,如果能够准确告知我这些想法的可行性,就已经十分感激了。
如果有其他的中文网站(简繁皆可)是你发布插件的主要站点,请告诉我地址,我想收藏一下,多谢。
This is because the blizzard secure templates for the unit button headers. There is no way to "substract" some units from a header.
I was thinking over this. Maybe we can first parse the layout to totally name lists. for example:
nameList="Abcde,Xyz"
1;NOREPEAT
2;NOREPEAT
Before enterning combat, we get the names of group 1 and group 2, and take out "Abcde" and "Xyz", and make it actually
nameList="Abcde,Xyz"
nameList="Ddd,Eee,Fff,Ccc"
nameList="Qqq,Www"
It is a little difficult to implement, but it is possible.
Need time though.
(Why don't we speak Chinese...:)
Lets say I am in a 10 man raid group and I have the CustomLayouts set as follows:
nameList="Abcde,Xyz"
1
2
This will give me a grid frame with 3 columns with the first column showing only "Abcde and Xyz", the 2nd and 3rd columns are for group 1 and 2, respectively. The problem is that Abcde and Xyz will show twice in the grid frame. They first appear in the first column as they have been nameList'ed. They then appear again in either 2nd or 3rd column depending on which group they are in.
Is there a way that I can have them shown only once? That means if they are nameList'ed under one header, they should not appear in anywhere else other than under that header. The same problem goes with groupFilter. For example if I have
groupFilter="ZS,DK";groupBy=CLASS
1
2
So whoever is a warrior or DK will show in first column but they will again show in either the 2nd or 3rd column.
Could you please help me with this?