示例#1
0
 /// <summary>
 ///     Обновляет насторойки игры.
 /// </summary>
 public void SettingsChanged()
 {
     lock (_lockObject)
     {
         _settingsPack = Fun.LoadSettings();
         Resized(null, null);
     }
 }
示例#2
0
        public SettingsForm()
        {
            InitializeComponent();
            _testBlock.X  = _testBlock.Y = 50;
            _settingsPack = Fun.LoadSettings().Clone();

            UpdateControls();

            foreach (Control item in Controls)
            {
                item.KeyDown += SettingsForm_KeyDown;
            }
        }
示例#3
0
        public static SettingsPack LoadSettings()
        {
            SettingsPack sp = Settings.Default.SettingsPack;

            if (sp != null)
            {
                return(sp);
            }

            sp = new SettingsPack();
            sp.Apply();
            return(sp);
        }
示例#4
0
        private void reset_Click(object sender, EventArgs e)
        {
            SettingsPack t = new SettingsPack
            {
                Blocks        = _settingsPack.Blocks,
                Score         = _settingsPack.Score,
                PreviousScore = _settingsPack.PreviousScore,
                PreviousStep  = _settingsPack.PreviousStep
            };

            _settingsPack = t;

            UpdateControls();
        }