Esempio n. 1
0
        private void LedClick_(int number)
        {
            if (!ledClicked_[number])
            {
                // Enable led
                ledClicked_[number] = true;
                SetLeds_(emulator_.GetF());

                // Disable led after 60 ms
                TimerCallback          callback = new TimerCallback(DisableLeds_);
                System.Threading.Timer timer    = new System.Threading.Timer(callback, number, 60, -1);

                // Remembre click
                easterEggMask_ <<= 2;
                easterEggMask_  += number;
                easterEggMask_  &= (1 << 8) - 1;
            }

            // Check last 4 clicks
            byte[] program = EasterEgg.GetData(easterEggMask_);
            if (program != null)
            {
                if (BeforeCloseProgram_())
                {
                    Reset_(null, program);
                    UpdateEggsCounter_();
                    easterEggMask_ = 0;
                }
            }
        }
Esempio n. 2
0
 private void UpdateEggsCounter_()
 {
     helpForm_.leftLabel.Text = $"{EasterEgg.FoundEggsCount()}/{EasterEgg.EggsCount()}";
     if (EasterEgg.EggsCount() - EasterEgg.FoundEggsCount() == 0 && !EasterEgg.IsNotified())
     {
         EasterEgg.SetNotified();
         MessageBox.Show(
             "Воу, ты нашел все пасхалки!\nНапиши в телеграме!\nCсылка будет в разделе помощи!",
             "Поздравляю!",
             MessageBoxButtons.OK,
             MessageBoxIcon.Information,
             MessageBoxDefaultButton.Button1
             );
         var linkBytes = Convert.FromBase64String("aHR0cHM6Ly90Lm1lL2pvaW5jaGF0L0F4VWdOaFJWSVBBQnJmTzY1em5HVXc=");
         helpForm_.linkLabel.Text     = System.Text.Encoding.UTF8.GetString(linkBytes);
         helpForm_.linkLabel.Visible  = true;
         helpForm_.codeLabel.Visible  = true;
         helpForm_.codeText.Visible   = true;
         helpForm_.codeButton.Visible = true;
         LedsAnimation_();
     }
 }