Beispiel #1
0
 public override void Register(UIMouse mouse)
 {
     base.Register(mouse);
     prevButton.Register(mouse);
     nextButton.Register(mouse);
     itemLabel.Register(mouse);
 }
Beispiel #2
0
 protected override void OnMouseLeftPress(UIMouse mouse)
 {
     if (knob.Contains(mouse.ScreenPositionP))
     {
         dragging = true;
     }
 }
Beispiel #3
0
 protected override void OnMouseLeftPress(UIMouse mouse)
 {
     if (hovering)
     {
         down = true;
     }
 }
Beispiel #4
0
 protected override void OnMouseLeftRelease(UIMouse mouse)
 {
     if (dragging)
     {
         dragging = false;
     }
 }
Beispiel #5
0
 protected override void OnMouseLeftRelease(UIMouse mouse)
 {
     if (down && hovering)
     {
         SetState(!state);
     }
     down = false;
 }
Beispiel #6
0
 protected override void OnMouseLeftRelease(UIMouse mouse)
 {
     if (down && hovering)
     {
         OnUse();
     }
     down = false;
 }
Beispiel #7
0
        protected override void OnMouseMove(UIMouse mouse)
        {
            base.OnMouseMove(mouse);

            if (dragging)
            {
                CenterKnob(mouse.ScreenPositionP.X);
            }
        }
 protected override void OnMouseLeftRelease(UIMouse mouse)
 {
     if (hovering)
     {
         ToggledOn = !ToggledOn;
         if (!ToggledOn)
             down = false;
         OnUse();
     }
 }
 /// <summary>
 /// Disconnects the component's event handlers from the mouse
 /// </summary>
 public virtual void Unregister(UIMouse mouse)
 {
     mouse.LPress -= LPress;
     mouse.LRelease -= LRelease;
     mouse.RPress -= RPress;
     mouse.RRelease -= RRelease;
     mouse.Move -= Move;
     hovering = false;
     active = false;
 }
 /// <summary>
 /// Disconnects the component's event handlers from the mouse
 /// </summary>
 public virtual void Unregister(UIMouse mouse)
 {
     mouse.LPress   -= LPress;
     mouse.LRelease -= LRelease;
     mouse.RPress   -= RPress;
     mouse.RRelease -= RRelease;
     mouse.Move     -= Move;
     hovering        = false;
     active          = false;
 }
 /// <summary>
 /// Connects the component's event handlers to the mouse
 /// </summary>
 public virtual void Register(UIMouse mouse)
 {
     mouse.LPress += LPress;
     mouse.LRelease += LRelease;
     mouse.RPress += RPress;
     mouse.RRelease += RRelease;
     mouse.Move += Move;
     active = true;
     OnMouseMove(mouse);
 }
 /// <summary>
 /// Connects the component's event handlers to the mouse
 /// </summary>
 public virtual void Register(UIMouse mouse)
 {
     mouse.LPress   += LPress;
     mouse.LRelease += LRelease;
     mouse.RPress   += RPress;
     mouse.RRelease += RRelease;
     mouse.Move     += Move;
     active          = true;
     OnMouseMove(mouse);
 }
 protected virtual void OnMouseMove(UIMouse mouse)
 {
     if (area.Contains(mouse.ScreenPositionP))
     {
         hovering = true;
     }
     else
     {
         hovering = false;
     }
 }
Beispiel #14
0
        public override void Initialize()
        {
            mouse         = new UIMouse();
            keyboard      = new UIKeyboard();
            messageLog    = new MessageLog();
            screenManager = new ScreenManager(this);
            camera        = new Camera(sim);
            console       = new Console(sim);

            base.Initialize();
        }
        public override void Initialize()
        {
            mouse = new UIMouse();
            keyboard = new UIKeyboard();
            messageLog = new MessageLog();
            screenManager = new ScreenManager(this);
            camera = new Camera(sim);
            console = new Console(sim);

            base.Initialize();
        }
Beispiel #16
0
 protected override void OnMouseLeftRelease(UIMouse mouse)
 {
     if (hovering)
     {
         ToggledOn = !ToggledOn;
         if (!ToggledOn)
         {
             down = false;
         }
         OnUse();
     }
 }
Beispiel #17
0
        private void UpdateMouseInput()
        {
            UIMouse m = manager.UI.Mouse;

            if (m.State.RightButton == ButtonState.Pressed)
            {
                if (m.LastMove != Vector2.Zero)
                {
                    manager.UI.Camera.Rotate(new Vector2(m.LastMove.Y, m.LastMove.X) / -200.0f);
                }
            }
        }
Beispiel #18
0
 private void OnRClick(UIMouse mouse)
 {
     if (mode == Mode.Normal)
     {
         if (selected is LightBall)
         {
             Vector3?cursorPos = world.Terrain.PickTerrain(manager.UI.MouseRay);
             if (cursorPos.HasValue)
             {
                 (selected as LightBall).SetWaypoints(world.Terrain.NodeGrid.Search(selected.Position, cursorPos.Value));
             }
         }
     }
 }
Beispiel #19
0
 private void OnLClick(UIMouse mouse)
 {
     if (mode == Mode.Normal)
     {
         Select();
     }
     else if (mode == Mode.Build)
     {
         Vector3?pos = world.Terrain.PickTerrain(manager.UI.MouseRay);
         if (pos.HasValue)
         {
             manager.UI.Sim.World.Wildlife.AddBall(pos.Value + Vector3.UnitY * 20);
         }
     }
 }
 protected override void OnMouseLeftPress(UIMouse mouse)
 {
     if (hovering)
         down = true;
 }
 protected override void OnMouseLeftRelease(UIMouse mouse)
 {
     if (down && hovering)
         SetState(!state);
     down = false;
 }
 private void OnLClick(UIMouse mouse)
 {
     if (mode == Mode.Normal)
     {
         Select();
     }
     else if (mode == Mode.Build)
     {
         Vector3? pos = world.Terrain.PickTerrain(manager.UI.MouseRay);
         if (pos.HasValue)
             manager.UI.Sim.World.Wildlife.AddBall(pos.Value + Vector3.UnitY * 20);
     }
 }
Beispiel #23
0
 public override void Unregister(UIMouse mouse)
 {
     base.Unregister(mouse);
     label.Unregister(mouse);
 }
 protected override void OnMouseLeftRelease(UIMouse mouse)
 {
     if (dragging)
         dragging = false;
 }
 protected override void OnMouseLeftPress(UIMouse mouse) { }
 protected override void OnMouseRightRelease(UIMouse mouse) { }
 protected override void OnMouseLeftRelease(UIMouse mouse) { }
 protected override void OnMouseLeftRelease(UIMouse mouse)
 {
     if (down && hovering)
         OnUse();
     down = false;
 }
 protected override void OnMouseRightPress(UIMouse mouse) { }
 public override void Unregister(UIMouse mouse)
 {
     base.Unregister(mouse);
     label.Unregister(mouse);
 }
 public override void Register(UIMouse mouse)
 {
     base.Register(mouse);
     label.Register(mouse);
 }
 protected abstract void OnMouseLeftPress(UIMouse mouse);
        protected override void OnMouseMove(UIMouse mouse)
        {
            base.OnMouseMove(mouse);

            if (dragging)
                CenterKnob(mouse.ScreenPositionP.X);
        }
 protected abstract void OnMouseRightPress(UIMouse mouse);
Beispiel #35
0
 public override void Register(UIMouse mouse)
 {
     base.Register(mouse);
     label.Register(mouse);
 }
 protected override void OnMouseLeftPress(UIMouse mouse)
 {
 }
 private void OnRClick(UIMouse mouse)
 {
     if (mode == Mode.Normal)
     {
         if (selected is LightBall)
         {
             Vector3? cursorPos = world.Terrain.PickTerrain(manager.UI.MouseRay);
             if (cursorPos.HasValue)
             {
                 (selected as LightBall).SetWaypoints(world.Terrain.NodeGrid.Search(selected.Position, cursorPos.Value));
             }
         }
     }
 }
 protected override void OnMouseRightPress(UIMouse mouse)
 {
 }
 protected override void OnMouseLeftPress(UIMouse mouse)
 {
     if (knob.Contains(mouse.ScreenPositionP))
         dragging = true;
 }
Beispiel #40
0
 public override void Unregister(UIMouse mouse)
 {
     base.Unregister(mouse);
     dragging = false;
 }
 protected abstract void OnMouseLeftPress(UIMouse mouse);
 protected abstract void OnMouseLeftRelease(UIMouse mouse);
 protected abstract void OnMouseLeftRelease(UIMouse mouse);
 protected abstract void OnMouseRightPress(UIMouse mouse);
 protected abstract void OnMouseRightRelease(UIMouse mouse);
 protected abstract void OnMouseRightRelease(UIMouse mouse);
 protected override void OnMouseLeftRelease(UIMouse mouse)
 {
 }
 protected virtual void OnMouseMove(UIMouse mouse) 
 {
     if (area.Contains(mouse.ScreenPositionP))
         hovering = true;
     else
         hovering = false;
 }
 protected override void OnMouseRightRelease(UIMouse mouse)
 {
 }
 public override void Unregister(UIMouse mouse)
 {
     base.Unregister(mouse);
     dragging = false;
 }