Beispiel #1
0
        public PickUpScreen(Rectangle locationToDrawRender, String title, PickUpEntity PUEntity) : base(locationToDrawRender)
        {
            this.PUEntity = PUEntity;
            bIsActive     = true;
            location      = new Rectangle(0, 0, locationToDrawRender.Width, locationToDrawRender.Height);

            TitleTextBox = new Rectangle(nameOffSet, new Point(locationToDrawRender.Width - nameOffSet.X * 2, 50 - nameOffSet.Y));
            this.title   = title;

            itemCollectionRenderLocation = new Rectangle(15, 62, locationToDrawRender.Width - 15 * 2, locationToDrawRender.Height - 62 - 4);

            scale           = (float)locationToDrawRender.Width / (float)panelFrameSource.Width;
            itemPanelRender = new RenderTarget2D(Game1.graphics.GraphicsDevice, itemCollectionRenderLocation.Width, itemCollectionRenderLocation.Height);

            int index = 0;

            foreach (var item in PUEntity.itemList)
            {
                lip.Add(new itemPanel(index, scale, item));
                index++;
            }

            if (lip.Count != 0)
            {
                maxVerticalModifier = lip.Last().End();
                //  ds = new DescriptionScreen(this, lip[0].getItemFromPanel(), (int)(130 * scale), (int)(190 * scale));
                // GameProcessor.popUpRenders.Add(ds);
            }
            else
            {
                maxVerticalModifier = 0;
            }
        }
        internal void HandlePickUp()
        {
            if (mapPUEntitiesInRange.Count == 1)
            {
                PUEntityHandle = mapPUEntitiesInRange[0];
            }
            if (mapPUEntitiesInRange.Count > 1)
            {
                int index = mapPUEntitiesInRange.IndexOf(PUEntityHandle);
                if (++index >= mapPUEntitiesInRange.Count)
                {
                    index = 0;
                }
                PUEntityHandle = mapPUEntitiesInRange[index];
            }


            var temp = new PickUpScreen(new Rectangle(250, 220, (int)(178 * 1.7f), (int)(226 * 1.7f)), "Inventory " + PlayerSaveData.playerInventory.localInventory.Count.ToString() + @"/" + PlayerSaveData.playerInventory.localInventoryMaxSize.ToString(), PUEntityHandle);

            GameProcessor.popUpRenders.Add(temp);
            Utilities.Control.Player.NonCombatCtrl.changeToPickUpScreen(temp);
        }
 internal void EndPickUpEntity(PickUpEntity pue)
 {
     mapPUEntities.Remove(pue);
     mapPUEntitiesInRange.Clear();
 }