private void button1_Click(object sender, EventArgs e) { /*Make sure the games are out of the cleanup order*/ for (int x = 0; x < listBox1.Items.Count; x++) { GameManager.GameInfo gi = (GameManager.GameInfo)listBox1.Items[x]; string originalPath = GameManager.getInstance().GetGamePath(gi.GAME_ID); gi.GAME_ID = gi.GAME_ID + 9001; string destPath = GameManager.getInstance().GetGamePath(gi.GAME_ID); System.IO.Directory.Move(originalPath, destPath); } /*Fix Game Ids*/ for (int x = 0; x < listBox1.Items.Count; x++) { GameManager.GameInfo gi = (GameManager.GameInfo)listBox1.Items[x]; if (gi.GAME_ID != x + 1) { string originalPath = GameManager.getInstance().GetGamePath(gi.GAME_ID); gi.GAME_ID = x + 1; string destPath = GameManager.getInstance().GetGamePath(gi.GAME_ID); System.IO.Directory.Move(originalPath, destPath); } } foreach (GameManager.GameInfo gi in listBox1.Items) { gi.SaveIni(); } System.Diagnostics.ProcessStartInfo si = new System.Diagnostics.ProcessStartInfo(System.IO.Path.Combine(_BaseFolder, "BleemSync\\BleemSync.exe")); System.Diagnostics.Process.Start(si); }
private void SaveGame() { if (!loadingData) { _gi.SaveIni(); } }
private void btnAddGame_Click(object sender, EventArgs e) { FolderBrowserDialog fbd = new FolderBrowserDialog(); if (fbd.ShowDialog() == DialogResult.OK) { long gameId = GameManager.getInstance().GetNextGameId(); string GamePath = System.IO.Path.Combine(_BaseFolder, "Games\\" + gameId.ToString() + "\\gamedata\\"); GameManager.GameInfo gi = new GameManager.GameInfo(); gi.GAME_ID = gameId; string[] splittedPath = fbd.SelectedPath.Split(new string[] { "\\" }, StringSplitOptions.RemoveEmptyEntries); gi.GAME_TITLE_STRING = splittedPath[splittedPath.Length - 1]; gi.RELEASE_YEAR = 2018; gi.PLAYERS = 2; GameCopy gc = new GameCopy(fbd.SelectedPath, GamePath); gc.ShowDialog(); gi.SaveIni(); LoadData(_BaseFolder); } }