Example #1
0
 private void GetObjsUnderPointFromList(IMapleList list, Point locationVirtualPos, ref BoardItem itemUnderPoint, ref BoardItem selectedUnderPoint, ref bool selectedItemHigher)
 {
     if (!list.IsItem) 
         return;
     SelectionInfo sel = selectedBoard.GetUserSelectionInfo();
     if (list.ListType == ItemTypes.None)
     {
         for (int i = 0; i < list.Count; i++)
         {
             BoardItem item = (BoardItem)list[i];
             if ((selectedBoard.EditedTypes & item.Type) != item.Type) continue;
             if (IsPointInsideRectangle(locationVirtualPos, item.Left, item.Top, item.Right, item.Bottom) 
                 && !(item is HaCreator.MapEditor.Input.Mouse) 
                 && item.CheckIfLayerSelected(sel)
                 && !item.IsPixelTransparent(locationVirtualPos.X - item.Left, locationVirtualPos.Y - item.Top))
             {
                 if (item.Selected)
                 {
                     selectedUnderPoint = item;
                     selectedItemHigher = true;
                 }
                 else
                 {
                     itemUnderPoint = item;
                     selectedItemHigher = false;
                 }
             }
         }
     }
     else if ((selectedBoard.EditedTypes & list.ListType) == list.ListType)
     {
         for (int i = 0; i < list.Count; i++)
         {
             BoardItem item = (BoardItem)list[i];
             if (IsPointInsideRectangle(locationVirtualPos, item.Left, item.Top, item.Right, item.Bottom) 
                 && !(item is HaCreator.MapEditor.Input.Mouse) 
                 && !(item is HaCreator.MapEditor.Input.Mouse) 
                 && item.CheckIfLayerSelected(sel) 
                 && !item.IsPixelTransparent(locationVirtualPos.X - item.Left, locationVirtualPos.Y - item.Top))
             {
                 if (item.Selected)
                 {
                     selectedUnderPoint = item;
                     selectedItemHigher = true;
                 }
                 else
                 {
                     itemUnderPoint = item;
                     selectedItemHigher = false;
                 }
             }
         }
     }
 }
Example #2
0
 private void GetObjsUnderPointFromList(IMapleList list, Point locationVirtualPos, ref BoardItem itemUnderPoint, ref BoardItem selectedUnderPoint, ref bool selectedItemHigher)
 {
     if (!list.Selectable)
     {
         return;
     }
     if (list.ListType == ItemTypes.None)
     {
         for (int i = 0; i < list.Count; i++)
         {
             BoardItem item = (BoardItem)list[i];
             if ((ApplicationSettings.editedTypes & item.Type) != item.Type)
             {
                 continue;
             }
             if (IsPointInsideRectangle(locationVirtualPos, item.Left, item.Top, item.Right, item.Bottom) && !(item is Mouse) && (selectedBoard.SelectedLayerIndex == -1 || item.CheckIfLayerSelected(selectedBoard.SelectedLayerIndex)) && !item.IsPixelTransparent(locationVirtualPos.X - item.Left, locationVirtualPos.Y - item.Top))
             {
                 if (item.Selected)
                 {
                     selectedUnderPoint = item;
                     selectedItemHigher = true;
                 }
                 else
                 {
                     itemUnderPoint     = item;
                     selectedItemHigher = false;
                 }
             }
         }
     }
     else if ((ApplicationSettings.editedTypes & list.ListType) == list.ListType)
     {
         for (int i = 0; i < list.Count; i++)
         {
             BoardItem item = (BoardItem)list[i];
             if (IsPointInsideRectangle(locationVirtualPos, item.Left, item.Top, item.Right, item.Bottom) && !(item is Mouse) && !(item is Mouse) && (selectedBoard.SelectedLayerIndex == -1 || item.CheckIfLayerSelected(selectedBoard.SelectedLayerIndex)) && !item.IsPixelTransparent(locationVirtualPos.X - item.Left, locationVirtualPos.Y - item.Top))
             {
                 if (item.Selected)
                 {
                     selectedUnderPoint = item;
                     selectedItemHigher = true;
                 }
                 else
                 {
                     itemUnderPoint     = item;
                     selectedItemHigher = false;
                 }
             }
         }
     }
 }