Beispiel #1
0
        private void InitializeComponents()
        {
            Width           = 250;
            Height          = 75;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            StartPosition   = FormStartPosition.CenterParent;
            BackColor       = Color.FromArgb(177, 210, 229);
            MaximizeBox     = false;
            ShowInTaskbar   = false;

            Label lblText = new Label();

            lblText.Text     = "¡Parcheo completado con éxito!";
            lblText.Location = new Point(55, 5);
            lblText.AutoSize = true;
            Controls.Add(lblText);

            Button closeBtn = new Button();

            closeBtn.Location  = new Point(105, 23);
            closeBtn.AutoSize  = true;
            closeBtn.Text      = "Cerrar";
            closeBtn.BackColor = SystemColors.Control;
            closeBtn.Click    += delegate { this.Close(); };
            Controls.Add(closeBtn);

            spritePanel          = new Panel();
            spritePanel.Location = new Point(5, 0);
            spritePanel.Size     = new Size(42, 45);
            Controls.Add(spritePanel);

            shizuku = new Sprite(0, -1, 1,
                                 new Point(0, 0), new Point(0, 0), new Size(0, 0), 1,
                                 ResourcesManager.GetImage("Done.shizuku_happy_0.png"),
                                 ResourcesManager.GetImage("Done.shizuku_happy_1.png"),
                                 ResourcesManager.GetImage("Done.shizuku_happy_2.png"),
                                 ResourcesManager.GetImage("Done.shizuku_happy_3.png"),
                                 ResourcesManager.GetImage("Done.shizuku_happy_4.png"),
                                 ResourcesManager.GetImage("Done.shizuku_happy_5.png"),
                                 ResourcesManager.GetImage("Done.shizuku_happy_6.png"));
            Animation.Instance.Add(spritePanel, shizuku);
        }
Beispiel #2
0
        private void InitializeComponents()
        {
            Text            = "Créditos";
            Width           = 800;
            Height          = 600;
            MaximizeBox     = false;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            StartPosition   = FormStartPosition.CenterParent;
            BackgroundImage = ResourcesManager.GetImage("credits.png");
            ShowInTaskbar   = false;

            Button closeBtn = new Button();

            closeBtn.Location  = new Point(715, 548);
            closeBtn.AutoSize  = true;
            closeBtn.Text      = "Cerrar";
            closeBtn.BackColor = SystemColors.Control;
            closeBtn.Click    += delegate { this.Close(); };
            Controls.Add(closeBtn);
        }
Beispiel #3
0
        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  = ResourcesManager.GetImage("Jabologo.png");
            Point jaboOffset = new Point(93, 0);
            Fade  jaboFade   = new Fade(5, 85, 1, jaboOffset, -1, 0.020f, jaboImage);
            Fade  jaboBlink  = new Fade(90, -1, 1, jaboOffset, 12, -0.030f, jaboImage, 1.0f);

            Image           textImage  = ResourcesManager.GetImage("logonombre.png");
            Point           textOffset = new Point(84, 0);
            Fade            textFade   = new Fade(50, 40, 1, textOffset, -1, 0.025f, textImage);
            BackgroundImage textFixed  = new BackgroundImage(90, -1, 1, textOffset, textImage);

            Animation animation = Animation.Instance;

            animation.Add(bgPanel, jaboFade);
            animation.Add(bgPanel, textFade);
            animation.Add(bgPanel, jaboBlink);
            animation.Add(bgPanel, textFixed);
            animation.Interval = 150;                   // Setting that, it starts

            // Create sprite animations for later use
            termito = new Sprite(0, -1, 1,                                          // delay, duration, steps
                                 new Point(10, 30), new Point(10, 30),              // start, end pos
                                 new Size(3, 0), 1,                                 // movement
                                 ResourcesManager.GetImage("Termito.anime_0.png"),  // frame 0
                                 ResourcesManager.GetImage("Termito.anime_1.png"),  // frame 1
                                 ResourcesManager.GetImage("Termito.anime_2.png"),  // frame 2
                                 ResourcesManager.GetImage("Termito.anime_3.png")); // frame 3
        }
Beispiel #4
0
        private void ExportTorrentFile(object sender, EventArgs e)
        {
            string output;

            InfoDialog.ShowWriteTorrent(this);
            using (SaveFileDialog outputDialog = new SaveFileDialog()) {
                outputDialog.AddExtension                 = true;
                outputDialog.CheckFileExists              = false;
                outputDialog.CheckPathExists              = true;
                outputDialog.DefaultExt                   = ".torrent";
                outputDialog.DereferenceLinks             = true;
                outputDialog.Filter                       = "Archivo Torrent|*.torrent";
                outputDialog.ShowHelp                     = false;
                outputDialog.SupportMultiDottedExtensions = true;
                outputDialog.ValidateNames                = true;
                outputDialog.OverwritePrompt              = true;
                outputDialog.FileName                     = "Vademécum del mago.torrent";
                if (outputDialog.ShowDialog(this) != DialogResult.OK)
                {
                    return;
                }

                output = outputDialog.FileName;
            }

            ErrorCode result = FileChecker.CheckOutput(output, FileChecker.TorrentLength);

            if (!result.IsValid())
            {
                MessageErrorDialog.Show(result, this);
                return;
            }

            using (Stream torrent = ResourcesManager.GetStream("Book.torrent"))
                using (Stream outputStream = new FileStream(output, FileMode.Create))
                    ExportStream(outputStream, torrent);
        }
Beispiel #5
0
        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            = ResourcesManager.GetIcon("icon.ico");

            CreateAnimation();

            bgBottom                 = new Panel();
            bgBottom.BackColor       = Color.Transparent;
            bgBottom.Location        = new Point(0, 480);
            bgBottom.Size            = new Size(800, 120);
            bgBottom.BackgroundImage = ResourcesManager.GetImage("skingold.png");
            Controls.Add(bgBottom);

            Panel separationLine = new Panel();

            separationLine.BackColor = Color.White;
            separationLine.Location  = new Point(0, 0);
            separationLine.Size      = new Size(800, 3);
            bgBottom.Controls.Add(separationLine);

            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);

            btnPatch              = new ImageButton();
            btnPatch.Location     = new Point(543, 10);
            btnPatch.DefaultImage = ResourcesManager.GetImage("Buttons.patch_0.png");
            btnPatch.PressedImage = ResourcesManager.GetImage("Buttons.patch_1.png");
            btnPatch.Click       += BtnPatchOnClick;
            bgBottom.Controls.Add(btnPatch);

            btnDownloadBook = new ImageButton();
            btnDownloadBook.DefaultImage = ResourcesManager.GetImage("Buttons.book_0.png");
            btnDownloadBook.PressedImage = ResourcesManager.GetImage("Buttons.book_1.png");
            btnDownloadBook.Location     = new Point(668, 10);
            btnDownloadBook.Click       += ExportTorrentFile;
            bgBottom.Controls.Add(btnDownloadBook);

            btnShowCredits = new ImageButton();
            btnShowCredits.DefaultImage = ResourcesManager.GetImage("Buttons.credits_0.png");
            btnShowCredits.PressedImage = ResourcesManager.GetImage("Buttons.credits_1.png");
            btnShowCredits.Location     = new Point(668, 55);
            btnShowCredits.Click       += delegate {
                CreditsWindow credits = new CreditsWindow();
                credits.ShowDialog(this);
                credits.Dispose();
            };
            bgBottom.Controls.Add(btnShowCredits);

            btnShowExtras = new ImageButton();
            btnShowExtras.DefaultImage = ResourcesManager.GetImage("Buttons.options_0.png");
            btnShowExtras.PressedImage = ResourcesManager.GetImage("Buttons.options_1.png");
            btnShowExtras.Location     = new Point(543, 55);
            bgBottom.Controls.Add(btnShowExtras);
            btnShowExtras.Click += delegate {
                ExtrasWindow extras = new ExtrasWindow();
                extras.ShowDialog(this);
                extras.Dispose();
            };

            ResumeLayout(false);
        }
Beispiel #6
0
 private void PlaySound()
 {
     player = new SoundPlayer(ResourcesManager.GetStream("sound.wav"));
     player.PlayLooping();
     FormClosing += delegate { player.Stop(); };
 }