Example #1
0
 public void OnMouseInput( MouseInput input )
 {
     Sync.CheckSyncUnchanged( world, () =>
     {
         Widget.HandleInput( input );
     } );
 }
Example #2
0
 public void OnMouseInput(MouseInput input)
 {
 }
Example #3
0
 public void OnMouseInput(MouseInput input)
 {
     Sync.CheckSyncUnchanged(world, () => Ui.HandleInput(input));
 }
Example #4
0
        public Order Order( int2 xy, MouseInput mi )
        {
            if (Owner != World.LocalPlayer)
                return null;

            if (!World.Map.IsInMap(xy.X, xy.Y))
                return null;

            var underCursor = World.FindUnitsAtMouse(mi.Location).FirstOrDefault();

            if (underCursor != null && !underCursor.traits.Contains<Selectable>())
                underCursor = null;

            return traits.WithInterface<IIssueOrder>()
                .Select( x => x.IssueOrder( this, xy, mi, underCursor ) )
                .FirstOrDefault( x => x != null );
        }
Example #5
0
		public bool HandleInput(World world, MouseInput mi)
		{
			if (selectedWidget != null)
				return selectedWidget.HandleInput(mi);
				
			if (rootWidget.HandleInput(mi))
				return true;
			
			if (mi.Event == MouseInputEvent.Move)
				lastMousePos = mi.Location;

			var action = buttons.Where(a => a.First.Contains(mi.Location.ToPoint()))
				.Select(a => a.Second).FirstOrDefault();

			if (action == null)
				return false;

			if (mi.Event == MouseInputEvent.Down)
				action(mi.Button == MouseButton.Left);

			return true;
		}
Example #6
0
 public void OnMouseInput(MouseInput input)
 {
     Sync.CheckSyncUnchanged(world, () => Ui.HandleInput(input));
 }
Example #7
0
 public void OnMouseInput(MouseInput input)
 {
 }
Example #8
0
 public void OnMouseInput(MouseInput input)
 {
     Sync.RunUnsynced(Game.Settings.Debug.SyncCheckUnsyncedCode, world, () => Ui.HandleInput(input));
 }