Ejemplo n.º 1
0
        /// <summary>
        /// Checks if Settings file exists, if not then it will create a new settings file
        /// </summary>
        private void CheckSettingsFile()
        {
            var path       = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            var folderPath = Path.Combine(path, "My Games", GameName);

            if (File.Exists(folderPath + @"\" + "Settings.xml"))
            {
                GameSettings = SolisXML.FromXML <SolisSettings>(folderPath + @"\" + "Settings.xml");
            }
            else
            {
                Directory.CreateDirectory(folderPath);
                CreateSettingsFile();
            }
        }
Ejemplo n.º 2
0
        private void CreateSettingsFile()
        {
            // Create New Settings File
            float w = (GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width * .75f);
            float h = (GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height * .75f);

            GameSettings = new SolisSettings
            {
                WindowMode           = WINDOW_MODE.WINDOWED,
                Vsync                = false,
                WindowWidth          = (int)w,
                WindowHeight         = (int)h,
                AllowWindowAdjusting = false,
                IsMouseVisible       = true,
                IsFixedTimeStep      = true,
                TargetFrameRate      = 120
            };
            SaveSettings();
            Console.WriteLine("Created initial default settings file");
        }