public void Insert(List <ShopItemId> items, bool hideOwnedHack) { m_ScrollInventory.HideItems(); m_ScrollInventory.Clear(); if (items.Count > m_ScrollCache.Count) { Debug.LogError("Scroll cache too small: size " + m_ScrollCache.Count + ", required " + items.Count); } items.Sort(); for (int i = 0; i < items.Count; i++) { //Debug.Log(" " + items.Count + " " + m_ScrollCache.Count + " " + items[i] + m_ScrollCache[i]); m_ScrollInventory.AddItem(items[i], m_ScrollCache[i], new GuiScrollItem(items[i], m_ScrollCache[i], hideOwnedHack)); } //m_ScrollInventory.Sort(); }
public void Insert(List <int> items, bool hideOwnedHack) { m_ScrollInventory.HideItems(); m_ScrollInventory.Clear(); if (items.Count > m_ScrollCache.Count) { Debug.LogError("Scroll cache too small: size " + m_ScrollCache.Count + ", required " + items.Count); } items.Sort(); for (int i = 0; i < items.Count; i++) { //Debug.Log(" " + items.Count + " " + m_ScrollCache.Count + " " + items[i] + m_ScrollCache[i]); int buttonId = items[i]; int textId = labelsText[i]; GUIBase_Widget rootSprite = m_ScrollCache[i]; GUIBase_Sprite icon = m_Icons[i]; m_ScrollInventory.AddItem(buttonId, rootSprite, new GuiResearchItem(rootSprite, icon, textId)); } //m_ScrollInventory.Sort(); }