Ejemplo n.º 1
0
        private void cmbVoice_SelectedIndexChanged(object sender, EventArgs e)
        {
            string selectedVoice = cmbVoice.SelectedItem.ToString() == "None" ? "" : cmbVoice.SelectedItem.ToString();

            VoiceAssist.SelectVoice(selectedVoice);
            VoiceAssist.Say("Ready");
        }
Ejemplo n.º 2
0
        private void frmMenu_Load(object sender, EventArgs e)
        {
            // Init stuff
            dlgFolder.IsFolderPicker = true;
            dlgDataImport.Filter     = "Frog Forge editor data files|*.ffed";
            dlgDataExport.Filter     = "Frog Forge editor data files|*.ffed";
            dlgProjectImport.Filter  = "Frog Forge project data files|*.ffpd";
            dlgProjectExport.Filter  = "Frog Forge project data files|*.ffpd";
            GamePath = DataDirectory.LoadFile("GamePath", "");
            string workingPath = DataDirectory.LoadFile("Path", "");

            if (workingPath == "")
            {
                if (WorkingDirectory.DirectoryExists(@"\Game\Data"))
                {
                    GamePath = WorkingDirectory.Path + @"\Game\";
                    DataDirectory.SaveFile("GamePath", GamePath);
                    WorkingDirectory.Path += @"\Game\Data";
                    DataDirectory.SaveFile("Path", WorkingDirectory.Path);
                }
                else
                {
                    if (ExtensionMethods.ConfirmDialog("Game directory not found. Locate manually?", "Missing game files"))
                    {
                        btnChangePath_Click(sender, e);
                    }
                    else
                    {
                        Close();
                        return;
                    }
                }
            }
            else
            {
                WorkingDirectory.Path = workingPath;
            }
            if (GamePath == "")
            {
                btnPlay.Visible = false;
                Height         -= 30;
            }
            // Load prefences
            string json = DataDirectory.LoadFile("Preferences", "", ".json");

            Preferences.Current = ((json == "" ? null : json)?.JsonToObject <Preferences>()) ?? new Preferences();
            // Apply them
            this.ApplyPreferences();
            CenterToScreen();
            lblVersion.Font = lblCredits.Font = new Font(lblCredits.Font.FontFamily, (int)Math.Round(lblCredits.Font.Size * Preferences.Current.ZoomAmount));
            lblTitle.Font   = new Font(lblTitle.Font.FontFamily, (int)Math.Round(lblTitle.Font.Size * Preferences.Current.ZoomAmount));
            // Joke (voice assist)
            if (Preferences.Current.VoiceAssistAvailable)
            {
                VoiceAssist.SelectVoice(Preferences.Current.VoiceAssist ?? "");
                VoiceAssist.Say("Ready");
            }
        }
Ejemplo n.º 3
0
 private void frmPreferences_FormClosed(object sender, FormClosedEventArgs e)
 {
     VoiceAssist.SelectVoice(Preferences.Current.VoiceAssist);
 }