Exemplo n.º 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);
             * }*/
        }
Exemplo n.º 2
0
        public static void OnDrawTick()
        {
            GameLocation location = Game1.currentLocation;

            bool inCave = location is MineShaft || location is FarmCave;
            bool frozen = (CJBCheatsMenu.Config.FreezeTimeInside && !location.IsOutdoors && !inCave) || (CJBCheatsMenu.Config.FreezeTimeCaves && inCave);

            frozen = frozen || CJBCheatsMenu.Config.FreezeTime;
            if (frozen)
            {
                CJB.DrawTextBox(5, inCave ? 100 : 5, Game1.smallFont, "Time Frozen");
            }
        }
Exemplo n.º 3
0
        public override void draw(SpriteBatch spriteBatch, int slotX, int slotY)
        {
            if (this.whichOption == -1)
            {
                SpriteText.drawString(spriteBatch, this.label, slotX + this.bounds.X, slotY + this.bounds.Y + Game1.pixelZoom * 3, 999, -1, 999, 1f, 0.1f);
                return;
            }

            string info = whichOption == 1
                ? CJB.GetWeatherNexDay()
                : "";

            Utility.drawTextWithShadow(spriteBatch, $"{this.label}: {info}", Game1.dialogueFont, new Vector2(this.bounds.X + slotX, this.bounds.Y + slotY), Game1.textColor, 1f, 0.15f);
        }
Exemplo n.º 4
0
        public override void draw(SpriteBatch spriteBatch)
        {
            if (!Game1.options.showMenuBackground)
            {
                spriteBatch.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.4f);
            }

            Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true);
            CJB.DrawTextBox(this.Title.bounds.X, this.Title.bounds.Y, Game1.borderFont, this.Title.name, 1);
            spriteBatch.End();
            spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null);
            for (int index = 0; index < this.OptionSlots.Count; ++index)
            {
                if (this.CurrentItemIndex >= 0 && this.CurrentItemIndex + index < this.Options.Count)
                {
                    this.Options[this.CurrentItemIndex + index].draw(spriteBatch, this.OptionSlots[index].bounds.X, this.OptionSlots[index].bounds.Y + 5);
                }
            }
            spriteBatch.End();
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
            if (!GameMenu.forcePreventClose)
            {
                for (int i = 0; i < this.Tabs.Count; i++)
                {
                    ClickableComponent tab = this.Tabs[i];
                    CJB.DrawTextBox(tab.bounds.X + tab.bounds.Width, tab.bounds.Y, Game1.smallFont, tab.name, 2, this.TabIndex == i ? 1F : 0.7F);
                }

                this.UpArrow.draw(spriteBatch);
                this.DownArrow.draw(spriteBatch);
                if (this.Options.Count > CheatsMenu.ItemsPerPage)
                {
                    IClickableMenu.drawTextureBox(spriteBatch, Game1.mouseCursors, new Rectangle(403, 383, 6, 6), this.ScrollbarRunner.X, this.ScrollbarRunner.Y, this.ScrollbarRunner.Width, this.ScrollbarRunner.Height, Color.White, Game1.pixelZoom, false);
                    this.Scrollbar.draw(spriteBatch);
                }
            }
            if (this.HoverText != "")
            {
                IClickableMenu.drawHoverText(spriteBatch, this.HoverText, Game1.smallFont);
            }

            if (!Game1.options.hardwareCursor)
            {
                spriteBatch.Draw(Game1.mouseCursors, new Vector2(Game1.getOldMouseX(), Game1.getOldMouseY()), Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, Game1.options.gamepadControls ? 44 : 0, 16, 16), Color.White, 0f, Vector2.Zero, Game1.pixelZoom + Game1.dialogueButtonScale / 150f, SpriteEffects.None, 1f);
            }
        }
Exemplo n.º 5
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);
            }
        }
Exemplo n.º 6
0
        public override void draw(SpriteBatch b, int slotX, int slotY)
        {
            if (this.whichOption == -1)
            {
                SpriteText.drawString(b, this.label, slotX + this.bounds.X, slotY + this.bounds.Y + Game1.pixelZoom * 3, 999, -1, 999, 1f, 0.1f, false, -1, "", -1);
                return;
            }

            string info = "";

            switch (whichOption)
            {
            case 1:
                info = CJB.getWeatherNexDay();
                break;
            }

            Utility.drawTextWithShadow(b, this.label + ": " + info, Game1.dialogueFont, new Vector2((float)(this.bounds.X + slotX), (float)(this.bounds.Y + slotY)), Game1.textColor, 1f, 0.15f, -1, -1, 1f, 3);
        }
Exemplo n.º 7
0
 private void LocationEvents_LocationsChanged(object sender, EventArgsGameLocationsChanged e)
 {
     this.Locations = CJB.GetAllLocations().ToArray();
 }
Exemplo n.º 8
0
 /*********
 ** Private methods
 *********/
 private void SaveEvents_AfterLoad(object sender, EventArgs eventArgs)
 {
     this.Locations = CJB.GetAllLocations().ToArray();
 }
Exemplo n.º 9
0
 /// <summary>Raised after a game location is added or removed.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void OnLocationListChanged(object sender, LocationListChangedEventArgs e)
 {
     this.Locations = CJB.GetAllLocations().ToArray();
 }
Exemplo n.º 10
0
 /*********
 ** Private methods
 *********/
 /// <summary>Raised after the player loads a save slot.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void OnSaveLoaded(object sender, SaveLoadedEventArgs e)
 {
     this.Locations = CJB.GetAllLocations().ToArray();
     this.Cheats.Reset();
 }
Exemplo n.º 11
0
        public override void receiveLeftClick(int x, int y)
        {
            if (this.greyedOut || this.Listening || !this.SetButtonBounds.Contains(x, y))
            {
                return;
            }
            if (!this.ButtonNames.Any())
            {
                switch (whichOption)
                {
                case 2:
                    Game1.player.money += 100;
                    Game1.soundBank.PlayCue("coin");
                    break;

                case 3:
                    Game1.player.money += 1000;
                    Game1.soundBank.PlayCue("coin");
                    break;

                case 4:
                    Game1.player.money += 10000;
                    Game1.soundBank.PlayCue("coin");
                    break;

                case 5:
                    Game1.player.money += 100000;
                    Game1.soundBank.PlayCue("coin");
                    break;

                case 6:
                    Game1.player.clubCoins += 100;
                    Game1.soundBank.PlayCue("coin");
                    break;

                case 7:
                    Game1.player.clubCoins += 1000;
                    Game1.soundBank.PlayCue("coin");
                    break;

                case 8:
                    Game1.player.clubCoins += 10000;
                    Game1.soundBank.PlayCue("coin");
                    break;

                case 9:
                    Game1.soundBank.PlayCue("glug");
                    Cheats.WaterAllFields(CJBCheatsMenu.GetAllLocations().ToArray());
                    break;

                case 10:
                    Cheats.SetWeatherForNextDay(Game1.weather_sunny);
                    break;

                case 11:
                    Cheats.SetWeatherForNextDay(Game1.weather_rain);
                    break;

                case 12:
                    Cheats.SetWeatherForNextDay(Game1.weather_lightning);
                    break;

                case 13:
                    Cheats.SetWeatherForNextDay(Game1.weather_snow);
                    break;

                case 14:
                    Game1.warpFarmer("FarmHouse", 9, 11, false);
                    Game1.exitActiveMenu();
                    break;

                case 100:
                    Game1.warpFarmer("Farm", 64, 15, false);
                    Game1.exitActiveMenu();
                    break;

                case 101:
                    Game1.warpFarmer("Town", 43, 57, false);
                    Game1.exitActiveMenu();
                    break;

                case 102:
                    Game1.warpFarmer("Town", 94, 82, false);
                    Game1.exitActiveMenu();
                    break;

                case 103:
                    Game1.warpFarmer("Town", 102, 90, false);
                    Game1.exitActiveMenu();
                    break;

                case 104:
                    Game1.warpFarmer("Town", 45, 71, false);
                    Game1.exitActiveMenu();
                    break;

                case 105:
                    Game1.warpFarmer("Town", 52, 20, false);
                    Game1.exitActiveMenu();
                    break;

                case 106:
                    Game1.warpFarmer("Mountain", 12, 26, false);
                    Game1.exitActiveMenu();
                    break;

                case 107:
                    Game1.warpFarmer("Mountain", 76, 9, false);
                    Game1.exitActiveMenu();
                    break;

                case 108:
                    Game1.warpFarmer("Mountain", 127, 12, false);
                    Game1.exitActiveMenu();
                    break;

                case 109:
                    Game1.warpFarmer("Mine", 13, 10, false);
                    Game1.exitActiveMenu();
                    break;

                case 110:
                    Game1.warpFarmer("Beach", 30, 34, false);
                    Game1.exitActiveMenu();
                    break;

                case 111:
                    Game1.warpFarmer("Beach", 87, 26, false);
                    Game1.exitActiveMenu();
                    break;

                case 112:
                    Game1.warpFarmer("Desert", 18, 28, false);
                    Game1.exitActiveMenu();
                    break;

                case 113:
                    Game1.warpFarmer("Forest", 90, 16, false);
                    Game1.exitActiveMenu();
                    break;

                case 114:
                    Game1.warpFarmer("Forest", 5, 27, false);
                    Game1.exitActiveMenu();
                    break;

                case 115:
                    Game1.warpFarmer("Forest", 34, 96, false);
                    Game1.exitActiveMenu();
                    break;

                case 116:
                    Game1.warpFarmer("Woods", 58, 15, false);
                    Game1.exitActiveMenu();
                    break;

                case 117:
                    Game1.warpFarmer("Sewer", 3, 48, false);
                    Game1.exitActiveMenu();
                    break;

                case 118:
                    Game1.warpFarmer("Railroad", 10, 57, false);
                    Game1.exitActiveMenu();
                    break;

                case 119:
                    Game1.warpFarmer("SandyHouse", 4, 8, false);
                    Game1.exitActiveMenu();
                    break;

                case 120:
                    Game1.warpFarmer("Club", 8, 11, false);
                    Game1.exitActiveMenu();
                    break;

                case 200:
                    int lvl1 = Game1.player.newLevels.Count;
                    Game1.player.gainExperience(0, CJB.GetExperiencePoints(Game1.player.farmingLevel));
                    if (lvl1 < Game1.player.newLevels.Count)
                    {
                        Game1.player.newLevels.RemoveAt(Game1.player.newLevels.Count - 1);
                    }
                    Game1.exitActiveMenu();
                    Game1.activeClickableMenu = new LevelUpMenu(0, Game1.player.farmingLevel);
                    break;

                case 201:
                    int lvl2 = Game1.player.newLevels.Count;
                    Game1.player.gainExperience(3, CJB.GetExperiencePoints(Game1.player.miningLevel));
                    if (lvl2 < Game1.player.newLevels.Count)
                    {
                        Game1.player.newLevels.RemoveAt(Game1.player.newLevels.Count - 1);
                    }
                    Game1.exitActiveMenu();
                    Game1.activeClickableMenu = new LevelUpMenu(3, Game1.player.miningLevel);
                    break;

                case 202:
                    int lvl3 = Game1.player.newLevels.Count;
                    Game1.player.gainExperience(2, CJB.GetExperiencePoints(Game1.player.foragingLevel));
                    if (lvl3 < Game1.player.newLevels.Count)
                    {
                        Game1.player.newLevels.RemoveAt(Game1.player.newLevels.Count - 1);
                    }
                    Game1.exitActiveMenu();
                    Game1.activeClickableMenu = new LevelUpMenu(2, Game1.player.foragingLevel);
                    break;

                case 203:
                    int lvl4 = Game1.player.newLevels.Count;
                    Game1.player.gainExperience(1, CJB.GetExperiencePoints(Game1.player.fishingLevel));
                    if (lvl4 < Game1.player.newLevels.Count)
                    {
                        Game1.player.newLevels.RemoveAt(Game1.player.newLevels.Count - 1);
                    }
                    Game1.exitActiveMenu();
                    Game1.activeClickableMenu = new LevelUpMenu(1, Game1.player.fishingLevel);
                    break;

                case 204:
                    int lvl5 = Game1.player.newLevels.Count;
                    Game1.player.gainExperience(4, CJB.GetExperiencePoints(Game1.player.combatLevel));
                    if (lvl5 < Game1.player.newLevels.Count)
                    {
                        Game1.player.newLevels.RemoveAt(Game1.player.newLevels.Count - 1);
                    }
                    Game1.exitActiveMenu();
                    Game1.activeClickableMenu = new LevelUpMenu(4, Game1.player.combatLevel);
                    break;

                case 205:
                    Game1.player.maxHealth          -= 5 * Game1.player.combatLevel;
                    Game1.player.experiencePoints[0] = 0;
                    Game1.player.experiencePoints[1] = 0;
                    Game1.player.experiencePoints[2] = 0;
                    Game1.player.experiencePoints[3] = 0;
                    Game1.player.experiencePoints[4] = 0;
                    Game1.player.farmingLevel        = 0;
                    Game1.player.miningLevel         = 0;
                    Game1.player.foragingLevel       = 0;
                    Game1.player.fishingLevel        = 0;
                    Game1.player.combatLevel         = 0;
                    if (Game1.player.professions.Contains(24))
                    {
                        Game1.player.maxHealth -= 15;
                    }
                    if (Game1.player.professions.Contains(27))
                    {
                        Game1.player.maxHealth -= 25;
                    }
                    Game1.player.health = Game1.player.maxHealth;
                    Game1.player.professions.Clear();
                    break;
                }
            }
            else
            {
                this.Listening = true;
                Game1.soundBank.PlayCue("breathin");
                GameMenu.forcePreventClose = true;
                this.ListenerMessage       = "Press new key...";
            }
        }