public TabControl(XIPlugin parent) { InitializeComponent(); xiParent = parent; cmbTranslationFrom.Items.Add(new TranslationComboBoxItem("English", "en")); cmbTranslationFrom.Items.Add(new TranslationComboBoxItem("Español", "es")); cmbTranslationFrom.Items.Add(new TranslationComboBoxItem("Deutsch", "de")); cmbTranslationFrom.Items.Add(new TranslationComboBoxItem("Française", "fr")); cmbTranslationFrom.Items.Add(new TranslationComboBoxItem("日本", "ja")); cmbTranslationTo.Items.Add(new TranslationComboBoxItem("English", "en")); cmbTranslationTo.Items.Add(new TranslationComboBoxItem("Español", "es")); cmbTranslationTo.Items.Add(new TranslationComboBoxItem("Deutsch", "de")); cmbTranslationTo.Items.Add(new TranslationComboBoxItem("Française", "fr")); cmbTranslationTo.Items.Add(new TranslationComboBoxItem("日本", "ja")); }
public static void DEBUG(String Title, String Message, XIPlugin Plugin) { #if DEBUG Translator.UpdateTranslationLog("DEBUG", Title, Message, Plugin); #endif }
public new void TranslateText(String Text, ref FFXIWindow window, ref FFACE.ChatMode cmChatMode, XIPlugin Plugin) { String sFromCode = GetLanguageCode(Text); String Result = String.Empty; if (SettingsModel.getInstance().English) { Result = GetTranslatedText(Text, sFromCode, "en"); ShowMessage(ref window, Text, GetDisplayText(Text, Result), ref cmChatMode, Plugin); } if (SettingsModel.getInstance().German) { Result = GetTranslatedText(Text, sFromCode, "de"); ShowMessage(ref window, Text, GetDisplayText(Text, Result), ref cmChatMode, Plugin); } if (SettingsModel.getInstance().French) { Result = GetTranslatedText(Text, sFromCode, "fr"); ShowMessage(ref window, Text, GetDisplayText(Text, Result), ref cmChatMode, Plugin); } if (SettingsModel.getInstance().Japanese) { Result = GetTranslatedText(Text, sFromCode, "ja"); ShowMessage(ref window, Text, GetDisplayText(Text, Result), ref cmChatMode, Plugin); } if (SettingsModel.getInstance().Spanish) { Result = GetTranslatedText(Text, sFromCode, "es"); ShowMessage(ref window, Text, GetDisplayText(Text, Result), ref cmChatMode, Plugin); } }
public void TranslateText(String Text, ref FFXIWindow window, ref FFACE.ChatMode cmChatMode, XIPlugin Plugin) { }
public void ShowMessage(ref FFXIWindow window, String From, String To, ref FFACE.ChatMode cmChatMode, XIPlugin Plugin) { if (To.Length == 0) return; String EncodedTo = EncodeShiftJIS(To); UpdateTranslationLog(window.process.MainWindowTitle, From, To, Plugin); if (SettingsModel.getInstance().OutEcho) { WindowerHelper.CKHSendString(window.keyboardHandle, String.Format("//input /echo {0}", EncodedTo)); } if (SettingsModel.getInstance().OutLinkshell && (cmChatMode == FFACE.ChatMode.RcvdLinkShell || cmChatMode == FFACE.ChatMode.SentLinkShell)) { WaitForLastSent(); WindowerHelper.CKHSendString(window.keyboardHandle, String.Format("//input /l {0}", ((char)26).ToString() + EncodedTo)); LastSent = DateTime.Now; } if (SettingsModel.getInstance().OutParty && (cmChatMode == FFACE.ChatMode.RcvdParty || cmChatMode == FFACE.ChatMode.SentParty)) { WaitForLastSent(); WindowerHelper.CKHSendString(window.keyboardHandle, String.Format("//input /p {0}", ((char)26).ToString() + EncodedTo)); LastSent = DateTime.Now; } }
public static void UpdateTranslationLog(String WindowTitle, String From, String To, XIPlugin Plugin) { Thread tUpdateTransLog = new Thread(UpdateTranslationLogTT); TranslationLogParams tp = new TranslationLogParams(); tp.Plugin = Plugin; tp.WindowTitle = WindowTitle; tp.From = From; tp.To = To; tUpdateTransLog.Start(tp); }
public static void UpdateStatusText(String Text, XIPlugin Plugin) { Thread tUpdateStatusText = new Thread(UpdateStatusTextTT); StatusParams sp = new StatusParams(); if (Text.Trim() == String.Empty) sp.Text = "Waiting for an instance..."; else sp.Text = "Monitoring the instance(s) of: " + Text; sp.Plugin = Plugin; tUpdateStatusText.Start(sp); }