Ejemplo n.º 1
0
        public static void LoadConfig()
        {
            // Create default bindings file if no file exists.
            if (!File.Exists(path))
            {
                Default();
                SaveConfig();
                return;
            }

            ConfigOptions options = JsonHelper <ConfigOptions> .Load(path);

            if (options.Version != configVersion)
            {
                Default();
                SaveConfig();
                return;
            }

            SoundManager.MusicVolume = options.MusicVolume;
            SoundManager.SoundVolume = options.SoundVolume;
            Config.Fullscreen        = options.Fullscreen;
            gs.DisplayManager.SetFullscreen(Config.Fullscreen);
            Config.Zoom = options.Zoom;
            gs.DisplayManager.SetZoom(Config.GameScales[Config.Zoom]);
        }
Ejemplo n.º 2
0
        public static void SaveConfig()
        {
            ConfigOptions options = new ConfigOptions();

            options.Version     = configVersion;
            options.MusicVolume = SoundManager.MusicVolume;
            options.SoundVolume = SoundManager.SoundVolume;
            options.Fullscreen  = Config.Fullscreen;
            options.Zoom        = Config.Zoom;
            JsonHelper <ConfigOptions> .Save(path, options);
        }