Beispiel #1
0
        public void Initialize(Dictionary <EquipmentSlotType, EquipmentSlotControl> es)
        {
            FingerLimit    = 2;
            EquipmentSlots = es;
            WeaponSlot     = EquipmentSlots[EquipmentSlotType.Weapon];
            OffhandSlot    = EquipmentSlots[EquipmentSlotType.Offhand];
            if (EquipmentSlots[EquipmentSlotType.Finger1].IsLocked)
            {
                FingerLimit--;
            }
            if (EquipmentSlots[EquipmentSlotType.Finger2].IsLocked)
            {
                FingerLimit--;
            }

            foreach (var set in DatasetManager.Dataset.Sets)
            {
                if (string.IsNullOrWhiteSpace(set.Value.WikiURL))
                {
                    continue;
                }
                int ml = 0;
                List <DDOAdventurePackData> apds = new List <DDOAdventurePackData>();
                foreach (var item in set.Value.Items)
                {
                    if (item.QuestFoundIn.Adpack != null && !apds.Contains(item.QuestFoundIn.Adpack))
                    {
                        apds.Add(item.QuestFoundIn.Adpack);
                    }
                    if (!QuestSourceManager.IsItemAllowed(item))
                    {
                        continue;
                    }
                    var mlp = item.Properties.Find(i => i.Property == "Minimum Level");
                    if (mlp != null && mlp.Value > ml)
                    {
                        ml = (int)mlp.Value;
                    }
                }

                foreach (var apd in apds)
                {
                    if (QuestSourceManager.IsAllowed(apd))
                    {
                        Sets.Add(new NamedSetInfo {
                            Name = set.Value.Name, ML = ml, WikiURL = set.Value.WikiURL, Set = set.Value
                        });
                        break;
                    }
                }
            }

            Sets.Sort((a, b) => a.ML < b.ML ? -1 : (a.ML > b.ML ? 1 : a.Name.CompareTo(b.Name)));

            lvSets.ItemsSource = Sets;
            SetFilter(CustomFilter);
        }
Beispiel #2
0
        public QuestSourcesWindow()
        {
            InitializeComponent();

            foreach (var ap in DatasetManager.Dataset.AdventurePacks)
            {
                QuestSourceList.Add(new QuestSourceItemData()
                {
                    Pack = ap, Allow = QuestSourceManager.IsAllowed(ap.Name)
                });
            }

            lbQuestSources.ItemsSource = QuestSourceList;

            Initializing = false;
        }