Exemple #1
0
        public static void Init()
        {
            initialized = false;
            switch (StardewModdingAPI.Constants.TargetPlatform)
            {
            case StardewModdingAPI.GamePlatform.Android:
                ModEntry.Log("Android detected. Speech2Text is not supported.", StardewModdingAPI.LogLevel.Error);
                break;

            case StardewModdingAPI.GamePlatform.Linux:
                if (ModEntry.GetConfig().tts_path.Length > 0)
                {
                    if (System.IO.File.Exists(ModEntry.GetConfig().tts_path))
                    {
                        executable  = ModEntry.GetConfig().tts_path;
                        initialized = true;
                        ModEntry.Log("Using custom tts installation specified in config.json", StardewModdingAPI.LogLevel.Debug);
                    }
                    else
                    {
                        ModEntry.Log("Couldn't find specified tts installation '" + ModEntry.GetConfig().tts_path + "' from config.json", StardewModdingAPI.LogLevel.Error);
                    }
                }
                else if (System.IO.File.Exists(linux_mimic_std))
                {
                    executable  = linux_mimic_std;
                    initialized = true;
                    ModEntry.Log("Using system mimic installation", StardewModdingAPI.LogLevel.Debug);
                }
                else
                {
                    string path = ModEntry.GetHelper().DirectoryPath + "/" + linux_mimic_manual_install;
                    if (System.IO.File.Exists(path))
                    {
                        executable  = path;
                        initialized = true;
                        ModEntry.Log("Using mimic installation in mod folder", StardewModdingAPI.LogLevel.Debug);
                    }
                    else
                    {
                        ModEntry.Log("Couldn't find mimic installation at " + linux_mimic_std + " or in mod folder", StardewModdingAPI.LogLevel.Error);
                    }
                }
                break;

            case StardewModdingAPI.GamePlatform.Mac:
                ModEntry.Log("OSX detected. Speech2Text is not supported.", StardewModdingAPI.LogLevel.Error);
                break;

            case StardewModdingAPI.GamePlatform.Windows:
                ModEntry.Log("Windows detected. Speech2Text is not supported.", StardewModdingAPI.LogLevel.Error);
                break;
            }
            if (initialized)
            {
                queueTask.Start();
            }
        }
Exemple #2
0
 public static bool IsGameMenuInventoryButton(SButton b) => ModEntry.GetConfig().key_gamemenu_inv.Contains(b);
Exemple #3
0
 public static bool IsTTSHealthButton(SButton b) => ModEntry.GetConfig().key_tts_health.Contains(b);
Exemple #4
0
 public static bool IsTTSTimeButton(SButton b) => ModEntry.GetConfig().key_tts_time.Contains(b);
Exemple #5
0
 public static bool IsTTSStopButton(SButton b) => ModEntry.GetConfig().key_tts_stop.Contains(b);
Exemple #6
0
        private static string GetPitchArg()
        {
            int pitch = ModEntry.GetConfig().tts_pitch;

            return("--setf int_f0_target_mean=" + pitch);
        }
Exemple #7
0
 public static bool IsGameMenuOptionsButton(SButton b) => ModEntry.GetConfig().key_gamemenu_options.Contains(b);
Exemple #8
0
 public static bool IsGameMenuMapButton(SButton b) => ModEntry.GetConfig().key_gamemenu_map.Contains(b);
Exemple #9
0
 public static bool IsMenuTitleMuteButton(SButton b) => ModEntry.GetConfig().key_menu_title_mute.Contains(b);
Exemple #10
0
 public static bool IsMenuEscapeButton(SButton b) => ModEntry.GetConfig().key_menu_escape.Contains(b);
Exemple #11
0
 public static bool IsMenuDeleteButton(SButton b) => ModEntry.GetConfig().key_menu_delete.Contains(b);
Exemple #12
0
 public static bool IsMenuActivateButton(SButton b) => ModEntry.GetConfig().key_menu_activate.Contains(b) || b.IsActionButton();
Exemple #13
0
 public static bool IsMenuPrevButton(SButton b) => ModEntry.GetConfig().key_menu_prev.Contains(b);
Exemple #14
0
 public static bool IsMenuNextButton(SButton b) => ModEntry.GetConfig().key_menu_next.Contains(b);
Exemple #15
0
 public static bool IsGameMenuSkillsButton(SButton b) => ModEntry.GetConfig().key_gamemenu_skills.Contains(b);
Exemple #16
0
 public static bool IsTTSMapCheckButton(SButton b) => ModEntry.GetConfig().key_tts_map_check.Contains(b);
Exemple #17
0
 public static bool IsGameMenuSocialButton(SButton b) => ModEntry.GetConfig().key_gamemenu_social.Contains(b);
Exemple #18
0
 public static bool IsTTSInfoButton(SButton b) => ModEntry.GetConfig().key_tts_info.Contains(b);
Exemple #19
0
 public static bool IsGameMenuCraftingButton(SButton b) => ModEntry.GetConfig().key_gamemenu_crafting.Contains(b);
Exemple #20
0
 public static bool IsTTSRepeatButton(SButton b) => ModEntry.GetConfig().key_tts_repeat.Contains(b);
Exemple #21
0
 public static bool IsGameMenuExitButton(SButton b) => ModEntry.GetConfig().key_gamemenu_exit.Contains(b);
Exemple #22
0
        private static string GetSpeedArg()
        {
            float speed = 1 + 1 - ModEntry.GetConfig().tts_speed / 100f;

            return("--setf duration_stretch=" + speed.ToString(System.Globalization.CultureInfo.InvariantCulture));
        }