Exemplo n.º 1
0
        //
        // Methods...
        //

        /// <summary>
        /// Save a file (& generate C# code)
        ///
        /// Called by an incoming http connection =>
        /// THREADSAFETY: Called from web server thread => do not call Unity code from this thread!
        /// </summary>
        /// <param name="data">Data.</param>
        public void Save(Dictionary <string, string> data)
        {
            string filename    = data ["file"];
            string content     = data ["content"];
            string codecontent = data ["code"];

            ServerLog.Log("Saving \"" + filename + "\"");

            string fullpath  = Path.Combine(scriptOutputDir, filename);
            string directory = Path.GetDirectoryName(fullpath);

            // Save the file
            Directory.CreateDirectory(directory);

            SaveEntry entry = new SaveEntry();

            entry.filename = "Assets/" + filename;
            entry.content  = content;
            entry.code     = VubbiFileHandler.GenerateHeader() + codecontent;

            lock (lockThis) {
                specificAssetsToSave.Add(entry);
            }

            // Note: if the save throws an error we will never know (we are in a different thread and we are not waiting for the save)
        }
Exemplo n.º 2
0
 /// <summary>
 ///   Suspends the serialization. Must resume as many times as you suspend
 /// </summary>
 public static void SuspendSerialization()
 {
     if (_suspensionCount == 0)
     {
         SuspendingSerialization();
         if (SerializationMode == SerializationModes.CacheSerialization)
         {
             _cachedState = CreateSaveEntry("resume", true);
             if (SaveResumeInformation)
             {
                 try
                 {
                     PlayerPrefs.SetString(PlayerName + "JSON__RESUME__",
                                           UnitySerializer.JSONSerialize(_cachedState));
                     PlayerPrefs.Save();
                 }
                 catch
                 {
                     Debug.LogError("Failed to save game");
                 }
             }
         }
     }
     _suspensionCount++;
 }
Exemplo n.º 3
0
        public void EnableEntry(SaveEntry entry)
        {
            SaveButton.isEnabled   = manager.CanSave();
            LoadButton.isEnabled   = manager.CanLoad();
            DeleteButton.isEnabled = true;
            string empty = string.Empty;

            if (GameSystem.Instance.UseEnglishText)
            {
                empty = entry.Text;
                if (empty == string.Empty)
                {
                    empty = entry.TextJp;
                }
            }
            else
            {
                empty = entry.TextJp;
                if (empty == string.Empty)
                {
                    empty = entry.Text;
                }
            }
            BottomLabel.text        = empty.Replace("\n", " ").TrimStart(' ', '\n');
            SaveTexture.mainTexture = AssetManager.Instance.LoadScreenshot(Path.GetFileNameWithoutExtension(entry.Path) + ".png");
        }
Exemplo n.º 4
0
        public void LoadSlot(int slotnum)
        {
            SaveEntry saveInfo = BurikoScriptSystem.Instance.GetSaveInfo(slotnum);

            SaveButton.GetComponent <SaveLoadButton>().Prepare(slotnum, manager);
            if (saveInfo == null)
            {
                if (isEnabled)
                {
                    isEnabled = false;
                    lastDate  = DateTime.Now;
                    DisableButton();
                }
            }
            else
            {
                isEnabled = true;
                if (!(saveInfo.Time == lastDate))
                {
                    lastDate = saveInfo.Time;
                    EnableEntry(saveInfo);
                    LoadButton.GetComponent <SaveLoadButton>().Prepare(slotnum, manager);
                    DeleteButton.GetComponent <SaveLoadButton>().Prepare(slotnum, manager);
                }
            }
        }
Exemplo n.º 5
0
 public virtual void Save()
 {
     if (SaveAndLoadManager.Instance != this)
     {
         SaveAndLoadManager.Instance.Save();
         return;
     }
     // Setup ();
     print("Save");
     if (!usePlayerPrefs)
     {
         savedData = "";
         if (!File.Exists(Application.persistentDataPath + Path.DirectorySeparatorChar + "Saved Data.txt"))
         {
             File.CreateText(Application.persistentDataPath + Path.DirectorySeparatorChar + "Saved Data.txt");
         }
         else
         {
             savedData = File.ReadAllText(Application.persistentDataPath + Path.DirectorySeparatorChar + "Saved Data.txt");
             string[] valueGroups = savedData.Split(new string[] { SaveEntry.VALUE_GROUP_SEPERATOR }, StringSplitOptions.None);
             for (int i = 0; i < valueGroups.Length; i += 2)
             {
                 string valueGroup = valueGroups[i];
                 if (valueGroup.StartsWith("" + AccountManager.lastUsedAccountIndex))
                 {
                     savedData = savedData.RemoveEach(valueGroup + SaveEntry.VALUE_GROUP_SEPERATOR + valueGroups[i + 1] + SaveEntry.VALUE_GROUP_SEPERATOR);
                 }
             }
         }
     }
     if (AccountManager.lastUsedAccountIndex != -1)
     {
         for (int i = 0; i < saveEntries.Length; i++)
         {
             SaveEntry saveEntry = saveEntries[i];
             if (AccountManager.CurrentlyPlaying.MostRecentlyUsedSaveEntryIndex > pastSaveEntryPreserveCount)
             {
                 saveEntry.Delete(AccountManager.lastUsedAccountIndex, AccountManager.CurrentlyPlaying.MostRecentlyUsedSaveEntryIndex - pastSaveEntryPreserveCount);
             }
             saveEntry.Save(AccountManager.lastUsedAccountIndex, AccountManager.CurrentlyPlaying.MostRecentlyUsedSaveEntryIndex);
             AccountManager.CurrentlyPlaying.MostRecentlyUsedSaveEntryIndex++;
             if (AccountManager.CurrentlyPlaying.MostRecentlyUsedSaveEntryIndex > AccountManager.CurrentlyPlaying.LastSaveEntryIndex)
             {
                 AccountManager.CurrentlyPlaying.LastSaveEntryIndex++;
             }
         }
     }
     else
     {
         for (int i = 0; i < saveEntries.Length; i++)
         {
             saveEntries[i].Save(AccountManager.lastUsedAccountIndex, AccountManager.lastUsedAccountIndex);
         }
     }
     if (!usePlayerPrefs)
     {
         File.WriteAllText(Application.persistentDataPath + Path.DirectorySeparatorChar + "Saved Data.txt", savedData);
     }
     displayOnSave.Do();
 }
Exemplo n.º 6
0
        public override void writeValue(SaveEntry entry)
        {
            XmlWriter xmlWriter = xmlSaver.XmlWriter;

            xmlWriter.WriteStartElement(elementName);
            xmlWriter.WriteAttributeString(NAME_ENTRY, entry.Name);
            xmlWriter.WriteAttributeString(OBJECT_ID, entry.ObjectID.ToString());
            xmlWriter.WriteEndElement();
        }
Exemplo n.º 7
0
        public void Save()
        {
            //var id = Guid.NewGuid();
            // XXX use fixed guid to help testing
            var id = new Guid(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);

            var msg = new Dwarrowdelf.Messages.SaveClientDataRequestMessage()
            {
                ID = id
            };

            foreach (var p in m_players.Where(p => p.IsConnected))
            {
                p.Send(msg);
            }

            if (ServerConfig.DisableSaving)
            {
                Trace.TraceError("Warning: Saving is disabled");
                return;
            }

            this.LastSaveID = id;

            var saveDir = Path.Combine(m_gameDir, id.ToString());

            Directory.CreateDirectory(saveDir);


            /* Save game intro */
            var saveEntry = new SaveEntry()
            {
                ID       = id,
                DateTime = DateTime.Now,
                GameMode = this.GameMode,
                Tick     = this.World.TickNumber,
            };

            using (var stream = File.Create(Path.Combine(saveDir, "intro.json")))
                using (var serializer = new Dwarrowdelf.SaveGameSerializer(stream))
                    serializer.Serialize(saveEntry);


            /* Save game */

            var savePath = Path.Combine(saveDir, "server.json");

            Trace.TraceInformation("Saving game {0}", savePath);
            var watch = Stopwatch.StartNew();

            using (var stream = File.Create(savePath))
                using (var serializer = new Dwarrowdelf.SaveGameSerializer(stream))
                    serializer.Serialize(this);

            watch.Stop();
            Trace.TraceInformation("Saving game took {0}", watch.Elapsed);
        }
 public static void MyselectEntry(SaveEntry entry)
 {
     // since we can not access any instance variables of the RootMenuRev2 without running a harmony patch, we replace RootMenuRev2.focusedSave with our own static varible which will have the same purpose as the original.
     // It holds the current save entry which is selected from the scroll canvas. Because we have to use our own variable we also have to repalce all methods of RootMenuRev2 which use it by our own.
     // The problem possibly could be solved with reflections, however i am not sure how to do it.
     if (!DeleteWorldSaves.MyRootMenuRev2.popupConfirmDelete.isVisible)
     {
         MyRootMenuRev2.focusedSave = entry;
     }
 }
Exemplo n.º 9
0
        public virtual void writeValue(SaveEntry entry)
        {
            XmlWriter xmlWriter = xmlSaver.XmlWriter;

            xmlWriter.WriteStartElement(elementName);
            xmlWriter.WriteAttributeString(NAME_ENTRY, entry.Name);
            if (entry.Value != null)
            {
                xmlWriter.WriteString(valueToString((T)entry.Value));
            }
            xmlWriter.WriteEndElement();
        }
Exemplo n.º 10
0
        public override void writeValue(SaveEntry entry)
        {
            XmlWriter xmlWriter = xmlSaver.XmlWriter;

            xmlWriter.WriteStartElement(elementName);
            xmlWriter.WriteAttributeString(NAME_ENTRY, entry.Name);
            xmlWriter.WriteAttributeString(TYPE, DefaultTypeFinder.CreateShortTypeString(entry.ObjectType));
            if (entry.Value != null)
            {
                xmlWriter.WriteString(entry.Value.ToString());
            }
            xmlWriter.WriteEndElement();
        }
Exemplo n.º 11
0
        public override void writeValue(SaveEntry entry)
        {
            XmlWriter xmlWriter = xmlSaver.XmlWriter;

            xmlWriter.WriteStartElement(elementName);
            xmlWriter.WriteAttributeString(NAME_ENTRY, entry.Name);
            if (entry.Value != null)
            {
                byte[] blobArray = (byte[])entry.Value;
                xmlWriter.WriteAttributeString(BYTE_SIZE_ENTRY, blobArray.Length.ToString());
                xmlWriter.WriteBinHex(blobArray, 0, blobArray.Length);
            }
            xmlWriter.WriteEndElement();
        }
Exemplo n.º 12
0
 /// <summary>
 ///   Suspends the serialization. Must resume as many times as you suspend
 /// </summary>
 public static void SuspendSerialization()
 {
     if (_suspensionCount == 0)
     {
         SuspendingSerialization();
         if (SerializationMode == SerializationModes.CacheSerialization)
         {
             _cachedState = CreateSaveEntry("resume", true);
             if (SaveResumeInformation)
             {
                 PlayerPrefs.SetString(PlayerName + "__RESUME__",
                                       Convert.ToBase64String(UnitySerializer.Serialize(_cachedState)));
             }
         }
     }
     _suspensionCount++;
 }
Exemplo n.º 13
0
 private void updateSavesList()
 {
     saves.Clear();
     menu.Items.Clear();
     foreach (var filename in Directory.EnumerateFiles(saveDirectory))
     {
         var saveEntry = new SaveEntry {
             Name = Path.GetFileName(filename), File = new FileInfo(filename)
         };
         saves.Add(saveEntry);
         menu.Items.Add(new TextMenuItem <Action> {
             Label = saveEntry.Name, Data = () => saveEntry.LoadSave()
         });
     }
     menu.Items.Add(new TextMenuItem <Action> {
         Label = "[New Save]", Data = () => CreateNewSave()
     });
 }
Exemplo n.º 14
0
        public void LoadSlot(int slotnum)
        {
            SaveEntry saveInfo = BurikoScriptSystem.Instance.GetSaveInfo(slotnum);

            SaveButton.GetComponent <SaveLoadButton>().Prepare(slotnum, manager);
            if (saveInfo == null)
            {
                if (isEnabled)
                {
                    DisableButton();
                    isEnabled = false;
                }
            }
            else
            {
                isEnabled = true;
                EnableEntry(saveInfo);
                LoadButton.GetComponent <SaveLoadButton>().Prepare(slotnum, manager);
            }
        }
Exemplo n.º 15
0
        public virtual void writeValue(SaveEntry entry)
        {
            var writer = xmlSaver.Writer;

            writer.WritePropertyName(entry.Name);
            var format = writer.Formatting;

            writer.Formatting = Newtonsoft.Json.Formatting.None;
            writer.WriteStartObject();
            writer.WritePropertyName(elementName);
            if (entry.Value != null)
            {
                writeValue((T)entry.Value, writer);
            }
            else
            {
                writer.WriteNull();
            }
            writer.WriteEndObject();
            writer.Formatting = format;
        }
Exemplo n.º 16
0
        public override void writeValue(SaveEntry entry)
        {
            var writer = xmlSaver.Writer;

            writer.WritePropertyName(entry.Name);
            var format = writer.Formatting;

            writer.Formatting = Newtonsoft.Json.Formatting.None;
            writer.WriteStartObject();
            writer.WritePropertyName(elementName);
            if (entry.Value != null)
            {
                writer.WriteValue(NumberParser.ToString(entry.ObjectID));
            }
            else
            {
                writer.WriteNull();
            }
            writer.WriteEndObject();
            writer.Formatting = format;
        }
Exemplo n.º 17
0
        private void OnClick()
        {
            if (UICamera.currentTouchID >= -1 && !(cooldown > 0f))
            {
                SlideButtonType type = Type;
                switch (type)
                {
                case SlideButtonType.Log:
                    GameSystem.Instance.SwitchToHistoryScreen();
                    break;

                case SlideButtonType.Auto:
                    GameSystem.Instance.IsAuto = true;
                    break;

                case SlideButtonType.Skip:
                    GameSystem.Instance.IsSkipping = true;
                    break;

                case SlideButtonType.Menu:
                    GameSystem.Instance.SwitchToRightClickMenu();
                    break;

                case SlideButtonType.QuickSave:
                    if (!GameSystem.Instance.CanSave)
                    {
                        AudioController.Instance.PlaySystemSound("sysse04.ogg", 1);
                        return;
                    }
                    GameSystem.Instance.ScriptSystem.SaveQuickSave();
                    break;

                case SlideButtonType.QuickLoad:
                {
                    if (!GameSystem.Instance.CanSave || !GameSystem.Instance.CanLoad)
                    {
                        AudioController.Instance.PlaySystemSound("sysse04.ogg", 1);
                        return;
                    }
                    SaveEntry d = BurikoScriptSystem.Instance.GetQSaveInfo();
                    if (d == null)
                    {
                        return;
                    }
                    StateDialogPrompt prompt = new StateDialogPrompt(PromptType.DialogLoad, delegate
                        {
                            GameSystem.Instance.ScriptSystem.LoadQuickSave();
                        }, null);
                    GameSystem.Instance.PushStateObject(prompt);
                    GameSystem.Instance.RegisterAction(delegate
                        {
                            PromptController promptController = prompt.GetPromptController();
                            if (!(promptController == null))
                            {
                                string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(d.Path);
                                Texture2D image = AssetManager.Instance.LoadScreenshot(fileNameWithoutExtension + ".png");
                                Debug.Log(promptController);
                                Debug.Log(d);
                                promptController.SetScreenshotDetails(image, d.Time.ToString("ddd MMM dd, yyyy h:mm tt"), d.Text, d.TextJp);
                            }
                        });
                    GameSystem.Instance.ExecuteActions();
                    break;
                }
                }
                AudioController.Instance.PlaySystemSound("wa_038.ogg", 1);
                cooldown = 0.5f;
            }
        }
Exemplo n.º 18
0
		public void Save()
		{
			//var id = Guid.NewGuid();
			// XXX use fixed guid to help testing
			var id = new Guid(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);

			var msg = new Dwarrowdelf.Messages.SaveClientDataRequestMessage() { ID = id };
			foreach (var p in m_players.Where(p => p.IsConnected))
				p.Send(msg);

			if (ServerConfig.DisableSaving)
			{
				Trace.TraceError("Warning: Saving is disabled");
				return;
			}

			this.LastSaveID = id;

			var saveDir = Path.Combine(m_gameDir, id.ToString());

			Directory.CreateDirectory(saveDir);


			/* Save game intro */
			var saveEntry = new SaveEntry()
			{
				ID = id,
				DateTime = DateTime.Now,
				GameMode = this.GameMode,
				Tick = this.World.TickNumber,
			};

			using (var stream = File.Create(Path.Combine(saveDir, "intro.json")))
			using (var serializer = new Dwarrowdelf.SaveGameSerializer(stream))
				serializer.Serialize(saveEntry);


			/* Save game */

			var savePath = Path.Combine(saveDir, "server.json");

			Trace.TraceInformation("Saving game {0}", savePath);
			var watch = Stopwatch.StartNew();

			using (var stream = File.Create(savePath))
			using (var serializer = new Dwarrowdelf.SaveGameSerializer(stream))
				serializer.Serialize(this);

			watch.Stop();
			Trace.TraceInformation("Saving game took {0}", watch.Elapsed);
		}
Exemplo n.º 19
0
        private void OnClick()
        {
            if (gameSystem == null)
            {
                gameSystem = GameSystem.Instance;
            }
            if (gameSystem.GameState == GameState.SaveLoadScreen && !(time > 0f) && UICamera.currentTouchID == -1 && isEnabled)
            {
                StateSaveLoad state = gameSystem.GetStateObject() as StateSaveLoad;
                if (state != null)
                {
                    switch (base.name)
                    {
                    case "Save":
                    case "0-Save":
                        manager.Save(slot);
                        break;

                    case "Load":
                    case "1-Load":
                    {
                        SaveEntry d = BurikoScriptSystem.Instance.GetSaveInfo(slot);
                        if (d == null)
                        {
                            return;
                        }
                        StateDialogPrompt state2 = new StateDialogPrompt(PromptType.DialogLoad, delegate
                            {
                                state.Leave(delegate
                                {
                                    StateTitle stateTitle = gameSystem.GetStateObject() as StateTitle;
                                    if (!manager.CanSave())
                                    {
                                        stateTitle?.RequestLeaveImmediate();
                                    }
                                    (gameSystem.GetStateObject() as StateChapterScreen)?.RequestLeaveImmediate();
                                    GameSystem.Instance.ScriptSystem.LoadGame(slot);
                                });
                            }, null);
                        gameSystem.PushStateObject(state2);
                        gameSystem.RegisterAction(delegate
                            {
                                PromptController promptController = state2.GetPromptController();
                                if (!(promptController == null))
                                {
                                    string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(d.Path);
                                    Texture2D image = AssetManager.Instance.LoadScreenshot(fileNameWithoutExtension + ".png");
                                    promptController.SetScreenshotDetails(image, d.Time.ToString("ddd MMM dd, yyyy h:mm tt"), d.Text, d.TextJp);
                                }
                            });
                        gameSystem.ExecuteActions();
                        break;
                    }

                    case "2-Edit":
                    {
                        SaveEntry d2 = BurikoScriptSystem.Instance.GetSaveInfo(slot);
                        if (d2 == null)
                        {
                            return;
                        }
                        SaveLoadManager.EditSlot = slot;
                        StateDialogPrompt state3 = new StateDialogPrompt(PromptType.DialogEdit, delegate
                            {
                            }, null);
                        gameSystem.PushStateObject(state3);
                        gameSystem.RegisterAction(delegate
                            {
                                PromptController promptController2 = state3.GetPromptController();
                                if (!(promptController2 == null))
                                {
                                    string fileNameWithoutExtension2 = Path.GetFileNameWithoutExtension(d2.Path);
                                    Texture2D image2 = AssetManager.Instance.LoadScreenshot(fileNameWithoutExtension2 + ".png");
                                    promptController2.SetScreenshotDetails(image2, d2.Time.ToString("ddd MMM dd, yyyy h:mm tt"), d2.Text, d2.TextJp);
                                }
                            });
                        gameSystem.ExecuteActions();
                        break;
                    }

                    case "3-Delete":
                    {
                        SaveEntry d3 = BurikoScriptSystem.Instance.GetSaveInfo(slot);
                        if (d3 == null)
                        {
                            return;
                        }
                        StateDialogPrompt prompt = new StateDialogPrompt(PromptType.DialogDelete, delegate
                            {
                                BurikoScriptSystem.Instance.DeleteSave(slot);
                                manager.RefreshList();
                            }, null);
                        GameSystem.Instance.PushStateObject(prompt);
                        GameSystem.Instance.RegisterAction(delegate
                            {
                                PromptController promptController3 = prompt.GetPromptController();
                                if (!(promptController3 == null))
                                {
                                    string fileNameWithoutExtension3 = Path.GetFileNameWithoutExtension(d3.Path);
                                    Texture2D image3 = AssetManager.Instance.LoadScreenshot(fileNameWithoutExtension3 + ".png");
                                    promptController3.SetScreenshotDetails(image3, d3.Time.ToString("ddd MMM dd, yyyy h:mm tt"), d3.Text, d3.TextJp);
                                }
                            });
                        break;
                    }

                    case "Return":
                        state.Leave(null);
                        break;

                    default:
                        Debug.LogWarning("Unhandled button action!");
                        break;
                    }
                    AudioController.Instance.PlaySystemSound("wa_038.ogg", 1);
                    time = 0.45f;
                }
            }
        }
        private static Boolean Prefix(ref ScrollCanvas ___scrollLoadCanvas, ref GuiElement ___popupLoad, ref bool ___popupActive, ref SaveEntry ___focusedSave)
        {
            DeleteWorldSaves.MyRootMenuRev2.MyscrollLoadCanvas = ___scrollLoadCanvas;
            ___popupActive = true;
            ___scrollLoadCanvas.elementList.Clear();
            bool flag = !Directory.Exists(Directory.GetCurrentDirectory() + "\\worldsaves\\");

            if (flag)
            {
                Directory.CreateDirectory(Directory.GetCurrentDirectory() + "\\worldsaves\\");
            }
            DirectoryInfo directoryInfo = new DirectoryInfo(Directory.GetCurrentDirectory() + "\\worldsaves\\");
            var           extensions    = new[] { "*.wdb", "*.wsav" }; // to make this patch compatible with 0.8 and 0.9 versions of the game we search for save files in the old and the new format
            var           files         = extensions.SelectMany(ext => directoryInfo.GetFiles(ext));

            foreach (FileInfo fileInfo in files)
            {
                string date = fileInfo.LastWriteTime.ToString("f", CONFIG.culture_en_US);
                // we have to replace RootMenuRev2.selectEntry method with our own, as we can not patch a private method with prefix or postfix patch. A reverse-patch would be an option if this method would not use any instance variables.
                // since it uses "this.focusedSave" "this." would be referring to an instance of our own class in a reverse-patch, which obviously would not work.
                MyRootMenuRev2.MyscrollLoadCanvas.AddSaveEntry(Path.GetFileNameWithoutExtension(fileInfo.Name), date, SCREEN_MANAGER.white, 0, 4, 436, 52, SortType.vertical, new SaveEntry.ClickJournalEvent(DeleteWorldSaves.MyRootMenuRev2.MyselectEntry), null);
            }
            ___popupLoad.isVisible = true;

            return(false); // returning "false" in a prefix patch is an instruction for Harmony to supress execution of the original method, so only our replacement will be executed-
        }
Exemplo n.º 21
0
 public virtual void Save(int accountIndex, int saveIndex)
 {
     if (SaveAndLoadManager.Instance != this)
     {
         SaveAndLoadManager.instance.SaveToCurrentAccount();
         return;
     }
     OnAboutToSave();
     // Setup ();
     // savedData = "";
     if (!usePlayerPrefs)
     {
         if (!File.Exists(Application.persistentDataPath + Path.DirectorySeparatorChar + "Saved Data.txt"))
         {
             File.CreateText(Application.persistentDataPath + Path.DirectorySeparatorChar + "Saved Data.txt");
         }
         else
         {
             savedData = File.ReadAllText(Application.persistentDataPath + Path.DirectorySeparatorChar + "Saved Data.txt");
             string[] valueGroups = savedData.Split(new string[] { SaveEntry.VALUE_GROUP_SEPERATOR }, StringSplitOptions.None);
             for (int i = 0; i < valueGroups.Length; i += 2)
             {
                 string valueGroup = valueGroups[i];
                 if (valueGroup.StartsWith("" + accountIndex))
                 {
                     savedData = savedData.RemoveEach(valueGroup + SaveEntry.VALUE_GROUP_SEPERATOR + valueGroups[i + 1] + SaveEntry.VALUE_GROUP_SEPERATOR);
                 }
             }
         }
     }
     if (accountIndex != -1)
     {
         Account account = ArchivesManager.Accounts[accountIndex];
         account.MostRecentlyUsedSaveIndex = saveIndex;
         if (account.MostRecentlyUsedSaveIndex > ArchivesManager.CurrentlyPlaying.LastSaveIndex)
         {
             account.LastSaveIndex++;
         }
         for (int i = 0; i < saveEntries.Length; i++)
         {
             SaveEntry saveEntry = saveEntries[i];
             if (ArchivesManager.CurrentlyPlaying.MostRecentlyUsedSaveIndex > keepPastSavesCount)
             {
                 saveEntry.Delete(accountIndex, ArchivesManager.CurrentlyPlaying.LastSaveIndex - keepPastSavesCount - 1);
             }
             saveEntry.Save(accountIndex, saveIndex);
         }
     }
     else
     {
         for (int i = 0; i < saveEntries.Length; i++)
         {
             saveEntries[i].Save(-1, -1);
         }
     }
     if (!usePlayerPrefs)
     {
         File.WriteAllText(Application.persistentDataPath + Path.DirectorySeparatorChar + "Saved Data.txt", savedData);
     }
     displayOnSave.Do();
 }
Exemplo n.º 22
0
 public void EnableEntry(SaveEntry entry)
 {
     SaveButton.isEnabled = false;
     LoadButton.isEnabled = true;
     BottomLabel.text     = entry.Time.ToString("MMM dd, yyyy h:mm tt");
 }