Even spaced hotbar (#22252)

* Fix spacing on hotbar

* more tweaksies
This commit is contained in:
Nemanja
2023-12-11 06:37:51 -05:00
committed by GitHub
parent cf3a5fe747
commit b37b988ce3
8 changed files with 54 additions and 46 deletions

View File

@@ -10,6 +10,8 @@ public sealed class HandsContainer : ItemSlotUIContainer<HandButton>
public int ColumnLimit { get => _grid.Columns; set => _grid.Columns = value; }
public int MaxButtonCount { get; set; } = 0;
public int MaxButtonsPerRow { get; set; }= 6;
/// <summary>
/// Indexer. This is used to reference a HandsContainer from the
/// controller.
@@ -36,6 +38,7 @@ public sealed class HandsContainer : ItemSlotUIContainer<HandButton>
_grid.AddChild(newButton);
}
_grid.Columns = Math.Min(_grid.ChildCount, MaxButtonsPerRow);
return base.AddButton(newButton);
}