Inheritance: MonoBehaviour
Exemplo n.º 1
0
        private void AddPlayerButton_Click(object sender, EventArgs e)
        {
            string currentUserName = UserNameTextBox.Text;

            if (currentUserName == "")
            {
                MessageBox.Show("Please enter a Name");
                return;
            }
            if (!PlayerList.DoesPlayerExist(currentUserName))
            {
                listBox1.Items.Add(PlayerList.NumberOfPlayers + ")  " + currentUserName);
                Player newPlayer = new Player(currentUserName);
                PlayerList.AddPlayerInVector(newPlayer);

                UserNameTextBox.Clear();
                if (PlayerList.IsGameFull())
                {
                    AddPlayerButton.Hide();
                    UserNameTextBox.Hide();
                }

                if (PlayerList.AreEnoughPlayers())
                {
                    StartButton.Show();
                }
            }
            else
            {
                MessageBox.Show("This username is already used");
            }
        }
Exemplo n.º 2
0
 //open screen
 private void StartButton_Click(object sender, EventArgs e)
 {
     StartButton.Hide();
     PlayButton.Show();
     numericUpDown1.Show();
     HowManyText.Text = "How Many Letters In The Word?";
 }
 void ReleaseDesignerOutlets()
 {
     if (lblX != null)
     {
         lblX.Dispose();
         lblX = null;
     }
     if (lblY != null)
     {
         lblY.Dispose();
         lblY = null;
     }
     if (lblZ != null)
     {
         lblZ.Dispose();
         lblZ = null;
     }
     if (StartButton != null)
     {
         StartButton.Dispose();
         StartButton = null;
     }
     if (StopButton != null)
     {
         StopButton.Dispose();
         StopButton = null;
     }
 }
Exemplo n.º 4
0
 void ShowUIEelements(bool x)
 {
     WinnerImage.gameObject.SetActive(x);
     StartButton.SetActive(x);
     ShuffleButtonBlue.SetActive(x);
     ShuffleButtonRed.SetActive(x);
 }
Exemplo n.º 5
0
        /// <summary>
        /// Draws the Start screen and its elements.
        /// </summary>
        /// <param name="spriteBatch">
        /// The SpriteBatch object used to draw with.
        /// </param>
        public override void Draw(SpriteBatch spriteBatch)
        {
            // Draw the backdrop.
            spriteBatch.Draw(
                backdrop,
                new Rectangle(0, 0, Game1.WindowWidth, Game1.WindowHeight),
                backdropColour);

            // Draw the buttons.
            StartButton.Draw(spriteBatch, "Start");
            LeaderboardButton.Draw(spriteBatch, "Leaderboard");
            QuitButton.Draw(spriteBatch, "Quit");

            // Draw the game title text and version number.
            spriteBatch.DrawString(
                subtextFont,
                "v1.1.0.0",
                subtextPosition,
                Color.MediumAquamarine);

            spriteBatch.DrawString(
                textFont,
                "Wall Dodger",
                textPosition,
                Color.Aquamarine);
        }
Exemplo n.º 6
0
 void Start_Click()
 {
     StartButton.Click += (sender, args) =>
     {
         _isReady = _player.IsReady();
         if (!_isReady)
         {
             _alpha       = 255;
             _message     = Messages.NotReady;
             _messageFlag = true;
         }
         else
         {
             StartButton.Enabled = false;
             StartButton.Visible = false;
             ShipWarsForm.Collection.RemoveByKey("RandomButton");
             ShipsToBoard();
             StartButton.Dispose();
             var send = new Message {
                 Code = Codes.PlayerIsReady, Matrix = new bool[GameBoard.BoardSize][]
             };
             for (var i = 0; i < GameBoard.BoardSize; i++)
             {
                 send.Matrix[i] = new bool[GameBoard.BoardSize];
                 for (var j = 0; j < GameBoard.BoardSize; j++)
                 {
                     send.Matrix[i][j] = _gameBoard.Board[i + GameBoard.BoardSize][j].ShipOverMe;
                 }
             }
             Write(send);
         }
     };
 }
Exemplo n.º 7
0
        private void ShowHighScores()
        {
            StartButton.Hide();
            HiScoresButton.Text    = "Return";
            HiScoreScreenActivated = true;
            label1.Hide();
            label6.Hide();
            label4.Text      = "H";
            label3.Text      = "i";
            label2.Text      = "g";
            label5.Text      = "h";
            MemoryLabel.Left = 60;
            label2.BringToFront();
            MemoryLabel.SendToBack();
            MemoryLabel.Text = "Scores";

            pointsText.Text = "";
            nameText.Text   = "";

            foreach (HighScore hs in highscorelist)
            {
                pointsText.Text = pointsText.Text + hs.points.ToString() + "\r\n";
                nameText.Text   = nameText.Text + hs.name.ToString().ToUpper() + "\r\n";
            }

            pointsText.Visible = true;
            nameText.Visible   = true;
        }
Exemplo n.º 8
0
        private void StartButton_Click(object sender, EventArgs e)
        {
            StartButton.SendToBack();
            //StopButton.BringToFront();

            if (RadioSeconds.Checked)
            {
                Timer2.Interval = Convert.ToInt32(Time_TextBox.Text);
            }
            else
            {
                Timer2.Interval = Convert.ToInt32(Time_TextBox.Text) * 10000;
            }
            //Start mine
            Timer2.Start();


            if (panel1.Height == 1 && panel1.Width == 133)
            {
                panel1.Height = 129;
                panel1.Width  = 133;
            }
            else
            {
            }
        }
Exemplo n.º 9
0
    // Use this for initialization

    void Start()
    {
        GameObject a = GameObject.Find("StartButton");

        startbutton = a.GetComponent <StartButton>();
        sound01     = GetComponent <AudioSource>();
    }
Exemplo n.º 10
0
        private void MainMenuButton_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("Save your result?", "Attention", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                results += String.Format("{0}\t Level: {1}\t Solved himself: {2}\t Auto solve: {3}\n", name, level - 5, level - 5 - autoSolves, autoSolves);
            }
            else if (dr == DialogResult.Cancel)
            {
                return;
            }
            dr = MessageBox.Show("Are you want to exit to main menu?", "Attention", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (dr == DialogResult.Yes)
            {
                level      = 6;
                autoSolves = 0;
                Vertices.Clear();
                Edges.Clear();
                DrawAll();
                Text = "Untangle";
                StartButton.Show();
                ExitStartMenuButton.Show();
                RulesStartMenuButton.Show();
                TitleLabel.Show();
                TitleUnderLabel.Show();
                isPlay    = false;
                isNewGame = true;
                MainMenuButton.Enabled = false;
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// Если победил
        /// </summary>
        private void IsWin(object sender, MouseEventArgs e)
        {
            if (isPlay)
            {
                DialogResult dr = MessageBox.Show("You win!\nSave the graph picture?", "Congratz", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dr == DialogResult.Yes)
                {
                    SaveButton_Click(sender, e);
                }

                if (MessageBox.Show("Continue?", "Congratz", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    level++;
                    StartLevel();
                    isPlay = true;
                }
                else
                {
                    results   += String.Format("{0}\t Level: {1}\t Solved himself: {2}\t Auto solve: {3}\n", name, level - 5, level - 5 - autoSolves, autoSolves);
                    level      = 4;
                    autoSolves = 0;
                    Vertices.Clear();
                    Edges.Clear();
                    DrawAll();
                    Text = "Untangle";
                    StartButton.Show();
                    ExitStartMenuButton.Show();
                    RulesStartMenuButton.Show();
                    TitleLabel.Show();
                    TitleUnderLabel.Show();
                    isPlay = false;
                    MainMenuButton.Enabled = false;
                }
            }
        }
Exemplo n.º 12
0
 public void StartButtonRemove()
 {
     StartButton.SetActive(false);
     ExitButton.SetActive(false);
     EscButton.SetActive(true);
     RstButton.SetActive(true);
 }
Exemplo n.º 13
0
 // Use this for initialization
 void Start()
 {
     timer              = 120; // In seconds
     winText.text       = "";
     button             = startButton.GetComponent <StartButton>();
     timeRemaining.text = "";
 }
Exemplo n.º 14
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            StartButton.AddTarget(startTimeEntry, UIControlEvent.TouchUpInside);
            StopButton.AddTarget(stopTimeEntry, UIControlEvent.TouchUpInside);
            ShowAllTimeEntriesButton.AddTarget((s, e) => openApp(), UIControlEvent.TouchUpInside);

            tapGestureRecognizer = new UITapGestureRecognizer(openApp);

            SuggestionsTableView.RegisterNibForCellReuse(SuggestionTableViewCell.Nib, SuggestionTableViewCell.Identifier);

            var suggestions = SharedStorage.Instance.GetCurrentSuggestions();

            if (suggestions == null)
            {
                ExtensionContext?.SetWidgetLargestAvailableDisplayMode(NCWidgetDisplayMode.Compact);
                return;
            }

            suggestionsCount = suggestions.Count;
            SuggestionsTableViewHeightConstraint.Constant = 60 * suggestionsCount;
            dataSource                  = new SuggestionsDataSource();
            dataSource.Suggestions      = suggestions;
            dataSource.Callback         = continueSuggestion;
            SuggestionsTableView.Source = dataSource;
        }
        void ReleaseDesignerOutlets()
        {
            if (StartButton != null)
            {
                StartButton.Dispose();
                StartButton = null;
            }

            if (StopButton != null)
            {
                StopButton.Dispose();
                StopButton = null;
            }

            if (Label != null)
            {
                Label.Dispose();
                Label = null;
            }

            if (ScrollView != null)
            {
                ScrollView.Dispose();
                ScrollView = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (LastTradeExchangeLabel != null)
            {
                LastTradeExchangeLabel.Dispose();
                LastTradeExchangeLabel = null;
            }

            if (LastTradePriceLabel != null)
            {
                LastTradePriceLabel.Dispose();
                LastTradePriceLabel = null;
            }

            if (StartButton != null)
            {
                StartButton.Dispose();
                StartButton = null;
            }

            if (StopButton != null)
            {
                StopButton.Dispose();
                StopButton = null;
            }
        }
Exemplo n.º 17
0
 private void Init()
 {
     _gameBoard = new GameBoard();
     _enemy     = new Player(false);
     StartButton.Show();
     _player.randomFleet.Show();
 }
Exemplo n.º 18
0
        void ReleaseDesignerOutlets()
        {
            if (ProgressTextView != null)
            {
                ProgressTextView.Dispose();
                ProgressTextView = null;
            }

            if (ProgressBar != null)
            {
                ProgressBar.Dispose();
                ProgressBar = null;
            }

            if (StatusTextView != null)
            {
                StatusTextView.Dispose();
                StatusTextView = null;
            }

            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

            if (StartButton != null)
            {
                StartButton.Dispose();
                StartButton = null;
            }
        }
Exemplo n.º 19
0
 private void ShowMainMenu()
 {
     this.Width             = 337;
     this.Height            = 493;
     HiScoreScreenActivated = false;
     pointsText.Visible     = false;
     nameText.Visible       = false;
     label4.Text            = "o";
     label3.Text            = "l";
     label2.Text            = "o";
     label5.Text            = "u";
     MemoryLabel.Text       = "Memory";
     MemoryLabel.Left       = 38;
     MemoryLabel.Top        = 88;
     label1.Show();
     label2.Show();
     label3.Show();
     label4.Show();
     label5.Show();
     label6.Show();
     MemoryLabel.Show();
     StartButton.Show();
     HiScoresButton.Text = "Hi-Score";
     HiScoresButton.Show();
     QuitButton.Show();
     mainMenuTimer.Start();
     PlayHome();
 }
        void ReleaseDesignerOutlets()
        {
            if (PrivacyLink != null)
            {
                PrivacyLink.Dispose();
                PrivacyLink = null;
            }

            if (StartButton != null)
            {
                StartButton.Dispose();
                StartButton = null;
            }

            if (StartDisclaimer != null)
            {
                StartDisclaimer.Dispose();
                StartDisclaimer = null;
            }

            if (StartSubtitle != null)
            {
                StartSubtitle.Dispose();
                StartSubtitle = null;
            }

            if (StartTitle != null)
            {
                StartTitle.Dispose();
                StartTitle = null;
            }
        }
Exemplo n.º 21
0
        public void Test1()
        {
            // Arrange

            // Act
            HomeScreen
            .Go()
            .Themes.GetValue(out var themes)
            .Themes[0].Name.Click()
            .Topics.GetValue(out var topics)
            .StartButton.Click()
            .FinishButton.Click()
            .Topics.GetValue(out var topicsResult)
            .Questions.GetValue(out var questionsResult)
            .ExportToExcelButton.Click();

            // Assert
            Assert.Equal(expected: 2, actual: themes.Count);
            Assert.Equal(expected: 4, actual: topics.Count);
            Assert.Equal(expected: 4, actual: topicsResult.Count);
            Assert.Equal(expected: 8, actual: questionsResult.Count);

            // var item = list.FirstOrDefault();
            // item.Index.GetValue(out var index);
            // item.Name.GetValue(out var name);
            // item.Topics.GetValue(out var topics);
            // item.Questions.GetValue(out var questions);
        }
Exemplo n.º 22
0
        public void Viewcontrols()
        {
            // background music

            simpleSound.PlayLooping();
            //View controls
            MovingButton.Text = arr[random.Next(0, 25)].ToString();
            timer1.Enabled    = true;
            StartButton.Hide();
            LivesLabel.Visible     = true;
            label2.Visible         = true;
            label3.Visible         = true;
            ScoreLabel.Visible     = true;
            InputText.Visible      = true;
            Life1.Visible          = true;
            Life2.Visible          = true;
            Life3.Visible          = true;
            Life4.Visible          = true;
            Life5.Visible          = true;
            resume.Visible         = true;
            pause.Visible          = true;
            Mute.Visible           = true;
            userName.Visible       = true;
            controlPanel.Visible   = true;
            LifeHeartPanel.Visible = true;
            InputText.Focus();
        }
 void ReleaseDesignerOutlets()
 {
     if (StartButton != null)
     {
         StartButton.Dispose();
         StartButton = null;
     }
     if (StopButton != null)
     {
         StopButton.Dispose();
         StopButton = null;
     }
     if (xLabel != null)
     {
         xLabel.Dispose();
         xLabel = null;
     }
     if (yLabel != null)
     {
         yLabel.Dispose();
         yLabel = null;
     }
     if (zLabel != null)
     {
         zLabel.Dispose();
         zLabel = null;
     }
 }
Exemplo n.º 24
0
    // Start is called before the first frame update
    void Start()
    {
        // Red팀 게임오브젝트를 가져옴
        GameObject redTeam = transform.Find("RedTeam").gameObject;

        // 게임오브젝트의 컴포넌트를 가져옴
        redTeamProfileInfo = redTeam.transform.GetChild(0).GetComponent <ProfileInfo>();

        // blue팀 게임오브젝트를 가져옴
        GameObject blueTeam = transform.Find("BlueTeam").gameObject;

        // 게임오브젝트의 컴포넌트를 가져옴
        blueTeamProfileInfo = blueTeam.transform.GetChild(0).GetComponent <ProfileInfo>();

        // 버튼(게임 시작, 준비) 컴포넌트를 가져옴
        gameStartButton = transform.Find("StartButton").GetComponent <StartButton>();

        // 이벤트 리스너 등록
        gameStartButton.startButtonClickEvent += OnButtonClick;

        // 팀 진영을 받아옴
        teamInfo = GameManager._instance.GetTeamInfo();

        // 팀에 맞게 프로필을 설정함
        SetProfile(teamInfo, GameManager._instance.GetPlayerAssetName(), PhotonNetwork.NickName);

        // 현재 나의 정보를 마스터 클라이언트에게 전달
        photonView.RPC("RPC_SetProfile", RpcTarget.MasterClient, teamInfo, GameManager._instance.GetPlayerAssetName(), PhotonNetwork.NickName);
    }
Exemplo n.º 25
0
 public void CloseDown()
 {
     Panel.SetActive(false);
     SettingButton.SetActive(true);
     StartButton.SetActive(true);
     YarikataButton.SetActive(true);
 }
        void ReleaseDesignerOutlets()
        {
            if (PauseButton != null)
            {
                PauseButton.Dispose();
                PauseButton = null;
            }

            if (ResetButton != null)
            {
                ResetButton.Dispose();
                ResetButton = null;
            }

            if (StartButton != null)
            {
                StartButton.Dispose();
                StartButton = null;
            }

            if (Surface != null)
            {
                Surface.Dispose();
                Surface = null;
            }
        }
Exemplo n.º 27
0
 private async void Animate()
 {
     while (animate)
     {
         StartButton.SetImage(UIImage.FromBundle("icPauseCircleFilled24Px"), UIControlState.Normal);
         if ((int)Slider.Value != (int)Slider.MaxValue)
         {
             foreach (var item in Polylines)
             {
                 if ((int)Slider.Value != (int)Slider.MaxValue && animate)
                 {
                     Slider.Value = Slider.Value + 1;
                     HandlePolylines();
                     await Task.Delay(500);
                 }
                 if ((int)Slider.Value == (int)Slider.MaxValue)
                 {
                     animate = false;
                     StartButton.SetImage(UIImage.FromBundle("icPlayCircleFilled24Px"), UIControlState.Normal);
                 }
             }
         }
         else
         {
             StartButton.SetImage(UIImage.FromBundle("icPlayCircleFilled24Px"), UIControlState.Normal);
         }
     }
 }
Exemplo n.º 28
0
        public OfflineGame()
        {
            _background = new GameBackground();
            _gameBoard  = new GameBoard();
            _player     = new Player(true);
            _enemy      = new Player(false);
            _enemy.GenerateRandomFleet();

            IsReady();

            StartButton.MouseClick += (s, e) =>
            {
                _isReady = _player.IsReady();
                if (!_isReady)
                {
                    _alpha       = 255;
                    _message     = Messages.NotReady;
                    _messageFlag = true;
                }
                else
                {
                    _playing            = true;
                    StartButton.Enabled = false;
                    StartButton.Visible = false;
                    ShipWarsForm.Collection.RemoveByKey("RandomButton");
                    ShipsToBoard();
                    StartButton.Dispose();
                }
            };
        }
Exemplo n.º 29
0
        void ReleaseDesignerOutlets()
        {
            if (TimeLabel != null)
            {
                TimeLabel.Dispose();
                TimeLabel = null;
            }

            if (AvgSpeedLabel != null)
            {
                AvgSpeedLabel.Dispose();
                AvgSpeedLabel = null;
            }

            if (DistanceLabel != null)
            {
                DistanceLabel.Dispose();
                DistanceLabel = null;
            }

            if (StartButton != null)
            {
                StartButton.Dispose();
                StartButton = null;
            }
        }
Exemplo n.º 30
0
        void ReleaseDesignerOutlets()
        {
            if (_viewForTowers != null)
            {
                _viewForTowers.Dispose();
                _viewForTowers = null;
            }

            if (PauseButton != null)
            {
                PauseButton.Dispose();
                PauseButton = null;
            }

            if (StartButton != null)
            {
                StartButton.Dispose();
                StartButton = null;
            }

            if (StopButton != null)
            {
                StopButton.Dispose();
                StopButton = null;
            }
        }
Exemplo n.º 31
0
 public override void Load()
 {
     this.BackgroundColor = Color.DarkRed;
     AddSprite(new TitleSprite());
     startbutton = new StartButton();
     AddSprite(startbutton);
     startbutton.X = 120f;
     LoadFont("QuartzMS");
 }
Exemplo n.º 32
0
        public StartScreen(Game1 game)
            : base(game)
        {
            var sprite = new Sprite("main");
            this.Add(sprite);

            var button = new StartButton(this);
            button.Released += new EventHandler<TouchEventArgs>(button_Released);
            this.Add(button);
            this.StartButton = button;
        }
Exemplo n.º 33
0
        public ServerDialog( TwoClient twoClient)
        {
            _twoClient = twoClient;
            _findServer = "Choose a server";
            _x = _twoClient.WindowWidth/2 - 150;
            _y = _twoClient.WindowHeight/2 - 170;
            _bgRect = new Rectangle(_x,_y,300,340);
            Cl = new ChooseList(_twoClient,11,180,_x+25,_y+85);
            try
            {
                StreamReader sr = new StreamReader("two.cfg");
                _tf = new TextField(_twoClient, sr.ReadLine(), _x + 65, _y + 45, 12);
                sr.Close();
            }catch( Exception e)
            {
                _tf = new TextField(_twoClient, "def", _x + 65, _y + 45, 12);
            }

            _twoClient.keyboardObject = _tf;
            _startButton = new StartButton(_x + 217,_y + 100,75,40,1f,"Join Game", _twoClient, _twoClient.Sf,_twoClient.ButtonTexture,this);
            _startButton.IsActive = true;
        }