Exemple #1
0
        public static void YotogiKagManager_Tag(YotogiKagManager manager, KagTagSupport kagTag)
        {
            try
            {
                var list = kagTag.GetTagList();

                Logger.Log(LogLevel.Debug, $"[Yotogi] Kag Tag({list["tagname"]})");

                switch (list["tagname"])
                {
                case "talk":
                case "talkrepeat":
                    foreach (var tag in list)
                    {
                        Logger.Log(LogLevel.Debug, $"[Yotogi] Kag Tag {tag.Key}:{tag.Value}");
                    }
                    yotogiTagEventArgs = new YotogiKagHitRetEventArgs(list["voice"] + ".ogg");
                    yotogiTagEventArgs.TagCallStack.Add(kagTag);
                    break;

                case "hitret":
                    if (yotogiTagEventArgs == null)
                    {
                        return;
                    }

                    yotogiTagEventArgs.Text = manager.kag.GetText();

                    var args = new TextTranslationEventArgs(manager.kag.GetText(), TextType.Text, TextSource.Yotogi);
                    TextTranslation?.Invoke(manager, args);

                    if (args.Translation != null)
                    {
                        yotogiTagEventArgs.Translation = args.Translation;
                    }

                    yotogiTagEventArgs.TagCallStack.Add(kagTag);
                    YotogiKagHitRet?.Invoke(manager, yotogiTagEventArgs);
                    yotogiTagEventArgs = null;
                    break;
                }
            }
            catch (Exception ex)
            {
                Logger.Log(LogLevel.Error, ex);
                throw;
            }
        }
Exemple #2
0
 public static void FreeScene_UI_FreeScene_Start(int tag, ref String value, ref Action endAction)
 {
     try
     {
         var args = new TextTranslationEventArgs(value, (TextType)tag, TextSource.FreeSceneUI);
         TextTranslation?.Invoke(null, args);
         if (args.Translation != null)
         {
             value = args.Translation;
         }
     }
     catch (Exception ex)
     {
         Logger.Log(LogLevel.Error, ex);
         throw;
     }
 }
Exemple #3
0
 public static void ScheduleAPI_InfoReplace(int tag, ref int nightWorkId, ref String value)
 {
     try
     {
         var args = new TextTranslationEventArgs(value, (TextType)tag, TextSource.ScheduleAPI);
         TextTranslation?.Invoke(null, args);
         if (args.Translation != null)
         {
             value = args.Translation;
         }
     }
     catch (Exception ex)
     {
         Logger.Log(LogLevel.Error, ex);
         throw;
     }
 }
Exemple #4
0
 public static void ScriptManager_ReplaceCharaName(int tag, ref String value)
 {
     try
     {
         var args = new TextTranslationEventArgs(value, (TextType)tag, TextSource.ScriptManager);
         TextTranslation?.Invoke(null, args);
         if (args.Translation != null)
         {
             value = args.Translation;
         }
     }
     catch (Exception ex)
     {
         Logger.Log(LogLevel.Error, ex);
         throw;
     }
 }
Exemple #5
0
 public static void UILabel_ProcessText(int tag, UILabel control, ref String value)
 {
     try
     {
         var args = new TextTranslationEventArgs(value, (TextType)tag, TextSource.UILabel);
         TextTranslation?.Invoke(control, args);
         if (args.Translation != null)
         {
             value = args.Translation;
         }
     }
     catch (Exception ex)
     {
         Logger.Log(LogLevel.Error, ex);
         throw;
     }
 }
Exemple #6
0
 public static void InvokeTextTranslation(object sender, TextTranslationEventArgs e)
 {
     TextTranslation?.Invoke(sender, e);
 }