public Next(TextScenario scenario) { Text.Next next = this; this.scenario = scenario; TextScenario.CurrentCharaData currentCharaData = scenario.currentCharaData; List <TextScenario.IMotion[]> motionList = currentCharaData.motionList; List <TextScenario.IExpression[]> expressionList = currentCharaData.expressionList; int cnt = 0; Func <bool> func1 = (Func <bool>)(() => !motionList.IsNullOrEmpty <TextScenario.IMotion[]>() && motionList.SafeGet <TextScenario.IMotion[]>(cnt) != null); Func <bool> func2 = (Func <bool>)(() => !expressionList.IsNullOrEmpty <TextScenario.IExpression[]>() && expressionList.SafeGet <TextScenario.IExpression[]>(cnt) != null); while (func1() || func2()) { TextScenario.IMotion[] motion = func1() ? motionList[cnt] : (TextScenario.IMotion[])null; TextScenario.IExpression[] expression = func2() ? expressionList[cnt] : (TextScenario.IExpression[])null; this.playList.Add(new List <Action>() { (Action)(() => closure_0.Play(expression)), (Action)(() => closure_0.Play(motion)) }); ++cnt; } if (currentCharaData.voiceList.IsNullOrEmpty <TextScenario.IVoice[]>()) { return; } this.onChange = (Action)(() => next.Play()); scenario.VoicePlay(currentCharaData.voiceList, this.onChange, (Action)(() => next.voicePlayEnd = true)); }
public override void Do() { base.Do(); TextScenario.CurrentCharaData currentCharaData = this.scenario.currentCharaData; currentCharaData.CreateVoiceList(); List <Voice.Data> dataList = new List <Voice.Data>(); if (this.args.Length > 1) { int cnt = 0; while (!this.args.IsNullOrEmpty(cnt)) { Voice.Data data = new Voice.Data(this.args, ref cnt); CharaData chara = this.scenario.commandController.GetChara(data.no); if (chara != null) { data.transform = chara.voiceTrans; data.chaCtrl = chara.chaCtrl; if (!data.usePersonality) { data.personality = chara.voiceNo; } if (!data.usePitch) { data.pitch = chara.voicePitch; } } data.is2D = this.scenario.info.audio.is2D; data.isNotMoveMouth = this.scenario.info.audio.isNotMoveMouth; if (this.scenario.info.audio.eco.use) { data.eco = this.scenario.info.audio.eco.DeepCopy <ADV.Info.Audio.Eco>(); } dataList.Add(data); } } currentCharaData.voiceList.Add((TextScenario.IVoice[])dataList.ToArray()); foreach (Voice.Data data in dataList) { if (data.bundle.IsNullOrEmpty()) { string str; if (this.scenario.currentCharaData.bundleVoices.TryGetValue(data.personality, out str)) { data.bundle = str; } } else { this.scenario.currentCharaData.bundleVoices[data.personality] = data.bundle; } } }
public override void Do() { base.Do(); Text.Data data = new Text.Data(this.args); this.scenario.fontColorKey = data.name; if (data.name != string.Empty) { data.name = this.scenario.ReplaceText(data.name); } if (data.text != string.Empty) { data.text = this.scenario.ReplaceText(data.text); } TextScenario.CurrentCharaData currentCharaData = this.scenario.currentCharaData; if (currentCharaData.isSkip || Manager.Config.GameData.NextVoiceStop) { this.scenario.VoicePlay((List <TextScenario.IVoice[]>)null, (Action)null, (Action)null); } currentCharaData.isSkip = false; this.scenario.captionSystem.SetName(data.name); this.scenario.captionSystem.SetText(data.text, false); string str = (string)null; switch (data.colorKey) { case "[H]": str = MapUIContainer.CharaNameColor(this.scenario.currentChara?.data?.actor); break; case "[P]": str = MapUIContainer.CharaNameColor(this.scenario.player?.actor); break; case "[M]": Actor actor = (Actor)this.scenario.currentChara?.data?.merchantActor; if (Object.op_Equality((Object)actor, (Object)null)) { List <TextScenario.ParamData> heroineList = this.scenario.heroineList; actor = heroineList != null?heroineList.FirstOrDefault <TextScenario.ParamData>((Func <TextScenario.ParamData, bool>)(p => Object.op_Inequality((Object)p.merchantActor, (Object)null)))?.actor : (Actor)null; } str = MapUIContainer.CharaNameColor(actor); break; } if (str != null) { data.name = str; } this.scenario.TextLogCall(data, (IReadOnlyCollection <TextScenario.IVoice[]>)currentCharaData.voiceList); this.next = new Text.Next(this.scenario); }