コード例 #1
0
        public NodeUIDialogPuzzleWin(GameUI myGameUI, int myDepth)
            : base(myGameUI, myDepth)
        {
            NodeUIButton buttonNext;
            NodeUIButton buttonCancel;
            NodeUIButton buttonSave;
            NodeUIButton buttonExit;
            buttonNext = new NodeUIButton(myGameUI, myDepth + 1, CurrentAbsolute, "$Graphics/Icons/Right.png", "Next");
            buttonCancel = new NodeUIButton(myGameUI, myDepth + 1, CurrentAbsolute, "$Graphics/Icons/Cancel.png", "Cancel");
            buttonSave = new NodeUIButton(myGameUI, myDepth + 1, CurrentAbsolute, "$Graphics/Icons/Save.png", "Save");
            buttonExit = new NodeUIButton(myGameUI, myDepth + 1, CurrentAbsolute, "$Graphics/Icons/Home.png", "Home");

            buttonNext.ToolTip = "Start the next puzzle";
            buttonCancel.ToolTip = "Redo this puzzle";
            buttonSave.ToolTip = "Save the solution to the library";
            buttonExit.ToolTip = "Return to home page";

            Add(buttonNext);
            Add(buttonCancel);
            Add(buttonSave);
            Add(buttonExit);

            Text = @"Congrats! You have solved the puzzle. Do you want to continue with the next puzzle in the library? Again, well done!";
            TextTitle = "Puzzle Complete";
        }
コード例 #2
0
        public NodeControllerCommands(GameUI myGameUI, int myDepth)
            : base(myGameUI, myDepth)
        {
            RectangleInt panel = myGameUI.GameCoords.PositionMovementCommands;
            VectorInt locCommands = myGameUI.GameCoords.PositionMovementCommands.TopLeft;

            NodeUIButton buttonUp = new NodeUIButton(myGameUI, myDepth + 1, locCommands.Add(22, 2), ResourceID.GameButtonUp, "Up");
            buttonUp.CurrentCentre = panel.TopMiddle;
            buttonUp.ToolTip = "Move Up";
            buttonUp.OnClick += new EventHandler<NotificationEvent>(Button_OnClick);
            myGameUI.Add(buttonUp);

            NodeUIButton buttonDown = new NodeUIButton(myGameUI, myDepth + 2, locCommands.Add(22, 42), ResourceID.GameButtonDown, "Down");
            buttonDown.CurrentCentre = panel.BottomMiddle;
            buttonDown.ToolTip = "Move Down";
            buttonDown.OnClick += new EventHandler<NotificationEvent>(Button_OnClick);
            myGameUI.Add(buttonDown);

            NodeUIButton buttonLeft = new NodeUIButton(myGameUI, myDepth + 3, locCommands.Add(2, 22), ResourceID.GameButtonLeft, "Left");
            buttonLeft.CurrentCentre = panel.MiddleLeft;
            buttonLeft.ToolTip = "Move Left";
            buttonLeft.OnClick += new EventHandler<NotificationEvent>(Button_OnClick);
            myGameUI.Add(buttonLeft);

            NodeUIButton buttonRight = new NodeUIButton(myGameUI, myDepth + 4, locCommands.Add(42, 22), ResourceID.GameButtonRight, "Right");
            buttonRight.CurrentCentre = panel.MiddleRight;
            buttonRight.ToolTip = "Move Right";
            buttonRight.OnClick += new EventHandler<NotificationEvent>(Button_OnClick);
            myGameUI.Add(buttonRight);

            NodeUIButton buttonUndo = new NodeUIButton(myGameUI, myDepth + 6, locCommands.Add(22, 22), ResourceID.GameButtonUndo, "Undo");
            buttonUndo.CurrentCentre = panel.Center;
            buttonUndo.ToolTip = "Undo last move";
            buttonUndo.OnClick += new EventHandler<NotificationEvent>(Button_OnClick);
            myGameUI.Add(buttonUndo);

            RectangleInt panelGen = myGameUI.GameCoords.PositionGeneralCommands;

            NodeUIButton buttonRestart = new NodeUIButton(myGameUI, myDepth + 7, locCommands.Add(42, 42), ResourceID.GameButtonRestart, "Restart");
            buttonRestart.CurrentCentre = panelGen.MiddleLeft;
            buttonRestart.ToolTip = "Restart puzzle";
            buttonRestart.OnClick += new EventHandler<NotificationEvent>(Button_OnClick);
            myGameUI.Add(buttonRestart);

            NodeUIButton buttonExit = new NodeUIButton(myGameUI, myDepth + 8, locCommands.Add(42, 2), ResourceID.GameButtonCancel, "Exit");
            buttonExit.CurrentCentre = panelGen.Center;
            buttonExit.ToolTip = "Give up and exit";
            buttonExit.OnClick += new EventHandler<NotificationEvent>(Button_OnClick);
            myGameUI.Add(buttonExit);

            NodeUIButton buttonHelp = new NodeUIButton(myGameUI, myDepth + 5, locCommands.Add(2, 42), ResourceID.GameButtonHelp, "Help");
            buttonHelp.CurrentCentre = panelGen.MiddleRight;
            buttonHelp.ToolTip = "Get a hint";
            buttonHelp.OnClick += new EventHandler<NotificationEvent>(Button_OnClick);
            myGameUI.Add(buttonHelp);
        }
コード例 #3
0
        public void Add(NodeUIButton button)
        {
            buttons.Add(button);
            if (!GameUI.HasNode(button))
            {
                GameUI.Add(button);
            }

            button.OnClick += new EventHandler<NotificationEvent>(OnClickButton);
        }
コード例 #4
0
        public NodeControllerBookmarks(GameUI myGameUI, int myDepth)
            : base(myGameUI, myDepth)
        {
            VectorInt vi = myGameUI.GameCoords.PositionWayPoints.TopLeft;
            b1 = new NodeUIButton(myGameUI, myDepth + 1, vi, "$Graphics/Tiles/Clean/WayPointButton1.png", "WP1");
            b1.ImageBack = null;
            b1.ToolTip = "Bookmark #1";
            b1.OnClick += new EventHandler<NotificationEvent>(OnButtonClick);
            b1.OnMouseOver += new EventHandler<NotificationEvent>(OnButtonMouseOver);
            myGameUI.Add(b1);

            vi = vi.Add(0, 40);
            b2 = new NodeUIButton(myGameUI, myDepth +2, vi, "$Graphics/Tiles/Clean/WayPointButton2.png", "WP2");
            b2.ImageBack = null;
            b2.ToolTip = "Bookmark #2";
            b2.OnClick += new EventHandler<NotificationEvent>(OnButtonClick);
            b2.OnMouseOver += new EventHandler<NotificationEvent>(OnButtonMouseOver);
            myGameUI.Add(b2);

            vi = vi.Add(0, 40);
            b3 = new NodeUIButton(myGameUI, myDepth + 3, vi, "$Graphics/Tiles/Clean/WayPointButton3.png", "WP3");
            b3.ImageBack = null;
            b3.ToolTip = "Bookmark #3";
            b3.OnClick += new EventHandler<NotificationEvent>(OnButtonClick);
            b3.OnMouseOver += new EventHandler<NotificationEvent>(OnButtonMouseOver);
            myGameUI.Add(b3);

            vi = vi.Add(0, 40);
            b4 = new NodeUIButton(myGameUI, myDepth + 4, vi, "$Graphics/Tiles/Clean/WayPointButton4.png", "WP4");
            b4.ImageBack = null;
            b4.ToolTip = "Bookmark #4";
            b4.OnClick += new EventHandler<NotificationEvent>(OnButtonClick);
            b4.OnMouseOver += new EventHandler<NotificationEvent>(OnButtonMouseOver);
            myGameUI.Add(b4);

            vi = vi.Add(0, 40);
            b5 = new NodeUIButton(myGameUI, myDepth + 5, vi, "$Graphics/Tiles/Clean/WayPointButton5.png", "WP5");
            b5.ImageBack = null;
            b5.ToolTip = "Bookmark #5";
            b5.OnClick += new EventHandler<NotificationEvent>(OnButtonClick);
            b5.OnMouseOver += new EventHandler<NotificationEvent>(OnButtonMouseOver);
            myGameUI.Add(b5);

            brushBookmarkOn = null;
            brushBookmarkOff = new SolidBrush(Color.FromArgb(120, Color.Black));

            staticImageRender = new StaticImage(ResourceFactory.Singleton.GetInstance("Default.Tiles"), new VectorInt(16, 16));
        }
コード例 #5
0
        private void ShowMouseOverImage(int idx, NodeUIButton button)
        {
            if (mouseOverImage != null && !mouseOverImage.IsRemoved  && idx != currentMouseOver)
            {
                mouseOverImage.Remove();
            }

            SokobanMap map = GameUI.Bookmarks[idx].Current;
            if (mouseOverImage == null || mouseOverImage.IsRemoved)
            {
                mouseOverImage = new NodeEffectImage(GameUI, Depth + 1, staticImageRender.Draw(map));
                mouseOverImage.CurrentAbsolute = button.CurrentAbsolute.Add(60, 0);
                mouseOverImage.Path = new StaticPath(mouseOverImage.CurrentAbsolute, 40);
                GameUI.Add(mouseOverImage);
                currentMouseOver = idx;
            }
        }