Exemple #1
0
 public void LoadCampaign()
 {
     if (!this.InvokeRequired)
     {
         DataTypes.PlayerProfile newPlayer = LegendOfDrongoEngine.MainMenu(0);
         if (!string.IsNullOrEmpty(newPlayer.name))
         {
             pnlWarning.Visible         = false;
             txtConsoleOutput.TextAlign = HorizontalAlignment.Left;
             lblSkipIntro.Visible       = false;
             lblOptions.Visible         = true;
             tkbVolume.Visible          = true;
             lblVolume.Visible          = true;
             LegendOfDrongoEngine.StartGame(newPlayer);
             txtInput.Visible = true;
             txtInput.Focus();
             txtConsoleOutput.TextAlign = HorizontalAlignment.Left;
         }
     }
     else
     {
         BeginCampaign d = new BeginCampaign(LoadCampaign);
         this.Invoke(d);
     }
 }
Exemple #2
0
        private void MainMenuChoice(int Choice)
        {
            if (Choice == 0)
            {
                txtConsoleOutput.TextAlign = HorizontalAlignment.Left;
                lblOptions.Visible         = false;
                tkbVolume.Visible          = false;
                lblVolume.Visible          = false;

                pnlWarning.Visible   = true;
                lblOkay.Visible      = false;
                lblSkipIntro.Visible = true;

                pnlMainMenu.Visible = false;

                thr.Start();
            }
            else
            {
                DataTypes.PlayerProfile newPlayer = LegendOfDrongoEngine.MainMenu(Choice);

                if (!string.IsNullOrEmpty(newPlayer.name))
                {
                    LegendOfDrongoEngine.StartGame(newPlayer);
                    txtInput.Visible = true;
                    txtInput.Focus();
                    txtConsoleOutput.TextAlign = HorizontalAlignment.Left;
                }
            }
        }
Exemple #3
0
 private void lblSkipIntro_Click(object sender, EventArgs e)
 {
     LegendOfDrongoEngine.SkipIntro();
     WriteLine("Skipping Intro");
     thr.Join();
     pnlWarning.Visible = false;
     LoadCampaign();
 }
Exemple #4
0
 private void lblOkay_Click(object sender, EventArgs e)
 {
     pnlWarning.Visible = false;
     //pnlOutputWindow.Visible = false;
     pnlMainMenu.Visible        = true;
     txtConsoleOutput.TextAlign = HorizontalAlignment.Center;
     LegendOfDrongoEngine.DrawMainMenu();
 }
Exemple #5
0
        public void SetupGame()
        {
            LegendOfDrongoEngine GameEngine = new LegendOfDrongoEngine(this);

            LegendOfDrongoEngine.ParseOptions();
            LegendOfDrongoEngine.Warning();
            pnlWarning.Visible = true;
        }
Exemple #6
0
        private void tkbVolume_ValueChanged(object sender, EventArgs e)
        {
            int    trackBarValue = tkbVolume.Value;
            double percentage    = Math.Round((double)trackBarValue * 10, 0);

            LegendOfDrongoEngine.MusicVolume(percentage);

            lblVolume.Text = "Game Volume " + percentage.ToString() + "%";
        }
Exemple #7
0
        private void lblOptions_Click(object sender, EventArgs e)
        {
            Process proc = new Process();

            proc = Process.Start(Directory.GetCurrentDirectory() + "\\Options.txt");
            while (proc.HasExited == false)
            {
            }
            LegendOfDrongoEngine.ParseOptions();
        }
Exemple #8
0
        private void txtInput_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 13)
            {
                e.Handled = true;
                CommandHistory.Add(txtInput.Text);
                LegendOfDrongoEngine.EnterCommand(txtInput.Text);
                txtInput.Clear();
                cmdHistory = -1;
                txtInput.Focus();
            }
            else if (e.KeyValue == 38)
            {
                if (CommandHistory.Count > 0)
                {
                    if (cmdHistory == -1)
                    {
                        cmdHistory = CommandHistory.Count - 1;
                    }
                    else if (cmdHistory > 0)
                    {
                        cmdHistory--;
                    }

                    txtInput.Text = CommandHistory[cmdHistory];
                }
            }
            else if (e.KeyValue == 40)
            {
                if (CommandHistory.Count > 0)
                {
                    if (cmdHistory < (CommandHistory.Count - 1))
                    {
                        cmdHistory++;
                        txtInput.Text = CommandHistory[cmdHistory];
                    }
                    else if (string.IsNullOrEmpty(txtInput.Text) && string.IsNullOrWhiteSpace(txtInput.Text))
                    {
                        txtInput.Clear();
                    }
                }
            }
        }