public void Initialise() //this wouldnt work as a constructor because some assets arent available during load time. { initialised = true; soundPlayer = new SoundPlayer(debugging, true); OutputManager = new OutputManager(soundPlayer, debugging); if (debugging == false) { MyAPIGateway.Utilities.MessageEntered += OnMessageEntered; //subscribes my method to the MessageEntered event. MyAPIGateway.Multiplayer.RegisterMessageHandler(packet_ID, OnReceivedPacket); //registers a multiplayer packet receiver. AttendanceManager.UpdatePlayers(); MyAPIGateway.Utilities.ShowMessage("TextToSpeechMod:", "If you find a broken word, please tell the designer."); } }
public static void UpdatePlayers() { AttendanceManager m = AttendanceManager.GetSingleton(); playersField.Clear(); //GetPlayers() just adds without overwriting so list must be cleared every time. if (OutputManager.IsDebugging == false) { MyAPIGateway.Multiplayer.Players.GetPlayers(playersField); for (int i = 0; i < playersField.Count; i++) { if (m.muteStatusesField.ContainsKey(playersField[i].DisplayName) == false) { m.muteStatusesField.Add(playersField[i].DisplayName, new bool()); } if (playersField[i].SteamUserId == MyAPIGateway.Multiplayer.MyId) { m.LocalPlayer = playersField[i]; } } } }