예제 #1
0
 public override void HandleInput(InputControl input, bool inFocus)
 {
     if (!Locked && inFocus)
     {
         Texture2D texture = Source;
         if (!isItemInUse)
         {
             if (input.MouseX() > Position.X && input.MouseX() < (Position.X + texture.Width) && input.MouseY() > Position.Y && input.MouseY() < (Position.Y + texture.Height))
             {
                 if (input.MouseReleased(1))
                 {
                     isItemInUse = true;
                 }
             }
         }
         else
         {
             if (input.MouseX() > Position.X && input.MouseX() < (Position.X + texture.Width) && input.MouseY() > Position.Y && input.MouseY() < (Position.Y + texture.Height))
             {
                 if (input.MouseReleased(1))
                 {
                     isItemInUse = false;
                 }
             }
             for (int i = 0; i < values.Count(); i++)
             {
                 if (input.MouseX() > Position.X && input.MouseX() < (Position.X + texture.Width) && input.MouseY() > Position.Y + (texture.Height * (i + 1))
                     && input.MouseY() < (Position.Y + texture.Height + (texture.Height * (i + 1))))
                 {
                     if (input.MouseReleased(1))
                     {
                         isItemInUse = false;
                         current = i;
                     }
                 }
             }
         }
     }
 }