Example #1
0
 public void Add(IQuest quest)
 {
     GameDeskControl doc = new GameDeskControl(quest);
     doc.Title = quest.Name;
     doc.InfoTip = "Info tipo for " + doc.Title;
     doc.ContentTypeDescription = "";
     doc.Closing += new EventHandler<CancelEventArgs>(doc_Closing);
     doc.Closed += new EventHandler(doc_Closed);
     doc.InfoPanel.SizeChanged+=new SizeChangedEventHandler(doc.ResizeInfoPanel);
     GameViews.Add(doc);
     doc.Resize(GamesDocumentPane.ActualWidth, GamesDocumentPane.ActualHeight);
 }
Example #2
0
 public GraphicsControl(GameDeskControl gameDeskControl, Canvas canvas, Rectangle gamedesk)
 {
     this.canvas = canvas;
     this.gamedesk = gamedesk;
     this.gameDeskControl = gameDeskControl;
 }
Example #3
0
 public void SetActiveGameChanged(GameDeskControl g)
 {
     ActiveGameControl = g;
 }
Example #4
0
        public GameDeskControl Add(IQuest quest, GameMode gameMode)
        {
            if (GameViews.Count == 1)
            {
                if (GameViews[0] is Introduction)
                {
                    GameViews.RemoveAt(0);
                }
            }

            GameDeskControl doc = new GameDeskControl(quest, gameMode, userInquirer);
            doc.Title = quest.Name;
            doc.InfoTip = doc.Title;
            doc.ContentTypeDescription = "";
            doc.Closing += new EventHandler<CancelEventArgs>(doc_Closing);
            doc.Closed += new EventHandler(doc_Closed);
            doc.InfoPanel.SizeChanged += new SizeChangedEventHandler(doc.ResizeInfoPanel);
            doc.SetSounds(this.isSoundOn);
            GameViews.Add(doc);
            doc.Resize(GamesDocumentPane.ActualWidth, GamesDocumentPane.ActualHeight);

            //this.SelectedIndex = GameViews.Count - 1;

            this.SetActiveGameChanged(doc);

            return doc;
        }
Example #5
0
 private void restartAvaibilityChangeCheck(GameDeskControl oldValue, GameDeskControl newValue)
 {
     if (oldValue != newValue)
     {
         if (RestartAvaibilityChanged != null)
         {
             RestartAvaibilityChanged(newValue != null);
         }
     }
 }
Example #6
0
        private void doc_Closed(object sender, EventArgs e)
        {
            GameDeskControl oldVal = ActiveGameControl;

            if (sender is GameDeskControl)
            {
                GameDeskControl gdc = sender as GameDeskControl;

                if (gdc == ActiveGameControl)
                {
                    ActiveGameControl = null;
                }
            }

            if (GameViews.Count == 0)
            {
                AddIntroduction();
            }

            restartAvaibilityChangeCheck(oldVal, ActiveGameControl);
        }
Example #7
0
        void dm_ActiveDocumentChanged(object sender, EventArgs e)
        {
            GameDeskControl oldVal = ActiveGameControl;

            if (dm.ActiveDocument != null)
            {
                GameDeskControl gdc = dm.ActiveDocument as GameDeskControl;

                if (gdc != null)
                {
                    ActiveGameControl = gdc;
                }
                else
                {
                    ActiveGameControl = null;
                }
            }
            else
            {
                ActiveGameControl = null;
            }

            restartAvaibilityChangeCheck(oldVal, ActiveGameControl);
        }
Example #8
0
        public void SetActiveGameChanged(GameDeskControl g)
        {
            if (dm != null && dm.ActiveDocument != g)
            {
                dm.ActiveDocument = g;
            }

            restartAvaibilityChangeCheck(g, ActiveGameControl);
            ActiveGameControl = g;
        }