Grid

416 - Allow SetTextCoord parameters to be pass to SendStatusGained

What is the enhancement in mind? How should it look and feel?

I would like to be able to pass the SetTextCood parameters to the SendStatusGained from a Grid module so that Grid apply those parameter to the target destination indicator.

Please provide any additional information below.

Reference to SetTexCoord.

Some ways that this could be implemented

Implement a table parameter for tex in SendStatusGained

local tex_param = { 
    texture = "Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes", 
    left = 0, 
    right = 0.25,  
    top = 0, 
    bottom = 0.25
}
self.core:SendStatusGained(guid, status, nil, nil, nil, text, nil, nil, tex_param)

Backward compatibility: Grid has to test for for table or string. If it's a string, assume that tex_param is just a string path to the texture and do nothing special for SetTextCood or use 0,1,0,1

Advantage: The table structure would allow to pass the two different types of parameters used by SetTexCoord. Keeps all the texture parameters in one place. Disadvantage: Possible memory garbage generation.

New table parameter specifically for SetTexCoord

local texture = "Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes", 
local tex_param = { 
    left = 0, 
    right = 0.25,  
    top = 0, 
    bottom = 0.25
}
self.core:SendStatusGained(guid, status, nil, nil, nil, text, nil, nil, texture, nil, nil, nil, tex_param)

Backward compatibility: Business as usual if the new parameter is not given

Advantage: The table parameter would allow to pass the two different types of parameters used by SetTexCoord. Less hassle for backward compatibility. Disadvantage: Possible memory garbage generation. The parameter line for SendStatusGained is becomming a bit convoluted.

Add the SetTexCoord parameter at the end of the Texture string

local texture = "Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes:0,0.25,0,0.25"
self.core:SendStatusGained(guid, status, nil, nil, nil, text, nil, nil, texture)

Backward compatibility: Business as usual if the new parameter are not at the end of the string

Advantage: No extra table are created. Keeps all the texture parameters in one place. Disadvantage: Only one way of calling SetTexCoord would be supported

User When Change
Phanx Feb 05, 2011 at 13:56 UTC Changed status from Started to Fixed
Phanx Feb 05, 2011 at 05:40 UTC Changed status from New to Started
Phanx Oct 23, 2010 at 18:11 UTC Changed assigned to from Pastamancer to Phanx
LaoTseu Oct 23, 2010 at 17:02 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • 4 comments
  • Avatar of Phanx Phanx Feb 05, 2011 at 13:55 UTC - 0 likes

    r1411 or higher:

    GridStatus:SendStatusGained(guid,
    	status,
    	priority,
    	range,
    	color,
    	text,
    	value,
    	maxValue,
    	texture,
    	start,
    	duration,
    	stack,
    	texCoords)
    

    texCoords should be a table in the following format, modeled after the color format:

    texCoords = {
    	left = 0.06,
    	right = 0.94,
    	top = 0.06,
    	bottom = 0.94,
    }
    

    For GridStatusDirectionArrows, you'll probably want to do something like generate a table where the keys are the angles, and the values are the appropriate texture coordinate tables.

    If anyone has a good argument for 8-argument texture coordinates I guess I can add that, but I can't think of anything practical at the moment.

  • Avatar of slaren slaren Oct 30, 2010 at 20:37 UTC - 0 likes

    A use case for this: GridStatusDirectionArrows shows direction arrows to other players. To do this, it has images of the arrow pointing at different angles and the addon chooses the appropriate image to display for each unit, based on their direction from the player.

    At this time, since I can't specify the texture coordinates, I have to use a huge amount of small textures, which presumably is a lot more inefficient than it would be if it could use a single, bigger texture and specify the texture coordinates to select each sub-image.

  • Avatar of Phanx Phanx Oct 23, 2010 at 18:11 UTC - 0 likes

    I believe this was discussed way back when, and Pasta decided not to add it; the discussion is probably in the old Grid thread. I'll keep it in mind for the future, but don't expect it any time soon.

  • 4 comments

Facts

Last updated
Feb 05, 2011
Reported
Oct 23, 2010
Status
Fixed - Developer made requested changes. QA should verify.
Type
Enhancement - A change which is intended to better the project in some way
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees