public override void Invoke(MissionRuntime runtime, MissionScript script) { var dlg = script.Dialogs[Dialog]; var netdlg = new NetDlgLine[dlg.Lines.Count]; for (int i = 0; i < dlg.Lines.Count; i++) { var d = dlg.Lines[i]; string voice = "trent_voice"; if (!d.Source.Equals("Player", StringComparison.OrdinalIgnoreCase)) { var src = script.Ships[d.Source]; var npc = script.NPCs[src.NPC]; voice = npc.Voice; } var hash = FLHash.CreateID(d.Line); runtime.EnqueueLine(hash, d.Line); netdlg[i] = new NetDlgLine() { Voice = voice, Hash = hash }; } runtime.Player.PlayDialog(netdlg); }
public override void Invoke(MissionRuntime runtime, MissionScript script) { var hash = FLHash.CreateID(Line); runtime.EnqueueLine(hash, Line); runtime.Player.PlayDialog(new NetDlgLine[] { new NetDlgLine() { Voice = Voice, Hash = hash } }); }
public override void Invoke(MissionRuntime runtime, MissionScript script) { var netdlg = new NetDlgLine[1]; var src = script.Ships[Source]; var npc = script.NPCs[src.NPC]; var voice = npc.Voice; var hash = FLHash.CreateID(Line); runtime.EnqueueLine(hash, Line); netdlg[0] = new NetDlgLine() { Voice = voice, Hash = hash }; runtime.Player.PlayDialog(netdlg); }
public IDTable(string fldir) { UtfNicknameTable = new Dictionary <uint, string>(); var fs = FileSystem.FromFolder(fldir, true); var flini = new FreelancerIni(fs); var voices = new VoicesIni(); foreach (var path in flini.VoicePaths) { voices.AddVoicesIni(path, fs); } foreach (var voice in voices.Voices.Values) { foreach (var msg in voice.Messages) { UtfNicknameTable[FLHash.CreateID(msg.Message)] = msg.Message; } } }
public VoiceUtf(string path) { foreach (var child in parseFile(path)) { if (!(child is LeafNode)) { FLLog.Error("Utf", "Invalid audio intermediate node in " + path); continue; } var leaf = (LeafNode)child; uint hash; if (!child.Name.StartsWith("0x", StringComparison.OrdinalIgnoreCase)) { hash = FLHash.CreateID(child.Name); } else { hash = uint.Parse(child.Name.Substring(2), NumberStyles.HexNumber); } AudioFiles.Add(hash, leaf.ByteArrayData); } }
public void PlayVoiceLine(string voice, string line) { Data.Sounds?.PlayVoiceLine(voice, FLHash.CreateID(line), null); }