public void PlayDrama(int inGroupId, GameObject inSrc, GameObject inAtker, bool bDialogTriggerStart = false) { this.EndDialogue(); this.m_actorLinesRaw = GameDataMgr.actorLinesDatabin.GetDataByKey(inGroupId); if (this.m_actorLinesRaw == null) { return; } ResActorLinesInfo dataByKeySingle = GameDataMgr.actorLinesDatabin.GetDataByKeySingle((uint)inGroupId); if (dataByKeySingle == null) { return; } if (bDialogTriggerStart) { this.PreDialogId = inGroupId; } this.m_ageActName = StringHelper.UTF8BytesToString(ref dataByKeySingle.szAgeActionName); bool flag = this.m_ageActName != null && this.m_ageActName.get_Length() > 0; if (flag) { this.PlayAgeActionInternal(inSrc, inAtker, inGroupId); } else { this.StartDialogue(inGroupId); } }
public void StartDialogue(int inGroupId) { string ageActName = this.m_ageActName; this.EndDialogue(); this.m_ageActName = ageActName; this.m_actorLinesRaw = GameDataMgr.actorLinesDatabin.GetDataByKey(inGroupId); if (this.m_actorLinesRaw == null) { return; } ResActorLinesInfo dataByKeySingle = GameDataMgr.actorLinesDatabin.GetDataByKeySingle((uint)inGroupId); if (dataByKeySingle == null) { return; } if (CSysDynamicBlock.bDialogBlock && dataByKeySingle.bIOSHide != 0) { return; } this.m_actorLines = new DialogueProcessor.SActorLineNode[this.m_actorLinesRaw.get_Count()]; DialogueProcessor.SActorLineNode sActorLineNode = default(DialogueProcessor.SActorLineNode); this.TranslateNodeFromRaw(ref sActorLineNode, ref dataByKeySingle); this.m_actorLines[0] = sActorLineNode; HashSet <object> .Enumerator enumerator = this.m_actorLinesRaw.GetEnumerator(); if (enumerator.MoveNext()) { int num = 1; while (enumerator.MoveNext()) { ResActorLinesInfo resActorLinesInfo = enumerator.get_Current() as ResActorLinesInfo; DialogueProcessor.SActorLineNode sActorLineNode2 = default(DialogueProcessor.SActorLineNode); this.TranslateNodeFromRaw(ref sActorLineNode2, ref resActorLinesInfo); this.m_actorLines[num] = sActorLineNode2; sActorLineNode = sActorLineNode2; num++; } } Singleton <CBattleGuideManager> .GetInstance().PauseGame(this, true); this.m_curIndex = -1; if (this.bAutoNextPage) { base.StartCoroutine(this.NextPageNoTimeScale()); } else { this.NextPageInternal(); } if (this.PreDialogId != 0 && inGroupId == this.PreDialogId) { PreDialogStartedEventParam preDialogStartedEventParam = new PreDialogStartedEventParam(this.PreDialogId); Singleton <GameEventSys> .get_instance().SendEvent <PreDialogStartedEventParam>(GameEventDef.Event_PreDialogStarted, ref preDialogStartedEventParam); this.PreDialogId = 0; } }
private void TranslateNodeFromRaw(ref DialogueProcessor.SActorLineNode outNode, ref ResActorLinesInfo inRecord) { outNode.DialogStyle = inRecord.iDialogStyle; string text = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Name; if (string.IsNullOrEmpty(text)) { text = "Unknown"; } outNode.DialogContent = StringHelper.UTF8BytesToString(ref inRecord.szDialogContent); if (string.IsNullOrEmpty(outNode.DialogContent)) { outNode.DialogContent = string.Empty; } else { outNode.DialogContent = outNode.DialogContent.Replace("[c]", text); } outNode.DialogTitle = StringHelper.UTF8BytesToString(ref inRecord.szDialogTitle); if (string.IsNullOrEmpty(outNode.DialogTitle)) { outNode.DialogTitle = string.Empty; } else { outNode.DialogTitle = outNode.DialogTitle.Replace("[c]", text); } outNode.bFadeIn = (inRecord.bFadeInType > 0); outNode.bFadeOut = (inRecord.bFadeOutType > 0); outNode.b3dPortrait = (inRecord.iUse3dPortrait > 0); outNode.ActorType = (ActorTypeDef)inRecord.iActorType; outNode.CharCfgId = inRecord.iCharacterCfgId; outNode.AnimName = StringHelper.UTF8BytesToString(ref inRecord.szAnimName); outNode.bAnimLoop = (inRecord.iAnimLoop > 0); outNode.PortraitImgPrefab = default(ObjData); if (outNode.b3dPortrait) { if (inRecord.iCharacterCfgId > 0) { switch (inRecord.iActorType) { case 0: outNode.PortraitImgPath = CUICommonSystem.GetHero3DObjPath((uint)inRecord.iCharacterCfgId, true); break; case 1: outNode.PortraitImgPath = CUICommonSystem.GetMonster3DObjPath(inRecord.iCharacterCfgId, true); break; case 2: outNode.PortraitImgPath = CUICommonSystem.GetOrgan3DObjPath(inRecord.iCharacterCfgId, true); break; } } } else { string text2 = StringHelper.UTF8BytesToString(ref inRecord.szImagePath); if (text2 == "9999") { text2 = "90" + (Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().HeadIconId + 1); text2 = CUIUtility.s_Sprite_Dynamic_Dialog_Dir_Portrait + text2; outNode.PortraitImgPrefab.Object = (Singleton <CResourceManager> .GetInstance().GetResource(text2, typeof(GameObject), 4, false, false).m_content as GameObject); } else { text2 = CUIUtility.s_Sprite_Dynamic_Dialog_Dir_Portrait + text2; outNode.PortraitImgPrefab.Object = (Singleton <CResourceManager> .GetInstance().GetResource(text2, typeof(GameObject), 4, false, false).m_content as GameObject); } } }