aloe effect
This commit is contained in:
parent
de33b6bc15
commit
5a6eb151ae
7 changed files with 212 additions and 70 deletions
|
|
@ -15,48 +15,18 @@ public partial class CYSFocusSetup : Node
|
|||
|
||||
Control control = grid.GetChild<Control>(i);
|
||||
|
||||
// If it isn't leftmost element
|
||||
if (x != 0)
|
||||
{
|
||||
control.FocusNeighborLeft = control.GetPathTo(grid.GetChild(PositionToIndex(x - 1, y)));
|
||||
}
|
||||
// If it isn't upmost element
|
||||
if (y != 0)
|
||||
{
|
||||
control.FocusNeighborTop = control.GetPathTo(grid.GetChild(PositionToIndex(x, y - 1)));
|
||||
}
|
||||
else
|
||||
if (y == 0)
|
||||
{
|
||||
control.FocusNeighborTop = control.GetPathTo(textContainer);
|
||||
}
|
||||
// If it isn't rightmost element
|
||||
if (x != grid.Columns - 1 && i != grid.GetChildCount())
|
||||
if (x == grid.Columns - 1)
|
||||
{
|
||||
control.FocusNeighborRight = control.GetPathTo(grid.GetChild(PositionToIndex(x + 1, y)));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (y != 0)
|
||||
{
|
||||
control.FocusNeighborRight = control.GetPathTo(grid.GetChild(PositionToIndex(x + 1, y - 1)));
|
||||
}
|
||||
else
|
||||
{
|
||||
control.FocusNeighborRight = control.GetPathTo(button);
|
||||
}
|
||||
}
|
||||
if (PositionToIndex(x, y + 1) < grid.GetChildCount())
|
||||
{
|
||||
control.FocusNeighborBottom = control.GetPathTo(grid.GetChild(PositionToIndex(x, y + 1)));
|
||||
control.FocusNeighborRight = control.GetPathTo(button);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
QueueFree();
|
||||
}
|
||||
private int PositionToIndex(int x, int y)
|
||||
{
|
||||
return y * grid.Columns + x;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue