Exemplo n.º 1
0
 /// <summary>
 /// Loads the current save data if available
 /// </summary>
 protected override void LoadData()
 {
     // Read and set slot data
     ProgressionSlots.AddRange(new ProgressionSlotViewModel[]
     {
         GetProgressionSlotViewModel("slot1.dat", () => String.Format(Resources.Progression_GenericSlot, "1")),
         GetProgressionSlotViewModel("slot2.dat", () => String.Format(Resources.Progression_GenericSlot, "2")),
         GetProgressionSlotViewModel("slot3.dat", () => String.Format(Resources.Progression_GenericSlot, "3"))
     });
 }
Exemplo n.º 2
0
        /// <summary>
        /// Loads the current save data if available
        /// </summary>
        protected override void LoadData()
        {
            // Make sure the file exists
            if (!ConfigFilePath.FileExists)
            {
                return;
            }

            // Create streams
            using var saveFileStream    = File.OpenRead(ConfigFilePath);
            using var decodedDataStream = new MemoryStream();

            // Decode the save file
            new Rayman12PCSaveDataEncoder().Decode(saveFileStream, decodedDataStream);

            // Set position to 0
            decodedDataStream.Position = 0;

            // Get the serialized data
            var config = BinarySerializableHelpers.ReadFromStream <Rayman2PCConfigData>(decodedDataStream, OpenSpaceSettings.GetDefaultSettings(OpenSpaceGame.Rayman2, Platform.PC), RCPServices.App.GetBinarySerializerLogger());

            // Read and set slot data
            ProgressionSlots.AddRange(config.Slots.Select(x => GetProgressionSlotViewModel(SaveGamePath + $"Slot{x.SlotIndex}" + "General.sav", x.SlotDisplayName)));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Loads the current save data if available
 /// </summary>
 protected override void LoadData()
 {
     // Read and set slot data
     ProgressionSlots.AddRange(Directory.GetFiles(SaveDir, "*.SAV", SearchOption.TopDirectoryOnly).Select(x => GetProgressionSlotViewModel(x)));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Loads the current save data if available
 /// </summary>
 protected override void LoadData()
 {
     // Read and set slot data
     ProgressionSlots.AddRange(Directory.GetDirectories(SaveDir).Select(x => new FileSystemPath(x) + "RaymanSave_0").Select(GetProgressionSlotViewModel));
 }