//--------------------------------------------------------------------------------------------------------------------------------------------------- // // Copyright (C)2007 DarkWynter Studios. All rights reserved. // //--------------------------------------------------------------------------------------------------------------------------------------------------- // {Contact : darkwynter.com for licensing information //--------------------------------------------------------------------------------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Reflection; using System.CodeDom.Compiler; using System.CodeDom; using System.IO; using System.Xml; using Microsoft.Xna; using Microsoft.Xna.Framework; using DarkWynter.Stream; using DarkWynter.Engine.Globals; using DarkWynter.Engine.Utilities; using DarkWynter.Game; using DarkWynter.Engine.Globals; using DarkWynter.Engine.GameObjects; using DarkWynter.App.Surveys; using DarkWynter.App.ChallengeSet; namespace DarkWynter.App { public partial class InstructionControl : UserControl { /// /// Holds the pointer for the dialogueTextBox we are loading the instructions in /// public static RichTextBox dialogTextBoxPointer; public InstructionControl() { InitializeComponent(); dialogTextBoxPointer = this.dialogueTextBox; } /// /// As the button is pressed, load the next line in the instructions /// /// mouse press (forms parameter) /// event (forms parameter) public void continueDialogue_Click(object sender, EventArgs e) { DarkWynter.App.CompilerControl.challengeList[Statics_Engine.GameSettings.currentChallengeNumber].dialogueCounter++; // If second problem set if (DarkWynter.App.CompilerControl.challengeList[Statics_Engine.GameSettings.currentChallengeNumber].dialogueCounter < DarkWynter.App.CompilerControl.challengeList[Statics_Engine.GameSettings.currentChallengeNumber].dialogueMax) { dialogueTextBox.Text += DarkWynter.App.CompilerControl.challengeList[Statics_Engine.GameSettings.currentChallengeNumber] .challengeDialogue[DarkWynter.App.CompilerControl.challengeList[Statics_Engine.GameSettings.currentChallengeNumber].dialogueCounter] + "\r\n"; if (DarkWynter.App.CompilerControl.challengeList[Statics_Engine.GameSettings.currentChallengeNumber].dialogueCounter == 10) { CompilerControl.menuStripPointer.Show(); } } // Move the scroller down ScrolltoText(); } /// /// autoscoll boxNumber to keep track of which line of dialogue we are changing /// public void ScrolltoText() { InstructionControl.dialogTextBoxPointer.SelectionStart = InstructionControl.dialogTextBoxPointer.Text.Length; InstructionControl.dialogTextBoxPointer.SelectionLength = InstructionControl.dialogTextBoxPointer.Text.Length; InstructionControl.dialogTextBoxPointer.SelectionColor = System.Drawing.Color.Red; InstructionControl.dialogTextBoxPointer.SelectionFont = new Font("Courier New", 20, FontStyle.Bold); InstructionControl.dialogTextBoxPointer.ScrollToCaret(); InstructionControl.dialogTextBoxPointer.Select(); } } }