Ejemplo n.º 1
0
        //pu.Location().X - width
        public DescriptionScreen(PickUpScreen pu, BaseItem bi, int width, int height, bool bRight = false) : base(new Microsoft.Xna.Framework.Rectangle(pu.Location().X - width, pu.Location().Y, width, height))
        {
            this.pu = pu;
            this.bi = bi;
            var temp = this.pu.Location();

            this.bRight = bRight;

            if (Location().X < 0)
            {
                ChangeLocation(new Rectangle(pu.Location().X + pu.Location().Width, pu.Location().Y, Location().Width, Location().Height));
                bRight = true;
            }

            frameBox = new Rectangle(0, 0, Location().Width, Location().Height);
            textBox  = new Rectangle(0 + 5, 0 + 5, Location().Width - 10, Location().Height - 10);
        }
        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);
        }