/// <summary>
        /// Creates an instance and reads a stream into it.
        /// </summary>
        public static ControlsSettings ReadObject(BinaryReader reader)
        {
            var result = new ControlsSettings();

            result.Read(reader);
            return(result);
        }
Exemple #2
0
 public Settings()
 {
     _General  = new GeneralSettings();
     _Graphics = new GraphicsSettings();
     _Audio    = new AudioSettings();
     _Controls = new ControlsSettings();
 }
Exemple #3
0
        private Keys[] ReadLegacyInputs(BinaryReader reader)
        {
            Keys[]           keys;
            ControlsSettings controls = new ControlsSettings();

            keys = controls.KeyboardConfig.ToArray();

            if (Global.LOADED_VERSION.older_than(0, 6, 5, 0))
            {
                for (byte i = 0; i < (byte)Inputs.Select; i++)
                {
                    Keys key = (Keys)reader.ReadInt32();
                    // If a remappable key
                    if (Tactile.Input.REMAPPABLE_KEYS.ContainsKey(key))
                    {
                        // If not loaded already
                        if (!keys.Take(i).Contains(key))
                        {
                            keys[i] = key;
                        }
                    }
                }
            }
            else
            {
                int count = reader.ReadInt32();

                for (int i = 0; i < count; i++)
                {
                    Inputs key   = (Inputs)reader.ReadByte();
                    Keys   value = (Keys)reader.ReadInt32();

                    // If a remappable key
                    if (Tactile.Input.REMAPPABLE_KEYS.ContainsKey(value))
                    {
                        // If not loaded already
                        if (!keys.Take(i).Contains(value))
                        {
                            keys[i] = value;
                        }
                    }
                }
            }
            return(keys);
        }
 private ControlsSettings(ControlsSettings source) : this()
 {
     CopySettingsFrom(source);
 }