private void OnPasteAutopilotSetup(MyObjectBuilder_AutopilotClipboard clipboard) { m_currentDirection.Value = (Base6Directions.Direction)clipboard.Direction; m_currentFlightMode.Value = (FlightMode)clipboard.FlightMode; m_dockingModeEnabled.Value = clipboard.DockingModeEnabled; if (clipboard.Waypoints != null) { m_waypoints = new List<MyAutopilotWaypoint>(clipboard.Waypoints.Count); foreach (var waypoint in clipboard.Waypoints) { if (waypoint.Actions != null) { foreach (var action in waypoint.Actions) { var blockAction = action as MyObjectBuilder_ToolbarItemTerminalBlock; //Swith from old entity to the new one if (blockAction != null && blockAction.BlockEntityId == clipboard.RemoteEntityId) { blockAction.BlockEntityId = EntityId; } } } m_waypoints.Add(new MyAutopilotWaypoint(waypoint, this)); } } m_selectedWaypoints.Clear(); RaisePropertiesChangedRemote(); }
public void SendPasteAutopilotSettings(MyObjectBuilder_AutopilotClipboard clipboard) { var msg = new PasteAutopilotSetupMsg(); msg.EntityId = m_remoteControl.EntityId; msg.Clipboard = clipboard; Sync.Layer.SendMessageToServerAndSelf(ref msg,MyTransportMessageEnum.Request); }
private void CopyAutopilotSetup() { m_clipboard = new MyObjectBuilder_AutopilotClipboard(); m_clipboard.Direction = (byte)m_currentDirection.Value; m_clipboard.FlightMode = (int)m_currentFlightMode.Value; m_clipboard.RemoteEntityId = EntityId; m_clipboard.DockingModeEnabled = m_dockingModeEnabled; m_clipboard.Waypoints = new List<MyObjectBuilder_AutopilotWaypoint>(m_waypoints.Count); foreach (var waypoint in m_waypoints) { m_clipboard.Waypoints.Add(waypoint.GetObjectBuilder()); } RaisePropertiesChangedRemote(); }
public void SendPasteAutopilotSettings(MyObjectBuilder_AutopilotClipboard clipboard) { var msg = new PasteAutopilotSetupMsg(); msg.EntityId = m_remoteControl.EntityId; msg.Clipboard = clipboard; Sync.Layer.SendMessageToAllAndSelf(ref msg); }