Esempio n. 1
0
        public override void Update(MouseState Mouse, KeyboardState KeyBoard, GameTime gameTime, int cX, int cY)
        {
            for (int Column = 0; Column < ColumnCount; Column++) //X
            {
                for (int Row = 0; Row < RowCount; Row++)         //Y
                {
                    int ItemKey = Row * ColumnCount + Column;

                    if (ItemKey < inventory.Slots.Length)
                    {
                        //GameObjectsManager.Items[Inventory.Slots[ItemKey].ID].Variant[Inventory.Slots[ItemKey].Variant].Draw(spriteBatch, new Rectangle(SizeBox.X + cX + Column * 64 + 16, SizeBox.Y + cY + Row * 64 + 16, 32, 32), Color.White, gameTime);

                        if (new Rectangle(SizeBox.X + cX + Column * 64 + 16, SizeBox.Y + cY + Row * 64 + 16, 32, 32).Contains(Engine.MouseCursor.MouseLocation))
                        {
                            if (lastMouseState.LeftButton == ButtonState.Pressed && currentMouseState.LeftButton == ButtonState.Released)
                            {
                                Inventory.ObjItem s = inventory.Slots[ItemKey];
                                inventory.Slots[ItemKey] = Engine.MouseCursor.Item;

                                Engine.MouseCursor.Item = s;
                            }
                        }
                    }
                }
            }

            base.Update(Mouse, KeyBoard, gameTime, cX, cY);
        }
Esempio n. 2
0
 public Recipe(Inventory.ObjItem _Result, Inventory.ObjItem[] _Needs)
 {
     Result = _Result;
     Needs  = _Needs;
 }