Ejemplo n.º 1
0
 // On quitting
 void OnApplicationQuit()
 {
     // This exists for the editor, because quitting doesn't actually work.
     Destroyer.Destroy();
     // Clean up temporary files
     QuestLoader.CleanTemp();
 }
Ejemplo n.º 2
0
    // This saves the current game to disk.  Will overwrite any previous saves
    public static void Save()
    {
        Game game = Game.Get();

        try
        {
            if (!Directory.Exists(System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "/Valkyrie"))
            {
                Directory.CreateDirectory(System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "/Valkyrie");
            }
            if (!Directory.Exists(System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "/Valkyrie/Save"))
            {
                Directory.CreateDirectory(System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "/Valkyrie/Save");
            }

            QuestLoader.CleanTemp();
            if (!Directory.Exists(Path.GetTempPath() + "/Valkyrie"))
            {
                Directory.CreateDirectory(Path.GetTempPath() + "/Valkyrie");
            }
            File.WriteAllText(Path.GetTempPath() + "/Valkyrie/save.ini", game.quest.ToString());
            ZipFile zip = new ZipFile();
            zip.AddFile(Path.GetTempPath() + "/Valkyrie/save.ini", "");
            zip.AddDirectory(Path.GetDirectoryName(game.quest.qd.questPath), "quest");
            zip.Save(SaveFile());
        }
        catch (System.Exception)
        {
            ValkyrieDebug.Log("Warning: Unable to write to save file.");
        }
    }
Ejemplo n.º 3
0
 public void UnloadLocalQuests()
 {
     if (local_quests_data != null)
     {
         // Clean up temporary files
         QuestLoader.CleanTemp();
         local_quests_data = null;
     }
 }
Ejemplo n.º 4
0
 // On quitting
 void onApplicationQuit()
 {
     // Clean up temporary files
     QuestLoader.CleanTemp();
 }