private string UserChatMessage_ConstructChatString(On.RoR2.Chat.UserChatMessage.orig_ConstructChatString orig, Chat.UserChatMessage self) { List <string> split = new List <string>(self.text.Split(Char.Parse(" "))); string commandName = ArgsHelper.GetValue(split, 0); if (commandName.Equals("spawn_as", StringComparison.CurrentCultureIgnoreCase)) { string bodyString = ArgsHelper.GetValue(split, 1); string userString = ArgsHelper.GetValue(split, 2); SpawnAs(self.sender.GetComponent <NetworkUser>(), bodyString, userString); } return(orig(self)); }
private string UserChatMessage_ConstructChatString(On.RoR2.Chat.UserChatMessage.orig_ConstructChatString orig, Chat.UserChatMessage self) { if (self.sender) { NetworkUser component = self.sender.GetComponent <NetworkUser>(); if (component) { if (self.text.StartsWith(">")) { return(string.Format(CultureInfo.InvariantCulture, "{0}: <color=#789922>{1}</color>", Util.EscapeRichTextForTextMeshPro(component.userName), Util.EscapeRichTextForTextMeshPro(self.text))); } else if (self.text.EndsWith("<")) { return(string.Format(CultureInfo.InvariantCulture, "{0}: <color=#E0727F>{1}</color>", Util.EscapeRichTextForTextMeshPro(component.userName), Util.EscapeRichTextForTextMeshPro(self.text))); } return(orig(self)); } } return(null); }
private string UserChatMessage_ConstructChatString(On.RoR2.Chat.UserChatMessage.orig_ConstructChatString orig, Chat.UserChatMessage self) { if (!LoadingFromSave) { if (!AllAgree && self.text.ToLower().Equals("agree")) { NetworkUser networkUser = self.sender.GetComponent <NetworkUser>(); if (networkUser) { var steamID = networkUser.id.steamId; for (int i = 0; i < SteamPlayers.Count; i++) { if (SteamPlayers[i].steamID == steamID) { SteamPlayers[i].isReady = true; break; } } bool checkAllReady = true; for (int i = 0; i < SteamPlayers.Count; i++) { if (!SteamPlayers[i].isReady) { checkAllReady = false; break; } } if (checkAllReady) { //Time.timeScale = 1f; AllAgree = true; RemoveLunarCoins(); UnfreezePlayers(); } } } } return(orig(self)); }