<commit_before>﻿//
//  MainWindow.cs
//
//  Author:
//       <NAME> <<EMAIL>>
//
//  Copyright (c) 2015 <NAME>
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
using System.Media;

namespace NinoPatcher
{
    public class MainWindow : Form
    {
        private const string IconResource = "NinoPatcher.Resources.icon.ico";
        private const string VademecumResource = "NinoPatcher.Resources.vademecum.png";

        private Assembly assembly = Assembly.GetExecutingAssembly();
        private SoundPlayer player;

        private Panel bgPanel;
        private ProgressBar progressBar;
        private Button btnPatch;
        private Button btnDownloadBook;
        private Button btnShowCredits;
        private Button btnShowExtras;

        public MainWindow()
        {
            InitializeComponents();
            PlaySound();
        }

        private void InitializeComponents()
        {
            SuspendLayout();

            FormBorderStyle = FormBorderStyle.FixedSingle;
            MaximizeBox = false;
            Width  = 800;
            Height = 600;
            MinimumSize = new Size(800, 600);
            MaximumSize = new Size(800, 600);
            Text = "Ninokuni - El Mago de las Tinieblas v1.0 ~~ GradienWords";
            Icon = new Icon(assembly.GetManifestResourceStream(IconResource));

            CreateAnimation();

            Panel bgBottom = new Panel();
            bgBottom.Location = new Point(0, 480);
            bgBottom.Size = new Size(800, 120);
            bgBottom.BackgroundImage = Image.FromStream(
                assembly.GetManifestResourceStream("NinoPatcher.Resources.skingold.png"));
            Controls.Add(bgBottom);

            progressBar = new ProgressBar();
            progressBar.Value = 0;
            progressBar.Location = new Point(10, 73);
            progressBar.Size = new Size(523, 15);
            progressBar.Style = ProgressBarStyle.Continuous;
            progressBar.ForeColor = Color.SkyBlue;
            bgBottom.Controls.Add(progressBar);

            PictureBox termito = new PictureBox();
            termito.BackColor = Color.Transparent;
            termito.Location = new Point(50, 30);
            termito.SizeMode = PictureBoxSizeMode.AutoSize;
            termito.Image = Image.FromStream(
                assembly.GetManifestResourceStream("NinoPatcher.Resources.anime_0.png"));
            bgBottom.Controls.Add(termito);

            btnPatch = new Button();
            btnPatch.Text = "¡Parchear!";
            btnPatch.Location = new Point(543, 4);
            btnPatch.Size = new Size(120, 40);
            bgBottom.Controls.Add(btnPatch);

            btnDownloadBook = new Button();
            btnDownloadBook.Text = "Vademécum";
            btnDownloadBook.Image =
                Image.FromStream(assembly.GetManifestResourceStream(VademecumResource));
            btnDownloadBook.TextImageRelation = TextImageRelation.ImageBeforeText;
            btnDownloadBook.Location = new Point(543, 49);
            btnDownloadBook.Size = new Size(120, 40);
            bgBottom.Controls.Add(btnDownloadBook);

            btnShowCredits = new Button();
            btnShowCredits.Text = "Créditos";
            btnShowCredits.Location = new Point(668, 4);
            btnShowCredits.Size = new Size(120, 40);
            bgBottom.Controls.Add(btnShowCredits);

            btnShowExtras = new Button();
            btnShowExtras.Text = "Opciones";
            btnShowExtras.Location = new Point(668, 49);
            btnShowExtras.Size = new Size(120, 40);
            bgBottom.Controls.Add(btnShowExtras);
            btnShowExtras.Click += delegate {
                new ExtrasWindow().ShowDialog(this);
            };

            ResumeLayout(false);
        }

        private void CreateAnimation()
        {
            // For smooth animations
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            bgPanel = new Panel();
            bgPanel.BackColor = Color.Black;
            bgPanel.Location  = new Point(0, 0);
            bgPanel.Size = new Size(800, 480);
            Controls.Add(bgPanel);

            Image jaboImage = Image.FromStream(
                assembly.GetManifestResourceStream("NinoPatcher.Resources.Jabologo.png"));
            Image textImage = Image.FromStream(
                assembly.GetManifestResourceStream("NinoPatcher.Resources.logonombre.png"));

            Point jaboOffset = new Point(93, 0);
            Point textOffset = new Point(84, 0);<commit_msg>NinoPatcher: Change buttons for images<commit_after>﻿//
//  MainWindow.cs
//
//  Author:
//       <NAME> <<EMAIL>>
//
//  Copyright (c) 2015 <NAME>
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
using System.Media;

namespace NinoPatcher
{
    public class MainWindow : Form
    {
        private const string IconResource = "NinoPatcher.Resources.icon.ico";
        private const string VademecumResource = "NinoPatcher.Resources.vademecum.png";
        private const string ButtonResourcePath = "NinoPatcher.Resources.Buttons.";

        private Assembly assembly = Assembly.GetExecutingAssembly();
        private SoundPlayer player;
        private ProgressBar progressBar;

        public MainWindow()
        {
            InitializeComponents();
            PlaySound();
        }

        private void InitializeComponents()
        {
            SuspendLayout();

            FormBorderStyle = FormBorderStyle.FixedSingle;
            MaximizeBox = false;
            Width  = 800;
            Height = 600;
            MinimumSize = new Size(800, 600);
            MaximumSize = new Size(800, 600);
            Text = "Ninokuni - El Mago de las Tinieblas v1.0 ~~ GradienWords";
            Icon = new Icon(assembly.GetManifestResourceStream(IconResource));

            CreateAnimation();

            Panel bgBottom = new Panel();
            bgBottom.Location = new Point(0, 480);
            bgBottom.Size = new Size(800, 120);
            bgBottom.BackgroundImage = Image.FromStream(
                assembly.GetManifestResourceStream("NinoPatcher.Resources.skingold.png"));
            Controls.Add(bgBottom);

            progressBar = new ProgressBar();
            progressBar.Value = 0;
            progressBar.Location = new Point(10, 73);
            progressBar.Size = new Size(523, 15);
            progressBar.Style = ProgressBarStyle.Continuous;
            progressBar.ForeColor = Color.SkyBlue;
            bgBottom.Controls.Add(progressBar);

            PictureBox termito = new PictureBox();
            termito.BackColor = Color.Transparent;
            termito.Location = new Point(50, 30);
            termito.SizeMode = PictureBoxSizeMode.AutoSize;
            termito.Image = Image.FromStream(
                assembly.GetManifestResourceStream("NinoPatcher.Resources.anime_0.png"));
            bgBottom.Controls.Add(termito);

            ImageButton btnPatch = new ImageButton();
            btnPatch.Location = new Point(543, 10);
            btnPatch.DefaultImage = Image.FromStream(
                assembly.GetManifestResourceStream(ButtonResourcePath + "patch_0.png"));
            btnPatch.PressedImage = Image.FromStream(
                assembly.GetManifestResourceStream(ButtonResourcePath + "patch_1.png"));
            bgBottom.Controls.Add(btnPatch);

            ImageButton btnDownloadBook = new ImageButton();
            btnDownloadBook.DefaultImage = Image.FromStream(
                assembly.GetManifestResourceStream(ButtonResourcePath + "book_0.png"));
            btnDownloadBook.PressedImage = Image.FromStream(
                assembly.GetManifestResourceStream(ButtonResourcePath + "book_1.png"));
            btnDownloadBook.Location = new Point(543, 55);
            bgBottom.Controls.Add(btnDownloadBook);

            ImageButton btnShowCredits = new ImageButton();
            btnShowCredits.DefaultImage = Image.FromStream(
                assembly.GetManifestResourceStream(ButtonResourcePath + "credits_0.png"));
            btnShowCredits.PressedImage = Image.FromStream(
                assembly.GetManifestResourceStream(ButtonResourcePath + "credits_1.png"));
            btnShowCredits.Location = new Point(668, 10);
            bgBottom.Controls.Add(btnShowCredits);

            ImageButton btnShowExtras = new ImageButton();
            btnShowExtras.DefaultImage = Image.FromStream(
                assembly.GetManifestResourceStream(ButtonResourcePath + "options_0.png"));
            btnShowExtras.PressedImage = Image.FromStream(
                assembly.GetManifestResourceStream(ButtonResourcePath + "options_1.png"));
            btnShowExtras.Location = new Point(668, 55);
            bgBottom.Controls.Add(btnShowExtras);
            btnShowExtras.Click += delegate {
                new ExtrasWindow().ShowDialog(this);
            };

            ResumeLayout(false);
        }

        private void CreateAnimation()
        {
            // For smooth animations
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            Panel bgPanel = new Panel();
            bgPanel.BackColor = Color.Black;
            bgPanel.Location  = new Point(0, 0);
            bgPanel.Size = new Size(800, 480);
            Controls.Add(bgPanel);

            Image jaboImage = Image.FromStream(
                assembly.GetManifestResourceStream("NinoPatcher.Resources.Jabologo.png"));
            Image textImage = Image.FromStream(
                assembly.GetManifestResourceStream("NinoPatcher.Resources.logonombre.png"));

            Point jaboOffset = new Point(93, 0);
            Point textOffset = new Point(84, 0);
{'fraction_non_alphanumeric': 0.0909735768753325, 'fraction_numerical': 0.017201631494945913, 'mean_word_length': 2.2485599078341014, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1361165', 'n_tokens_mistral': 3056, 'n_tokens_neox': 2867, 'n_words': 712}