Пример #1
0
        private void CbThemeConstants_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                Grid gdParent = (Grid)((FrameworkElement)sender).Parent;

                string  Name    = (string)((Label)IntegrationUI.SearchElementByName("PART_ThemeConstantsLabel", gdParent)).Tag;
                dynamic Element = ((ComboBoxItem)((ComboBox)sender).SelectedItem).Tag;

                if (SettingsThemeConstants.Find(x => x.Name == Name) != null)
                {
                    SettingsThemeConstants.Find(x => x.Name == Name).Element = Element;
                }
                else
                {
                    SettingsThemeConstants.Add(new ThemeElement {
                        Name = Name, Element = Element
                    });
                }
#if DEBUG
                logger.Debug($"ThemeModifier [Ignored] - SettingsThemeConstants: {JsonConvert.SerializeObject(SettingsThemeConstants)}");
#endif
            }
            catch (Exception ex)
            {
#if DEBUG
                Common.LogError(ex, "ThemeModifier [Ignored]");
#endif
            }
        }
        public override void AddBtActionBar()
        {
            if (PART_BtActionBar != null)
            {
#if DEBUG
                logger.Debug($"HowLongToBeat - PART_BtActionBar allready insert");
#endif
                return;
            }

            HltbButton BtActionBar = new HltbButton();
            BtActionBar.Click += OnBtActionBarClick;
            BtActionBar.Name   = BtActionBarName;
            BtActionBar.Margin = new Thickness(10, 0, 0, 0);

            try
            {
                ui.AddButtonInGameSelectedActionBarButtonOrToggleButton(BtActionBar);
                PART_BtActionBar = IntegrationUI.SearchElementByName(BtActionBarName);
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "HowLongToBeat", "Error on AddBtActionBar()");
            }
        }
        public override void AddBtActionBar()
        {
            if (PART_BtActionBar != null)
            {
#if DEBUG
                logger.Debug($"CheckLocalizations [Ignored] - PART_BtActionBar allready insert");
#endif
                return;
            }


            Button BtActionBar = new Button();

            if (PluginDatabase.PluginSettings.EnableIntegrationButtonDetails)
            {
                BtActionBar = new ClButtonAdvanced();
            }
            else
            {
                BtActionBar        = new ClButton();
                BtActionBar.Click += OnBtActionBarClick;
            }

            BtActionBar.Name = BtActionBarName;

            try
            {
                ui.AddButtonInGameSelectedActionBarButtonOrToggleButton(BtActionBar);
                PART_BtActionBar = IntegrationUI.SearchElementByName(BtActionBarName);
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "CheckLocalizations");
            }
        }
Пример #4
0
        public override void AddSpInfoBarFS()
        {
            if (PART_SpInfoBarFS != null)
            {
#if DEBUG
                logger.Debug($"HowLongToBeat [Ignored] - PART_BtInfoBar allready insert");
#endif

                ((HLTBInfoBarFS)PART_SpInfoBarFS).SetData(PluginDatabase.Get(HowLongToBeatDatabase.GameSelected));
                return;
            }

            FrameworkElement SpInfoBar;
            SpInfoBar = new HLTBInfoBarFS();

            SpInfoBar.Name   = SpInfoBarFSName;
            SpInfoBar.Margin = new Thickness(50, 0, 0, 0);

            try
            {
                ui.AddStackPanelInGameSelectedInfoBarFS(SpInfoBar);
                PART_SpInfoBarFS = IntegrationUI.SearchElementByName(SpInfoBarFSName);

                if (PART_SpInfoBarFS != null)
                {
                    ((HLTBInfoBarFS)PART_SpInfoBarFS).SetData(PluginDatabase.Get(HowLongToBeatDatabase.GameSelected));
                }
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "HowLongToBeat");
            }
        }
Пример #5
0
        public override DispatcherOperation AddElementsFS()
        {
            if (_PlayniteApi.ApplicationInfo.Mode == ApplicationMode.Fullscreen)
            {
                if (IsFirstLoad)
                {
#if DEBUG
                    logger.Debug($"HowLongToBeat [Ignored] - IsFirstLoad");
#endif
                    Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new ThreadStart(delegate
                    {
                        System.Threading.SpinWait.SpinUntil(() => IntegrationUI.SearchElementByName("PART_ButtonContext") != null, 5000);
                    })).Wait();
                    IsFirstLoad = false;
                }

                return(Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new ThreadStart(delegate
                {
                    if (PluginDatabase.PluginSettings.EnableIntegrationFS)
                    {
#if DEBUG
                        logger.Debug($"HowLongToBeat [Ignored] - AddBtInfoBarFS()");
#endif
                        AddSpInfoBarFS();
                    }
                })));
            }

            return(null);
        }
Пример #6
0
        public override void AddSpInfoBarFS()
        {
            if (PART_SpInfoBarFS != null)
            {
#if DEBUG
                logger.Debug($"ThemeModifier [Ignored] - PART_BtInfoBar allready insert");
#endif

                ((FeaturesListFS)PART_SpInfoBarFS).SetData(ThemeModifier.GameSelected);
                return;
            }

            FrameworkElement SpInfoBar;
            SpInfoBar = new FeaturesListFS();

            SpInfoBar.Name   = SpInfoBarFSName;
            SpInfoBar.Margin = new Thickness(50, 0, 0, 0);

            try
            {
                ui.AddStackPanelInGameSelectedInfoBarFS(SpInfoBar);
                PART_SpInfoBarFS = IntegrationUI.SearchElementByName(SpInfoBarFSName);

                if (PART_SpInfoBarFS != null)
                {
                    ((FeaturesListFS)PART_SpInfoBarFS).SetData(ThemeModifier.GameSelected);
                }
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "ThemeModifier");
            }
        }
Пример #7
0
        private void TbThemeConstants_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
        {
            try
            {
                Grid gdParent = (Grid)((FrameworkElement)sender).Parent;

                string Name    = (string)((Label)IntegrationUI.SearchElementByName("PART_ThemeConstantsLabel", gdParent)).Tag;
                string Element = ((TextBox)sender).Text;

                if (SettingsThemeConstants.Find(x => x.Name == Name) != null)
                {
                    SettingsThemeConstants.Find(x => x.Name == Name).Element = Element;
                }
                else
                {
                    SettingsThemeConstants.Add(new ThemeElement {
                        Name = Name, Element = Element
                    });
                }
#if DEBUG
                logger.Debug($"ThemeModifier [Ignored] - SettingsThemeConstants: {JsonConvert.SerializeObject(SettingsThemeConstants)}");
#endif
            }
            catch (Exception ex)
            {
#if DEBUG
                Common.LogError(ex, "ThemeModifier [Ignored]");
#endif
            }
        }
        public override void AddBtActionBar()
        {
            if (PART_BtActionBar != null)
            {
#if DEBUG
                logger.Debug($"SuccessStory - PART_BtActionBar allready insert");
#endif
                return;
            }

            FrameworkElement BtActionBar;

            if (_Settings.EnableIntegrationInDescriptionWithToggle)
            {
                if (_Settings.EnableIntegrationButtonDetails)
                {
                    BtActionBar = new SuccessStoryToggleButtonDetails();
                }
                else
                {
                    BtActionBar = new SuccessStoryToggleButton(_Settings);
                }

                ((ToggleButton)BtActionBar).Click += OnBtActionBarToggleButtonClick;
            }
            else
            {
                if (_Settings.EnableIntegrationButtonDetails)
                {
                    BtActionBar = new SuccessStoryButtonDetails();
                }
                else
                {
                    BtActionBar = new SuccessStoryButton(_Settings.EnableIntegrationInDescriptionOnlyIcon);
                }

                ((Button)BtActionBar).Click += OnBtActionBarClick;
            }

            if (!_Settings.EnableIntegrationInDescriptionOnlyIcon)
            {
                BtActionBar.Width = 150;
            }

            BtActionBar.Name   = BtActionBarName;
            BtActionBar.Margin = new Thickness(10, 0, 0, 0);

            try
            {
                ui.AddButtonInGameSelectedActionBarButtonOrToggleButton(BtActionBar);
                PART_BtActionBar = IntegrationUI.SearchElementByName(BtActionBarName);
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "SuccessStory", "Error on AddBtActionBar()");
            }
        }
Пример #9
0
        public override void AddBtActionBar()
        {
            if (PART_BtActionBar != null)
            {
#if DEBUG
                logger.Debug($"GameActivity [Ignored] - PART_BtActionBar allready insert");
#endif
                return;
            }

            FrameworkElement BtActionBar;

            if (PluginDatabase.PluginSettings.EnableIntegrationInDescriptionWithToggle)
            {
                if (PluginDatabase.PluginSettings.EnableIntegrationButtonDetails)
                {
                    BtActionBar = new GameActivityToggleButtonDetails();
                }
                else
                {
                    BtActionBar = new GameActivityToggleButton();
                }

                ((ToggleButton)BtActionBar).Click += OnBtActionBarToggleButtonClick;
            }
            else
            {
                if (PluginDatabase.PluginSettings.EnableIntegrationButtonDetails)
                {
                    BtActionBar = new GameActivityButtonDetails();
                }
                else
                {
                    BtActionBar = new GameActivityButton();
                }

                ((Button)BtActionBar).Click += OnBtActionBarClick;
            }

            if (!PluginDatabase.PluginSettings.EnableIntegrationInDescriptionOnlyIcon)
            {
                BtActionBar.MinWidth = 150;
            }

            BtActionBar.Name = BtActionBarName;

            try
            {
                ui.AddButtonInGameSelectedActionBarButtonOrToggleButton(BtActionBar);
                PART_BtActionBar = IntegrationUI.SearchElementByName(BtActionBarName);
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "GameActivity");
            }
        }
        public override void AddCustomElements()
        {
            if (ListCustomElements.Count > 0)
            {
#if DEBUG
                logger.Debug($"SystemChecker - CustomElements allready insert - {ListCustomElements.Count}");
#endif
                return;
            }

            FrameworkElement PART_ScheckButtonWithJustIcon           = null;
            FrameworkElement PART_ScheckButtonWithJustIconAndDetails = null;
            try
            {
                PART_ScheckButtonWithJustIcon           = IntegrationUI.SearchElementByName("PART_ScheckButtonWithJustIcon", false, true);
                PART_ScheckButtonWithJustIconAndDetails = IntegrationUI.SearchElementByName("PART_ScheckButtonWithJustIconAndDetails", false, true);
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "SystemChecker", $"Error on find custom element");
            }

            if (PART_ScheckButtonWithJustIcon != null)
            {
                PART_ScheckButtonWithJustIcon = new SystemCheckerButton();
                ((Button)PART_ScheckButtonWithJustIcon).Click += OnBtActionBarClick;
                try
                {
                    ui.AddElementInCustomTheme(PART_ScheckButtonWithJustIcon, "PART_ScheckButtonWithJustIcon");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_ScheckButtonWithJustIcon", Element = PART_ScheckButtonWithJustIcon
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SystemChecker", "Error on AddCustomElements()");
                }
            }

            if (PART_ScheckButtonWithJustIconAndDetails != null)
            {
                PART_ScheckButtonWithJustIconAndDetails = new SystemCheckerButtonDetails();
                ((Button)PART_ScheckButtonWithJustIconAndDetails).Click += OnBtActionBarClick;
                try
                {
                    ui.AddElementInCustomTheme(PART_ScheckButtonWithJustIconAndDetails, "PART_ScheckButtonWithJustIconAndDetails");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_ScheckButtonWithJustIconAndDetails", Element = PART_ScheckButtonWithJustIconAndDetails
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SystemChecker", "Error on AddCustomElements()");
                }
            }
        }
Пример #11
0
        public override DispatcherOperation AddElements()
        {
            if (_PlayniteApi.ApplicationInfo.Mode == ApplicationMode.Desktop)
            {
                if (IsFirstLoad)
                {
#if DEBUG
                    logger.Debug($"HowLongToBeat [Ignored] - IsFirstLoad");
#endif
                    Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new ThreadStart(delegate
                    {
                        System.Threading.SpinWait.SpinUntil(() => IntegrationUI.SearchElementByName("PART_HtmlDescription") != null, 5000);
                    })).Wait();
                    IsFirstLoad = false;
                }

                return(Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new ThreadStart(delegate
                {
                    CheckTypeView();

                    if (PluginDatabase.PluginSettings.EnableIntegrationButton)
                    {
#if DEBUG
                        logger.Debug($"HowLongToBeat [Ignored] - AddBtActionBar()");
#endif
                        AddBtActionBar();
                    }

                    if (PluginDatabase.PluginSettings.EnableIntegrationInDescription)
                    {
#if DEBUG
                        logger.Debug($"HowLongToBeat [Ignored] - AddSpDescription()");
#endif
                        AddSpDescription();
                    }

                    if (PluginDatabase.PluginSettings.EnableIntegrationInCustomTheme)
                    {
#if DEBUG
                        logger.Debug($"HowLongToBeat [Ignored] - AddCustomElements()");
#endif
                        AddCustomElements();
                    }
                })));
            }

            return(null);
        }
Пример #12
0
        public override void AddCustomElements()
        {
            if (ListCustomElements.Count > 0)
            {
#if DEBUG
                logger.Debug($"ThemeModifier [Ignored] - CustomElements allready insert - {ListCustomElements.Count}");
#endif
                return;
            }

            FrameworkElement PART_TmFeaturesList = null;

            try
            {
                PART_TmFeaturesList = IntegrationUI.SearchElementByName("PART_TmFeaturesList", false, true);
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "ThemeModifier", $"Error on find custom element");
            }

            if (PART_TmFeaturesList != null)
            {
                PART_TmFeaturesList = new FeaturesList();
                try
                {
                    ui.AddElementInCustomTheme(PART_TmFeaturesList, "PART_TmFeaturesList");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_TmFeaturesList", Element = PART_TmFeaturesList
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "ThemeModifier", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"ThemeModifier [Ignored] - PART_TmFeaturesList not find");
#endif
            }
        }
Пример #13
0
        private void CbThemeConstants_Click(object sender, RoutedEventArgs e)
        {
            Grid gdParent = (Grid)((FrameworkElement)sender).Parent;

            string Name    = (string)((Label)IntegrationUI.SearchElementByName("PART_ThemeConstantsLabel", gdParent)).Tag;
            bool   Element = (bool)((CheckBox)sender).IsChecked;

            if (SettingsThemeConstants.Find(x => x.Name == Name) != null)
            {
                SettingsThemeConstants.Find(x => x.Name == Name).Element = Element;
            }
            else
            {
                SettingsThemeConstants.Add(new ThemeElement {
                    Name = Name, Element = Element
                });
            }
#if DEBUG
            logger.Debug($"ThemeModifier [Ignored] - SettingsThemeConstants: {JsonConvert.SerializeObject(SettingsThemeConstants)}");
#endif
        }
Пример #14
0
        private void sThemeConstants_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            try
            {
                Grid gdParent = (Grid)((FrameworkElement)sender).Parent;

                string  Name    = (string)((Label)IntegrationUI.SearchElementByName("PART_ThemeConstantsLabel", gdParent)).Tag;
                string  Type    = (string)gdParent.Tag;
                dynamic Element = null;
                if (Type.ToLower() == "int")
                {
                    Element = (int)((Slider)sender).Value;
                }
                if (Type.ToLower() == "double")
                {
                    Element = (double)Math.Round(((Slider)sender).Value, 1);
                }

                if (SettingsThemeConstants.Find(x => x.Name == Name) != null)
                {
                    SettingsThemeConstants.Find(x => x.Name == Name).Element = Element;
                }
                else
                {
                    SettingsThemeConstants.Add(new ThemeElement {
                        Name = Name, Element = Element
                    });
                }
#if DEBUG
                logger.Debug($"ThemeModifier [Ignored] - SettingsThemeConstants: {JsonConvert.SerializeObject(SettingsThemeConstants)}");
#endif
            }
            catch (Exception ex)
            {
#if DEBUG
                Common.LogError(ex, "ThemeModifier [Ignored]");
#endif
            }
        }
        public override void AddBtActionBar()
        {
            CheckTypeView();

            if (PART_BtActionBar != null)
            {
#if DEBUG
                logger.Debug($"SystemChecker - PART_BtActionBar allready insert");
#endif
                return;
            }

            Button BtActionBar = new Button();

            if (PluginDatabase.PluginSettings.EnableIntegrationButton)
            {
                BtActionBar = new SystemCheckerButton();
            }

            if (PluginDatabase.PluginSettings.EnableIntegrationButtonDetails)
            {
                BtActionBar = new SystemCheckerButtonDetails();
            }

            BtActionBar.Click  += OnBtActionBarClick;
            BtActionBar.Name    = BtActionBarName;
            DefaultBtForeground = BtActionBar.Foreground;

            try
            {
                ui.AddButtonInGameSelectedActionBarButtonOrToggleButton(BtActionBar);
                PART_BtActionBar = IntegrationUI.SearchElementByName(BtActionBarName);
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "SystemChecker", "Error on AddBtActionBar()");
            }
        }
Пример #16
0
        public override void AddBtActionBar()
        {
            if (PART_BtActionBar != null)
            {
#if DEBUG
                logger.Debug($"ThemeModifier [Ignored] - PART_BtActionBar allready insert");
#endif
                return;
            }

            try
            {
                FeaturesList featuresList = new FeaturesList();
                featuresList.Name = BtActionBarName;

                ui.AddButtonInGameSelectedActionBarButtonOrToggleButton(featuresList);
                PART_BtActionBar = IntegrationUI.SearchElementByName(BtActionBarName);
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "ThemeModifier");
            }
        }
Пример #17
0
        public override void AddSpDescription()
        {
            if (PART_SpDescription != null)
            {
#if DEBUG
                logger.Debug($"HowLongToBeat [Ignored] - PART_SpDescription allready insert");
#endif
                return;
            }

            try
            {
                HltbDescriptionIntegration SpDescription = new HltbDescriptionIntegration();
                SpDescription.Name = SpDescriptionName;

                ui.AddElementInGameSelectedDescription(SpDescription, PluginDatabase.PluginSettings.IntegrationTopGameDetails, PluginDatabase.PluginSettings.IntegrationShowTitle);
                PART_SpDescription = IntegrationUI.SearchElementByName(SpDescriptionName);
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "HowLongToBeat");
            }
        }
Пример #18
0
        public override void AddSpDescription()
        {
            if (PART_SpDescription != null)
            {
#if DEBUG
                logger.Debug($"ThemeModifier [Ignored] - PART_SpDescription allready insert");
#endif
                return;
            }

            try
            {
                FeaturesList SpDescription = new FeaturesList();
                SpDescription.Name = SpDescriptionName;

                ui.AddElementInGameSelectedDescription(SpDescription, true);
                PART_SpDescription = IntegrationUI.SearchElementByName(SpDescriptionName);
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "ThemeModifier");
            }
        }
Пример #19
0
        public override void AddSpDescription()
        {
            if (PART_SpDescription != null)
            {
#if DEBUG
                logger.Debug($"SuccessStory [Ignored] - PART_SpDescription allready insert");
#endif
                return;
            }

            try
            {
                ScDescriptionIntegration SpDescription = new ScDescriptionIntegration();
                SpDescription.Name = SpDescriptionName;

                ui.AddElementInGameSelectedDescription(SpDescription, PluginDatabase.PluginSettings.IntegrationTopGameDetails);
                PART_SpDescription = IntegrationUI.SearchElementByName(SpDescriptionName);

                if (PluginDatabase.PluginSettings.EnableIntegrationInDescriptionWithToggle && PART_SpDescription != null)
                {
                    if (PART_BtActionBar != null && PART_BtActionBar is ToggleButton)
                    {
                        ((ToggleButton)PART_BtActionBar).IsChecked = false;
                    }
                    else
                    {
                        logger.Warn($"SuccessStory - PART_BtActionBar is null or not ToggleButton");
                    }

                    PART_SpDescription.Visibility = Visibility.Collapsed;
                }
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "SuccessStory", "Error on AddSpDescription()");
            }
        }
        public override void AddCustomElements()
        {
            if (ListCustomElements.Count > 0)
            {
#if DEBUG
                logger.Debug($"SuccessStory - CustomElements allready insert - {ListCustomElements.Count}");
#endif
                return;
            }

            FrameworkElement PART_ScButtonWithJustIcon        = null;
            FrameworkElement PART_ScButtonWithTitle           = null;
            FrameworkElement PART_ScButtonWithTitleAndDetails = null;

            FrameworkElement PART_Achievements_ProgressBar         = null;
            FrameworkElement PART_Achievements_Graphics            = null;
            FrameworkElement PART_Achievements_List                = null;
            FrameworkElement PART_Achievements_ListCompactUnlocked = null;
            FrameworkElement PART_Achievements_ListCompactLocked   = null;
            try
            {
                PART_ScButtonWithJustIcon        = IntegrationUI.SearchElementByName("PART_ScButtonWithJustIcon", false, true);
                PART_ScButtonWithTitle           = IntegrationUI.SearchElementByName("PART_ScButtonWithTitle", false, true);
                PART_ScButtonWithTitleAndDetails = IntegrationUI.SearchElementByName("PART_ScButtonWithTitleAndDetails", false, true);

                PART_Achievements_ProgressBar         = IntegrationUI.SearchElementByName("PART_Achievements_ProgressBar", false, true);
                PART_Achievements_Graphics            = IntegrationUI.SearchElementByName("PART_Achievements_Graphics", false, true);
                PART_Achievements_List                = IntegrationUI.SearchElementByName("PART_Achievements_List", false, true);
                PART_Achievements_ListCompactUnlocked = IntegrationUI.SearchElementByName("PART_Achievements_ListCompactUnlocked", false, true);
                PART_Achievements_ListCompactLocked   = IntegrationUI.SearchElementByName("PART_Achievements_ListCompactLocked", false, true);
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "SuccessStory", $"Error on find custom element");
            }

            if (PART_ScButtonWithJustIcon != null)
            {
                PART_ScButtonWithJustIcon = new SuccessStoryButton(true);
                ((Button)PART_ScButtonWithJustIcon).Click += OnBtActionBarClick;
                try
                {
                    ui.AddElementInCustomTheme(PART_ScButtonWithJustIcon, "PART_ScButtonWithJustIcon");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_ScButtonWithJustIcon", Element = PART_ScButtonWithJustIcon
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory - PART_ScButtonWithJustIcon not find");
#endif
            }

            if (PART_ScButtonWithTitle != null)
            {
                PART_ScButtonWithTitle = new SuccessStoryButton(false);
                ((Button)PART_ScButtonWithTitle).Click += OnBtActionBarClick;
                try
                {
                    ui.AddElementInCustomTheme(PART_ScButtonWithTitle, "PART_ScButtonWithTitle");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_ScButtonWithTitle", Element = PART_ScButtonWithTitle
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory - PART_ScButtonWithTitle not find");
#endif
            }

            if (PART_ScButtonWithTitleAndDetails != null)
            {
                PART_ScButtonWithTitleAndDetails = new SuccessStoryButtonDetails();
                ((Button)PART_ScButtonWithTitleAndDetails).Click += OnBtActionBarClick;
                try
                {
                    ui.AddElementInCustomTheme(PART_ScButtonWithTitleAndDetails, "PART_ScButtonWithTitleAndDetails");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_ScButtonWithTitleAndDetails", Element = PART_ScButtonWithTitleAndDetails
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory - PART_ScButtonWithTitleAndDetails not find");
#endif
            }


            if (PART_Achievements_ProgressBar != null && _Settings.IntegrationShowProgressBar)
            {
                PART_Achievements_ProgressBar      = new ScDescriptionIntegration(_Settings, SuccessStory.achievementsDatabase, SuccessStory.SelectedGameAchievements, true, false, false, false, false, true);
                PART_Achievements_ProgressBar.Name = "Achievements_ProgressBar";
                try
                {
                    ui.AddElementInCustomTheme(PART_Achievements_ProgressBar, "PART_Achievements_ProgressBar");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_Achievements_ProgressBar", Element = PART_Achievements_ProgressBar
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory - PART_Achievements_ProgressBar not find");
#endif
            }

            if (PART_Achievements_Graphics != null && _Settings.IntegrationShowGraphic)
            {
                PART_Achievements_Graphics      = new ScDescriptionIntegration(_Settings, SuccessStory.achievementsDatabase, SuccessStory.SelectedGameAchievements, true, true, false, false, false, false);
                PART_Achievements_Graphics.Name = "Achievements_Graphics";
                try
                {
                    ui.AddElementInCustomTheme(PART_Achievements_Graphics, "PART_Achievements_Graphics");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_Achievements_Graphics", Element = PART_Achievements_Graphics
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory - PART_Achievements_Graphics not find");
#endif
            }

            if (PART_Achievements_List != null && _Settings.IntegrationShowAchievements)
            {
                PART_Achievements_List      = new ScDescriptionIntegration(_Settings, SuccessStory.achievementsDatabase, SuccessStory.SelectedGameAchievements, true, false, true, false, false, false);
                PART_Achievements_List.Name = "Achievements_List";
                try
                {
                    ui.AddElementInCustomTheme(PART_Achievements_List, "PART_Achievements_List");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_Achievements_List", Element = PART_Achievements_List
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory - PART_Achievements_List not find");
#endif
            }

            if (PART_Achievements_ListCompactUnlocked != null && _Settings.IntegrationShowAchievements)
            {
                PART_Achievements_ListCompactUnlocked      = new ScDescriptionIntegration(_Settings, SuccessStory.achievementsDatabase, SuccessStory.SelectedGameAchievements, true, false, false, false, true, false);
                PART_Achievements_ListCompactUnlocked.Name = "Achievements_ListCompactUnlocked";
                try
                {
                    ui.AddElementInCustomTheme(PART_Achievements_ListCompactUnlocked, "PART_Achievements_ListCompactUnlocked");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_Achievements_ListCompactUnlocked", Element = PART_Achievements_ListCompactUnlocked
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory - PART_Achievements_ListCompactUnlocked not find");
#endif
            }

            if (PART_Achievements_ListCompactLocked != null && _Settings.IntegrationShowAchievements)
            {
                PART_Achievements_ListCompactLocked      = new ScDescriptionIntegration(_Settings, SuccessStory.achievementsDatabase, SuccessStory.SelectedGameAchievements, true, false, false, true, false, false);
                PART_Achievements_ListCompactLocked.Name = "Achievements_ListCompactLocked";
                try
                {
                    ui.AddElementInCustomTheme(PART_Achievements_ListCompactLocked, "PART_Achievements_ListCompactLocked");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_Achievements_ListCompactLocked", Element = PART_Achievements_ListCompactLocked
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory - PART_Achievements_ListCompactLocked not find");
#endif
            }
        }
Пример #21
0
        public override void AddCustomElements()
        {
            if (ListCustomElements.Count > 0)
            {
#if DEBUG
                logger.Debug($"HowLongToBeat [Ignored] - CustomElements allready insert - {ListCustomElements.Count}");
#endif
                return;
            }

            FrameworkElement PART_HltbButtonWithJustIcon = null;
            FrameworkElement PART_hltbProgressBar        = null;
            try
            {
                PART_HltbButtonWithJustIcon = IntegrationUI.SearchElementByName("PART_HltbButtonWithJustIcon", false, true);
                PART_hltbProgressBar        = IntegrationUI.SearchElementByName("PART_hltbProgressBar", false, true);
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "HowLongToBeat", $"Error on find custom element");
            }

            if (PART_HltbButtonWithJustIcon != null)
            {
                PART_HltbButtonWithJustIcon                  = new HltbButton();
                PART_HltbButtonWithJustIcon.Name             = "HltbButtonWithJustIcon";
                ((Button)PART_HltbButtonWithJustIcon).Click += OnBtActionBarClick;
                try
                {
                    ui.AddElementInCustomTheme(PART_HltbButtonWithJustIcon, "PART_HltbButtonWithJustIcon");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_HltbButtonWithJustIcon", Element = PART_HltbButtonWithJustIcon
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "HowLongToBeat", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"HowLongToBeat [Ignored] - PART_HltbButtonWithJustIcon not find");
#endif
            }

            if (PART_hltbProgressBar != null)
            {
                PART_hltbProgressBar      = new HltbProgressBar();
                PART_hltbProgressBar.Name = "hltbProgressBar";
                try
                {
                    ui.AddElementInCustomTheme(PART_hltbProgressBar, "PART_hltbProgressBar");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_hltbProgressBar", Element = PART_hltbProgressBar
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "HowLongToBeat", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"HowLongToBeat [Ignored] - PART_HltbButtonWithJustIcon not find");
#endif
            }
        }
Пример #22
0
        public override void AddCustomElements()
        {
            if (ListCustomElements.Count > 0)
            {
#if DEBUG
                logger.Debug($"GameActivity [Ignored] - CustomElements allready insert - {ListCustomElements.Count}");
#endif
                return;
            }

            FrameworkElement PART_GaButtonWithJustIcon        = null;
            FrameworkElement PART_GaButtonWithTitle           = null;
            FrameworkElement PART_GaButtonWithTitleAndDetails = null;

            FrameworkElement PART_GameActivity_Graphic    = null;
            FrameworkElement PART_GameActivity_GraphicLog = null;
            try
            {
                PART_GaButtonWithJustIcon        = IntegrationUI.SearchElementByName("PART_GaButtonWithJustIcon", false, true);
                PART_GaButtonWithTitle           = IntegrationUI.SearchElementByName("PART_GaButtonWithTitle", false, true);
                PART_GaButtonWithTitleAndDetails = IntegrationUI.SearchElementByName("PART_GaButtonWithTitleAndDetails", false, true);

                PART_GameActivity_Graphic    = IntegrationUI.SearchElementByName("PART_GameActivity_Graphic", false, true);
                PART_GameActivity_GraphicLog = IntegrationUI.SearchElementByName("PART_GameActivity_GraphicLog", false, true);
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "GameActivity", $"Error on find custom element");
            }


            if (PART_GaButtonWithJustIcon != null)
            {
                PART_GaButtonWithJustIcon = new GameActivityButton(true);
                ((Button)PART_GaButtonWithJustIcon).Click += OnBtActionBarClick;
                try
                {
                    ui.AddElementInCustomTheme(PART_GaButtonWithJustIcon, "PART_GaButtonWithJustIcon");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_GaButtonWithJustIcon", Element = PART_GaButtonWithJustIcon
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "GameActivity");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"GameActivity [Ignored] - PART_GaButtonWithJustIcon not find");
#endif
            }

            if (PART_GaButtonWithTitle != null)
            {
                PART_GaButtonWithTitle = new GameActivityButton(false);
                ((Button)PART_GaButtonWithTitle).Click += OnBtActionBarClick;
                try
                {
                    ui.AddElementInCustomTheme(PART_GaButtonWithTitle, "PART_GaButtonWithTitle");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_GaButtonWithTitle", Element = PART_GaButtonWithTitle
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "GameActivity");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"GameActivity [Ignored] - PART_GaButtonWithTitle not find");
#endif
            }

            if (PART_GaButtonWithTitleAndDetails != null)
            {
                PART_GaButtonWithTitleAndDetails = new GameActivityButtonDetails();
                ((Button)PART_GaButtonWithTitleAndDetails).Click += OnBtActionBarClick;
                try
                {
                    ui.AddElementInCustomTheme(PART_GaButtonWithTitleAndDetails, "PART_GaButtonWithTitleAndDetails");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_GaButtonWithTitleAndDetails", Element = PART_GaButtonWithTitleAndDetails
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "GameActivity");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"GameActivity [Ignored] - PART_GaButtonWithTitleAndDetails not find");
#endif
            }


            if (PART_GameActivity_Graphic != null && PluginDatabase.PluginSettings.IntegrationShowGraphic)
            {
                PART_GameActivity_Graphic = new GameActivityGameGraphicTime(0, PluginDatabase.PluginSettings.IntegrationGraphicOptionsCountAbscissa);
                ((GameActivityGameGraphicTime)PART_GameActivity_Graphic).DisableAnimations(true);

                PART_GameActivity_Graphic.Name = "GameActivity_Graphic";
                try
                {
                    ui.AddElementInCustomTheme(PART_GameActivity_Graphic, "PART_GameActivity_Graphic");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_GameActivity_Graphic", Element = PART_GameActivity_Graphic
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "GameActivity");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"GameActivity [Ignored] - PART_GameActivity_Graphic not find");
#endif
            }

            if (PART_GameActivity_GraphicLog != null && PluginDatabase.PluginSettings.IntegrationShowGraphicLog)
            {
                PART_GameActivity_GraphicLog = new GameActivityGameGraphicLog(null, string.Empty, 0, !PluginDatabase.PluginSettings.EnableIntegrationInCustomTheme, PluginDatabase.PluginSettings.IntegrationGraphicLogOptionsCountAbscissa);
                ((GameActivityGameGraphicLog)PART_GameActivity_GraphicLog).DisableAnimations(true);

                PART_GameActivity_GraphicLog.Name = "GameActivity_GraphicLog";
                try
                {
                    ui.AddElementInCustomTheme(PART_GameActivity_GraphicLog, "PART_GameActivity_GraphicLog");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_GameActivity_GraphicLog", Element = PART_GameActivity_GraphicLog
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "GameActivity");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"GameActivity [Ignored] - PART_GameActivity_GraphicLog not find");
#endif
            }
        }
        public override void AddCustomElements()
        {
            if (ListCustomElements.Count > 0)
            {
#if DEBUG
                logger.Debug($"CheckLocalizations [Ignored] - CustomElements allready insert - {ListCustomElements.Count}");
#endif
                return;
            }

            FrameworkElement PART_ClButtonWithJustIcon           = null;
            FrameworkElement PART_ClButtonWithTitle              = null;
            FrameworkElement PART_ClButtonWithTitleAndDetails    = null;
            FrameworkElement PART_ClButtonWithJustIconAndDetails = null;

            FrameworkElement PART_ClListLanguages = null;
            try
            {
                PART_ClButtonWithJustIcon           = IntegrationUI.SearchElementByName("PART_ClButtonWithJustIcon", false, true);
                PART_ClButtonWithTitle              = IntegrationUI.SearchElementByName("PART_ClButtonWithTitle", false, true);
                PART_ClButtonWithTitleAndDetails    = IntegrationUI.SearchElementByName("PART_ClButtonWithTitleAndDetails", false, true);
                PART_ClButtonWithJustIconAndDetails = IntegrationUI.SearchElementByName("PART_ClButtonWithJustIconAndDetails", false, true);

                PART_ClListLanguages = IntegrationUI.SearchElementByName("PART_ClListLanguages", false, true);
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "CheckLocalizations", $"Error on find custom element");
            }

            if (PART_ClButtonWithJustIcon != null)
            {
                PART_ClButtonWithJustIcon = new ClButton(true);
                ((Button)PART_ClButtonWithJustIcon).Click += OnBtActionBarClick;
                try
                {
                    ui.AddElementInCustomTheme(PART_ClButtonWithJustIcon, "PART_ClButtonWithJustIcon");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_ClButtonWithJustIcon", Element = PART_ClButtonWithJustIcon
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "CheckLocalizations");
                }
            }

            if (PART_ClButtonWithTitle != null)
            {
                PART_ClButtonWithTitle = new ClButton(false);
                ((Button)PART_ClButtonWithTitle).Click += OnBtActionBarClick;
                try
                {
                    ui.AddElementInCustomTheme(PART_ClButtonWithTitle, "PART_ClButtonWithTitle");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_ClButtonWithTitle", Element = PART_ClButtonWithTitle
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "CheckLocalizations");
                }
            }

            if (PART_ClButtonWithTitleAndDetails != null)
            {
                PART_ClButtonWithTitleAndDetails = new ClButtonAdvanced(false);
                try
                {
                    ui.AddElementInCustomTheme(PART_ClButtonWithTitleAndDetails, "PART_ClButtonWithTitleAndDetails");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_ClButtonWithTitleAndDetails", Element = PART_ClButtonWithTitleAndDetails
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "CheckLocalizations");
                }
            }

            if (PART_ClButtonWithJustIconAndDetails != null)
            {
                PART_ClButtonWithJustIconAndDetails = new ClButtonAdvanced(true);
                try
                {
                    ui.AddElementInCustomTheme(PART_ClButtonWithJustIconAndDetails, "PART_ClButtonWithJustIconAndDetails");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_ClButtonWithJustIconAndDetails", Element = PART_ClButtonWithJustIconAndDetails
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "CheckLocalizations");
                }
            }

            if (PART_ClListLanguages != null)
            {
                PART_ClListLanguages = new ClListViewLanguages(true);
                try
                {
                    ui.AddElementInCustomTheme(PART_ClListLanguages, "PART_ClListLanguages");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_ClListLanguages", Element = PART_ClListLanguages
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "CheckLocalizations");
                }
            }
        }
Пример #24
0
        private void BtRestoreConstants_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Grid gdParent = (Grid)((FrameworkElement)sender).Parent;

                string           elName    = (string)((Label)IntegrationUI.SearchElementByName("PART_ThemeConstantsLabel", gdParent)).Tag;
                string           elType    = (string)gdParent.Tag;
                FrameworkElement elControl = IntegrationUI.SearchElementByName("PART_ThemeConstantsControl", gdParent);

                dynamic elDefault = ThemeModifier.ThemeDefaultConstants.Find(x => x.Name == elName).Element;

                if (elDefault is bool)
                {
                    gdParent.Tag = "bool";
                    ((CheckBox)elControl).IsChecked = (bool)elDefault;
                    CbThemeConstants_Click(elControl, null);
                }

                if (elDefault is string)
                {
                    gdParent.Tag = "string";
                    ((TextBox)elControl).Text = (string)elDefault;
                    TbThemeConstants_KeyUp(elControl, null);
                }

                if (elDefault is double)
                {
                    gdParent.Tag = "double";
                    ((Slider)elControl).Value = (double)elDefault;
                    sThemeConstants_ValueChanged(elControl, null);
                }

                if (elDefault is int)
                {
                    gdParent.Tag = "int";
                    ((Slider)elControl).Value = (int)elDefault;
                    sThemeConstants_ValueChanged(elControl, null);
                }

                if (elDefault is Color)
                {
                    gdParent.Tag = "color";
                    ((TextBlock)elControl).Background = new SolidColorBrush((Color)elDefault);

                    tbControl    = gdParent.Children.OfType <TextBlock>().FirstOrDefault();
                    lControl     = gdParent.Children.OfType <Label>().FirstOrDefault();
                    colorDefault = (Color)elDefault;
                    PART_TM_ColorOKConstants_Click(elControl, null);
                }

                if (elDefault is SolidColorBrush)
                {
                    gdParent.Tag = "solidcolorbrush";
                    ((TextBlock)elControl).Background = (SolidColorBrush)elDefault;

                    tbControl    = gdParent.Children.OfType <TextBlock>().FirstOrDefault();
                    lControl     = gdParent.Children.OfType <Label>().FirstOrDefault();
                    colorDefault = (SolidColorBrush)elDefault;
                    PART_TM_ColorOKConstants_Click(elControl, null);
                }

                if (elDefault is LinearGradientBrush)
                {
                    gdParent.Tag = "lineargradientbrush";
                    ((TextBlock)elControl).Background = (LinearGradientBrush)elDefault;

                    tbControl    = gdParent.Children.OfType <TextBlock>().FirstOrDefault();
                    lControl     = gdParent.Children.OfType <Label>().FirstOrDefault();
                    colorDefault = (LinearGradientBrush)elDefault;
                    PART_TM_ColorOKConstants_Click(elControl, null);
                }

                if (elDefault is Visibility)
                {
                    gdParent.Tag = "visibility";

                    switch (elDefault)
                    {
                    case Visibility.Collapsed:
                        ((ComboBox)elControl).SelectedIndex = 0;
                        break;

                    case Visibility.Hidden:
                        ((ComboBox)elControl).SelectedIndex = 1;
                        break;

                    case Visibility.Visible:
                        ((ComboBox)elControl).SelectedIndex = 2;
                        break;
                    }

                    CbThemeConstants_SelectionChanged(elControl, null);
                }

                if (elDefault is VerticalAlignment)
                {
                    gdParent.Tag = "verticalalignment";

                    switch (elDefault)
                    {
                    case VerticalAlignment.Bottom:
                        ((ComboBox)elControl).SelectedIndex = 0;
                        break;

                    case VerticalAlignment.Center:
                        ((ComboBox)elControl).SelectedIndex = 1;
                        break;

                    case VerticalAlignment.Stretch:
                        ((ComboBox)elControl).SelectedIndex = 2;
                        break;

                    case VerticalAlignment.Top:
                        ((ComboBox)elControl).SelectedIndex = 2;
                        break;
                    }

                    CbThemeConstants_SelectionChanged(elControl, null);
                }

                if (elDefault is HorizontalAlignment)
                {
                    gdParent.Tag = "horizontalalignment";

                    switch (elDefault)
                    {
                    case HorizontalAlignment.Center:
                        ((ComboBox)elControl).SelectedIndex = 0;
                        break;

                    case HorizontalAlignment.Left:
                        ((ComboBox)elControl).SelectedIndex = 1;
                        break;

                    case HorizontalAlignment.Right:
                        ((ComboBox)elControl).SelectedIndex = 2;
                        break;

                    case HorizontalAlignment.Stretch:
                        ((ComboBox)elControl).SelectedIndex = 2;
                        break;
                    }

                    CbThemeConstants_SelectionChanged(elControl, null);
                }
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "ThemeModifier", "Error on BtRestoreConstants_Click()");
            }
        }
Пример #25
0
        public override void AddCustomElements()
        {
            if (ListCustomElements.Count > 0)
            {
#if DEBUG
                logger.Debug($"SuccessStory [Ignored] - CustomElements allready insert - {ListCustomElements.Count}");
#endif
                return;
            }

            FrameworkElement PART_ScButtonWithJustIcon        = null;
            FrameworkElement PART_ScButtonWithTitle           = null;
            FrameworkElement PART_ScButtonWithTitleAndDetails = null;

            FrameworkElement PART_Achievements_ProgressBar                 = null;
            FrameworkElement PART_Achievements_Graphics                    = null;
            FrameworkElement PART_Achievements_List                        = null;
            FrameworkElement PART_Achievements_ListComptact                = null;
            FrameworkElement PART_Achievements_ListComptactVertical        = null;
            FrameworkElement PART_Achievements_ListCompactUnlocked         = null;
            FrameworkElement PART_Achievements_ListCompactLocked           = null;
            FrameworkElement PART_Achievements_ListCompactVerticalUnlocked = null;
            FrameworkElement PART_Achievements_ListCompactVerticalLocked   = null;

            FrameworkElement PART_ScUserStats = null;
            try
            {
                PART_ScButtonWithJustIcon        = IntegrationUI.SearchElementByName("PART_ScButtonWithJustIcon", false, true);
                PART_ScButtonWithTitle           = IntegrationUI.SearchElementByName("PART_ScButtonWithTitle", false, true);
                PART_ScButtonWithTitleAndDetails = IntegrationUI.SearchElementByName("PART_ScButtonWithTitleAndDetails", false, true);

                PART_Achievements_ProgressBar                 = IntegrationUI.SearchElementByName("PART_Achievements_ProgressBar", false, true);
                PART_Achievements_Graphics                    = IntegrationUI.SearchElementByName("PART_Achievements_Graphics", false, true);
                PART_Achievements_List                        = IntegrationUI.SearchElementByName("PART_Achievements_List", false, true);
                PART_Achievements_ListComptact                = IntegrationUI.SearchElementByName("PART_Achievements_ListComptact", false, true);
                PART_Achievements_ListComptactVertical        = IntegrationUI.SearchElementByName("PART_Achievements_ListComptactVertical", false, true);
                PART_Achievements_ListCompactUnlocked         = IntegrationUI.SearchElementByName("PART_Achievements_ListCompactUnlocked", false, true);
                PART_Achievements_ListCompactLocked           = IntegrationUI.SearchElementByName("PART_Achievements_ListCompactLocked", false, true);
                PART_Achievements_ListCompactVerticalUnlocked = IntegrationUI.SearchElementByName("PART_Achievements_ListCompactVerticalUnlocked", false, true);
                PART_Achievements_ListCompactVerticalLocked   = IntegrationUI.SearchElementByName("PART_Achievements_ListCompactVerticalLocked", false, true);

                PART_ScUserStats = IntegrationUI.SearchElementByName("PART_ScUserStats", false, true);
            }
            catch (Exception ex)
            {
                Common.LogError(ex, "SuccessStory", $"Error on find custom element");
            }

            if (PART_ScButtonWithJustIcon != null)
            {
                PART_ScButtonWithJustIcon = new SuccessStoryButton(true);
                ((Button)PART_ScButtonWithJustIcon).Click += OnBtActionBarClick;
                try
                {
                    ui.AddElementInCustomTheme(PART_ScButtonWithJustIcon, "PART_ScButtonWithJustIcon");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_ScButtonWithJustIcon", Element = PART_ScButtonWithJustIcon
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory [Ignored] - PART_ScButtonWithJustIcon not find");
#endif
            }

            if (PART_ScButtonWithTitle != null)
            {
                PART_ScButtonWithTitle = new SuccessStoryButton(false);
                ((Button)PART_ScButtonWithTitle).Click += OnBtActionBarClick;
                try
                {
                    ui.AddElementInCustomTheme(PART_ScButtonWithTitle, "PART_ScButtonWithTitle");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_ScButtonWithTitle", Element = PART_ScButtonWithTitle
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory [Ignored] - PART_ScButtonWithTitle not find");
#endif
            }

            if (PART_ScButtonWithTitleAndDetails != null)
            {
                PART_ScButtonWithTitleAndDetails = new SuccessStoryButtonDetails();
                ((Button)PART_ScButtonWithTitleAndDetails).Click += OnBtActionBarClick;
                try
                {
                    ui.AddElementInCustomTheme(PART_ScButtonWithTitleAndDetails, "PART_ScButtonWithTitleAndDetails");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_ScButtonWithTitleAndDetails", Element = PART_ScButtonWithTitleAndDetails
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory [Ignored] - PART_ScButtonWithTitleAndDetails not find");
#endif
            }


            if (PART_Achievements_ProgressBar != null && PluginDatabase.PluginSettings.IntegrationShowProgressBar)
            {
                PART_Achievements_ProgressBar      = new SuccessStoryAchievementsProgressBar();
                PART_Achievements_ProgressBar.Name = "Achievements_ProgressBar";
                try
                {
                    ui.AddElementInCustomTheme(PART_Achievements_ProgressBar, "PART_Achievements_ProgressBar");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_Achievements_ProgressBar", Element = PART_Achievements_ProgressBar
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory [Ignored] - PART_Achievements_ProgressBar not find");
#endif
            }

            if (PART_Achievements_Graphics != null && PluginDatabase.PluginSettings.IntegrationShowGraphic)
            {
                PART_Achievements_Graphics      = new SuccessStoryAchievementsGraphics();
                PART_Achievements_Graphics.Name = "Achievements_Graphics";
                try
                {
                    ui.AddElementInCustomTheme(PART_Achievements_Graphics, "PART_Achievements_Graphics");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_Achievements_Graphics", Element = PART_Achievements_Graphics
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory [Ignored] - PART_Achievements_Graphics not find");
#endif
            }

            if (PART_Achievements_ListComptact != null && PluginDatabase.PluginSettings.IntegrationShowAchievementsCompact)
            {
                PART_Achievements_ListComptact      = new ScAchievementsListCompact();
                PART_Achievements_ListComptact.Name = "Achievements_ListCompact";
                try
                {
                    ui.AddElementInCustomTheme(PART_Achievements_ListComptact, "PART_Achievements_ListComptact");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_Achievements_ListComptact", Element = PART_Achievements_ListComptact
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory [Ignored] - PART_Achievements_ListComptact not find");
#endif
            }

            if (PART_Achievements_ListComptactVertical != null)// && PluginDatabase.PluginSettings.IntegrationShowAchievementsCompact)
            {
                PART_Achievements_ListComptactVertical      = new ScAchievementsListCompactVertical();
                PART_Achievements_ListComptactVertical.Name = "Achievements_ListCompactVertical";
                try
                {
                    ui.AddElementInCustomTheme(PART_Achievements_ListComptactVertical, "PART_Achievements_ListComptactVertical");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_Achievements_ListComptactVertical", Element = PART_Achievements_ListComptactVertical
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory [Ignored] - PART_Achievements_ListComptactVertical not find");
#endif
            }

            if (PART_Achievements_List != null && PluginDatabase.PluginSettings.IntegrationShowAchievements)
            {
                PART_Achievements_List      = new SuccessStoryAchievementsList();
                PART_Achievements_List.Name = "Achievements_List";
                try
                {
                    ui.AddElementInCustomTheme(PART_Achievements_List, "PART_Achievements_List");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_Achievements_List", Element = PART_Achievements_List
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory [Ignored] - PART_Achievements_List not find");
#endif
            }

            if (PART_Achievements_ListCompactUnlocked != null && PluginDatabase.PluginSettings.IntegrationShowAchievements)
            {
                PART_Achievements_ListCompactUnlocked      = new SuccessStoryAchievementsCompact(true);
                PART_Achievements_ListCompactUnlocked.Name = "Achievements_ListCompactUnlocked";
                try
                {
                    ui.AddElementInCustomTheme(PART_Achievements_ListCompactUnlocked, "PART_Achievements_ListCompactUnlocked");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_Achievements_ListCompactUnlocked", Element = PART_Achievements_ListCompactUnlocked
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory [Ignored] - PART_Achievements_ListCompactUnlocked not find");
#endif
            }

            if (PART_Achievements_ListCompactLocked != null && PluginDatabase.PluginSettings.IntegrationShowAchievements)
            {
                PART_Achievements_ListCompactLocked      = new SuccessStoryAchievementsCompact();
                PART_Achievements_ListCompactLocked.Name = "Achievements_ListCompactLocked";
                try
                {
                    ui.AddElementInCustomTheme(PART_Achievements_ListCompactLocked, "PART_Achievements_ListCompactLocked");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_Achievements_ListCompactLocked", Element = PART_Achievements_ListCompactLocked
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory [Ignored] - PART_Achievements_ListCompactLocked not find");
#endif
            }

            if (PART_Achievements_ListCompactVerticalUnlocked != null)// && PluginDatabase.PluginSettings.IntegrationShowAchievements)
            {
                PART_Achievements_ListCompactVerticalUnlocked      = new SuccessStoryAchievementsCompactVertical(true);
                PART_Achievements_ListCompactVerticalUnlocked.Name = "Achievements_ListCompactVerticalUnlocked";
                try
                {
                    ui.AddElementInCustomTheme(PART_Achievements_ListCompactVerticalUnlocked, "PART_Achievements_ListCompactVerticalUnlocked");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_Achievements_ListCompactVerticalUnlocked", Element = PART_Achievements_ListCompactVerticalUnlocked
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory [Ignored] - PART_Achievements_ListCompactVerticalUnlocked not find");
#endif
            }

            if (PART_Achievements_ListCompactVerticalLocked != null)// && PluginDatabase.PluginSettings.IntegrationShowAchievements)
            {
                PART_Achievements_ListCompactVerticalLocked      = new SuccessStoryAchievementsCompactVertical();
                PART_Achievements_ListCompactVerticalLocked.Name = "Achievements_ListCompactVerticalLocked";
                try
                {
                    ui.AddElementInCustomTheme(PART_Achievements_ListCompactVerticalLocked, "PART_Achievements_ListCompactVerticalLocked");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_Achievements_ListCompactVerticalLocked", Element = PART_Achievements_ListCompactVerticalLocked
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory [Ignored] - PART_Achievements_ListCompactLocked not find");
#endif
            }

            if (PART_ScUserStats != null && PluginDatabase.PluginSettings.IntegrationShowUserStats)
            {
                PART_ScUserStats      = new SuccessStoryUserStats();
                PART_ScUserStats.Name = "UserStats_List";
                try
                {
                    ui.AddElementInCustomTheme(PART_ScUserStats, "PART_ScUserStats");
                    ListCustomElements.Add(new CustomElement {
                        ParentElementName = "PART_ScUserStats", Element = PART_ScUserStats
                    });
                }
                catch (Exception ex)
                {
                    Common.LogError(ex, "SuccessStory", "Error on AddCustomElements()");
                }
            }
            else
            {
#if DEBUG
                logger.Debug($"SuccessStory [Ignored] - PART_UserStats not find");
#endif
            }
        }