public void SetCharacterRenderer(OldCharacterRenderer rend)
        {
            m_rend = rend;
            //update draw location
            Rectangle rendRect = rend.DrawAreaWithOffset;

            DrawLocation = new Vector2(rendRect.Right + 20, rendRect.Y + rend.TopPixel);

            if (DrawAreaWithOffset.Right > Game.GraphicsDevice.PresentationParameters.BackBufferWidth - 15)
            {
                //case: goes off the right side of the screen, show on the left
                DrawLocation = new Vector2(rendRect.X - DrawArea.Width - 20, drawLocation.Y);
            }
            //MAGIC NUMBER: 308px is the bottom of the display area for map stuff
            if (DrawAreaWithOffset.Bottom > 308)
            {
                //case: goes off bottom of the screen, adjust new rectangle so it is above 308
                DrawLocation = new Vector2(drawLocation.X, 298 - DrawArea.Height);
            }
            else if (DrawAreaWithOffset.Y < 25)
            {
                //case: goes off top of screen, adjust new rectangle so it aligns with top of character head
                DrawLocation = new Vector2(drawLocation.X, 35);
            }

            EOGame.Instance.Hud.SetStatusLabel(EOResourceID.STATUS_LABEL_TYPE_ACTION, EOResourceID.STATUS_LABEL_MENU_BELONGS_TO_PLAYER, m_rend.Character.Name);

            Visible = true;
        }
        private Rectangle GetTargetRectangle(OldCharacterRenderer character)
        {
            //Because the rendering code is terrible, the character rectangle needs an additional offset
            var rect = character.DrawAreaWithOffset;

            rect.Offset(6, 11);
            return(rect);
        }
Exemple #3
0
        public void ResetGameElements()
        {
            if (m_mapRender != null)
            {
                m_mapRender.Dispose();
                m_mapRender = null;
            }

            if (m_charRender != null)
            {
                m_charRender.Dispose();
                m_charRender = null;
            }

            if (MapCache != null)
            {
                MapCache.Clear();
            }
        }
 public void ShowContextMenu(OldCharacterRenderer player)
 {
     _contextMenu.SetCharacterRenderer(player);
 }
 public EffectRenderer(INativeGraphicsManager gfxManager,
                       OldCharacterRenderer character,
                       Action cleanupAction = null)
     : this(gfxManager, (DrawableGameComponent)character, cleanupAction)
 {
 }