From b6a9e525aa30f6ea7b26ca41c0400b60b7118806 Mon Sep 17 00:00:00 2001
From: miepzerino <o.skotnik@gmail.com>
Date: Thu, 03 Apr 2025 22:24:55 +0000
Subject: [PATCH] fix build

---
 Assets/Scripts/Inventory/InventoryDisplay.cs |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/Assets/Scripts/Inventory/InventoryDisplay.cs b/Assets/Scripts/Inventory/InventoryDisplay.cs
index dfd4f32..0b2690b 100644
--- a/Assets/Scripts/Inventory/InventoryDisplay.cs
+++ b/Assets/Scripts/Inventory/InventoryDisplay.cs
@@ -1,4 +1,5 @@
 using Assets.Scripts.Enums;
+using Assets.Scripts.Helpers;
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -17,6 +18,7 @@
     public GameObject itemNameDescription;
     public GameObject itemDescription;
     public GameObject itemDeleteButton;
+    public GameObject inventoryMaxAmount;
 
     public List<GameObject> itemUIs = new List<GameObject>();
 
@@ -58,15 +60,20 @@
         //}
         if (context.started)
         {
-            inventoryPanel.SetActive(!inventoryPanel.activeSelf);
-            if (inventoryPanel.activeSelf)
-            {
-                UpdateItemContentList();
-            }
-            else
-            {
-                //ClearItemContentList();
-            }
+            ToggleInventoryPanel();
+        }
+    }
+
+    public void ToggleInventoryPanel()
+    {
+        inventoryPanel.SetActive(!inventoryPanel.activeSelf);
+        if (inventoryPanel.activeSelf)
+        {
+            UpdateItemContentList();
+        }
+        else
+        {
+            //ClearItemContentList();
         }
     }
 
@@ -205,7 +212,7 @@
         var scrollrect = itemDescription.transform.parent.parent.GetComponent<ScrollRect>();
         if (scrollrect != null)
         {
-            Debug.Log("Resetting scroll position");
+            //Debug.Log("Resetting scroll position");
             scrollrect.verticalNormalizedPosition = 1; // 0 = top, 1 = bottom
         }
         // Reset the content's position
@@ -223,6 +230,8 @@
 
     private void UpdateItemContentList()
     {
+        UIHelper.UpdateItemMaxCountText(inventoryMaxAmount.GetComponent<TextMeshProUGUI>(), inventory.items.Count, inventory.maxInventorySize);
+
         // First, deactivate all existing itemUIs
         itemUIs.ForEach(itemUI => itemUI.SetActive(false));
 

--
Gitblit v1.9.3