• 0

    posted a message on Grid
    Quote from yoshimo
    Sometimes after Herald Volazjs Insanity in An Kahet my Grid displays debuffs that dont exist (any more?)
    The unitguidbranch should "fix" that , shouldnt it?


    Yes, it does. I've run AK a few times with the unitguid branch and Grid behaved as it should.
    Posted in: Grid & Grid2
  • 0

    posted a message on Lib UTF8
    'É' is two octets in UTF-8.

    If you are using string.sub to get the first 'character' use string.utf8sub instead.
    Posted in: Libraries
  • 0

    posted a message on Lib UTF8
    The error being on line 84 indicates that your string ends with an octet between 194 and 223 (inclusive) which in UTF8 indicates that there should be another octet following it. Hence the "UTF-8 string terminated early" error.
    Posted in: Libraries
  • 0

    posted a message on Cant load UTF8
    Its official home is still at http://grid.13th-floor.org/svn/trunk/UTF8/
    Posted in: AddOn HELP!
  • 0

    posted a message on Cant load UTF8
    Hooray for people using the UTF8 library!

    I should probably create an official project for it, but I don't ever expect to make changes to it.
    Posted in: AddOn HELP!
  • 0

    posted a message on Grid
    Quote from phyltr
    Ok, I'm a bit confused by the syntax. In the example you posted per my ideal layout, you set [FONT=monospace]'[/FONT]unitsPerColumn = 9' but we don't reset maxColumns which, unless I'm mistaken, is set in Grid to '5' unless by redefining defaults reverts it to nil which is still confusing because it would then functionally be '1', no?

    So, the example you posted works, obviously, but...why? It seems like "unitsPerColumn" should define the number of rows but it seems to actually define the number of columns and maxColumns is never reset so it seems like i should just have 1 long column or 5 columns 9 rows long.

    Unless by setting "Horizantal Groups" I've essentially reversed rows and columns...which I now think is the case and just need to turn my head to the side to not get confused in the column/row terminology.


    Horizontal groups does exactly that :). It makes your "columns" horizontal.

    By default each header is one column. The [1] [2] and [3] there are defining new headers so that your layout will always have the same number of columns.

    I could have set maxColumns to '3' and created only one header but then it would grow to fit however many people were in your raid group (well, in groups 1-5). Most people seem to prefer having Grid with a fixed-width layout since it is easier to make it fit in their interface.
    Posted in: Grid & Grid2
  • 0

    posted a message on textureString format?
    IIRC those 4 are the arguments to SetTexCoord.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Grid
    Quote from phyltr
    AddLayout you mean? :)

    Also thanks for the help, I'll try to put some sort of tutorial together and shoot it your way.


    Err, yes... AddLayout.

    Available settings from SecureTemplates.lua

    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

    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") (Grid actually defaults this to "NAME")

    sortDir = ["ASC", "DESC"]
    -- defines the sort order (Default: "ASC")

    groupBy = [nil, "GROUP", "CLASS"]
    -- (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)

    startingIndex = [NUMBER]
    -- the index in the final sorted unit list at which to start displaying units (Default: 1)
    Posted in: Grid & Grid2
  • 0

    posted a message on Grid
    Quote from phyltr
    So, I may be touching on a subject that has already been covered, but in my searching it just seems like the answer is "do it with a mod", but in my experience in BC and now, the notion of groups (from my resto shaman experience anyway) is a relatively antiquated and largely useless notion in raids now. I was using RDX and am working to switch to Grid, but the one thing I miss is being able to setup an arbitrary row/column breakdown and sort by group or class in an order I specify. Ideally, I would like my 25-man grid to be 2 rows of 9 columns and 1 row of 7, sorted by warriors first, druids second, etc. I understand a lot of healing was done by groups in the past, but in my experience it really doesn't matter who's in group 1, group 2, etc.

    I love using Grid because its just SO much easier to configure than RDX. 30 seconds to add a debuff vs. like 3 minutes? Yes please! But I would really love it if Grid incorporated those sorting capabilities.


    Grid's layouts are as flexible as the secure headers allow. However, I don't feel that adding an in-game layout editor is worth the time and effort when the included layouts are good enough for the majority of the users.

    That said, it is very simple to create a custom layout as an addon.

    MyGridLayout.lua
    GridLayout:AddLayout("My Layout", {
            defaults = {
                unitsPerColumn = 9,
                groupFilter = "1,2,3,4,5",
                groupBy = "CLASS",
                groupingOrder = "WARRIOR,DRUID,DEATHKNIGHT,PALADIN,PRIEST,SHAMAN,MAGE,WARLOCK,HUNTER,ROGUE",
            },
            [1] = {
                startingIndex = 1,
            },
            [2] = {
                startingIndex = 10,
            },
            [3] = {
                startingIndex = 19,
            },
        })


    MyGridLayout.toc
    ## Interface: 30000
    ## Title: MyGridLayout
    ## Notes: A custom layout I wrote for Grid.
    ## Author: me
    ## Dependencies: Grid
    
    MyGridLayout.lua


    If you found this useful, please consider rewriting it as a tutorial and sending it to me so that I can improve the documentation for Grid. I've found that as the author, I make assumptions and take things for granted that result in documentation that is only useful to people who have a similarly intimate knowledge of Grid.
    Posted in: Grid & Grid2
  • 0

    posted a message on Working with variable number of return values
    One of these things is not like the other.

    local function tail1(x, t, ...)
    	if not x then return false end
    	return t == "binder" or tail1(...)
    end
    
    local function tail2(x, t, ...)
    	if not x then
    		return false
    	end
    
    	if t == "binder" then
    		return true
    	else
    		return tail2(...)
    	end
    end
    


    $ luac -l tailrecursion.lua 
    
    main <tailrecursion.lua:0,0> (5 instructions, 20 bytes at 0x100bd0)
    0+ params, 2 slots, 0 upvalues, 2 locals, 0 constants, 2 functions
    	1	[4]	CLOSURE  	0 0	; 0x100cd0
    	2	[4]	MOVE     	0 0
    	3	[16]	CLOSURE  	1 1	; 0x100ec0
    	4	[16]	MOVE     	0 1
    	5	[16]	RETURN   	0 1
    
    function <tailrecursion.lua:1,4> (14 instructions, 56 bytes at 0x100cd0)
    2+ params, 5 slots, 1 upvalue, 3 locals, 1 constant, 0 functions
    	1	[2]	TEST     	0 0 1
    	2	[2]	JMP      	2	; to 5
    	3	[2]	LOADBOOL 	3 0 0
    	4	[2]	RETURN   	3 2
    	5	[3]	EQ       	1 1 -1	; - "binder"
    	6	[3]	JMP      	5	; to 12
    	7	[3]	GETUPVAL 	3 0	; tail1
    	8	[3]	VARARG   	4 0
    	9	[3]	CALL     	3 0 2
    	10	[3]	JMP      	2	; to 13
    	11	[3]	LOADBOOL 	3 0 1
    	12	[3]	LOADBOOL 	3 1 0
    	13	[3]	RETURN   	3 2
    	14	[4]	RETURN   	0 1
    
    function <tailrecursion.lua:6,16> (14 instructions, 56 bytes at 0x100ec0)
    2+ params, 5 slots, 1 upvalue, 3 locals, 1 constant, 0 functions
    	1	[7]	TEST     	0 0 1
    	2	[7]	JMP      	2	; to 5
    	3	[8]	LOADBOOL 	3 0 0
    	4	[8]	RETURN   	3 2
    	5	[11]	EQ       	0 1 -1	; - "binder"
    	6	[11]	JMP      	3	; to 10
    	7	[12]	LOADBOOL 	3 1 0
    	8	[12]	RETURN   	3 2
    	9	[12]	JMP      	4	; to 14
    	10	[14]	GETUPVAL 	3 0	; tail2
    	11	[14]	VARARG   	4 0
    	12	[14]	TAILCALL 	3 0 0
    	13	[14]	RETURN   	3 0
    	14	[16]	RETURN   	0 1
    
    Posted in: Lua Code Discussion
  • 0

    posted a message on Working with variable number of return values
    Since I've already posted in this thread, I can't ignore the innacurate information in some of the replies.

    You don't need to worry about the size of your SavedVariables file. Auctioneer manages just fine with storing huge amounts of data.

    You don't need AceDB to store tables in SavedVariables and never have needed it.

    Store your lists of item ids in a table. Don't go messing around with strsplit/string.find. Looking up the value associated with a table key is very fast in lua.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Working with variable number of return values
    Look at how it's done in GossipFrame.lua in the default interface.

    GossipFrameOptionsUpdate(GetGossipOptions());
    
    ...
    
    function GossipFrameOptionsUpdate(...)
    	local titleButton;
    	local titleIndex = 1;
    	local titleButtonIcon;
    	for i=1, select("#", ...), 2 do
    		if ( GossipFrame.buttonIndex > NUMGOSSIPBUTTONS ) then
    			message("This NPC has too many quests and/or gossip options.");
    		end
    		titleButton = getglobal("GossipTitleButton" .. GossipFrame.buttonIndex);
    		titleButton:SetText(select(i, ...));
    		GossipResize(titleButton);
    		titleButton:SetID(titleIndex);
    		titleButton.type="Gossip";
    		titleButtonIcon = getglobal(titleButton:GetName() .. "GossipIcon")
    		titleButtonIcon:SetTexture("Interface\\GossipFrame\\" .. select(i+1, ...) .. "GossipIcon");
    		titleButtonIcon:SetVertexColor(1, 1, 1, 1);
    		GossipFrame.buttonIndex = GossipFrame.buttonIndex + 1;
    		titleIndex = titleIndex + 1;
    		titleButton:Show();
    	end
    end
    Posted in: Lua Code Discussion
  • 0

    posted a message on Grid
    Quote from yoshimo
    why cant incoming heals not tell units of the same name apart?
    where is the problem?


    The UNIT_SPELLCAST_SENT event only provides the name of the target.

    I've asked to in the UI Suggestions thread to have the target's guid added to the UNIT_SPELLCAST_SENT event. We'll have to wait a few patches to see if Blizzard decides to change things.
    Posted in: Grid & Grid2
  • 0

    posted a message on Grid party pets in group 2
    What Phanx said was true when that part of Grid was written.

    The Blizzard party and raid headers actually share most of the same code now. I've got pets showing as a separate group in the unitguid branch because I overhauled the layout system. This of course means that once I move the unitguid branch to trunk people will start complaining that they want pets shown in the group the old way, but it's not worth it.

    If you want to try out the unitguid branch just to have pets as a separate group, I wouldn't recommend it since the unitguid branch breaks most existing layout and all existing status addons. Also, I'm still in the middle of making a few more big changes and things will break every now and then.
    Posted in: AddOn HELP!
  • 0

    posted a message on LibUnitAura?
    SpecialEvents Auras is Ace2 but would be a good starting point.
    Posted in: Libraries
  • To post a comment, please or register a new account.