private void SaveLocal()
        {
            BackupLocal(fileName);

            byte[] array = SaveGameUtils.ConvertDictionaryToByteArray(cloudSaveKeys);

            File.WriteAllBytes(fileName, array);

            MessageBox.Show("File saved !", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        private void LoadFile(string path)
        {
            byte[] array = File.ReadAllBytes(path);

            if (array.Length > 0)
            {
                cloudSaveKeys = SaveGameUtils.ConvertByteArrayToDictionary(array);

                bindingSource.DataSource = cloudSaveKeys;
                dataGridView1.DataSource = bindingSource;

                dataGridView1.Columns[1].Width    = 75;
                dataGridView1.Columns[0].ReadOnly = true;
                dataGridView1.Columns[1].ReadOnly = false;

                EnableButtons();
            }
        }
Пример #3
0
		public void Awake() {
			REF = this;
			DontDestroyOnLoad(this.gameObject);
			if(ES2.Exists(SETTINGS_NAME)) {
				_globalSettings = ES2.LoadList<string>(SETTINGS_NAME);
			} else {
				_globalSettings = new List<string>(); 
				for(int i = 0;i<(int) EGlobalSettings.MaxSize;i++) {
					_globalSettings.Add("");
				}
				_globalSettings[(int) EGlobalSettings.OfflineUnlocked] = Convert.ToString(false);
				_globalSettings[(int) EGlobalSettings.Music] = Convert.ToString(true);
				_globalSettings[(int) EGlobalSettings.Sounds] = Convert.ToString(true);
				_globalSettings[(int) EGlobalSettings.PollBalances] = Convert.ToString(false);
				_globalSettings[(int) EGlobalSettings.RateBox] = Convert.ToString(true);
				saveSettings();
			}
		}