예제 #1
0
 private void TweetBox_MouseEnter(object sender, EventArgs e)
 {
     if (ActiveForm == this)
     {
         TweetBox.Focus();
     }
 }
예제 #2
0
    protected override void WindowOpen(UIWindow window)
    {
        window.Open();
        TweetBox box = window as TweetBox;

        box.text = Text;
    }
예제 #3
0
 public void SetReply(long statusId, string screenName)
 {
     replyStatusId   = statusId;
     TweetBox.Text   = "@" + screenName + " ";
     SendButton.Text = "返神" + (140 - TweetBox.TextLength).ToString();
     sendMode        = SendMode.Reply;
     TweetBox.Focus();
     TweetBox.Select(TweetBox.Text.Length, 0);
 }
예제 #4
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
#endif
        {
            TweetBox.Focus();
            base.OnNavigatedTo(e);
#if WP8
            if (e.NavigationMode == System.Windows.Navigation.NavigationMode.New && NavigationContext.QueryString.ContainsKey("voiceCommandName"))
            {
                StartSpeechToText();
            }
#endif
        }
예제 #5
0
    //private void OnCollisionEnter2D(Collision2D collision)
    //{
    //    float impact = 0f;
    //    GameObject opponent = collision.rigidbody.gameObject;

    //    //落下ダメージ & 接触ダメージ
    //    if (opponent.tag == "Ground")
    //    {
    //        Vector2 velocity = collision.relativeVelocity;
    //        impact += Mathf.Pow(velocity.magnitude, 2) / robustness;
    //    }

    //}

    public void Impact(float strongth)
    {
        float damage = Mathf.Max(strongth / 2 - robustness, 0f)
                       + strongth / 2 * ((robustness >= strongth) ? 0.25f : 1f);

        health -= damage;
        if (prefabBox != null)
        {
            TweetBox box = Builder.Window(prefabBox, transform) as TweetBox;
            box.text = "" + (int)damage;
            box.transform.position += new Vector3(Random.Range(-.5f, .5f), 0);
            box.CloseAuto();
        }

        if (health <= 0f)
        {
            OnDestroy?.Invoke();
            Destroy(gameObject);
        }
    }
예제 #6
0
 public void PostTweet(string tweet)
 {
     TweetBox.SendKeys(tweet);
     TweetBtn.Click();
 }
예제 #7
0
        private async void UpdateStatus()
        {
            Status res = null;

            if (TweetBox.TextLength <= 140)
            {
                try
                {
                    switch (sendMode)
                    {
                    // 通常のツイート
                    case SendMode.Tweet:
                        res = await TwitterTools.UpdateStatus(TweetBox.Text);

                        break;

                    // リプライ
                    case SendMode.Reply:
                        if (fileLocation.Count == 0)
                        {
                            // ただのリプライ
                            res = await TwitterTools.UpdateStatus(TweetBox.Text, replyStatusId);
                        }
                        else
                        {
                            // リプライ + 画像
                            res = await TwitterTools.UpdateStatus(TweetBox.Text, replyStatusId, fileLocation);
                        }
                        SendButton.Text = "送神" + (140 - TweetBox.TextLength).ToString();
                        break;

                    // 画像付きツイート
                    case SendMode.TweetWithMedia:
                        res = await TwitterTools.UpdateStatus(text : TweetBox.Text, media_info : fileLocation);

                        break;

                    default:
                        break;
                    }
                    sendMode = SendMode.Tweet;
                }
                catch (ArgumentException e)
                {
                    Console.WriteLine(e.Message);
                }

                if (res == null)
                {
                    MessageBox.Show("送神失敗");
                }
                else
                {
                    TweetBox.Clear();

                    // 画像リセット
                    for (int i = 0; i < pictureBox.Length; i++)
                    {
                        pictureBox[i].ImageLocation = null;
                        pictureBox[i].Visible       = false;
                    }
                    fileLocation = new List <string>();
                }
            }
            else
            {
                MessageBox.Show("文字数オーバー");
            }
        }