private void Notify(MyTextsWrapperEnum text, object[] args, MyNotificationType notificationType = MyNotificationType.Text) { var handler = OnNotification; if (handler != null) { handler(notificationType, text, args); } }
public void SendNotification(MyNotificationType type, MyTextsWrapperEnum text, string arg0 = null, string arg1 = null, string arg2 = null, string arg3 = null) { var msg = new MyEventNotification(); msg.Text = (int)text; msg.Type = type; msg.Arg0 = arg0; msg.Arg1 = arg1; msg.Arg2 = arg2; msg.Arg3 = arg3; Peers.SendToAll(ref msg, NetDeliveryMethod.ReliableOrdered); }
private void Notify(MyTextsWrapperEnum text, object arg0 = null, object arg1 = null, object arg2 = null, object arg3 = null, MyNotificationType notificationType = MyNotificationType.Text) { var handler = OnNotification; if (handler != null) { m_textArgs[0] = arg0; m_textArgs[1] = arg1; m_textArgs[2] = arg2; m_textArgs[3] = arg3; handler(notificationType, text, m_textArgs); } }
static void Multiplayer_OnNotification(MyNotificationType notificationType, MyTextsWrapperEnum arg1, object[] arg2) { if (notificationType == MyNotificationType.Text) { MyHudNotification.MyNotification notification = new MyHudNotification.MyNotification(arg1, 3000, null, arg2); MyHudNotification.AddNotification(notification); } else if (notificationType == MyNotificationType.WaitStart) { MyGuiManager.CloseIngameScreens(); MyGuiManager.AddModalScreen(new MyGuiScreenWaitingOnHost(arg1), null); MyMultiplayerGameplay.IsWaiting = true; if (!MyMinerGame.IsPaused()) MyMinerGame.SwitchPause(); } else if (notificationType == MyNotificationType.WaitEnd) { MyMultiplayerGameplay.IsWaiting = false; if (!MyMinerGame.IsPaused()) MyMinerGame.SwitchPause(); CloseWaitingScreen(); } }