Esempio n. 1
0
 internal void Animation(IReadOnlyList <IColoredKey[]> keyBlocks)
 {
     Inst.Clear();
     for (var i = 0; i < keyBlocks.Count; i++)
     {
         Thread.Sleep(40 - i);
         if (keyBlocks.Count > i)
         {
             Inst.SetKeys(keyBlocks[i].Select(x => x.Key), Color.Red);
         }
         Thread.Sleep(8);
         if (keyBlocks.Count > i - 1 && i - 1 >= 0)
         {
             Inst?.SetKeys(keyBlocks[i - 1].Select(x => x.Key), Color.Orange);
         }
         Thread.Sleep(8);
         if (keyBlocks.Count > i - 2 && i - 2 >= 0)
         {
             Inst?.SetKeys(keyBlocks[i - 2].Select(x => x.Key), Color.Green);
         }
         Thread.Sleep(8);
         if (keyBlocks.Count > i - 3 && i - 3 >= 0)
         {
             Inst?.SetKeys(keyBlocks[i - 3].Select(x => x.Key), Color.Yellow);
         }
         Thread.Sleep(8);
         if (keyBlocks.Count > i - 4 && i - 4 >= 0)
         {
             Inst?.SetKeys(keyBlocks[i - 4].Select(x => x.Key), Color.White);
         }
     }
 }
        private void InitializeChromaSDK()
        {
            _chroma = Chroma.Instance;
            _chroma.Initialize();

            _keyboard = _chroma.Keyboard;
            _keyboard.Clear();
        }
Esempio n. 3
0
 internal void ProcessInput(IKeyboard keyboard)
 {
     if (IsBindingKey)
     {
         if (keyboard.IsKeyPressed(Options.KeyBindings[GameAction.OpenMenu]))
         {
             this.IsBindingKey = false;
             // Don't allow the parent (keybindings console) to abort back to the options menu
             keyboard.Clear();
         }
         else
         {
             var keys = keyboard.GetKeysPressed();
             if (keys.Any())
             {
                 // Rebind
                 var selectedItem = this.controls[selectedIndex];
                 Options.KeyBindings[selectedItem] = keys.First();
                 this.IsBindingKey = false;
             }
         }
     }
     else
     {
         if (keyboard.IsKeyPressed(Options.KeyBindings[GameAction.MoveUp]))
         {
             this.selectedIndex--;
             if (this.selectedIndex == -1)
             {
                 this.selectedIndex = this.controls.Count - 1;
             }
         }
         if (keyboard.IsKeyPressed(Options.KeyBindings[GameAction.MoveDown]))
         {
             this.selectedIndex = (this.selectedIndex + 1) % this.controls.Count;
         }
         if (keyboard.IsKeyPressed(Options.KeyBindings[GameAction.SkipTurn]))
         {
             this.IsBindingKey = true;
         }
     }
 }
        private void InitializeChromaSDK()
        {
            _chroma = Chroma.Instance;
            _chroma.Initialize();

            _keyboard = _chroma.Keyboard;
            _keyboard.Clear();
        }