コード例 #1
0
        private void UpdateDecorationOverrideConfiguration()
        {
            InParametersConfigurationV2 config = GlobalData.Instance.Configuration.InParameters;

            if (decorationsOverrideViewModel.HasChanged)
            {
                Dictionary <string, DecorationOverrideConfigurationItem> items = config.DecorationOverride.Items;

                items.Clear();

                foreach (JewelOverrideViewModel vm in decorationsOverrideViewModel.Jewels.Where(x => x.IsOverriding || x.Count > 0))
                {
                    items.Add(Core.Localization.GetDefault(vm.Name), new DecorationOverrideConfigurationItem
                    {
                        IsOverriding = vm.IsOverriding,
                        Count        = vm.Count
                    });
                }

                ConfigurationManager.Save(GlobalData.Instance.Configuration);

                rootViewModel.CreateSolverData();

                HasDecorationOverrideChanged = true;
            }
        }
コード例 #2
0
        protected override void OnClosing(CancelEventArgs e)
        {
            base.OnClosing(e);

            rootViewModel.EquipmentOverride.SaveConfiguration();

            rootViewModel.CreateSolverData();

            e.Cancel = true;
            Hide();
        }
コード例 #3
0
        private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            if (ConfigurationManager.IsBrandNewConfiguration)
            {
                OpenIntegratedHelp(HelpCategory.GettingStarted);
            }

            await Dispatcher.Yield(DispatcherPriority.SystemIdle);

            skillSelectorWindow = new SkillSelectorWindow {
                Owner = this
            };
            WindowManager.InitializeWindow(skillSelectorWindow);

            advancedSearchWindow = new AdvancedSearchWindow(rootViewModel)
            {
                Owner = this
            };
            WindowManager.InitializeWindow(advancedSearchWindow);

            if (await LoadData() == false)
            {
                Application.Current.Shutdown();
                return;
            }

            loadoutManager = new LoadoutManager(rootViewModel);
            rootViewModel.SetLoadoutManager(loadoutManager);

            string lastOpenedLoadout = GlobalData.Instance.Configuration.LastOpenedLoadout;
            Dictionary <string, SkillLoadoutItemConfigurationV3> loadout = GlobalData.Instance.Configuration.SkillLoadouts;

            if (loadout != null && lastOpenedLoadout != null && loadout.TryGetValue(lastOpenedLoadout, out SkillLoadoutItemConfigurationV3 loadoutConfig))
            {
                loadoutManager.Open(lastOpenedLoadout, loadoutConfig);
            }

            rootViewModel.SearchResultsViewModel.IsDataLoading = false;
            rootViewModel.SearchResultsViewModel.IsDataLoaded  = true;

            rootViewModel.NotifyDataLoaded();

            rootViewModel.CreateSolverData();
        }