@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,39 +24,46 @@
|
||||
Visible="False"/>
|
||||
</BoxContainer>
|
||||
</Control>
|
||||
<inventory:ItemSlotButtonContainer
|
||||
Name="InventoryHotbar"
|
||||
Access="Public"
|
||||
Visible="False"
|
||||
Columns="10"
|
||||
SlotGroup="Default"
|
||||
ExpandBackwards="True"
|
||||
VerticalExpand="True"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Bottom"
|
||||
/>
|
||||
<BoxContainer Orientation="Horizontal" Name="Hotbar">
|
||||
<BoxContainer Orientation="Vertical">
|
||||
<inventory:ItemSlotButtonContainer
|
||||
Name="SecondHotbar"
|
||||
SlotGroup="SecondHotbar"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalExpand="False"
|
||||
Columns="6"
|
||||
HorizontalExpand="True"/>
|
||||
<hands:HandsContainer
|
||||
Name="HandContainer"
|
||||
Name="InventoryHotbar"
|
||||
Access="Public"
|
||||
Visible="False"
|
||||
Columns="10"
|
||||
SlotGroup="Default"
|
||||
ExpandBackwards="True"
|
||||
VerticalExpand="True"
|
||||
HorizontalAlignment="Center"
|
||||
ColumnLimit="6" />
|
||||
<inventory:ItemSlotButtonContainer
|
||||
Name="MainHotbar"
|
||||
SlotGroup="MainHotbar"
|
||||
VerticalExpand="False"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalExpand="True"
|
||||
Columns="6"
|
||||
/>
|
||||
Margin="0 0 0 4"
|
||||
/>
|
||||
<BoxContainer Orientation="Horizontal" Name="Hotbar" HorizontalAlignment="Center">
|
||||
<inventory:ItemSlotButtonContainer
|
||||
Name="SecondHotbar"
|
||||
SlotGroup="SecondHotbar"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalExpand="False"
|
||||
ExpandBackwards="True"
|
||||
Columns="6"
|
||||
HorizontalExpand="False"/>
|
||||
<hands:HandsContainer
|
||||
Name="HandContainer"
|
||||
Access="Public"
|
||||
HorizontalAlignment="Center"
|
||||
HorizontalExpand="False"
|
||||
ColumnLimit="6"
|
||||
Margin="4 0 4 0"/>
|
||||
<inventory:ItemSlotButtonContainer
|
||||
Name="MainHotbar"
|
||||
SlotGroup="MainHotbar"
|
||||
VerticalExpand="False"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalExpand="False"
|
||||
ExpandBackwards="True"
|
||||
Columns="6"
|
||||
/>
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</widgets:HotbarGui>
|
||||
|
||||
@@ -68,6 +68,7 @@ public abstract class ItemSlotUIContainer<T> : GridContainer, IItemslotUIContain
|
||||
{
|
||||
if (!Children.Contains(newButton) && newButton.Parent == null && newButton.SlotName != "")
|
||||
AddChild(newButton);
|
||||
Columns = ChildCount;
|
||||
return AddButtonToDict(newButton);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user