Exemplo n.º 1
0
 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();
             }
         }
     }
 }
Exemplo n.º 2
0
        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;
                }
            }
        }