Ejemplo n.º 1
0
        private void playShowSound2()
        {
            EmoticionsPictureBox.BackgroundImage = Resources.NotListening;
            lastState = TaskPanelState.NotListining;
            EmoticionsPictureBox.Refresh();
            Stream str = Properties.Resources.UI_button_2;

            System.Media.SoundPlayer snd = new System.Media.SoundPlayer(str);
            snd.Play();
        }
Ejemplo n.º 2
0
 public void UserSay(string text, TaskPanelState _state)
 {
     if (jTextBox1.InvokeRequired)
     {
         jLabel1.BeginInvoke((MethodInvoker) delegate
         {
             state          = _state;
             jTextBox1.Text = text;
         });
         return;
     }
     state          = _state;
     jTextBox1.Text = text;
 }
Ejemplo n.º 3
0
 public void HideNow(int time = -1)
 {
     if (this.InvokeRequired)
     {
         this.BeginInvoke((MethodInvoker) delegate
         {
             state     = TaskPanelState.Exiting;
             timeOut   = time;
             isclosing = true;
         });
         return;
     }
     state     = TaskPanelState.Exiting;
     isclosing = true;
     timeOut   = time;
 }
Ejemplo n.º 4
0
        public void openTests()
        {
            if (this.InvokeRequired)
            {
                this.BeginInvoke((MethodInvoker) delegate
                {
                    openTests();
                });
                return;
            }
            TestProcesor tp = new TestProcesor();

            tp.Show();
            EnableAnimation(false);
            EmoticionsPictureBox.BackgroundImage = Resources.NotListening;
            lastState = TaskPanelState.NotListining;
            EmoticionsPictureBox.Refresh();
        }
Ejemplo n.º 5
0
 public void ShowNow(TaskPanelState _state)
 {
     if (this.InvokeRequired)
     {
         this.BeginInvoke((MethodInvoker) delegate
         {
             state = _state;
             playShowSound();
             new JAnimate().FadeInForm(this, 1);
             isclosing = false;
             Recenter();
         });
         return;
     }
     state = _state;
     playShowSound();
     new JAnimate().FadeInForm(this, 1);
     isclosing = false;
     Recenter();
 }
Ejemplo n.º 6
0
        public void TaskPanelUpdate()
        {
            if (EmoticionsPictureBox.InvokeRequired)
            {
                EmoticionsPictureBox.BeginInvoke((MethodInvoker) delegate
                {
                    if (lastState != state)
                    {
                        EmoticionsPictureBox.BackgroundImage = null;
                        EmoticionsPictureBox.Invalidate();
                        switch (state)
                        {
                        case TaskPanelState.Smiling:
                            EmoticionsPictureBox.BackgroundImage = Resources.smile;
                            lastState = TaskPanelState.Smiling;
                            EmoticionsPictureBox.Refresh();
                            break;

                        case TaskPanelState.Speaking:
                            EmoticionsPictureBox.BackgroundImage = Resources.Speaking;
                            lastState = TaskPanelState.Speaking;
                            EmoticionsPictureBox.Refresh();
                            break;

                        case TaskPanelState.IDK:
                            if (lastGeneratedTime < Time.time)
                            {
                                allIDK = new List <Bitmap>()
                                {
                                    Resources.frown, Resources.meh
                                };
                                int index = random.Next(allIDK.Count);
                                var name  = allIDK[index];
                                EmoticionsPictureBox.BackgroundImage = name;
                                lastGeneratedTime = Time.time + 60;
                                lastState         = TaskPanelState.IDK;
                                EmoticionsPictureBox.Refresh();
                            }
                            break;

                        case TaskPanelState.Exiting:
                            EmoticionsPictureBox.BackgroundImage = Resources.Exiting;
                            lastState = TaskPanelState.Exiting;
                            EmoticionsPictureBox.Refresh();
                            break;

                        case TaskPanelState.NotListining:
                            EmoticionsPictureBox.BackgroundImage = Resources.NotListening;
                            lastState = TaskPanelState.NotListining;
                            EmoticionsPictureBox.Refresh();
                            break;

                        case TaskPanelState.Listening:
                            EmoticionsPictureBox.BackgroundImage = Resources.Listening;
                            lastState = TaskPanelState.Listening;
                            EmoticionsPictureBox.Refresh();
                            break;

                        case TaskPanelState.Pusseling:
                            EmoticionsPictureBox.BackgroundImage = Resources.idu0;
                            lastState = TaskPanelState.Pusseling;
                            EmoticionsPictureBox.Refresh();
                            break;
                        }
                    }
                });
            }
            if (this.InvokeRequired)
            {
                BeginInvoke((MethodInvoker) delegate
                {
                    if (isclosing)
                    {
                        if (timeOut < Time.time)
                        {
                            new JAnimate().FadeOutForm(this, 1, new Action(() => { isclosing = false; }));
                        }
                    }
                });
                return;
            }
            try
            {
                new JAnimate().FadeOutForm(this, 1);
            }
            catch { }
        }