Esempio n. 1
0
        void RefreshSkinsList()
        {
            if (_skinsDropdown != null)
            {
                _availableSkins = SkinLoader.FindAllSkins();
                _skinsDropdown.localizedItems = new string[0];

                _skinsDropdown.AddItem("Vanilla (by Colossal Order)");
                foreach (var skin in _availableSkins)
                {
                    _skinsDropdown.AddItem(String.Format("{0} (by {1})", skin.Name, skin.Author));
                }

                _skinsDropdown.selectedIndex = 0;
                _skinsDropdown.Invalidate();
            }
        }
Esempio n. 2
0
        private void RenameBrushTextField_eventTextChanged(UIComponent component, string newName)
        {
            string currentName = ForestBrush.Instance.BrushTool.Brush.Name;

            if (UserMod.Settings.Brushes.Find(b => b.Name == newName && b.Name != currentName) == null)
            {
                ResetRenameError();
                UIDropDown brushDropDown = owner.BrushSelectSection.SelectBrushDropDown;
                if (newName != brushDropDown.items[brushDropDown.selectedIndex])
                {
                    brushDropDown.items[brushDropDown.selectedIndex] = newName;
                }
                ForestBrush.Instance.BrushTool.Brush.Name = newName;
                brushDropDown.Invalidate();
            }
            else
            {
                SetRenameError();
            }
        }