Beispiel #1
0
        public void AddItem(ListBoxObject item)
        {
            if (!itemList.Contains(item))
            {
                Rectangle location   = GetItemSize(currentCount);
                int       fontHeight = (int)(spriteFont.MeasureString("D").Y *DisplayController.uiScale);

                item.SetLocation(location, fontHeight, currentCount);
                itemList.Add(item);
                currentCount++;
            }
            SetMaxHeight();
        }
Beispiel #2
0
        public bool AddItemUniqueDisplay(ListBoxObject item)
        {
            if (!itemList.Contains(item))
            {
                foreach (ListBoxObject itemIn in itemList)
                {
                    if (itemIn.displayName == item.displayName)
                    {
                        return(false);
                    }
                }

                Rectangle location   = GetItemSize(currentCount);
                int       fontHeight = (int)(spriteFont.MeasureString("D").Y *DisplayController.uiScale);

                item.SetLocation(location, fontHeight, currentCount);
                itemList.Add(item);
                currentCount++;
                SetMaxHeight();
                return(true);
            }
            return(false);
        }