private void OnGlobalEvent(MyGuiControlButton sender) { if (MyGuiScreenGamePlay.Static != null) { var globalEventEnum = (MyGlobalEventEnum)sender.UserData; MyGlobalEvents.StartGlobalEvent(globalEventEnum); } }
void OnEvent(ref MyEventEvent msg) { var eventType = (MyGlobalEventEnum)msg.EventTypeEnum; if (!MyMwcEnums.IsValidValue(eventType)) { Alert("Invalid global event type", msg.SenderEndpoint, msg.EventType); } // TODO: When required, add position and seed MyGlobalEvents.StartGlobalEvent(eventType); }