Ejemplo n.º 1
0
        public void OpenOrRestart(IDataContext context, TutorialId id)
        {
            var globalOptions = context.GetComponent <GlobalSettings>();
            var titleString   = TutorialXmlReader.ReadIntro(globalOptions.GetPath(id, PathType.WorkCopyContentFile));
            var step          = TutorialXmlReader.ReadCurrentStep(globalOptions.GetPath(id, PathType.WorkCopyContentFile));
            var firstTime     = step == 1;

            var titleWnd = new TitleWindow(titleString, firstTime);

            if (titleWnd.ShowDialog() != true)
            {
                return;
            }
            if (titleWnd.Restart)
            {
                SolutionCopyHelper.CopySolution(globalOptions.GetPath(id, PathType.BaseSolutionFolder),
                                                globalOptions.GetPath(id, PathType.WorkCopySolutionFolder));

                GC.Collect();
                TutorialXmlReader.WriteCurrentStep(globalOptions.GetPath(id, PathType.WorkCopyContentFile), "1");

                VsCommunication.OpenVsSolution(globalOptions.GetPath(id, PathType.WorkCopySolutionFile));
            }
            else
            {
                VsCommunication.OpenVsSolution(globalOptions.GetPath(id, PathType.WorkCopySolutionFile));
            }
        }
Ejemplo n.º 2
0
        private static void Init()
        {
            GameSession = new GameSession();

            // Shows the main menu
            TitleWindow = TitleWindow.Show();

            Global.CurrentScreen.IsFocused = true;
        }
Ejemplo n.º 3
0
    private void Start()
    {
        // For the Title screen, start listening to OnPlay; otherwise, listen for the Scoreboard OK at the end of the level before advancing.
        TitleWindow t = FindObjectOfType <TitleWindow>();

        if (t)
        {
            t.OnPlay += ToNextLevel;
        }
        else
        {
            FindObjectOfType <ScoreboardWindow>().OnWindowDestroy += ToNextLevel;
        }

        GameplayManager.instance.onDeath += ListenForEarlyRestart;
        PlayerManager.instance.onDeathAnimationFinish += RestartLevel;
    }
Ejemplo n.º 4
0
        private void AddTitle_Click(object sender, RoutedEventArgs e)
        {
            if (this.ViewModel.Project == null)
            {
                return;
            }

            TitleWindow window = new TitleWindow(this.ViewModel.Project.Title)
            {
                Owner = this,
            };

            bool?result = window.ShowDialog();

            if (result.GetValueOrDefault())
            {
                this.ViewModel.SetTitle(window.MapTitle);
            }
        }
Ejemplo n.º 5
0
 private void Awake()
 {
     instance = this;
 }
Ejemplo n.º 6
0
 private void Awake()
 {
     instance   = this;
     playerCtrl = FindObjectOfType <PlayerController>();
 }