This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //BEFORE================================================================================ | |
| //-- IN EXTENSIONS.CS: | |
| public static int CurrentLine { get; private set; } | |
| public static bool ContinueConversation { get; set; } = true; | |
| public static bool EndOfConversation { get; private set; } | |
| public static void TalkingFunction(List<Tuple<Ped, List<string>>> convoList, string otherPedName, List<string> firstThingTheySay = null) | |
| { | |
| GameFiber.StartNew(delegate | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void DisplayConversation(string[] lines, string playerName, int playerCol, string pedName, int pedCol) | |
| { | |
| for(int i = 0; i < lines.Lenght; i++) | |
| { | |
| if(i % 2 == 0) DialogueLine(pedCol, pedName, lines[i]); | |
| else DialogueLine(playerCol, playerName, lines[i]); | |
| while(!Game.IsKeyPressed(key)) GameFiber.Yield(); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static void AddOrReplaceObject<T>(string file, T obj, Predicate<T> find) | |
| { | |
| if (File.Exists(file)) | |
| { | |
| Serializer.ModifyItemInXML<List<T>>(file, d => AddOrReplace(d, obj, find)); | |
| } | |
| else | |
| { | |
| Serializer.SaveToXML(new List<T>{ obj }, file); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static bool IsHeadingOppositeInRange(float h1, float h2, float range) | |
| { | |
| float op = NormalizeHeading(h1 + 180f); | |
| float b1 = op + range / 2; | |
| float b2 = op - range / 2; | |
| return Math.Abs(b1 - h2) <= range && Math.Abs(b2 - h2) <= range; | |
| } | |
| static float NormalizeHeading(float angle) |