Ejemplo n.º 1
0
        public void Handle(PaneVisibilityChangedEvent args)
        {
            if (args.IsVisible == false)
            {
                return;
            }

            switch (args.Pane)
            {
            case Pane.Navigation:
                NavigationPane.Show();
                break;

            case Pane.Filter:
                FilterPane.Show();
                break;

            case Pane.Layout:
                LayoutPane.Show();
                break;

            case Pane.Legend:
                LegendPane.Show();
                break;

            case Pane.Property:
                PropertyPane.Show();
                break;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// the constructor for PathwayView.
        /// set the handler of event and user control.
        /// </summary>
        public PathwayControl(PathwayWindow window)
        {
            this.m_window = window;
            // Create Internal object.
            m_canvas = null;
            m_csManager = new ComponentManager();
            SetNodeIcons();
            // Create menus
            m_menu = new MenuControl(this);
            // Set AnimationControl
            m_animCon = new AnimationControl(this);
            // Preparing Interfaces
            m_pathwayView = new PathwayView(this);
            m_layerView = new LayerView(this);
            m_toolBox = new Stencils(this);
            m_layout = new LayoutPane(m_window.Environment);
            m_layout.ApplyButton.Click += new EventHandler(ApplyButton_Click);

            m_window.PluginManager.Refresh += new EventHandler(PluginManager_Refresh);
        }
Ejemplo n.º 3
0
 public DemoView(LayoutPane root) : base(root)
 {
 }
Ejemplo n.º 4
0
 public SessionView(LayoutPane root)
     : base(root)
 {
     rng = new Random();
 }
Ejemplo n.º 5
0
        protected override void Init()
        {
            font             = Content.Load <SpriteFont>("fonts/menu_font");
            blank            = Content.Load <Texture2D>("textures/blank");
            background       = new ImageItem(blank);
            background.HGrow = background.VGrow = 1;
            background.Color = Color.Black;
            background.Alpha = 0.5f;

            TextItem gameOver = new TextItem(font, "Game Over");

            gameOver.HAlign       = HAlignment.Center;
            gameOver.VAlign       = VAlignment.Center;
            gameOver.IsSizeScaled = true;
            gameOver.Scale        = 2;

            HPane hGameOver = new HPane(gameOver);

            hGameOver.HGrow = hGameOver.VGrow = 1;

            ImageItem bTop = new ImageItem(blank);

            bTop.HGrow = bTop.VGrow = 1;
            bTop.Color = Color.DarkGray;
            bTop.Alpha = 0.5f;

            ImageItem bBot = new ImageItem(blank);

            bBot.HGrow = bBot.VGrow = 1;
            bBot.Color = Color.Black;
            bBot.Alpha = 0.5f;

            StackPane sTop = new StackPane(bTop, hGameOver);

            sTop.VAlign = VAlignment.Center;
            sTop.HAlign = HAlignment.Center;
            sTop.HGrow  = 0.5f;
            sTop.VGrow  = 1;

            mainPane        = new StackPane(bBot);
            mainPane.HAlign = HAlignment.Center;
            mainPane.VAlign = VAlignment.Center;
            mainPane.HGrow  = 0.5f;
            mainPane.VGrow  = 1;

            VPane vPane = new VPane(sTop, mainPane);

            vPane.HGrow = vPane.VGrow = 1;

            ViewPane.Clear();
            RootPane       = new StackPane(background, vPane);
            RootPane.HGrow = RootPane.VGrow = 1;
            ViewPane.Add(RootPane);

            Task.Run(() => {
                Game.Scores = FileManager.LoadHighscores(Game.ScoresPath);
                int pos     = Game.AddHighscore(score, out kicked);

                if (score.MinesHit < score.TotalMines &&
                    pos <= Minestory.MAX_SCORES_PER_DIFF)
                {
                    message = "New Highscore! Rank " + pos + ". Enter your Name:";
                    mainPane.Add(CreateTextInputPane(message));
                }
                else
                {
                    mainPane.Add(CreateNavPane());
                }
            });
        }
Ejemplo n.º 6
0
        private void SaveScores(TextField nameField, LayoutPane pane)
        {
            MapDifficulty diff = Game.Settings.Difficulty;

            score.Name = nameField.Text;

            int              p    = 1;
            Highscore        best = null;
            List <Highscore> dups = new List <Highscore>();
            var              it   = Game.ScoresOf(diff).GetEnumerator();

            for (it.MoveNext(); it.Current != null; it.MoveNext())
            {
                if (it.Current.Name.Equals(score.Name))
                {
                    if (best == null)
                    {
                        best = it.Current;
                    }
                    else
                    {
                        dups.Add(it.Current);
                    }
                }

                if (best == null)
                {
                    ++p;
                }
            }

            if (score == best)
            {
                Task.Run(() => {
                    mainPane.Remove(pane);
                    dups.ForEach(Game.RemoveHighscore);
                    FileManager.SaveHighscores(Game.ScoresPath, Game.Scores);
                    MySqlHelper.Instance.Sync(Game);
                    mainPane.Add(CreateNavPane());
                });
            }
            else
            {
                Game.Scores.Remove(score);
                if (kicked != null)
                {
                    Game.Scores.Add(kicked);
                }
                var ti = new TextItem(font, string.Format("A better score by {0} already exists at Rank {1}.", best.Name, p));
                var fp = new FadingPane(2000);
                fp.HGrow  = fp.VGrow = 1;
                ti.HAlign = HAlignment.Center;
                ti.VAlign = VAlignment.Center;
                fp.Add(ti);

                fp.FadedOut += (s, a) => {
                    mainPane.Remove(fp);
                    mainPane.Add(CreateNavPane());
                };

                mainPane.Remove(pane);
                mainPane.Add(fp);
            }
        }
Ejemplo n.º 7
0
 public PauseView(LayoutPane root, SessionView parent) : base(root)
 {
     FadeInTime  = FadeOutTime = 0;
     this.parent = parent;
 }
Ejemplo n.º 8
0
 public FadingView(LayoutPane rootPane) : base(rootPane)
 {
 }