private void BuildDialogueMatchesConditional(JObject conditionalObject) { Main.LogDebug("[BuildDialogueMatchesConditional] Building 'DialogueMatchesConditional' conditional"); string guid = conditionalObject["DialogueGuid"].ToString(); DialogueMatchesConditional conditional = ScriptableObject.CreateInstance <DialogueMatchesConditional>(); DialogueRef dialogueRef = new DialogueRef(); dialogueRef.EncounterObjectGuid = guid; conditional.dialogue = dialogueRef; conditionalList.Add(new EncounterConditionalBox(conditional)); }
static void UpdateEncounterObjectRef(DialogueRef dialogRef) { EncounterLayerData encounterLayerData = MissionControl.Instance.EncounterLayerData; if (encounterLayerData != null) { DialogueGameLogic[] componentsInChildren = encounterLayerData.GetComponentsInChildren <DialogueGameLogic>(); for (int i = 0; i < componentsInChildren.Length; i++) { if (componentsInChildren[i].encounterObjectGuid == dialogRef.EncounterObjectGuid) { dialogRef.encounterObject = componentsInChildren[i]; return; } } } }
private void BuildDialogueGameLogicResult(JObject resultObject) { Main.LogDebug("[BuildDialogueGameLogicResult] Building 'Dialogue' result"); string dialogueGuid = (resultObject.ContainsKey("DialogueGuid")) ? resultObject["DialogueGuid"].ToString() : null; string dialogueSequenceGuid = (resultObject.ContainsKey("DialogueSequenceGuid")) ? resultObject["DialogueSequenceGuid"].ToString() : null; bool isInterrupt = (resultObject.ContainsKey("IsInterrupt")) ? (bool)resultObject["IsInterrupt"] : true; DialogResult result = ScriptableObject.CreateInstance <DialogResult>(); DialogueRef dialogueRef = new DialogueRef(); dialogueRef.EncounterObjectGuid = dialogueGuid; DialogueSequenceRef dialogueSequenceRef = new DialogueSequenceRef(); dialogueSequenceRef.EncounterObjectGuid = dialogueSequenceGuid; result.dialogueRef = dialogueRef; result.dialogueSequenceRef = dialogueSequenceRef; result.isInterrupt = isInterrupt; results.Add(result); }
static void Prefix(DialogResult __instance, DialogueRef ___dialogueRef) { Main.Logger.Log($"[DialogResultPatch Prefix] Patching Trigger"); UpdateEncounterObjectRef(___dialogueRef); }