void disposeFlight() { if (currentFlight != null) { currentFlight.stop(connection); currentFlight = null; } cargoView.Rows.Clear(); currentState = FSECONOMY_STATES.IDLE; connection.MenuDeleteSubItem(EVENTS.MENU1, EVENTS.MENU3); connection.MenuAddSubItem(EVENTS.MENU1, "Start flight", EVENTS.MENU2, 0); }
public P3DClient(SimConnectDummyWindow dummyWindow) { this.dummyWindow = dummyWindow; setupSimConnect(); optionsWindow = new P3DAutoSave.OptionsWindow(this); optionsWindow.Visible = false; saveTimer = new System.Timers.Timer(); saveTimer.Elapsed += new ElapsedEventHandler(saveGame); loadSettings(); p3d.MenuAddItem("P3DAutoSave", EVENTS.EVENT_MENU, 0); p3d.MenuAddSubItem(EVENTS.EVENT_MENU, "Enable/Disable", EVENTS.EVENT_MENU_ENABLE_DISABLE, 0); p3d.MenuAddSubItem(EVENTS.EVENT_MENU, "Options", EVENTS.EVENT_MENU_OPTIONS, 0); p3d.MenuAddSubItem(EVENTS.EVENT_MENU, "Save", EVENTS.EVENT_MENU_SAVE, 0); p3d.MenuAddSubItem(EVENTS.EVENT_MENU, "Open Console", EVENTS.EVENT_MENU_CONSOLE, 0); }
void onRecvOpen(SimConnect sender, SIMCONNECT_RECV_OPEN data) { this.fsStatusLabel.Text = "Connected"; this.fsStatusLabel.Image = FSEconomy.Properties.Resources.icon_airplane_green; connection.SubscribeToSystemEvent(EVENTS.CRASH, "Crashed"); connection.SubscribeToSystemEvent(EVENTS.JUMP, "PositionChanged"); connection.SubscribeToSystemEvent(EVENTS.SIMSTATE, "Sim"); Aircraft.SetDataDefinition(connection); connection.RequestDataOnSimObject(DATA_REQUESTID.AIRCRAFT_INFO, DATA_DEF.AIRCRAFT_INFO, SimConnect.SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD.SECOND, SIMCONNECT_DATA_REQUEST_FLAG.DEFAULT, 0, 0, 0); stateManager.connection = connection; connection.MenuAddItem("FS Economy", EVENTS.MENU1, 0); connection.MenuAddSubItem(EVENTS.MENU1, "Start flight", EVENTS.MENU2, 0); }