Beispiel #1
0
        /// <summary>
        /// Draws a Yes No dialogue box with the text supplied
        /// </summary>
        /// <param name="text">The text to display</param>
        /// <returns>If yes was selected</returns>
        public bool DrawYesNoOption(String text)
        {
            MessageBoxResult result = SimpleMessageBox.Show(string.Empty, text, MessageBoxButton.YesNo, Window.GetWindow(this));

            if (result == MessageBoxResult.Yes)
            {
                return(true);
            }
            return(false);
        }
Beispiel #2
0
        /// <summary>
        /// Displays the results from scavenging
        /// </summary>
        /// <param name="scavenged">The items scavenged</param>
        public void DrawScavengeResults(List <Item> scavenged)
        {
            String results = "You scavenged the following:\n";

            foreach (Item item in scavenged)
            {
                String[] desc = item.description.Split('(');
                results += String.Format("{0} x {1} - {2}\n", item.name, item.amount, desc[0]);
            }
            SimpleMessageBox.Show("Scavenging Results", results, Window.GetWindow(this));
        }
Beispiel #3
0
        /// <summary>
        /// Draws the results of the event
        /// </summary>
        /// <param name="optionResult">The main option result text</param>
        /// <param name="results">The results of the selected option</param>
        public void DrawEventResult(String optionResult, List <String> results)
        {
            String effectResults = "";

            foreach (String result in results)
            {
                effectResults += result + "\n";
            }

            SimpleMessageBox.Show(optionResult, effectResults, MessageBoxButton.OK, Window.GetWindow(this));
        }
Beispiel #4
0
 private void DrawIntro()
 {
     if (intro)
     {
         SimpleMessageBox.Show("", "You wake up, somewhat groggy. How much did you drink last night?" +
                               "Looking at the door you notice you've propped it shut with a chair, what could you have" +
                               "possibly been thinking? You get your things together and try to work out where you are." +
                               "Going outside you find yourself at cheap run down motel. No one seems to be about, not even the staff." +
                               "Puzzled you decide to make your way to the nearest town. Walking along the road you soon find what remains of a burn out car, abandoned" +
                               "and discarded. It looks somewhat familar but you have no idea why. As you approach the town you begin to sense something is wrong, surely there should be some traffic some people." +
                               "As you turn the final bend you start to see smoke and more abandoned vehicles. This is wrong you think to yourself. Looking in your wallet you pull out the picture of your wife and daughter." +
                               "I must get home to them and make sure they are alright. Taking one step forward you begin on the long road home.", Window.GetWindow(this));
         intro = false;
     }
 }
Beispiel #5
0
 /// <summary>
 /// Draws a discovery dialogue box
 /// </summary>
 /// <param name="discovery">The discovery text</param>
 public void DrawDiscovery(string discovery)
 {
     SimpleMessageBox.Show("You made a discovery!", discovery, Window.GetWindow(this));
 }
Beispiel #6
0
 /// <summary>
 /// Displays the results of the event based on the option chosen
 /// </summary>
 /// <param name="optionResult">The Main option result</param>
 /// <param name="results">The text from the effects of the result</param>
 public void DrawEventResult(String optionResult, List <String> results)
 {
     SimpleMessageBox.Show(string.Empty, optionResult, MessageBoxButton.OK, Window.GetWindow(this));
 }
Beispiel #7
0
        /// <summary>
        /// Creates a dialogue box for the event and displays it
        /// </summary>
        /// <param name="eventText">The main text for the event</param>
        /// <param name="options">The text for each option</param>
        /// <returns>The selected option</returns>
        public int DrawEvent(String eventText, List <String> options)
        {
            List <String> buttonText = new List <string>()
            {
                "Option 1", "Option 2", "Option 3", "Option 4"
            };

            string optionsText = "";

            for (int i = 1; i <= options.Count; i++)
            {
                optionsText += i + ". " + options[i - 1] + "\n";
            }

            MessageBoxResult result = MessageBoxResult.None;

            switch (options.Count)
            {
            case 1:
                SimpleMessageBox.Show("Event!", eventText + "\n\n" + optionsText, MessageBoxButton.OK, Window.GetWindow(this));
                result = MessageBoxResult.Yes;
                break;

            case 2:
                result = SimpleMessageBox.Show("Event!", eventText + "\n\n" + optionsText, MessageBoxButton.YesNo, buttonText, Window.GetWindow(this));
                break;

            case 3:
                result = SimpleMessageBox.Show("Event!", eventText + "\n\n" + optionsText, MessageBoxButton.YesNoCancel, buttonText, Window.GetWindow(this));
                break;

            case 4:
                result = SimpleMessageBox.Show("Event!", eventText + "\n\n" + optionsText, MessageBoxButton.OKCancel, buttonText, Window.GetWindow(this));
                break;
            }

            int selected = 1;

            switch (result)
            {
            case MessageBoxResult.Yes:
                selected = 1;
                break;

            case MessageBoxResult.No:
                selected = 2;
                break;

            case MessageBoxResult.OK:
                selected = 4;
                break;

            case MessageBoxResult.Cancel:
                if (options.Count == 3)
                {
                    selected = 3;
                }
                else
                {
                    selected = 4;
                }
                break;
            }
            return(selected);
        }
Beispiel #8
0
 /// <summary>
 /// Draws a simple dialogue box with the text supplied
 /// </summary>
 /// <param name="text">The text to display</param>
 public void DrawDialogueBox(String text)
 {
     SimpleMessageBox.Show(string.Empty, text, MessageBoxButton.OK, Window.GetWindow(this));
 }
Beispiel #9
0
 /// <summary>
 /// Draws the victory dialogue
 /// </summary>
 public void DrawVictory()
 {
     SimpleMessageBox.Show("Congradulations", "You made it home.", Window.GetWindow(this));
 }
Beispiel #10
0
 /// <summary>
 /// Draws the game over dialogue
 /// </summary>
 public void DrawGameOver()
 {
     SimpleMessageBox.Show("Game Over", "I'm sorry you did not manage to make your way home.", Window.GetWindow(this));
 }