示例#1
0
 public void OnMouseInput( MouseInput input )
 {
     Sync.CheckSyncUnchanged( world, () =>
     {
         Widget.HandleInput( input );
     } );
 }
示例#2
0
 public void OnMouseInput(MouseInput input)
 {
 }
示例#3
0
 public void OnMouseInput(MouseInput input)
 {
     Sync.CheckSyncUnchanged(world, () => Ui.HandleInput(input));
 }
示例#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 );
        }
示例#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;
		}
示例#6
0
 public void OnMouseInput(MouseInput input)
 {
     Sync.CheckSyncUnchanged(world, () => Ui.HandleInput(input));
 }
示例#7
0
 public void OnMouseInput(MouseInput input)
 {
 }
示例#8
0
 public void OnMouseInput(MouseInput input)
 {
     Sync.RunUnsynced(Game.Settings.Debug.SyncCheckUnsyncedCode, world, () => Ui.HandleInput(input));
 }