示例#1
0
        internal override void Display()
        {
            pText t = new pText("Password:"******"", 16, new Vector2(150, 120), 450, 0.92f);
            gamePassword.LengthLimit = 50;

            currentVerticalSpace = 180;

            spriteManager.Add(gamePassword.SpriteCollection);

            AddOption("Join Game", Color.LimeGreen, onClick, false);
            AddOption("Cancel", Color.LightGray, cancel, false);

            base.Display();

            Background.InitialColour = new Color(15, 59, 87, 200);

            gamePassword.Select();
        }
示例#2
0
        void textBox_OnCommit(pTextBox sender, bool newText)
        {
            if (commentTarget == CommentTargets.None && newText)
            {
                NotificationManager.ShowMessageMassive("Select a target for your comment first!", 1500);
                commentInputTextbox.Select();
                return;
            }

            if (newText && commentInputTextbox.Text.Length > 0)
            {
                pWebRequest fnr = new pWebRequest(General.WEB_ROOT + "/web/osu-comment.php");
                fnr.AddParameter("u", ConfigManager.sUsername);
                fnr.AddParameter("p", ConfigManager.sPassword);

                fnr.AddParameter("s", BeatmapManager.Current.BeatmapSetId.ToString());
                fnr.AddParameter("b", BeatmapManager.Current.BeatmapId.ToString(GameBase.nfi));
                fnr.AddParameter("m", ((int)InputManager.ReplayScore.PlayMode).ToString(GameBase.nfi));
                fnr.AddParameter("r", InputManager.ReplayScore.OnlineId.ToString(GameBase.nfi));
                fnr.AddParameter("target", commentTarget.ToString().ToLower());
                //append colour here
                if (commentColourPicker.InitialColour != Color.White && commentColourPicker.InitialColour != Color.TransparentWhite)
                {
                    string colour = ColourHelper.Color2Hex(commentColourPicker.InitialColour);
                    fnr.AddParameter("f", colour);
                }


                fnr.AddParameter("a", "post");
                fnr.AddParameter("starttime", commitStartTime.ToString());
                fnr.AddParameter("comment", commentInputTextbox.Text);

                fnr.Finished += delegate
                {
                    GameBase.Scheduler.Add(delegate
                    {
                        increaseCount(commentTarget);
                        updateCounts();

                        commentInputTextbox.Text = "Please wait before commenting again...";
                        NotificationManager.ShowMessage("Your comment has been submitted!", Color.Orange, 3000);
                    });
                };

                fnr.Perform();

                commentInputTextbox.Enabled = false;
                commentInputTextbox.Text    = "Sending...";
            }

            if (commentInputTextbox.Text.Length == 0)
            {
                commentInputTextbox.Text = DEFAULT_MESSAGE;
            }

            UpdateCommentWindowSizing();

            if (Player.Paused)
            {
                AudioEngine.TogglePause();
                Player.Paused = false;
            }
        }