示例#1
0
 internal void SetMoveGhostItem(Meubi meubi)
 {
     meubi.Hide();
     ghostMeubi = new GhostMeubi(_content, meubi.GetItemId(), meubi.GetData().id,
                                 () => { ghostMeubi = null; meubi.Show(); },
                                 () => { RetroEnvironment.GetGame().GetClientManager().SendPacket(new MoveObjectEvent(ghostMeubi.GetItemId(), (int)floorDesign.GetMouseTile(roomOffset).GetCoordinate().X, (int)floorDesign.GetMouseTile(roomOffset).GetCoordinate().Z, ghostMeubi.GetRotation())); ghostMeubi = null; });
     placeDelay.Start();
 }
示例#2
0
        public void Draw(SpriteBatch spriteBatch, float depth = 1f)
        {
            Vector2i bottomRightPos = GameScreenManager.Instance.Dimensions - new Vector2i(7, 7 + GameScreenManager.Instance.GetOverlayRenderer().GetHeight());
            Vector2i topLeftMenuPos = bottomRightPos - size;

            if (hasRights)
            {
                topLeftMenuPos -= new Vector2i(0, 25 + 7);
            }

            if (selectedItem != null)
            {
                crnLT.Draw(spriteBatch, topLeftMenuPos + new Vector2i(0, 0), depth - 0.02f);
                edgeT.Draw(spriteBatch, topLeftMenuPos + new Vector2i(crnLT.SourceRect.Width, 0), depth - 0.02f);
                crnRT.Draw(spriteBatch, topLeftMenuPos + new Vector2i(crnLT.SourceRect.Width + edgeT.SourceRect.Width, 0), depth - 0.02f);
                backdrop.Draw(spriteBatch, topLeftMenuPos + new Vector2i(0, edgeT.SourceRect.Height), depth - 0.02f);
                crnLB.Draw(spriteBatch, topLeftMenuPos + new Vector2i(0, size.Y - crnLB.SourceRect.Height), depth - 0.02f);
                edgeB.Draw(spriteBatch, topLeftMenuPos + new Vector2i(crnLB.SourceRect.Width, size.Y - edgeB.SourceRect.Height), depth - 0.02f);
                crnRB.Draw(spriteBatch, topLeftMenuPos + new Vector2i(crnLB.SourceRect.Width + edgeB.SourceRect.Width, size.Y - crnRB.SourceRect.Height), depth - 0.02f);

                close.Draw(spriteBatch, topLeftMenuPos + new Vector2i(size.X - 8 - close.SourceRect.Width, 8), depth);
                titleFnt.Draw(spriteBatch, topLeftMenuPos + new Vector2i(12, 12), depth - 0.01f);
                divider1.Draw(spriteBatch, topLeftMenuPos + new Vector2i(10, 30), depth - 0.01f);

                preview.Draw(spriteBatch, topLeftMenuPos + new Vector2i(10, 36) + new Vector2i((size.X / 2) - (preview.GetTexture().Width / 2), (previewAreaHeight / 2) - (preview.GetTexture().Height / 2)), depth - 0.01f);
                divider2.Draw(spriteBatch, topLeftMenuPos + new Vector2i(10, 42 + previewAreaHeight), depth - 0.01f);

                descFnt.Draw(spriteBatch, topLeftMenuPos + new Vector2i(12, 42 + previewAreaHeight) + new Vector2i(0, (24 / 2) - (descFnt.measureString().Y / 2)), depth - 0.01f);
                divider3.Draw(spriteBatch, topLeftMenuPos + new Vector2i(10, 66 + previewAreaHeight), depth - 0.01f);

                userProfile.Draw(spriteBatch, topLeftMenuPos + new Vector2i(10, 66 + previewAreaHeight) + new Vector2i(0, (24 / 2) - (userProfile.SourceRect.Height / 2)), depth - 0.01f);
                userFnt.Draw(spriteBatch, topLeftMenuPos + new Vector2i(30, 66 + previewAreaHeight) + new Vector2i(0, (24 / 2) - (userFnt.measureString().Y / 2)), depth - 0.01f);
            }

            if (hasRights && selectedItem != null)
            {
                Vector2i rightTopButtonPosition = bottomRightPos;
                Vector2i offset = new Vector2i(0, 25);

                if (selectedItem.GetData().interactions > 1)
                {
                    offset += new Vector2i(useBtn.SourceRect.Width, 0);
                    useBtn.Draw(spriteBatch, rightTopButtonPosition - offset, depth - 0.02f);
                    useFnt.Draw(spriteBatch, rightTopButtonPosition - offset + new Vector2i((useBtn.SourceRect.Width / 2) - (useFnt.measureString().X / 2), (useBtn.SourceRect.Height / 2) - (useFnt.measureString().Y / 2)), depth - 0.01f);
                    offset += new Vector2i(10, 0);
                }

                offset += new Vector2i(pickupBtn.SourceRect.Width, 0);
                pickupBtn.Draw(spriteBatch, rightTopButtonPosition - offset, depth - 0.02f);
                pickupFnt.Draw(spriteBatch, rightTopButtonPosition - offset + new Vector2i((pickupBtn.SourceRect.Width / 2) - (pickupFnt.measureString().X / 2), (pickupBtn.SourceRect.Height / 2) - (pickupFnt.measureString().Y / 2)), depth - 0.01f);
                offset += new Vector2i(10, 0);

                if (selectedItem.GetData().rotations > 1)
                {
                    offset += new Vector2i(rotateBtn.SourceRect.Width, 0);
                    rotateBtn.Draw(spriteBatch, rightTopButtonPosition - offset, depth - 0.02f);
                    rotateFnt.Draw(spriteBatch, rightTopButtonPosition - offset + new Vector2i((rotateBtn.SourceRect.Width / 2) - (rotateFnt.measureString().X / 2), (rotateBtn.SourceRect.Height / 2) - (rotateFnt.measureString().Y / 2)), depth - 0.01f);
                    offset += new Vector2i(10, 0);
                }

                offset += new Vector2i(moveBtn.SourceRect.Width, 0);
                moveBtn.Draw(spriteBatch, rightTopButtonPosition - offset, depth - 0.02f);
                moveFnt.Draw(spriteBatch, rightTopButtonPosition - offset + new Vector2i((moveBtn.SourceRect.Width / 2) - (moveFnt.measureString().X / 2), (moveBtn.SourceRect.Height / 2) - (moveFnt.measureString().Y / 2)), depth - 0.01f);
            }
        }