コード例 #1
0
        private async Task BuildIndexAsync(bool skipItemTypesReload = false)
        {
            SetStatusbarText("Loading characters and items...");
            IndexSummary result;

            var newIndex = new Index();

            result = await newIndex.BuildAsync(GrimDawnDirectory, GrimDawnSavesDirectory, _loadedSettings.KeepExtractedDBFiles, false, (msg) => SetStatusbarText(msg)).ConfigureAwait(false);

            _index = newIndex;

            if (!skipItemTypesReload)
            {
                Dispatcher.Invoke((Action)(() =>
                {
                    var itemQualities = new ObservableCollection <MultiselectComboItem>();
                    itemQualities.AddRange(result.ItemRarities.Select(x => new MultiselectComboItem()
                    {
                        Selected = (x != "Common" && x != "Rare" && x != "Magical"), Value = x, DisplayText = x
                    }));
                    ItemQualities = itemQualities;

                    ItemTypes.Clear();
                    ItemTypes.AddRange(result.ItemTypes.Select(x => new MultiselectComboItem()
                    {
                        Selected = true, Value = x, DisplayText = ItemHelper.GetItemTypeDisplayName(x)
                    }));

                    AllCharacters.Clear();
                    AllCharacters.Add("(select character)");
                    AllCharacters.AddRange(result.Characters);
                }));
            }
        }
コード例 #2
0
        private void PopulateLists()
        {
            ItemTypes.Clear();
            foreach (string iType in Enum.GetNames(typeof(ItemType)))
            {
                ItemTypes.Add(iType);
            }

            LocationTypes.Clear();
            foreach (string lType in Enum.GetNames(typeof(LocationType)))
            {
                LocationTypes.Add(lType);
            }

            Mediums = new ObservableCollection <string>();
        }