Exemplo n.º 1
0
        private void NextVideoStart(object sender, EventArgs e)
        {
            // by default we advance the position by 1
            int nextStoryPosition = MainResources.GetPathPosition() + 1;

            switch (_prevButtonSchema.ButtonType)
            {
            case ButtonType.Default:
                MainResources.AdjustHP(_prevButtonSchema.ScoreAdjustment.HP);
                MainResources.AdjustPoints(_prevButtonSchema.ScoreAdjustment.Points);
                break;

            case ButtonType.End:
                // an "End" button type will end the game immidiately
                nextStoryPosition = -1;
                break;

            default:
                break;
            }
            // update the game resources
            MainResources.SetPathPosition(nextStoryPosition);
            // create new GameMenu instance
            GameMenu nextGameMenu = new GameMenu(_prevButtonSchema);

            DebugFunctions.DEBUG_output_list_of_videos("NextVideoStart function, line 398", _prevButtonSchema);
            MainResources.MainWindow.MainPanel.Children.Add(nextGameMenu);
            MainResources.MainWindow.MainPanel.Children.Remove(this);
            MainResources.SetPathPosition(nextStoryPosition);
        }
Exemplo n.º 2
0
        private void PlayButtonClicked(object sender, RoutedEventArgs e)
        {
            // sets base path file location (root directory)
            MainResources.SetRootDirectory(_path);

            // confirm the scenario, loads the settings into mainresources
            MainResources.SetHP(_settings.StartingHP);
            MainResources.SetBranch(_settings.StartingBranch);
            MainResources.SetPathPosition(_settings.StartingPathPosition);
            MainResources.SetPoints(_settings.StartingPoints);

            // sets the folder path where we store all the ending videos
            MainResources.SetEndingPathRoot(Path.Combine(_path, "endings"));

            ButtonSchema buttonData = new ButtonSchema()
            {
                VideoFilename = new List <string>()
                {
                    Path.Combine(_path, _introVideo)
                },
                Endings = new List <Ending>()
            };

            GameMenu gameMenu = new GameMenu(buttonData);

            MainResources.MainWindow.MainPanel.Children.Add(gameMenu);
            MainResources.MainWindow.MainPanel.Children.Remove(this);
            MainResources.MainWindow.RemoveBackground();
        }
Exemplo n.º 3
0
        private void ButtonClicked(ButtonSchema buttonSchema)
        {
            DebugFunctions.DEBUG_output_list_of_videos("ButtonClicked", buttonSchema);

            // disable UI
            IsEnabled = false;

            if (buttonSchema.Path.Branch != MainResources.GetBranch())
            {
                MainResources.SetBranch(buttonSchema.Path.Branch);
                MainResources.SetPathPosition(buttonSchema.Path.StartPosition - 1);
            }

            _prevButtonSchema = buttonSchema;
            _fadeInStoryboards.Stop();
            _fadeOutStoryboards.Begin();
        }