Beispiel #1
0
        public Form1()
        {
            InitializeComponent();
            this.AcceptButton = btn_submitCommand;
            companion.loadSettings();
            companion.loadAIMLFromFiles();
            companion.isAcceptingUserInput = false;

            if (File.Exists("settings.json"))
            {
                logger.Info("Loading settings...");
                settings = JsonConvert.DeserializeObject <JSONSettings>(File.ReadAllText(@"settings.json"));
                UpdateSettings();
                logger.Info("Settings loaded.");
            }
            else
            {
                logger.Info("Could not find settings file. Creating a new one.");
                UpdateSettings();
            }

            user = new User(settings.name, companion);

            synthesisEngine.Volume = 100;
            synthesisEngine.Rate   = 1;
        }
Beispiel #2
0
 private void resetConfigurationToolStripMenuItem_Click(object sender, EventArgs e)
 {
     logger.Info("Reset settings to their default values.");
     File.Delete("settings.json");
     settings = new JSONSettings
     {
         textMode           = false,
         silentMode         = false,
         disableChatBot     = false,
         startAutomatically = false,
         hideWhenMinimized  = false,
         name = "user",
         companionSettings = new CompanionSettings {
             volume = 100, speed = 1, randomWaitToRespondMaxMs = 0
         },
         logSettings = new LogSettings {
             logConversations = true, logDirectory = Directory.GetCurrentDirectory()
         }
     };
     UpdateSettings();
 }