示例#1
0
        public static void onDrawTick()
        {
            GameLocation loc = Game1.currentLocation;

            bool inCave = (loc is MineShaft || loc is FarmCave);
            bool frozen = (CJBCheatsMenu.config.freezeTimeInside && !loc.IsOutdoors && !inCave) || (CJBCheatsMenu.config.freezeTimeCaves && inCave);

            frozen = (frozen || CJBCheatsMenu.config.freezeTime);
            if (frozen)
            {
                CJB.drawTextBox(5, inCave ? 100 : 5, Game1.smallFont, "Time Frozen");
            }

            /*
             * int xTile = (Game1.viewport.X + Game1.getOldMouseX()) / Game1.tileSize;
             * int yTile = (Game1.viewport.Y + Game1.getOldMouseY()) / Game1.tileSize;
             *
             * Vector2 tile = new Vector2(xTile, yTile);
             *
             * if (Game1.currentLocation.objects.ContainsKey(tile)) {
             *  int time = Game1.currentLocation.objects[tile].minutesUntilReady;
             *  if (time > 0)
             *      CJB.drawTextBox(5, inCave ? 100 : 5, Game1.smallFont, "Ready in: " + time);
             * }*/
        }
示例#2
0
        public override void draw(SpriteBatch b)
        {
            if (!Game1.options.showMenuBackground)
            {
                b.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.4f);
            }
            Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true, null, false);
            CJB.drawTextBox(title.bounds.X, title.bounds.Y, Game1.borderFont, title.name, 1, 1.0f);
            b.End();
            b.Begin(SpriteSortMode.FrontToBack, BlendState.NonPremultiplied, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null);
            for (int index = 0; index < Enumerable.Count <ClickableComponent>((IEnumerable <ClickableComponent>) this.optionSlots); ++index)
            {
                if (currentItemIndex >= 0 && currentItemIndex + index < Enumerable.Count <OptionsElement>((IEnumerable <OptionsElement>) this.options))
                {
                    this.options[currentItemIndex + index].draw(b, this.optionSlots[index].bounds.X, this.optionSlots[index].bounds.Y + 5);
                }
            }
            b.End();
            b.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null);
            if (!GameMenu.forcePreventClose)
            {
                for (int i = 0; i < tabs.Count(); i++)
                {
                    ClickableComponent current = tabs[i];
                    CJB.drawTextBox(current.bounds.X + current.bounds.Width, current.bounds.Y, Game1.smallFont, current.name, 2, tab == i ? 1F : 0.7F);
                }

                this.upArrow.draw(b);
                this.downArrow.draw(b);
                if (this.options.Count() > itemsPerPage)
                {
                    IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(403, 383, 6, 6), this.scrollBarRunner.X, this.scrollBarRunner.Y, this.scrollBarRunner.Width, this.scrollBarRunner.Height, Color.White, (float)Game1.pixelZoom, false);
                    this.scrollBar.draw(b);
                }
            }
            if (!this.hoverText.Equals(""))
            {
                IClickableMenu.drawHoverText(b, this.hoverText, Game1.smallFont, 0, 0, -1, (string)null, -1, (string[])null, (Item)null, 0, -1, -1, -1, -1, 1f, (CraftingRecipe)null);
            }

            if (!Game1.options.hardwareCursor)
            {
                b.Draw(Game1.mouseCursors, new Vector2((float)Game1.getOldMouseX(), (float)Game1.getOldMouseY()), new Rectangle?(Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, Game1.options.gamepadControls ? 44 : 0, 16, 16)), Color.White, 0f, Vector2.Zero, (float)Game1.pixelZoom + Game1.dialogueButtonScale / 150f, SpriteEffects.None, 1f);
            }
        }