using System;
using System.Diagnostics;

namespace Dota2ConsoleFont
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                Console.WriteLine("Input new Dota2 console font size.");
                Console.WriteLine("Or just hit Enter to exit.");

                int newSize;

                var input = Console.ReadLine();
                if (!String.IsNullOrEmpty(input))
                {
                    if (!Int32.TryParse(input, out newSize))
                    {
                        Console.WriteLine("Not a number! Try again.\n\n");
                        continue;
                    }
                }
                else
                {
                    break;
                }
                
                var scc = new SourceConfigChanger();
                var sw = Stopwatch.StartNew();
                bool isOk = scc.ChangeDota2ConsoleFontSize(newSize);
                sw.Stop();
                Console.WriteLine(isOk ? "Success!" : "Failed!!!");
                Console.WriteLine("Working time: " + sw.ElapsedMilliseconds + " ms.");
                Console.WriteLine("\nPress any key to continue...");
                Console.ReadKey(true);
                break;
            }

        }
    }
}
