private GlobalTargetInfo CurrentTargetUnderMouse()
        {
            GlobalTargetInfo result;

            if (!this.IsTargeting)
            {
                result = GlobalTargetInfo.Invalid;
            }
            else
            {
                List <WorldObject> list = GenWorldUI.WorldObjectsUnderMouse(UI.MousePositionOnUI);
                if (list.Any <WorldObject>())
                {
                    result = list[0];
                }
                else if (this.canTargetTiles)
                {
                    int num = GenWorld.MouseTile(false);
                    if (num >= 0)
                    {
                        result = new GlobalTargetInfo(num);
                    }
                    else
                    {
                        result = GlobalTargetInfo.Invalid;
                    }
                }
                else
                {
                    result = GlobalTargetInfo.Invalid;
                }
            }
            return(result);
        }
示例#2
0
 public bool IsTargetedNow(WorldObject o, List <WorldObject> worldObjectsUnderMouse = null)
 {
     if (!this.IsTargeting)
     {
         return(false);
     }
     if (worldObjectsUnderMouse == null)
     {
         worldObjectsUnderMouse = GenWorldUI.WorldObjectsUnderMouse(UI.MousePositionOnUI);
     }
     return(worldObjectsUnderMouse.Any <WorldObject>() && o == worldObjectsUnderMouse[0]);
 }
示例#3
0
        private GlobalTargetInfo CurrentTargetUnderMouse()
        {
            if (!IsTargeting)
            {
                return(GlobalTargetInfo.Invalid);
            }
            List <WorldObject> list = GenWorldUI.WorldObjectsUnderMouse(UI.MousePositionOnUI);

            if (list.Any())
            {
                return(list[0]);
            }
            if (canTargetTiles)
            {
                int num = GenWorld.MouseTile();
                if (num >= 0)
                {
                    return(new GlobalTargetInfo(num));
                }
                return(GlobalTargetInfo.Invalid);
            }
            return(GlobalTargetInfo.Invalid);
        }
示例#4
0
        protected virtual GlobalTargetInfo CurrentTargetUnderMouse()
        {
            if (!IsTargeting)
            {
                return(GlobalTargetInfo.Invalid);
            }
            List <WorldObject> list = GenWorldUI.WorldObjectsUnderMouse(Verse.UI.MousePositionOnUI);

            if (list.Any())
            {
                return(list[0]);
            }
            if (!canTargetTiles)
            {
                return(GlobalTargetInfo.Invalid);
            }
            int num = GenWorld.MouseTile(false);

            if (num >= 0)
            {
                return(new GlobalTargetInfo(num));
            }
            return(GlobalTargetInfo.Invalid);
        }