public frmMain()
 {
     InitializeComponent();
     hex                     = new HexConverter();
     config                  = new ConfigRepository();
     fpsFixRepository        = new FPSFixRepository(config, hex);
     gameProcessRepository   = new ProcessRepository(config.Get("FF7ProcessName"));
     fpsFixProcessRepository = new ProcessRepository(config.Get("FPSFixExecutable"));
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            bool              done              = false;
            ConfigRepository  config            = new ConfigRepository();
            HexConverter      hex               = new HexConverter();
            FPSFixRepository  fPSFixRepository  = new FPSFixRepository(config, hex);
            ProcessRepository processRepository = new ProcessRepository(config.Get("FF7ProcessName"));

            List <CommandOption> colors = Enum.GetValues(typeof(CommandOption)).Cast <CommandOption>().ToList();

            for (;;)
            {
                Inquirer.Prompt(Question.List("Choose favourite color", colors)).Then((command) => {
                    switch (command)
                    {
                    case CommandOption.Exit:
                        done = true;
                        return;

                    case CommandOption.GetFPSFixValueFromFile:
                        Console.Clear();
                        Console.WriteLine("Get FPSFix value");
                        Console.WriteLine(fPSFixRepository.GetFPSFIXValue().ToString());
                        Console.ReadLine();
                        break;

                    case CommandOption.SaveFPSFixValueToFile:
                        Console.Clear();
                        Console.WriteLine("Enter a new value: (integer only!)");
                        int newValue = int.Parse(Console.ReadLine());
                        Console.WriteLine($"New value is: {newValue.ToString()}");
                        fPSFixRepository.SaveFPSFixValue(newValue);
                        Console.ReadLine();
                        break;

                    case CommandOption.AttachToGame:
                        Task.Run(() => RunGame());
                        break;

                    case CommandOption.DetatchFromGame:
                        break;
                    }
                });
                Inquirer.Go();

                if (done)
                {
                    return;
                }
            }
        }