/// <summary>APIの処理を実際に担当できるサブモジュールを用いてインスタンスを初期化します。</summary> /// <param name="window">キャラ表示ウィンドウ</param> /// <param name="character">実際のキャラクター</param> /// <param name="voiceOperator">発声処理器</param> /// <param name="chatWindow">チャット枠</param> /// <param name="requestor">スクリプト実行要求器</param> /// <param name="setting">設定事項</param> /// <param name="characterName">キャラクター名</param> public ScriptApi( IMainWindow window, IHarrietCharacter character, IVoiceOperator voiceOperator, IChatWindowModel chatWindow, IScriptRequestor requestor, CharacterSetting setting, IScriptApiSetting scriptApiSetting, string characterName ) { this.Window = window; this.Character = character; this._voiceOperater = voiceOperator; this.ChatWindow = chatWindow; this.CharacterName = characterName; this.Setting = new SettingWindowViewModel(setting); this.ScriptRequest = requestor; _keyboardHook = new KeyboardHook(OnKeyboardUpDown); ////プラグインがあったら拾い、無かったら無視 //try //{ // TextConverter = TextToPronounceConverterLoader.Load().FirstOrDefault() ?? // new ImeTextConverter(); //} //catch(Exception) //{ // TextConverter = new ImeTextConverter(); //} _scriptApiSetting = scriptApiSetting; }