예제 #1
0
        private static bool ConfirmMapping(LocalMapping mapping)
        {
            Console.WriteLine("\n");
            Console.WriteLine("You have created the following mapping");
            Console.WriteLine($"Name: {mapping.FileName}");
            Console.WriteLine($"Save Location: {mapping.FilePathToTrack}");
            Console.WriteLine($"Exe: {mapping.GameExePath}");
            Console.WriteLine("\nType C to confirm the mapping is correct, any other key to return to menu without saving");

            if (Console.ReadKey(true).Key == ConsoleKey.C)
            {
                return(true);
            }

            return(false);
        }
예제 #2
0
        public LocalMapping AddGameForm(string name)
        {
            var mapping = new LocalMapping();

            mapping.FileName = name;

            string file;

            Console.WriteLine($"\nGreat in what file can we find the {mapping.FileName} save");
            file = RunFileDialog("Select Save File");

            if (string.IsNullOrEmpty(file))
            {
                Console.WriteLine("Not a valid file");
                return(null);
            }
            mapping.FilePathToTrack = file;

            Console.WriteLine("Okay!");

            Console.WriteLine($"\nWhere is the {mapping.FileName} application .exe located?");
            var exe = RunFileDialog("Select Game Executable");

            if (string.IsNullOrEmpty(exe))
            {
                Console.WriteLine("Invalid exe selected!");
                return(null);
            }
            mapping.GameExePath = exe;

            if (ConfirmMapping(mapping))
            {
                return(mapping);
            }
            else
            {
                Console.WriteLine("New file was not added");
            }

            return(null);
        }