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); } }
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; } } }
private void lblSkipIntro_Click(object sender, EventArgs e) { LegendOfDrongoEngine.SkipIntro(); WriteLine("Skipping Intro"); thr.Join(); pnlWarning.Visible = false; LoadCampaign(); }
private void lblOkay_Click(object sender, EventArgs e) { pnlWarning.Visible = false; //pnlOutputWindow.Visible = false; pnlMainMenu.Visible = true; txtConsoleOutput.TextAlign = HorizontalAlignment.Center; LegendOfDrongoEngine.DrawMainMenu(); }
public void SetupGame() { LegendOfDrongoEngine GameEngine = new LegendOfDrongoEngine(this); LegendOfDrongoEngine.ParseOptions(); LegendOfDrongoEngine.Warning(); pnlWarning.Visible = true; }
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() + "%"; }
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(); }
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(); } } } }