private void OnKeyDown(object sender, KeyEventArgs e) { if (DatabaseHandler.initialised && instantiated) { if (DatabaseHandler.dealerInRangeIndex != null && e.KeyCode == Keys.E) { if (GlobalVariables.dealerMenu != null) { DealerMenu.ToggleMenu(); } } } }
private void OnTick(object sender, EventArgs e) { if (DatabaseHandler.initialised && !instantiated) { Instantiate(); } if (DatabaseHandler.initialised && instantiated) { PedHelper.CheckNearbyDealer(); if (DatabaseHandler.dealerInRangeIndex != null && DatabaseHandler.dealerInventory != null) { if (GlobalVariables.dealerMenu == null) { DealerMenu.CreateMenu(DatabaseHandler.dealers[(int)DatabaseHandler.dealerInRangeIndex]); } } else { GlobalVariables.dealerMenu = null; } } }