diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_InventoryUI.cs b/Assets/PerfectWorld/Scripts/Managers/EC_InventoryUI.cs index 817318d79f..83b2d9e1c9 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_InventoryUI.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_InventoryUI.cs @@ -58,6 +58,9 @@ namespace BrewMonster.Scripts.Managers [Header("Stack combine — merge into another stack (C++ inventory drag-merge, assign in Inspector)")] [SerializeField] private Button combineStackButton; + [Header("Sort / arrange pack (C++ DlgInventory arrange)")] + [SerializeField] private Button sortInventoryButton; + private int _splitAmount = 1; private int _splitMaxAmount = 1; @@ -137,6 +140,7 @@ namespace BrewMonster.Scripts.Managers WireBagTabButtons(); WireSplitUI(); WireCombineUI(); + WireSortInventoryUI(); //if (currentDragImage == null) //{ @@ -228,6 +232,60 @@ namespace BrewMonster.Scripts.Managers } } + private void WireSortInventoryUI() + { + ResolveSortInventoryButton(); + if (sortInventoryButton != null) + { + sortInventoryButton.onClick.RemoveAllListeners(); + sortInventoryButton.onClick.AddListener(OnSortInventoryClicked); + } + } + + private void ResolveSortInventoryButton() + { + if (sortInventoryButton != null) + return; + + var buttons = GetComponentsInChildren