Beispiel #1
0
        private void OnImpButtonValueChanged(object sender, ButtonValueChangedArgs args)
        {
            if (!_buttonsToListen.ContainsKey(args.Button.Id))
            {
                throw new InvalidOperationException($"Unknown Button {args.Button.Name} ({args.Button.Id})");
            }

            // Just save the information about the changed value. All other handling including
            // firing the user event is done in PreRender.
            _buttonsToListenJustChanged[args.Button.Id] = args.Pressed;
        }
Beispiel #2
0
 private void OnMouse(object sender, ButtonValueChangedArgs bvca)
 {
     if (bvca.Pressed)
     {
         OnMouseDown?.Invoke(this);
     }
     else
     {
         OnMouseUp?.Invoke(this);
     }
 }
Beispiel #3
0
 private void OnMouseButton(object sender, ButtonValueChangedArgs bvca)
 {
     if (MouseOnPanel())
     {
         if (bvca.Pressed)
         {
             OnGUIPanelDown?.Invoke(this, new GUIPanelEventArgs {
                 mouseX = Input.Mouse.PositionInt.x, mouseY = Input.Mouse.PositionInt.y
             });
         }
         else
         {
             OnGUIPanelUp?.Invoke(this, new GUIPanelEventArgs {
                 mouseX = Input.Mouse.PositionInt.x, mouseY = Input.Mouse.PositionInt.y
             });
         }
     }
 }