Example #1
0
    static public void SaveData()
    {
        BinaryFormatter Bff = new BinaryFormatter();

        if (File.Exists(Pth_Deflt + Pth_Opts))
        {
            File.Delete(Pth_Deflt + Pth_Opts);
        }
        FileStream file = File.Create(Pth_Deflt + Pth_Opts);

        DataFrmt data = new DataFrmt();

        data.isFirstPlay = isFirstPlay;
        data.Sel_lang    = Sel_lang;
        data.Sel_res     = Sel_res;
        data.Scene_Last  = Scene_Last;

        Bff.Serialize(file, data);
        file.Close();
    }
Example #2
0
    static public void LoadData()
    {
        if (File.Exists(Pth_Deflt + Pth_Opts))
        {
            BinaryFormatter Bff = new BinaryFormatter();

            FileStream file = File.Open(Pth_Deflt + Pth_Opts, FileMode.Open);

            DataFrmt data = (DataFrmt)Bff.Deserialize(file);
            file.Close();

            isFirstPlay = data.isFirstPlay;
            Sel_lang    = data.Sel_lang;
            Sel_res     = data.Sel_res;
            Scene_Last  = data.Scene_Last;
        }
        else
        {
            isFirstPlay = true;
            Sel_lang    = Lst_lang [0];
            Sel_res     = Lst_res [0];
            Scene_Last  = "Splash";
        }
    }