Exemplo n.º 1
0
 public UIEventHub(IScriptRunner runner, UIElement control,
                   bool startIsEnabled = true, params UIEventProcessorBase[] eventProcessors)
 {
     Control          = control;
     _eventProcessors = new List <UIEventProcessorBase>(eventProcessors);
     _inputProcessors = new UIInputManager(
         new FlickInputProcessor(),
         new ClickCountInputProcessor(),
         new DropInputProcessor(),
         new DragInputProcessor()
     {
         DragStartedFunc = inp =>
         {
             if (inp.InputType == UIInputType.Touch)
             {
                 Control_TouchDrag(inp.Sender, inp.EventArgs as InputEventArgs);
             }
             else
             {
                 Control_MouseDrag(inp.Sender, inp.EventArgs as InputEventArgs);
             }
             //ScrollViewer.SetPanningRatio(inp.Sender as DependencyObject, 0);
             ScrollViewer.SetPanningMode(inp.Sender as DependencyObject, PanningMode.None);
         },
         DragStoppedFunc = inp =>
         {
             //ScrollViewer.SetPanningRatio(inp.Sender as DependencyObject, 1);
             ScrollViewer.SetPanningMode(inp.Sender as DependencyObject, PanningMode.Both);
         }
     },
         new TouchDragMoveCountInputProcessor()
         );
     _scriptRunner = runner;
     IsEnabled     = startIsEnabled;
 }
Exemplo n.º 2
0
        private void CreateNewPossiblePlayer(UserDevice userDevice, UIInputManager uiInputManager)
        {
            while (userDevice.deviceIndex >= playerControllers.Count)
            {
                playerControllers.Add(null);
            }
            userDevice.EnableUIInput(true);
            SelectScreenPlayerController playerSelectController = new SelectScreenPlayerController(userDevice.deviceIndex, uiInputManager, this);

            playerControllers[userDevice.deviceIndex] = playerSelectController;
            playerSelectController.Subscribe();
        }
Exemplo n.º 3
0
 public void Activate(int playerIndex, UIInputManager uiInputManager)
 {
     this.playerIndex    = playerIndex;
     this.uiInputManager = uiInputManager;
     inactivePanel.SetActive(false);
     activePanel.SetActive(true);
     SubscribeToUI();
     SubscribeToInput();
     for (int i = 0; i < activeUIElements.Length; i++)
     {
         activeUIElements[i].LoseFocus();
     }
     activeUIElements[currentlySelectedElement].Focus(uiInputManager);
 }
Exemplo n.º 4
0
 public virtual void Focus(UIInputManager uiInputManager)
 {
     SetAllFocusElementsVisibility(true);
     this.uiInputManager = uiInputManager;
     SubscribeToInput();
 }
Exemplo n.º 5
0
 private void OnDeviceRegistered(UserDevice userDevice, PlayerGameplayInputManager gameplayInputManager, UIInputManager uiInputManager)
 {
     CreateNewPossiblePlayer(userDevice, uiInputManager);
 }