Пример #1
0
        static bool AssembleFinalEntryPrefix(DialogueEntry entry, CheckResult checkResult, bool isLocalizationTrigger, ref FinalEntry __result)
        {
            FinalEntry finalEntry;

            if (JanusNode.IsJanusNode(entry))
            {
                finalEntry = JanusNode.HandleEntry(entry);
            }
            else if (WhiteCheckNode.IsWhiteCheckNode(entry))
            {
                finalEntry = ((checkResult == null) ? CheckNodeUtil.HandleEntry(entry) : CheckNodeUtil.HandleEntry(entry, checkResult));
            }
            else if (RedCheckNode.IsRedCheckNode(entry))
            {
                finalEntry = ((checkResult == null) ? CheckNodeUtil.HandleEntry(entry) : CheckNodeUtil.HandleEntry(entry, checkResult));
            }
            else if (PassiveNode.IsPassiveNode(entry))
            {
                finalEntry = PassiveNode.HandleEntry(entry, true);
            }
            else if (CostOptionNode.IsCostOptionNode(entry))
            {
                finalEntry = CostOptionNode.HandleEntry(entry, isLocalizationTrigger);
            }
            else if (KimSwitchNode.IsKimSwitchNode(entry))
            {
                string localizedTerm = LocalizationManager.GetLocalizedTerm(LocalizationUtils.GetDialogueEntryLocalizationTerm(entry));
                string spokenLine    = (localizedTerm == null || localizedTerm.Equals(string.Empty)) ? entry.subtitleText : LocalizationUtils.FormatLocalizedDialogueText(localizedTerm);
                KimSwitchNode.HandleEntry(entry, isLocalizationTrigger);
                finalEntry = new FinalEntry(entry, spokenLine, FinalEntry.GetSpeakerName(entry));
            }
            else if (FakeCheckNode.IsFakeCheckNode(entry))
            {
                finalEntry = CheckNodeUtil.HandleEntry(entry);
            }
            else if (checkResult != null)
            {
                finalEntry = CheckNodeUtil.HandleEntry(entry, checkResult);
                string localizedTerm2 = LocalizationManager.GetLocalizedTerm(LocalizationUtils.GetDialogueEntryLocalizationTerm(entry));
                string spokenLine2    = (localizedTerm2 == null || localizedTerm2.Equals(string.Empty)) ? entry.subtitleText : LocalizationUtils.FormatLocalizedDialogueText(localizedTerm2);
                finalEntry.spokenLine = spokenLine2;
            }
            else
            {
                string localizedTerm3 = LocalizationManager.GetLocalizedTerm(LocalizationUtils.GetDialogueEntryLocalizationTerm(entry));
                string spokenLine3    = (localizedTerm3 == null || localizedTerm3.Equals(string.Empty)) ? entry.subtitleText : LocalizationUtils.FormatLocalizedDialogueText(localizedTerm3);
                finalEntry = new FinalEntry(entry, spokenLine3, FinalEntry.GetSpeakerName(entry));
            }

            __result = finalEntry;
            return(false);
        }
Пример #2
0
    public override void OnInspectorGUI()
    {
        passiveNode = uiPassiveNode.node == null ? new PassiveNode() : uiPassiveNode.node;

        titleStyle = new GUIStyle(GUI.skin.label)
        {
            alignment = TextAnchor.MiddleCenter, fontStyle = FontStyle.Bold
        };
        EditorGUILayout.BeginVertical("Box");
        EditorGUILayout.LabelField("UI Node Attributs :", titleStyle);
        EditorGUILayout.EndVertical();
        EditorGUI.indentLevel += 2;
        base.DrawDefaultInspector();

        EditorGUILayout.Space();

        EditorGUI.indentLevel -= 2;
        EditorGUILayout.BeginVertical("Box");
        EditorGUILayout.LabelField("Node Editor :", titleStyle);
        EditorGUILayout.EndVertical();

        EditorGUI.indentLevel += 2;
        // save node
        if (GUILayout.Button("Save Node Effect"))
        {
            uiPassiveNode.setNode(passiveNode);
        }

        passiveNode.name     = EditorGUILayout.TextField("Name : ", passiveNode.name);
        passiveNode.icon     = (Sprite)EditorGUILayout.ObjectField("Icon : ", passiveNode.icon, typeof(Sprite), false);
        passiveNode.maxLevel = EditorGUILayout.IntField("Max level : ", passiveNode.maxLevel > 3 ? 3 : passiveNode.maxLevel);

        EditorGUILayout.BeginHorizontal("Box");
        EditorGUILayout.LabelField("Stats :", titleStyle);
        if (GUILayout.Button("+"))
        {
            addStat();
        }
        EditorGUILayout.EndHorizontal();

        displayStats();
    }
Пример #3
0
        public static bool ChooseResponseTextPrefix(Response response, ref FinalResponseText __result)
        {
            DialogueEntry destinationEntry = response.destinationEntry;

            if (JanusNode.IsJanusNode(destinationEntry))
            {
                __result = JanusNode.HandleResponseText(response);
            }
            else if (WhiteCheckNode.IsWhiteCheckNode(destinationEntry))
            {
                __result = WhiteCheckNode.HandleResponseText(response);
            }
            else if (RedCheckNode.IsRedCheckNode(destinationEntry))
            {
                __result = RedCheckNode.HandleResponseText(response);
            }
            else if (PassiveNode.IsPassiveNode(destinationEntry))
            {
                __result = PassiveNode.HandleResponseText(response);
            }
            else if (CostOptionNode.IsCostOptionNode(destinationEntry))
            {
                __result = CostOptionNode.HandleResponseText(response);
            }
            else if (FakeCheckNode.IsFakeCheckNode(destinationEntry))
            {
                __result = FakeCheckNode.HandleResponseText(response);
            }
            else
            {
                string localizedTerm = LocalizationManager.GetLocalizedTerm(LocalizationUtils.GetDialogueEntryLocalizationTerm(destinationEntry));
                string responseText  = (localizedTerm == null || localizedTerm.Equals(string.Empty)) ? destinationEntry.subtitleText : LocalizationUtils.FormatLocalizedDialogueText(localizedTerm);
                __result = new FinalResponseText(response, responseText);
            }

            return(false);
        }