private static void Main()
        {
            var instructional = new InstructionalButtons();
            var spawnCarGroup = new InstructionalButtonGroup("Spawn Car", ModifierKey.GetInstructionalKey(), InstructionalKey.SymbolPlus, SpawnCarKey.GetInstructionalKey());

            instructional.Buttons.Add(spawnCarGroup);

            while (true)
            {
                GameFiber.Yield();

                if (HasInputJustChanged)
                {
                    var(modifier, key) = IsUsingController ? (ModifierButton.GetInstructionalKey(), SpawnCarButton.GetInstructionalKey()) :
                                         (ModifierKey.GetInstructionalKey(), SpawnCarKey.GetInstructionalKey());
                    spawnCarGroup.Buttons[0] = modifier;
                    spawnCarGroup.Buttons[2] = key;
                    instructional.Update();
                }

                instructional.Draw();

                bool spawn = IsUsingController ? (ModifierButton == ControllerButtons.None || Game.IsControllerButtonDownRightNow(ModifierButton)) && Game.IsControllerButtonDown(SpawnCarButton) :
                             (ModifierKey == Keys.None || Game.IsKeyDownRightNow(ModifierKey)) && Game.IsKeyDown(SpawnCarKey);

                if (spawn)
                {
                    GameFiber.StartNew(() => new Vehicle(m => m.IsCar, Game.LocalPlayer.Character.GetOffsetPositionFront(5.0f)).Dismiss());
                }
            }
        }
예제 #2
0
 public void ShowInstructionalButtons()
 {
     InstructionalButtons.Draw();
 }