﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Media;
using System.Data.OleDb;

namespace Bomberman
{
    public partial class options : Form
    {
        //##### - INITAL - #####//
        bool initial = true;
        public void initial_stat(bool _initial)
        {
            initial = _initial;
        }
        //######################//

        public options()
        {
            InitializeComponent();
        }

        private void options_Load(object sender, EventArgs e)
        {

        }

        private void options_FormClosed(object sender, FormClosedEventArgs e)
        {
            //esconde o form
            this.Hide();
            Form1 form = new Form1();
            form.initial_stat(initial);
            form.Show();
        }

        private void b_reset_game_Click(object sender, EventArgs e)
        {
            SoundPlayer audio = new SoundPlayer(Bomberman.Properties.Resources.code_right);
            audio.Play();
        }

        private void b_reset_1player_Click(object sender, EventArgs e)
        {
            SoundPlayer audio = new SoundPlayer(Bomberman.Properties.Resources.code_right);
            audio.Play();
        }

        private void b_reset_proezas_Click(object sender, EventArgs e)
        {
            SoundPlayer audio = new SoundPlayer(Bomberman.Properties.Resources.code_right);
            audio.Play();
        }

        private void b_reset_estatisticas_Click(object sender, EventArgs e)
        {
            SoundPlayer audio = new SoundPlayer(Bomberman.Properties.Resources.code_right);
            audio.Play();
        }

        private void b_reset_partidas_Click(object sender, EventArgs e)
        {
            SoundPlayer audio = new SoundPlayer(Bomberman.Properties.Resources.code_right);
            audio.Play();
        }

        private void b_reset_maps_Click(object sender, EventArgs e)
        {
            SoundPlayer audio = new SoundPlayer(Bomberman.Properties.Resources.code_right);
            audio.Play();
        }

        private void b_reset_models_Click(object sender, EventArgs e)
        {
            OleDbConnection cn = new OleDbConnection(@"Provider = Microsoft.ACE.OLEDB.12.0; Data Source = DB_BM.accdb; Persist Security Info=False;");
            OleDbCommand cmd = new OleDbCommand();
            cn.Open();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "UPDATE Unlocks SET model_satan = @model_satan, model_dev_reaper = @model_dev_reaper, model_dev_elgongas = @model_dev_elgongas, model_prof_port = @model_prof_port, model_dia_aberto = @model_dia_aberto, model_russian = @model_russian, model_original = @model_original;";
            cmd.Parameters.AddWithValue("@model_satan", false);
            cmd.Parameters.AddWithValue("@model_dev_reaper", false);
            cmd.Parameters.AddWithValue("@model_dev_elgongas", false);
            cmd.Parameters.AddWithValue("@model_prof_port", false);
            cmd.Parameters.AddWithValue("@model_dia_aberto", false);
            cmd.Parameters.AddWithValue("@model_russian", false);
            cmd.Parameters.AddWithValue("@model_original", false);
            cmd.Connection = cn;
            cmd.ExecuteNonQuery();
            cn.Close();

            SoundPlayer audio = new SoundPlayer(Bomberman.Properties.Resources.code_right);
            audio.Play();
        }
    }
}
