aloe effect

This commit is contained in:
Rendo 2025-07-30 03:52:34 +05:00
commit 5a6eb151ae
7 changed files with 212 additions and 70 deletions

View file

@ -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;
}
}