Exemple #1
0
    public GameOptions_EducationalDos_GameInfoItemViewModel(GameOptions_EducationalDos_ViewModel parentVM, UserData_EducationalDosBoxGameData gameData, string name)
    {
        ParentVM = parentVM;
        GameData = gameData;
        Name     = name;

        EditGameCommand     = new AsyncRelayCommand(EditGameAsync);
        OpenLocationCommand = new AsyncRelayCommand(OpenLocationAsync);
        RemoveGameCommand   = new AsyncRelayCommand(RemoveGameAsync);
    }
Exemple #2
0
    public EducationalDosGameEditViewModel(UserData_EducationalDosBoxGameData game, string[] availableLaunchModes = null)
    {
        // Get the available launch modes
        AvailableLaunchModes = availableLaunchModes ??
                               Directory.GetDirectories(game.InstallDir + "PCMAP", "*", SearchOption.TopDirectoryOnly).
                               Select(x => new FileSystemPath(x).Name).
                               ToArray();

        MountPath  = game.MountPath;
        LaunchMode = game.LaunchMode ?? AvailableLaunchModes.FirstOrDefault();
        Name       = game.Name;
    }
    public UserData_EducationalDosBoxGameData GetNewEducationalDosBoxGameInfo(FileSystemPath installDir)
    {
        // Find the launch name
        FileSystemPath launchName = Directory.EnumerateFiles(installDir, "*.exe", SearchOption.TopDirectoryOnly).FirstOrDefault();

        // Create the collection if it doesn't exist
        if (Services.Data.Game_EducationalDosBoxGames == null)
        {
            Services.Data.Game_EducationalDosBoxGames = new List <UserData_EducationalDosBoxGameData>();
        }

        // Create the game data
        var info = new UserData_EducationalDosBoxGameData(installDir, launchName.Name)
        {
            Name = installDir.Name
        };

        return(info);
    }
    public async Task <bool> VerifyCanLaunchAsync(UserData_EducationalDosBoxGameData game)
    {
        // Make sure the DosBox executable exists
        if (!File.Exists(Services.Data.Emu_DOSBox_Path))
        {
            await Services.MessageUI.DisplayMessageAsync(Resources.LaunchGame_DosBoxNotFound, MessageType.Error);

            return(false);
        }

        // Make sure the mount path exists, unless the game is Rayman 1 and TPLS is enabled
        if (!game.MountPath.Exists)
        {
            await Services.MessageUI.DisplayMessageAsync(Resources.LaunchGame_MountPathNotFound, MessageType.Error);

            return(false);
        }

        return(true);
    }
 public ProgressionGameViewModel_EducationalDos(UserData_EducationalDosBoxGameData gameData) : base(Games.EducationalDos, gameData.Name)
 {
     GameData = gameData;
 }
 public GameLaunchInfo GetLaunchInfo(UserData_EducationalDosBoxGameData game)
 {
     return(new GameLaunchInfo(Services.Data.Emu_DOSBox_Path, GetDosBoxArguments(game.MountPath, $"{game.LaunchName} ver={game.LaunchMode}", game.InstallDir)));
 }