Ejemplo n.º 1
0
    static bool TagFaceBlend(BaseKagManager baseKagManager, KagTagSupport tag_data)
    {
        Maid maidAndMan = GetMaidAndMan(tag_data);

        if (maidAndMan == null)
        {
            return(false);
        }
        if (ExSaveData.GetBool(maidAndMan, PluginName, "FACEBLEND_OFF", false))
        {
            // Helper.Log("FACEBLEND_OFF() -> match");
            return(false);
        }

        baseKagManager.CheckAbsolutelyNecessaryTag(tag_data, "faceblend", new string[] { "name" });

        string oldName = tag_data.GetTagProperty("name").AsString();

        if (oldName == "なし")
        {
            oldName = "無し";
        }
        string newName = FaceScriptTemplates.ProcFaceBlendName(maidAndMan, PluginName, oldName);

        // Helper.Log("TagFaceBlend({0})->({1})", oldName, newName);

        maidAndMan.FaceBlend(newName);
        return(false);
    }
        private static void OnPlayVoice(BaseKagManager __instance, KagTagSupport tag_data, object ___subtitle_data)
        {
            __instance.CheckAbsolutelyNecessaryTag(tag_data, "playvoice", "voice");

            var voice   = tag_data.GetTagProperty("voice").AsString();
            var subData =
                Core.ScriptTranslate.GetSubtitle(Path.GetFileNameWithoutExtension(__instance.kag.GetCurrentFileName()),
                                                 voice);

            if (subData == null)
            {
                return;
            }

            var sub = SubtitleMovieManager.GetGlobalInstance(false);

            sub.Clear();

            if (subData.Count == 1 && subData[0].startTime == 0)
            {
                subData[0].SetSubtitleData(___subtitle_data);
            }
            else
            {
                sub.autoDestroy = true;
                foreach (var subtitleData in subData)
                {
                    sub.AddData($"{subtitleData.original}<E>{subtitleData.translation}", subtitleData.startTime,
                                subtitleData.displayTime);
                }
                sub.Play();
            }
        }
    static bool TagFaceBlend(BaseKagManager baseKagManager, KagTagSupport tag_data)
    {
        Maid maidAndMan = baseKagManager.GetMaidAndMan(tag_data);

        if (maidAndMan == null)
        {
            return(false);
        }
        if (ExSaveData.GetBool(maidAndMan, PluginName, "FACEBLEND_OFF", false))
        {
            Trace.WriteLine("FACEBLEND_OFF() -> match");
            return(false);
        }

        baseKagManager.CheckAbsolutelyNecessaryTag(tag_data, "faceblend", new string[] { "name" });

        string oldName = tag_data.GetTagProperty("name").AsString();

        if (oldName == "なし")
        {
            oldName = "無し";
        }

        string newName = FaceScriptTemplates.ProcFaceBlendName(maidAndMan, PluginName, oldName);

        Trace.WriteLine(string.Format("TagFaceBlend({0})->({1})", oldName, newName));

        if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "ScenePhotoMode")
        {
            newName = "オリジナル";
        }

        maidAndMan.FaceBlend(newName);
        return(false);
    }
Ejemplo n.º 4
0
    static bool TagFace(BaseKagManager baseKagManager, KagTagSupport tag_data)
    {
        Maid maidAndMan = GetMaidAndMan(tag_data);

        if (maidAndMan == null)
        {
            return(false);
        }
        if (maidAndMan != null && ExSaveData.GetBool(maidAndMan, PluginName, "FACE_OFF", false))
        {
            // Helper.Log("FACE_OFF() -> match");
            return(false);
        }

        baseKagManager.CheckAbsolutelyNecessaryTag(tag_data, "face", new string[] { "name" });

        string oldName = tag_data.GetTagProperty("name").AsString();
        string newName = FaceScriptTemplates.ProcFaceName(maidAndMan, PluginName, oldName);
        // Helper.Log("TagFace({0})->({1})", oldName, newName);

        WaitEventList waitEventList = GetWaitEventList(baseKagManager, "face");
        int           num           = 0;

        if (tag_data.IsValid("wait"))
        {
            num = tag_data.GetTagProperty("wait").AsInteger();
        }
        if (num > 0)
        {
            waitEventList.Add(() =>
            {
                if (maidAndMan != null && maidAndMan.body0 != null && maidAndMan.body0.isLoadedBody)
                {
                    maidAndMan.FaceAnime(newName, 1f, 0);
                }
            }, num);
        }
        else
        {
            maidAndMan.FaceAnime(newName, 1f, 0);
            waitEventList.Clear();
        }
        return(false);
    }
Ejemplo n.º 5
0
    static bool TagPropSet(BaseKagManager baseKagManager, KagTagSupport tag_data)
    {
        Maid maidAndMan = GetMaidAndMan(tag_data);

        if (maidAndMan != null && ExSaveData.GetBool(maidAndMan, PluginName, "PROPSET_OFF", false))
        {
            string str = tag_data.GetTagProperty("category").AsString();
            if (Array.IndexOf(PluginHelper.MpnStrings, str) >= 0)
            {
                // Helper.Log("PROPSET_OFF(category={0}) -> match", str);
                return(false);
            }
        }

        return(baseKagManager.TagPropSet(tag_data));
    }
Ejemplo n.º 6
0
    static bool TagPropSet(BaseKagManager baseKagManager, KagTagSupport tag_data)
    {
        Maid maidAndMan = baseKagManager.GetMaidAndMan(tag_data);
        if (maidAndMan != null && ExSaveData.GetBool(maidAndMan, PluginName, "PROPSET_OFF", false))
        {
            string str = tag_data.GetTagProperty("category").AsString();
            if (Array.IndexOf(PluginHelper.MpnStrings, str) >= 0)
            {
#if DEBUG
                Console.WriteLine("PROPSET_OFF(category={0}) -> match", str);
                Helper.Log("PROPSET_OFF(category={0}) -> match", str);
#endif
                return false;
            }
        }

        return baseKagManager.TagPropSet(tag_data);
    }
Ejemplo n.º 7
0
    static bool TagFaceBlend(BaseKagManager baseKagManager, KagTagSupport tag_data)
    {
        Maid maidAndMan = GetMaidAndMan(tag_data);
        if (maidAndMan == null)
        {
            return false;
        }
        if (ExSaveData.GetBool(maidAndMan, PluginName, "FACEBLEND_OFF", false))
        {
            // Helper.Log("FACEBLEND_OFF() -> match");
            return false;
        }

        baseKagManager.CheckAbsolutelyNecessaryTag(tag_data, "faceblend", new string[] { "name" });

        string oldName = tag_data.GetTagProperty("name").AsString();
        if (oldName == "なし")
        {
            oldName = "無し";
        }
        string newName = FaceScriptTemplates.ProcFaceBlendName(maidAndMan, PluginName, oldName);
        // Helper.Log("TagFaceBlend({0})->({1})", oldName, newName);

        maidAndMan.FaceBlend(newName);
        return false;
    }
Ejemplo n.º 8
0
    static bool TagFace(BaseKagManager baseKagManager, KagTagSupport tag_data)
    {
        Maid maidAndMan = GetMaidAndMan(tag_data);
        if (maidAndMan == null)
        {
            return false;
        }
        if (maidAndMan != null && ExSaveData.GetBool(maidAndMan, PluginName, "FACE_OFF", false))
        {
            // Helper.Log("FACE_OFF() -> match");
            return false;
        }

        baseKagManager.CheckAbsolutelyNecessaryTag(tag_data, "face", new string[] { "name" });

        string oldName = tag_data.GetTagProperty("name").AsString();
        string newName = FaceScriptTemplates.ProcFaceName(maidAndMan, PluginName, oldName);
        // Helper.Log("TagFace({0})->({1})", oldName, newName);

        WaitEventList waitEventList = GetWaitEventList(baseKagManager, "face");
        int num = 0;
        if (tag_data.IsValid("wait"))
        {
            num = tag_data.GetTagProperty("wait").AsInteger();
        }
        if (num > 0)
        {
            waitEventList.Add(() =>
            {
                if (maidAndMan != null && maidAndMan.body0 != null && maidAndMan.body0.isLoadedBody)
                {
                    maidAndMan.FaceAnime(newName, 1f, 0);
                }
            }, num);
        }
        else
        {
            maidAndMan.FaceAnime(newName, 1f, 0);
            waitEventList.Clear();
        }
        return false;
    }