Exemplo n.º 1
0
        public SuccessStorySettings(SuccessStory plugin)
        {
            // Injecting your plugin instance is required for Save/Load method because Playnite saves data to a location based on what plugin requested the operation.
            this.plugin = plugin;

            // Load saved settings.
            var savedSettings = plugin.LoadPluginSettings <SuccessStorySettings>();

            // LoadPluginSettings returns null if not saved data is available.
            if (savedSettings != null)
            {
                EnableIntegrationInDescription           = savedSettings.EnableIntegrationInDescription;
                EnableIntegrationInDescriptionWithToggle = savedSettings.EnableIntegrationInDescriptionWithToggle;

                IntegrationShowTitle        = savedSettings.IntegrationShowTitle;
                IntegrationShowGraphic      = savedSettings.IntegrationShowGraphic;
                IntegrationShowAchievements = savedSettings.IntegrationShowAchievements;
                IntegrationTopGameDetails   = savedSettings.IntegrationTopGameDetails;
                IntegrationToggleDetails    = savedSettings.IntegrationToggleDetails;

                EnableIntegrationInCustomTheme = savedSettings.EnableIntegrationInCustomTheme;

                EnableIntegrationButton        = savedSettings.EnableIntegrationButton;
                EnableIntegrationButtonDetails = savedSettings.EnableIntegrationButtonDetails;

                EnableSteam  = savedSettings.EnableSteam;
                EnableGog    = savedSettings.EnableGog;
                EnableOrigin = savedSettings.EnableOrigin;

                EnableLocal = savedSettings.EnableLocal;

                NameSorting = savedSettings.NameSorting;
                IsAsc       = savedSettings.IsAsc;
            }
        }
Exemplo n.º 2
0
        public SuccessStorySettings(SuccessStory plugin)
        {
            // Injecting your plugin instance is required for Save/Load method because Playnite saves data to a location based on what plugin requested the operation.
            this.plugin = plugin;

            // Load saved settings.
            var savedSettings = plugin.LoadPluginSettings <SuccessStorySettings>();

            // LoadPluginSettings returns null if not saved data is available.
            if (savedSettings != null)
            {
                EnableCheckVersion = savedSettings.EnableCheckVersion;

                EnableIntegrationInDescription           = savedSettings.EnableIntegrationInDescription;
                EnableIntegrationInDescriptionWithToggle = savedSettings.EnableIntegrationInDescriptionWithToggle;

                GraphicAllUnlockedByMonth = savedSettings.GraphicAllUnlockedByMonth;
                GraphicAllUnlockedByDay   = savedSettings.GraphicAllUnlockedByDay;

                IncludeHiddenGames = savedSettings.IncludeHiddenGames;

                IntegrationShowTitle        = savedSettings.IntegrationShowTitle;
                IntegrationShowGraphic      = savedSettings.IntegrationShowGraphic;
                IntegrationShowAchievements = savedSettings.IntegrationShowAchievements;
                IntegrationTopGameDetails   = savedSettings.IntegrationTopGameDetails;
                IntegrationToggleDetails    = savedSettings.IntegrationToggleDetails;

                EnableIntegrationInCustomTheme = savedSettings.EnableIntegrationInCustomTheme;

                EnableIntegrationButton        = savedSettings.EnableIntegrationButton;
                EnableIntegrationButtonDetails = savedSettings.EnableIntegrationButtonDetails;

                EnableIntegrationButtonHeader = savedSettings.EnableIntegrationButtonHeader;

                IntegrationShowProgressBar          = savedSettings.IntegrationShowProgressBar;
                IntegrationShowProgressBarIndicator = savedSettings.IntegrationShowProgressBarIndicator;
                IntegrationShowProgressBarPercent   = savedSettings.IntegrationShowProgressBarPercent;

                EnableSteam             = savedSettings.EnableSteam;
                EnableGog               = savedSettings.EnableGog;
                EnableOrigin            = savedSettings.EnableOrigin;
                EnableRetroAchievements = savedSettings.EnableRetroAchievements;

                RetroAchievementsUser = savedSettings.RetroAchievementsUser;
                RetroAchievementsKey  = savedSettings.RetroAchievementsKey;

                EnableLocal = savedSettings.EnableLocal;

                NameSorting = savedSettings.NameSorting;
                IsAsc       = savedSettings.IsAsc;
            }
        }
Exemplo n.º 3
0
        public SuccessStorySettings(SuccessStory plugin)
        {
            // Injecting your plugin instance is required for Save/Load method because Playnite saves data to a location based on what plugin requested the operation.
            this.plugin = plugin;

            // Load saved settings.
            var savedSettings = plugin.LoadPluginSettings <SuccessStorySettings>();

            // LoadPluginSettings returns null if not saved data is available.
            if (savedSettings != null)
            {
                EnableCheckVersion = savedSettings.EnableCheckVersion;
                MenuInExtensions   = savedSettings.MenuInExtensions;
                EnableImageCache   = savedSettings.EnableImageCache;

                EnableIntegrationInDescription           = savedSettings.EnableIntegrationInDescription;
                EnableIntegrationInDescriptionWithToggle = savedSettings.EnableIntegrationInDescriptionWithToggle;

                EnableIntegrationInDescriptionOnlyIcon = savedSettings.EnableIntegrationInDescriptionOnlyIcon;

                GraphicAllUnlockedByMonth = savedSettings.GraphicAllUnlockedByMonth;
                GraphicAllUnlockedByDay   = savedSettings.GraphicAllUnlockedByDay;

                IncludeHiddenGames = savedSettings.IncludeHiddenGames;

                IntegrationShowTitle                       = savedSettings.IntegrationShowTitle;
                IntegrationShowGraphic                     = savedSettings.IntegrationShowGraphic;
                IntegrationShowAchievements                = savedSettings.IntegrationShowAchievements;
                IntegrationShowAchievementsCompact         = savedSettings.IntegrationShowAchievementsCompact;
                IntegrationShowAchievementsCompactLocked   = savedSettings.IntegrationShowAchievementsCompactLocked;
                IntegrationShowAchievementsCompactUnlocked = savedSettings.IntegrationShowAchievementsCompactUnlocked;
                IntegrationShowUserStats                   = savedSettings.IntegrationShowUserStats;
                IntegrationTopGameDetails                  = savedSettings.IntegrationTopGameDetails;
                IntegrationToggleDetails                   = savedSettings.IntegrationToggleDetails;

                EnableIntegrationAxisGraphic           = savedSettings.EnableIntegrationAxisGraphic;
                EnableIntegrationOrdinatesGraphic      = savedSettings.EnableIntegrationOrdinatesGraphic;
                IntegrationShowAchievementsHeight      = savedSettings.IntegrationShowAchievementsHeight;
                IntegrationShowGraphicHeight           = savedSettings.IntegrationShowGraphicHeight;
                IntegrationGraphicOptionsCountAbscissa = savedSettings.IntegrationGraphicOptionsCountAbscissa;
                IntegrationAchievementsColCount        = savedSettings.IntegrationAchievementsColCount;

                EnableIntegrationInCustomTheme = savedSettings.EnableIntegrationInCustomTheme;

                EnableIntegrationButton        = savedSettings.EnableIntegrationButton;
                EnableIntegrationButtonDetails = savedSettings.EnableIntegrationButtonDetails;

                EnableIntegrationButtonHeader = savedSettings.EnableIntegrationButtonHeader;

                IntegrationShowProgressBar          = savedSettings.IntegrationShowProgressBar;
                IntegrationShowProgressBarIndicator = savedSettings.IntegrationShowProgressBarIndicator;
                IntegrationShowProgressBarPercent   = savedSettings.IntegrationShowProgressBarPercent;

                EnableSteam             = savedSettings.EnableSteam;
                EnableGog               = savedSettings.EnableGog;
                EnableOrigin            = savedSettings.EnableOrigin;
                EnableXbox              = savedSettings.EnableXbox;
                EnableRetroAchievements = savedSettings.EnableRetroAchievements;
                EnableRpcs3Achievements = savedSettings.EnableRpcs3Achievements;

                EnableSteamWithoutWebApi = savedSettings.EnableSteamWithoutWebApi;

                Rpcs3InstallationFolder = savedSettings.Rpcs3InstallationFolder;

                EnableRetroAchievementsView = savedSettings.EnableRetroAchievementsView;
                EnableOneGameView           = savedSettings.EnableOneGameView;

                RetroAchievementsUser = savedSettings.RetroAchievementsUser;
                RetroAchievementsKey  = savedSettings.RetroAchievementsKey;

                EnableLocal = savedSettings.EnableLocal;
                LocalPath   = savedSettings.LocalPath;

                EnableManual = savedSettings.EnableManual;

                NameSorting = savedSettings.NameSorting;
                IsAsc       = savedSettings.IsAsc;

                EnableRaretyIndicator = savedSettings.EnableRaretyIndicator;

                lvGamesIcon100Percent = savedSettings.lvGamesIcon100Percent;
                lvGamesIcon           = savedSettings.lvGamesIcon;
                lvGamesName           = savedSettings.lvGamesName;
                lvGamesLastSession    = savedSettings.lvGamesLastSession;
                lvGamesSource         = savedSettings.lvGamesSource;
                lvGamesProgression    = savedSettings.lvGamesProgression;

                EnableIntegrationFS = savedSettings.EnableIntegrationFS;
            }
        }
        public SuccessView(SuccessStory plugin, IPlayniteAPI PlayniteApi, string PluginUserDataPath, bool isRetroAchievements = false, Game GameSelected = null)
        {
            _plugin              = plugin;
            _PlayniteApi         = PlayniteApi;
            _PlayniteApiDatabase = PlayniteApi.Database;
            _PlayniteApiPaths    = PlayniteApi.Paths;
            _PluginUserDataPath  = PluginUserDataPath;


            InitializeComponent();


            PART_DataLoad.Visibility = Visibility.Visible;
            PART_Data.Visibility     = Visibility.Hidden;

            var TaskView = Task.Run(() =>
            {
                GetListGame();
                SetGraphicsAchievementsSources();

                this.Dispatcher.BeginInvoke((Action) delegate
                {
                    // Block hidden column.
                    lvProgressionValue.IsEnabled = false;
                    lvSourceName.IsEnabled       = false;


                    pbProgressionGlobalCount.Value      = PluginDatabase.Progession().Unlocked;
                    pbProgressionGlobalCount.Maximum    = PluginDatabase.Progession().Total;
                    labelProgressionGlobalCount.Content = PluginDatabase.Progession().Progression + "%";

                    pbProgressionLaunchedCount.Value      = PluginDatabase.ProgessionLaunched().Unlocked;
                    pbProgressionLaunchedCount.Maximum    = PluginDatabase.ProgessionLaunched().Total;
                    labelProgressionLaunchedCount.Content = PluginDatabase.ProgessionLaunched().Progression + "%";


                    GraphicTitle.Content = string.Empty;


                    // lvGames options
                    if (!PluginDatabase.PluginSettings.lvGamesIcon100Percent)
                    {
                        lvGameIcon100Percent.Width = 0;
                    }
                    if (!PluginDatabase.PluginSettings.lvGamesIcon)
                    {
                        lvGameIcon.Width = 0;
                    }
                    if (!PluginDatabase.PluginSettings.lvGamesName)
                    {
                        lvGameName.Width = 0;
                    }
                    if (!PluginDatabase.PluginSettings.lvGamesLastSession)
                    {
                        lvGameLastActivity.Width = 0;
                    }
                    if (!PluginDatabase.PluginSettings.lvGamesSource)
                    {
                        lvGamesSource.Width = 0;
                    }
                    if (!PluginDatabase.PluginSettings.lvGamesProgression)
                    {
                        lvGameProgression.Width = 0;
                    }

                    int limit = 5;
                    GraphicTitleALL.Content = resources.GetString("LOCSuccessStoryGraphicTitleALL");

                    SuccessStory_Achievements_Graphics.Children.Clear();
                    PluginDatabase.PluginSettings.IgnoreSettings = true;
                    SuccessStoryAchievementsGraphics successStoryAchievementsGraphics = new SuccessStoryAchievementsGraphics();
                    successStoryAchievementsGraphics.SetScData(null, limit, true);
                    SuccessStory_Achievements_Graphics.Children.Add(successStoryAchievementsGraphics);
                    SuccessStory_Achievements_Graphics.UpdateLayout();

                    // Set game selected
                    if (GameSelected != null)
                    {
                        for (int i = 0; i < ListviewGames.Items.Count; i++)
                        {
                            if (((ListViewGames)ListviewGames.Items[i]).Name == GameSelected.Name)
                            {
                                ListviewGames.SelectedIndex = i;
                            }
                        }
                    }
                    ListviewGames.ScrollIntoView(ListviewGames.SelectedItem);

                    string icon = string.Empty;

                    if (PluginDatabase.PluginSettings.EnableRetroAchievementsView && PluginDatabase.PluginSettings.EnableRetroAchievements)
                    {
                        if (isRetroAchievements)
                        {
                            PART_GraphicBySource.Visibility = Visibility.Collapsed;
                            Grid.SetColumn(PART_GraphicAllUnlocked, 0);
                            Grid.SetColumnSpan(PART_GraphicAllUnlocked, 3);

                            if (PluginDatabase.PluginSettings.EnableRetroAchievements)
                            {
                                icon = TransformIcon.Get("RetroAchievements") + " ";
                                FilterSourceItems.Add(new ListSource {
                                    SourceName = ((icon.Length == 2) ? icon : string.Empty) + "RetroAchievements", SourceNameShort = "RetroAchievements", IsCheck = false
                                });
                            }
                        }
                        else
                        {
                            if (PluginDatabase.PluginSettings.EnableLocal)
                            {
                                icon = TransformIcon.Get("Playnite") + " ";
                                FilterSourceItems.Add(new ListSource {
                                    SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Playnite", SourceNameShort = "Playnite", IsCheck = false
                                });

                                icon = TransformIcon.Get("Hacked") + " ";
                                FilterSourceItems.Add(new ListSource {
                                    SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Hacked", SourceNameShort = "Hacked", IsCheck = false
                                });
                            }
                            if (PluginDatabase.PluginSettings.EnableSteam)
                            {
                                icon = TransformIcon.Get("Steam") + " ";
                                FilterSourceItems.Add(new ListSource {
                                    SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Steam", SourceNameShort = "Steam", IsCheck = false
                                });
                            }
                            if (PluginDatabase.PluginSettings.EnableGog)
                            {
                                icon = TransformIcon.Get("GOG") + " ";
                                FilterSourceItems.Add(new ListSource {
                                    SourceName = ((icon.Length == 2) ? icon : string.Empty) + "GOG", SourceNameShort = "GOG", IsCheck = false
                                });
                            }
                            if (PluginDatabase.PluginSettings.EnableOrigin)
                            {
                                icon = TransformIcon.Get("Origin") + " ";
                                FilterSourceItems.Add(new ListSource {
                                    SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Origin", SourceNameShort = "Origin", IsCheck = false
                                });
                            }
                            if (PluginDatabase.PluginSettings.EnableXbox)
                            {
                                icon = TransformIcon.Get("Xbox") + " ";
                                FilterSourceItems.Add(new ListSource {
                                    SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Xbox", SourceNameShort = "Xbox", IsCheck = false
                                });
                            }
                            if (PluginDatabase.PluginSettings.EnableRpcs3Achievements)
                            {
                                icon = TransformIcon.Get("Rpcs3") + " ";
                                FilterSourceItems.Add(new ListSource {
                                    SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Rpcs3", SourceNameShort = "Rpcs3", IsCheck = false
                                });
                            }
                            if (PluginDatabase.PluginSettings.EnableManual)
                            {
                                icon = TransformIcon.Get("Manual") + " ";
                                FilterSourceItems.Add(new ListSource {
                                    SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Manual", SourceNameShort = "Manual", IsCheck = false
                                });
                            }
                        }
                    }
                    else
                    {
                        if (PluginDatabase.PluginSettings.EnableLocal)
                        {
                            icon = TransformIcon.Get("Playnite") + " ";
                            FilterSourceItems.Add(new ListSource {
                                SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Playnite", SourceNameShort = "Playnite", IsCheck = false
                            });

                            icon = TransformIcon.Get("Hacked") + " ";
                            FilterSourceItems.Add(new ListSource {
                                SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Hacked", SourceNameShort = "Hacked", IsCheck = false
                            });
                        }
                        if (PluginDatabase.PluginSettings.EnableSteam)
                        {
                            icon = TransformIcon.Get("Steam") + " ";
                            FilterSourceItems.Add(new ListSource {
                                SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Steam", SourceNameShort = "Steam", IsCheck = false
                            });
                        }
                        if (PluginDatabase.PluginSettings.EnableGog)
                        {
                            icon = TransformIcon.Get("GOG") + " ";
                            FilterSourceItems.Add(new ListSource {
                                SourceName = ((icon.Length == 2) ? icon : string.Empty) + "GOG", SourceNameShort = "GOG", IsCheck = false
                            });
                        }
                        if (PluginDatabase.PluginSettings.EnableOrigin)
                        {
                            icon = TransformIcon.Get("Origin") + " ";
                            FilterSourceItems.Add(new ListSource {
                                SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Origin", SourceNameShort = "Origin", IsCheck = false
                            });
                        }
                        if (PluginDatabase.PluginSettings.EnableXbox)
                        {
                            icon = TransformIcon.Get("Xbox") + " ";
                            FilterSourceItems.Add(new ListSource {
                                SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Xbox", SourceNameShort = "Xbox", IsCheck = false
                            });
                        }
                        if (PluginDatabase.PluginSettings.EnableRetroAchievements)
                        {
                            icon = TransformIcon.Get("RetroAchievements") + " ";
                            FilterSourceItems.Add(new ListSource {
                                SourceName = ((icon.Length == 2) ? icon : string.Empty) + "RetroAchievements", SourceNameShort = "RetroAchievements", IsCheck = false
                            });
                        }
                        if (PluginDatabase.PluginSettings.EnableRpcs3Achievements)
                        {
                            icon = TransformIcon.Get("RPCS3") + " ";
                            FilterSourceItems.Add(new ListSource {
                                SourceName = ((icon.Length == 2) ? icon : string.Empty) + "RPCS3", SourceNameShort = "Rpcs3", IsCheck = false
                            });
                        }
                        if (PluginDatabase.PluginSettings.EnableManual)
                        {
                            icon = TransformIcon.Get("Manual") + " ";
                            FilterSourceItems.Add(new ListSource {
                                SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Manual", SourceNameShort = "Manual", IsCheck = false
                            });
                        }
                    }

                    FilterSource.ItemsSource = FilterSourceItems;


                    // Set Binding data
                    DataContext = this;

                    PART_DataLoad.Visibility = Visibility.Hidden;
                    PART_Data.Visibility     = Visibility.Visible;
                });
            });
        }
Exemplo n.º 5
0
        public SuccessView(SuccessStory plugin, SuccessStorySettings settings, IPlayniteAPI PlayniteApi, string PluginUserDataPath, bool isRetroAchievements = false, Game GameSelected = null)
        {
            this.plugin             = plugin;
            this._PlayniteApi       = PlayniteApi;
            _PlayniteApiDatabase    = PlayniteApi.Database;
            _PlayniteApiPaths       = PlayniteApi.Paths;
            this.settings           = settings;
            this.PluginUserDataPath = PluginUserDataPath;


            InitializeComponent();


            PART_DataLoad.Visibility = Visibility.Visible;
            PART_Data.Visibility     = Visibility.Hidden;

            var TaskView = Task.Run(() =>
            {
                AchievementsDb = new AchievementsDatabase(plugin, PlayniteApi, settings, PluginUserDataPath, isRetroAchievements);
                AchievementsDb.Initialize(false);

                GetListGame();
                SetGraphicsAchievementsSources();

                AchievementsGraphicsDataCount GraphicsData = null;
                if (settings.GraphicAllUnlockedByMonth)
                {
                    GraphicsData = AchievementsDb.GetCountByMonth(null, 6);
                }
                else
                {
                    GraphicsData = AchievementsDb.GetCountByDay(null, 5);
                }

                Application.Current.Dispatcher.BeginInvoke((Action) delegate
                {
                    // Block hidden column.
                    lvProgressionValue.IsEnabled = false;
                    lvSourceName.IsEnabled       = false;


                    pbProgressionGlobalCount.Value      = AchievementsDb.Progession().Unlocked;
                    pbProgressionGlobalCount.Maximum    = AchievementsDb.Progession().Total;
                    labelProgressionGlobalCount.Content = AchievementsDb.Progession().Progression + "%";

                    pbProgressionLaunchedCount.Value      = AchievementsDb.ProgessionLaunched().Unlocked;
                    pbProgressionLaunchedCount.Maximum    = AchievementsDb.ProgessionLaunched().Total;
                    labelProgressionLaunchedCount.Content = AchievementsDb.ProgessionLaunched().Progression + "%";


                    GraphicTitle.Content = string.Empty;


                    // lvGames options
                    if (!settings.lvGamesIcon100Percent)
                    {
                        lvGameIcon100Percent.Width = 0;
                    }
                    if (!settings.lvGamesIcon)
                    {
                        lvGameIcon.Width = 0;
                    }
                    if (!settings.lvGamesName)
                    {
                        lvGameName.Width = 0;
                    }
                    if (!settings.lvGamesLastSession)
                    {
                        lvGameLastActivity.Width = 0;
                    }
                    if (!settings.lvGamesSource)
                    {
                        lvGamesSource.Width = 0;
                    }
                    if (!settings.lvGamesProgression)
                    {
                        lvGameProgression.Width = 0;
                    }


                    if (settings.GraphicAllUnlockedByMonth)
                    {
                        GraphicTitleALL.Content = resources.GetString("LOCSuccessStoryGraphicTitleALL");
                    }
                    else
                    {
                        GraphicTitleALL.Content = resources.GetString("LOCSuccessStoryGraphicTitleALLDay");
                    }
                    string[] StatsGraphicsAchievementsLabels        = GraphicsData.Labels;
                    SeriesCollection StatsGraphicAchievementsSeries = new SeriesCollection();
                    StatsGraphicAchievementsSeries.Add(new LineSeries
                    {
                        Title  = string.Empty,
                        Values = GraphicsData.Series
                    });

                    SuccessStory_Achievements_Graphics.Children.Clear();
                    settings.IgnoreSettings = true;
                    SuccessStory_Achievements_Graphics.Children.Add(new SuccessStoryAchievementsGraphics(StatsGraphicAchievementsSeries, StatsGraphicsAchievementsLabels, settings));
                    SuccessStory_Achievements_Graphics.UpdateLayout();

                    // Set game selected
                    if (GameSelected != null)
                    {
                        for (int i = 0; i < ListviewGames.Items.Count; i++)
                        {
                            if (((ListViewGames)ListviewGames.Items[i]).Name == GameSelected.Name)
                            {
                                ListviewGames.SelectedIndex = i;
                            }
                        }
                    }
                    ListviewGames.ScrollIntoView(ListviewGames.SelectedItem);

                    string icon = string.Empty;

                    if (settings.EnableRetroAchievementsView && settings.EnableRetroAchievements)
                    {
                        if (isRetroAchievements)
                        {
                            PART_GraphicBySource.Visibility = Visibility.Collapsed;
                            Grid.SetColumn(PART_GraphicAllUnlocked, 0);
                            Grid.SetColumnSpan(PART_GraphicAllUnlocked, 3);

                            if (settings.EnableRetroAchievements)
                            {
                                icon = TransformIcon.Get("RetroAchievements") + " ";
                                FilterSourceItems.Add(new ListSource {
                                    SourceName = ((icon.Length == 2) ? icon : string.Empty) + "RetroAchievements", SourceNameShort = "RetroAchievements", IsCheck = false
                                });
                            }
                        }
                        else
                        {
                            if (settings.EnableLocal)
                            {
                                icon = TransformIcon.Get("Playnite") + " ";
                                FilterSourceItems.Add(new ListSource {
                                    SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Playnite", SourceNameShort = "Playnite", IsCheck = false
                                });
                            }
                            if (settings.EnableSteam)
                            {
                                icon = TransformIcon.Get("Steam") + " ";
                                FilterSourceItems.Add(new ListSource {
                                    SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Steam", SourceNameShort = "Steam", IsCheck = false
                                });
                            }
                            if (settings.EnableGog)
                            {
                                icon = TransformIcon.Get("GOG") + " ";
                                FilterSourceItems.Add(new ListSource {
                                    SourceName = ((icon.Length == 2) ? icon : string.Empty) + "GOG", SourceNameShort = "GOG", IsCheck = false
                                });
                            }
                            if (settings.EnableOrigin)
                            {
                                icon = TransformIcon.Get("Origin") + " ";
                                FilterSourceItems.Add(new ListSource {
                                    SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Origin", SourceNameShort = "Origin", IsCheck = false
                                });
                            }
                            if (settings.EnableXbox)
                            {
                                icon = TransformIcon.Get("Xbox") + " ";
                                FilterSourceItems.Add(new ListSource {
                                    SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Xbox", SourceNameShort = "Xbox", IsCheck = false
                                });
                            }
                        }
                    }
                    else
                    {
                        if (settings.EnableLocal)
                        {
                            icon = TransformIcon.Get("Playnite") + " ";
                            FilterSourceItems.Add(new ListSource {
                                SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Playnite", SourceNameShort = "Playnite", IsCheck = false
                            });
                        }
                        if (settings.EnableSteam)
                        {
                            icon = TransformIcon.Get("Steam") + " ";
                            FilterSourceItems.Add(new ListSource {
                                SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Steam", SourceNameShort = "Steam", IsCheck = false
                            });
                        }
                        if (settings.EnableGog)
                        {
                            icon = TransformIcon.Get("GOG") + " ";
                            FilterSourceItems.Add(new ListSource {
                                SourceName = ((icon.Length == 2) ? icon : string.Empty) + "GOG", SourceNameShort = "GOG", IsCheck = false
                            });
                        }
                        if (settings.EnableOrigin)
                        {
                            icon = TransformIcon.Get("Origin") + " ";
                            FilterSourceItems.Add(new ListSource {
                                SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Origin", SourceNameShort = "Origin", IsCheck = false
                            });
                        }
                        if (settings.EnableXbox)
                        {
                            icon = TransformIcon.Get("Xbox") + " ";
                            FilterSourceItems.Add(new ListSource {
                                SourceName = ((icon.Length == 2) ? icon : string.Empty) + "Xbox", SourceNameShort = "Xbox", IsCheck = false
                            });
                        }
                        if (settings.EnableRetroAchievements)
                        {
                            icon = TransformIcon.Get("RetroAchievements") + " ";
                            FilterSourceItems.Add(new ListSource {
                                SourceName = ((icon.Length == 2) ? icon : string.Empty) + "RetroAchievements", SourceNameShort = "RetroAchievements", IsCheck = false
                            });
                        }
                    }

                    FilterSource.ItemsSource = FilterSourceItems;


                    // Set Binding data
                    DataContext = this;

                    PART_DataLoad.Visibility = Visibility.Hidden;
                    PART_Data.Visibility     = Visibility.Visible;
                });
            });
        }