Exemple #1
0
        public void Refresh()
        {
            selectedSnapshot = null;

            if (header)
            {
                header.DisplayCustomInfo((saveContext())? "Save your game" : "Load a Party", null, null);
            }

            if (population.Count > 0)
            {
                foreach (Button btn in population)
                {
                    Destroy(btn.gameObject);
                }
                population.Clear();
            }
            AllowValidation(false);
            PopupateList();
        }
 internal void FillHeaderInfo(RegisterySnapshot snapshot)
 {
     partyText.text = snapshot.PartyName;
     sceneText.text = snapshot.m_currentScene;
     timePlayedText.text = snapshot.FormatTimePlayed;
 }
        public void Refresh()
        {
            selectedSnapshot = null;

            if (header)
            {
                header.DisplayCustomInfo((saveContext())? "Save your game" : "Load a Party", null, null);
            }

            if (population.Count > 0)
            {
                foreach(Button btn in population)
                {
                    Destroy(btn.gameObject);
                }
                population.Clear();
            }
            AllowValidation(false);
            PopupateList();
        }
Exemple #4
0
        private static void LoadRegistery(RegisterySnapshot snap)
        {
            string path = "/saves/" + snap.m_identifier + ".gjd";

            BinaryFormatter bf = new BinaryFormatter();
            FileStream stream = File.Open(Application.persistentDataPath + path, FileMode.Open);

            Registery = bf.Deserialize(stream) as GameRegistery;
            stream.Close();

            PausePlayTimer(false);
            GameController.TimeController.GameOver(false);
            BlockedSave = false;
            SceneManager.LoadScene(Registery.m_snapshot.m_currentScene);
        }
Exemple #5
0
        /// <summary>
        /// Load the regitery (and the party right after) 
        /// Fire OnPreLoadEvent before any actions, then OnPostLoadEvent at the very end  
        /// </summary>
        /// <param name="snap">The snapshot to load</param>
        public static void LoadGame(RegisterySnapshot snap)
        {
            if (OnPreLoadEvent != null)
                OnPreLoadEvent();

            PausePlayTimer(true);
            LoadRegistery(snap);


            if (OnPostLoadEvent != null)
                OnPostLoadEvent();

        }
Exemple #6
0
 /// <summary>
 /// Update and write the current Registery to disk.
 /// </summary>
 /// <param name="overriden">The snapshot file to override</param>
 public static void SaveAndWrite(RegisterySnapshot overriden)
 {
     Registery.m_snapshot.m_identifier = overriden.m_identifier;
     SaveAndWrite(false);
 }
Exemple #7
0
 internal void FillHeaderInfo(RegisterySnapshot snapshot)
 {
     partyText.text      = snapshot.PartyName;
     sceneText.text      = snapshot.m_currentScene;
     timePlayedText.text = snapshot.FormatTimePlayed;
 }