Ejemplo n.º 1
0
        public static string GetDefaultIcon(this Game game, PlayniteSettings settings, GameDatabase database, LibraryPlugin plugin)
        {
            if (settings.DefaultIconSource == DefaultIconSourceOptions.None)
            {
                return(null);
            }
            else if (settings.DefaultIconSource == DefaultIconSourceOptions.Library && plugin?.LibraryIcon.IsNullOrEmpty() == false)
            {
                return(plugin.LibraryIcon);
            }
            else if (settings.DefaultIconSource == DefaultIconSourceOptions.Platform && game.Platform?.Icon.IsNullOrEmpty() == false)
            {
                return(database.GetFullFilePath(game.Platform.Icon));
            }

            return(null);
        }
Ejemplo n.º 2
0
 public GamesEditor(
     GameDatabase database,
     GameControllerFactory controllerFactory,
     PlayniteSettings appSettings,
     IDialogsFactory dialogs,
     ExtensionFactory extensions,
     PlayniteApplication app)
 {
     this.Dialogs             = dialogs;
     this.Database            = database;
     this.AppSettings         = appSettings;
     this.Extensions          = extensions;
     this.Application         = app;
     controllers              = controllerFactory;
     controllers.Installed   += Controllers_Installed;
     controllers.Uninstalled += Controllers_Uninstalled;
     controllers.Started     += Controllers_Started;
     controllers.Stopped     += Controllers_Stopped;
 }
Ejemplo n.º 3
0
        public static PlayniteSettings LoadSettings()
        {
            var settings = LoadSettingFile <PlayniteSettings>(PlaynitePaths.ConfigFilePath);

            if (settings == null)
            {
                settings = new PlayniteSettings();
            }

            settings.WindowPositions = LoadSettingFile <WindowPositions>(PlaynitePaths.WindowPositionsPath);
            if (settings.WindowPositions == null)
            {
                settings.WindowPositions = new WindowPositions();
            }

            settings.Fullscreen = LoadSettingFile <FullscreenSettings>(PlaynitePaths.FullscreenConfigFilePath);
            if (settings.Fullscreen == null)
            {
                settings.Fullscreen = new FullscreenSettings();
            }

            return(settings);
        }
Ejemplo n.º 4
0
        public static PlayniteSettings LoadSettings()
        {
            var settings = LoadSettingFile <PlayniteSettings>(PlaynitePaths.ConfigFilePath);

            if (settings == null)
            {
                settings = new PlayniteSettings();
            }
            else
            {
                if (settings.Version == 1)
                {
                    settings.BackgroundImageBlurAmount = 17;
                    settings.Version = 2;
                }

                if (settings.Version == 2)
                {
                    settings.BackgroundImageBlurAmount = 60;
                    settings.Version = 3;
                }
            }

            settings.WindowPositions = LoadSettingFile <WindowPositions>(PlaynitePaths.WindowPositionsPath);
            if (settings.WindowPositions == null)
            {
                settings.WindowPositions = new WindowPositions();
            }

            settings.Fullscreen = LoadSettingFile <FullscreenSettings>(PlaynitePaths.FullscreenConfigFilePath);
            if (settings.Fullscreen == null)
            {
                settings.Fullscreen = new FullscreenSettings();
            }

            return(settings);
        }