Exemple #1
0
        public override void Update()
        {
            if (btnToMenu.isActive)
            {
                stateaction = StateActions.POP;
            }

            if (btnPasteIP.isActive)
            {
                string tmpIP = fastClipboard.GetText();
                if (isValidIPAddress(tmpIP))
                {
                    text.setString("IP: " + tmpIP);
                }
                else
                {
                    text.setString("IP: " + "incorrect IP");
                }
            }

            if (btnConnectToGame.isActive && isCorrect)
            {
                Console.WriteLine("Connecting...");
                stateaction = StateActions.PUSH;
                nextstate   = States.GS_GAMEPLAY;
            }
        }
Exemple #2
0
        private void InitializeGui()
        {
            backgroundColor = new Color(0, 110, 0);

            int resx         = Program.LoadIntSetting("resx");
            int resy         = Program.LoadIntSetting("resy");
            int buttonWidth  = Program.LoadIntSetting("buttonWidth");
            int buttonHeight = Program.LoadIntSetting("buttonHeight");

            text = new CuteText("", new Vector2f(50, 50));
            text.setString("IP: ");

            btnToMenu = new Button(buttonWidth, buttonHeight);
            btnToMenu.setPosition(new Vector2f(40, resy - buttonHeight - 40));
            btnToMenu.ButtonText = "Back";

            btnPasteIP = new Button(buttonWidth * 1.6f, buttonHeight);
            btnPasteIP.setPosition(new Vector2f(resx - buttonWidth * 1.6f - 50, 120));
            btnPasteIP.ButtonText = "Paste IP address";

            btnConnectToGame = new Button(buttonWidth, buttonHeight);
            btnConnectToGame.setPosition(new Vector2f(resx - buttonWidth - 40, resy - buttonHeight - 40));
            btnConnectToGame.ButtonText = "Connect";

            mouseInteractionList.Add(btnToMenu);
            mouseInteractionList.Add(btnPasteIP);
            mouseInteractionList.Add(btnConnectToGame);
        }
Exemple #3
0
        private void InitializeGui()
        {
            backgroundColor = new Color(40, 50, 90);

            int resx         = Program.LoadIntSetting("resx");
            int resy         = Program.LoadIntSetting("resy");
            int buttonWidth  = Program.LoadIntSetting("buttonWidth");
            int buttonHeight = Program.LoadIntSetting("buttonHeight");

            btnBack = new Button(buttonWidth, buttonHeight);
            btnBack.setPosition(new Vector2f(40, resy - buttonHeight - 40));
            btnBack.ButtonText = "Back";

            btnEndOfTurn = new Button(buttonWidth, buttonHeight);
            btnEndOfTurn.setPosition(new Vector2f(resx - buttonWidth - 20, resy - buttonHeight - 160));
            btnEndOfTurn.ButtonText = "End Turn";

            yourTurnCuteText = new CuteText("", new Vector2f(resx - 160, 60));
            yourTurnCuteText.setString("Your\r\nTurn");

            notCuteText = new CuteText("", new Vector2f(resx - 160, 25));
            notCuteText.setString("Not");

            mouseInteractionList.Add(btnBack);
            mouseInteractionList.Add(btnEndOfTurn);
        }
Exemple #4
0
        private void InitializeGui()
        {
            backgroundColor = new Color(30, 110, 60);

            int resx         = Program.LoadIntSetting("resx");
            int resy         = Program.LoadIntSetting("resy");
            int buttonWidth  = Program.LoadIntSetting("buttonWidth");
            int buttonHeight = Program.LoadIntSetting("buttonHeight");

            textSettings = new CuteText("", new Vector2f(50, 50));
            textSettings.setString("IP: ");

            btnToMenu = new Button(buttonWidth, buttonHeight);
            btnToMenu.setPosition(new Vector2f(40, resy - buttonHeight - 40));
            btnToMenu.ButtonText = "Back";

            mouseInteractionList.Add(btnToMenu);
        }