Exemplo n.º 1
0
        /// <summary>
        /// Initializes the species lists.
        /// </summary>
        /// <param name="species"></param>
        /// <param name="aliases"></param>
        public void SetSpeciesLists(List <Species> species, Dictionary <string, string> aliases)
        {
            if (SelectedSpecies != null)
            {
                SelectedSpecies = Values.V.SpeciesByBlueprint(SelectedSpecies.blueprintPath);
            }

            if (SelectedSpecies == null)
            {
                // if after loading a new file the previously selected species is not available (e.g. previous species is from a now not loaded mod), select first available species
                SetSpecies(species.FirstOrDefault(), ignoreInRecent: true);
            }

            InitializeSpeciesImages(species);

            _entryList = CreateSpeciesList(species, aliases);

            // autocomplete for species-input
            var al = new AutoCompleteStringCollection();

            al.AddRange(_entryList.Select(e => e.SearchName).ToArray());
            _textBox.AutoCompleteCustomSource = al;

            VariantSelector.SetVariants(species);
            cbDisplayUntameable.Checked = Properties.Settings.Default.DisplayNonDomesticableSpecies;

            TextBoxTextChanged(null, null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes the species lists.
        /// </summary>
        /// <param name="species"></param>
        /// <param name="aliases"></param>
        public void SetSpeciesLists(List <Species> species, Dictionary <string, string> aliases)
        {
            if (SelectedSpecies != null)
            {
                SelectedSpecies = Values.V.SpeciesByBlueprint(SelectedSpecies.blueprintPath);
            }

            ImageList imageList;

            (_entryList, imageList, _iconIndices) = LoadSpeciesImagesAndCreateSpeciesList(species, aliases);

            imageList.ImageSize               = new Size(64, 64);
            lvLastSpecies.LargeImageList      = imageList;
            lvSpeciesInLibrary.LargeImageList = imageList;

            // autocomplete for species-input
            var al = new AutoCompleteStringCollection();

            al.AddRange(_entryList.Select(e => e.SearchName).ToArray());
            _textBox.AutoCompleteCustomSource = al;

            VariantSelector.SetVariants(species);
            cbDisplayUntameable.Checked = Properties.Settings.Default.DisplayNonDomesticableSpecies;

            Textbox_TextChanged(null, null);
        }