public static void SelSave()
        {
            Console.WriteLine("Select a battle cats save, or click cancel to download your save using transfer and confirmation codes");
            OpenFileDialog FD = new()
            {
                Filter = "battle cats save(*.*)|*.*",
                Title  = "Select save"
            };

            if (FD.ShowDialog() == DialogResult.OK)
            {
                main_path = FD.FileName;
                ColouredText("&Save: &\"" + Path.GetFileName(main_path) + "\"& is selected\n", ConsoleColor.White, ConsoleColor.Green);
            }
            else
            {
                ColouredText("&What game version are you using? (e.g en, jp, kr)\n");
                gameVer = Console.ReadLine();
                SendAndReceiveSaveData.Download_Save_Data();
                Options();
            }
            gameVer = PatchSaveFile.DetectGameVersion(main_path);
            if (gameVer.Length < 2)
            {
                Console.WriteLine("What game version are you using? (e.g en, jp, kr), note: en currently has the most support with the editor, so features may not work in other versions");
                gameVer = Console.ReadLine();
            }
            else
            {
                ColouredText("&Detected game version: &" + gameVer + "&\n");
            }
        }
예제 #2
0
        public static void Copy(string feature_name, string path_selected)
        {
            Console.WriteLine("Do you want to copy data from another save into the currently selected save(1), or copy data from the currently selected save into another save(2)?");
            string answer           = Console.ReadLine();
            string path_has_data    = "";
            string path_to_get_data = "";

            if (answer == "1")
            {
                path_to_get_data = path_selected;
                OpenFileDialog dialog = new();
                dialog.Title = "Select a save to copy from";
                DialogResult result = dialog.ShowDialog();
                if (result == DialogResult.OK)
                {
                    path_has_data = dialog.FileName;
                }
                else
                {
                    Console.WriteLine("Please select a save file");
                    Copy(feature_name, path_selected);
                }
            }
            else
            {
                path_has_data = path_selected;
                OpenFileDialog dialog = new();
                dialog.Title = "Select a save to copy into";
                DialogResult result = dialog.ShowDialog();
                if (result == DialogResult.OK)
                {
                    path_to_get_data = dialog.FileName;
                    CreateBackup(path_to_get_data);
                }
                else
                {
                    Console.WriteLine("Please select a save file");
                    Copy(feature_name, path_selected);
                }
            }
            override_warning_message = true;
            object return_val = RunGetFunction(feature_name, path_has_data);

            RunSetFunction(feature_name, path_to_get_data, new List <object> {
                return_val
            });
            PatchSaveFile.PatchSaveData(path_to_get_data);
            PatchSaveFile.PatchSaveData(path_has_data);
            override_warning_message = false;
        }
        private static void Main()
        {
            bool error_catching = true;

            if (error_catching)
            {
                AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs eventArgs)
                {
                    Console.WriteLine("An error has occurred\nPlease report this in #bug-reports:\n");
                    Console.WriteLine(eventArgs.ExceptionObject.ToString() + "\n");
                    PatchSaveFile.PatchSaveData(main_path);
                    Console.WriteLine("\nPress enter to exit");
                    Console.ReadLine();
                    Environment.Exit(0);
                };
            }
            CheckUpdate();
            SelSave();
            CreateBackup(main_path);
            Options();
        }