Пример #1
0
 private void LoadAgent(string pathToAcsFile)
 {
     try { axAgent1.Characters.Unload("CharacterID"); }
     catch { }
     try
     {
         SetLastAgent(pathToAcsFile);
         axAgent1.Characters.Load("CharacterID", (object)pathToAcsFile);
         Character = axAgent1.Characters["CharacterID"];
         Character.Show(null);
         Character.Balloon.Style = 0;
         Character.Left          = Convert.ToInt16(this.Right);
         //Character.Left = Convert.ToInt16(right - Character.Width);
         Character.Top = Convert.ToInt16(this.bottom);
         //Character.Top = Convert.ToInt16(bottom + Character.Height);
         //
         Character.Speak("Hello, i wanna chat with you", null);
         enabledAgent = true;
         if (pi != null)
         {
             pi.isSpeaking = false;
         }
         //menuSettingsSpeak.Checked = false;
         statusBar.Text = "Loaded MsAgent: " + Character.Name;
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("Uh uh, i encountered an error: " + ex.ToString());
     }
 }
Пример #2
0
        private void LoadAgent(string pathToAcsFile)
        {
            try { axAgent1.Characters.Unload("CharacterID"); }
            catch { }
            try
            {
                SetLastAgent(pathToAcsFile);
                axAgent1.Characters.Load("CharacterID", (object)pathToAcsFile);
                Character = axAgent1.Characters["CharacterID"];
                Character.Show(null);
                Character.Balloon.Style = 0;
                Character.Left = Convert.ToInt16(this.Right);
                //Character.Left = Convert.ToInt16(right - Character.Width);
                Character.Top = Convert.ToInt16(this.bottom);
                //Character.Top = Convert.ToInt16(bottom + Character.Height);
                //
                Character.Speak("Hello, i wanna chat with you", null);
                enabledAgent = true;
                if(pi != null)
                    pi.isSpeaking = false;
                //menuSettingsSpeak.Checked = false;
                statusBar.Text = "Loaded MsAgent: " + Character.Name;

            }
            catch(System.Exception ex)
            {
                MessageBox.Show("Uh uh, i encountered an error: " + ex.ToString());
            }
        }