Пример #1
0
        public static bool Prefix(Vector2 offset, bool useWindowStack)
        {
            Tip  tip    = TipDatabase.CurrentTip;
            Rect canvas = new Rect(offset.x, offset.y, WindowWidth, tip.Height(WindowWidth));

            // set bottomLeft, so we know where the mod info panel thing starts.
            bottomLeft = canvas.BottomLeft();

            // draw window contents
            if (useWindowStack)
            {
                // using window stack when available
                Find.WindowStack.ImmediateWindow(62893997, canvas, WindowLayer.Super,
                                                 delegate { tip.Draw(canvas.AtZero()); });
            }
            else
            {
                // and manually otherwise
                Widgets.DrawShadowAround(canvas);
                Widgets.DrawWindowBackground(canvas);
                tip.Draw(canvas);
            }

            // this replaces the vanilla version completely, so return false.
            return(false);
        }
Пример #2
0
        public void Draw(SpriteBatch spriteBatch)
        {
            if (SelectedPart != null)
            {
                if (State == CursorState.Rotate)
                {
                    spriteBatch.Draw(CursorTexture, SelectedPart.WorldOrigin, SourceRectangles[3].SourceRect, Color.White);
                }
            }

            //Draw the cursor.
            if (ShowToolTip)
            {
                Tip.Draw(spriteBatch);
            }
            spriteBatch.Draw(CursorTexture, new Vector2(Position.X, Position.Y), SourceRectangles[(int)State].SourceRect, Color.White, 0f, new Vector2(0, 0), 1, SpriteEffects.None, 0f);
        }