Esempio n. 1
0
        public void WaterAllFields()
        {
            foreach (GameLocation location in CJB.GetAllLocations())
            {
                if (!location.IsFarm && !location.IsGreenhouse)
                {
                    continue;
                }

                foreach (TerrainFeature terrainFeature in location.terrainFeatures.Values)
                {
                    if (terrainFeature is HoeDirt dirt)
                    {
                        dirt.state.Value = HoeDirt.watered;
                    }
                }

                foreach (IndoorPot pot in location.objects.Values.OfType <IndoorPot>())
                {
                    if (pot.hoeDirt.Value is HoeDirt dirt)
                    {
                        dirt.state.Value        = HoeDirt.watered;
                        pot.showNextIndex.Value = true;
                    }
                }
            }
        }
Esempio n. 2
0
 public void OnDrawTick(ITranslationHelper i18n)
 {
     if (this.ShouldFreezeTime(Game1.currentLocation, out bool isCave))
     {
         CJB.DrawTextBox(5, isCave ? 100 : 5, Game1.smallFont, i18n.Get("messages.time-frozen"));
     }
 }
Esempio n. 3
0
        public void OnDrawTick(ITranslationHelper i18n)
        {
            GameLocation location = Game1.currentLocation;

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

            frozen = frozen || this.Config.FreezeTime;
            if (frozen)
            {
                CJB.DrawTextBox(5, inCave ? 100 : 5, Game1.smallFont, i18n.Get("messages.time-frozen"));
            }
        }
Esempio 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.dialogueFont, 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)
            {
                foreach (ClickableComponent tab in this.Tabs)
                {
                    MenuTab tabID = this.GetTabID(tab);
                    CJB.DrawTextBox(tab.bounds.X + tab.bounds.Width, tab.bounds.Y, Game1.smallFont, tab.label, 2, this.CurrentTab == tabID ? 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);
            }
        }
Esempio n. 5
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 (this.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");
                    this.Cheats.WaterAllFields(CJB.GetAllLocations().ToArray());
                    break;

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

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

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

                case 13:
                    this.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       = this.PressNewKeyLabel;
            }
        }
Esempio n. 6
0
        /*********
        ** Public methods
        *********/
        public CheatsMenu(MenuTab tabIndex, ModConfig config, Cheats cheats, ITranslationHelper i18n)
            : base(Game1.viewport.Width / 2 - (600 + IClickableMenu.borderWidth * 2) / 2, Game1.viewport.Height / 2 - (600 + IClickableMenu.borderWidth * 2) / 2, 800 + IClickableMenu.borderWidth * 2, 600 + IClickableMenu.borderWidth * 2)
        {
            this.Config            = config;
            this.Cheats            = cheats;
            this.TranslationHelper = i18n;

            this.Title      = new ClickableComponent(new Rectangle(this.xPositionOnScreen + this.width / 2, this.yPositionOnScreen, Game1.tileSize * 4, Game1.tileSize), i18n.Get("title"));
            this.CurrentTab = tabIndex;

            {
                int i           = 0;
                int labelX      = (int)(this.xPositionOnScreen - Game1.tileSize * 4.8f);
                int labelY      = (int)(this.yPositionOnScreen + Game1.tileSize * 1.5f);
                int labelHeight = (int)(Game1.tileSize * 0.9F);

                this.Tabs.Add(new ClickableComponent(new Rectangle(labelX, labelY + labelHeight * i++, Game1.tileSize * 5, Game1.tileSize), MenuTab.PlayerAndTools.ToString(), i18n.Get("tabs.player-and-tools")));
                this.Tabs.Add(new ClickableComponent(new Rectangle(labelX, labelY + labelHeight * i++, Game1.tileSize * 5, Game1.tileSize), MenuTab.FarmAndFishing.ToString(), i18n.Get("tabs.farm-and-fishing")));
                this.Tabs.Add(new ClickableComponent(new Rectangle(labelX, labelY + labelHeight * i++, Game1.tileSize * 5, Game1.tileSize), MenuTab.Skills.ToString(), i18n.Get("tabs.skills")));
                this.Tabs.Add(new ClickableComponent(new Rectangle(labelX, labelY + labelHeight * i++, Game1.tileSize * 5, Game1.tileSize), MenuTab.Weather.ToString(), i18n.Get("tabs.weather")));
                this.Tabs.Add(new ClickableComponent(new Rectangle(labelX, labelY + labelHeight * i++, Game1.tileSize * 5, Game1.tileSize), MenuTab.Relationships.ToString(), i18n.Get("tabs.relationships")));
                this.Tabs.Add(new ClickableComponent(new Rectangle(labelX, labelY + labelHeight * i++, Game1.tileSize * 5, Game1.tileSize), MenuTab.WarpLocations.ToString(), i18n.Get("tabs.warp")));
                this.Tabs.Add(new ClickableComponent(new Rectangle(labelX, labelY + labelHeight * i++, Game1.tileSize * 5, Game1.tileSize), MenuTab.Time.ToString(), i18n.Get("tabs.time")));
                this.Tabs.Add(new ClickableComponent(new Rectangle(labelX, labelY + labelHeight * i++, Game1.tileSize * 5, Game1.tileSize), MenuTab.Quests.ToString(), i18n.Get("tabs.quests")));
                this.Tabs.Add(new ClickableComponent(new Rectangle(labelX, labelY + labelHeight * i, Game1.tileSize * 5, Game1.tileSize), MenuTab.Controls.ToString(), i18n.Get("tabs.controls")));
            }

            this.UpArrow         = new ClickableTextureComponent("up-arrow", new Rectangle(this.xPositionOnScreen + this.width + Game1.tileSize / 4, this.yPositionOnScreen + Game1.tileSize, 11 * Game1.pixelZoom, 12 * Game1.pixelZoom), "", "", Game1.mouseCursors, new Rectangle(421, 459, 11, 12), Game1.pixelZoom);
            this.DownArrow       = new ClickableTextureComponent("down-arrow", new Rectangle(this.xPositionOnScreen + this.width + Game1.tileSize / 4, this.yPositionOnScreen + this.height - Game1.tileSize, 11 * Game1.pixelZoom, 12 * Game1.pixelZoom), "", "", Game1.mouseCursors, new Rectangle(421, 472, 11, 12), Game1.pixelZoom);
            this.Scrollbar       = new ClickableTextureComponent("scrollbar", new Rectangle(this.UpArrow.bounds.X + Game1.pixelZoom * 3, this.UpArrow.bounds.Y + this.UpArrow.bounds.Height + Game1.pixelZoom, 6 * Game1.pixelZoom, 10 * Game1.pixelZoom), "", "", Game1.mouseCursors, new Rectangle(435, 463, 6, 10), Game1.pixelZoom);
            this.ScrollbarRunner = new Rectangle(this.Scrollbar.bounds.X, this.UpArrow.bounds.Y + this.UpArrow.bounds.Height + Game1.pixelZoom, this.Scrollbar.bounds.Width, this.height - Game1.tileSize * 2 - this.UpArrow.bounds.Height - Game1.pixelZoom * 2);
            for (int i = 0; i < CheatsMenu.ItemsPerPage; i++)
            {
                this.OptionSlots.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4, this.yPositionOnScreen + Game1.tileSize * 5 / 4 + Game1.pixelZoom + i * ((this.height - Game1.tileSize * 2) / CheatsMenu.ItemsPerPage), this.width - Game1.tileSize / 2, (this.height - Game1.tileSize * 2) / CheatsMenu.ItemsPerPage + Game1.pixelZoom), string.Concat(i)));
            }

            int slotWidth = this.OptionSlots[0].bounds.Width;

            switch (this.CurrentTab)
            {
            case MenuTab.PlayerAndTools:
                this.Options.Add(new OptionsElement($"{i18n.Get("player.title")}:"));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("player.infinite-stamina"), config.InfiniteStamina, value => config.InfiniteStamina             = value));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("player.infinite-health"), config.InfiniteHealth, value => config.InfiniteHealth                = value));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("player.increased-movement-speed"), config.IncreasedMovement, value => config.IncreasedMovement = value));
                this.Options.Add(new CheatsOptionsSlider(i18n.Get("player.movement-speed"), this.Config.MoveSpeed, 10, value => this.Config.MoveSpeed               = value, disabled: () => !this.Config.IncreasedMovement));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("player.one-hit-kill"), config.OneHitKill, value => config.OneHitKill       = value));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("player.max-daily-luck"), config.MaxDailyLuck, value => config.MaxDailyLuck = value));

                this.Options.Add(new OptionsElement($"{i18n.Get("tools.title")}:"));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("tools.infinite-water"), config.InfiniteWateringCan, value => config.InfiniteWateringCan = value));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("tools.one-hit-break"), config.OneHitBreak, value => config.OneHitBreak           = value));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("tools.harvest-with-sickle"), config.HarvestSickle, value => config.HarvestSickle = value));

                this.Options.Add(new OptionsElement($"{i18n.Get("money.title")}:"));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("money.add-amount", new { amount = 100 }), 2, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("money.add-amount", new { amount = 1000 }), 3, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("money.add-amount", new { amount = 10000 }), 4, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("money.add-amount", new { amount = 100000 }), 5, slotWidth, config, cheats, i18n));

                this.Options.Add(new OptionsElement($"{i18n.Get("casino-coins.title")}:"));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("casino-coins.add-amount", new { amount = 100 }), 6, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("casino-coins.add-amount", new { amount = 1000 }), 7, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("casino-coins.add-amount", new { amount = 10000 }), 8, slotWidth, config, cheats, i18n));
                break;

            case MenuTab.FarmAndFishing:
                this.Options.Add(new OptionsElement($"{i18n.Get("farm.title")}:"));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("farm.water-all-fields"), 9, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("farm.durable-fences"), config.DurableFences, value => config.DurableFences = value));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("farm.instant-build"), config.InstantBuild, value => config.InstantBuild    = value));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("farm.always-auto-feed"), config.AutoFeed, value => config.AutoFeed         = value));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("farm.infinite-hay"), config.InfiniteHay, value => config.InfiniteHay       = value));

                this.Options.Add(new OptionsElement($"{i18n.Get("fishing.title")}:"));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("fishing.instant-catch"), config.InstantCatch, value => config.InstantCatch = value));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("fishing.instant-bite"), config.InstantBite, value => config.InstantBite    = value));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("fishing.always-throw-max-distance"), config.ThrowBobberMax, value => config.ThrowBobberMax = value));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("fishing.always-treasure"), config.AlwaysTreasure, value => config.AlwaysTreasure           = value));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("fishing.durable-tackles"), config.DurableTackles, value => config.DurableTackles           = value));

                this.Options.Add(new OptionsElement($"{i18n.Get("fast-machines.title")}:"));
                {
                    IList <CheatsOptionsCheckbox> machines = new[]
                    {
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.cask"), config.FastCask, value => config.FastCask          = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.furnace"), config.FastFurnace, value => config.FastFurnace = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.recycling-machine"), config.FastRecyclingMachine, value => config.FastRecyclingMachine = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.crystalarium"), config.FastCrystalarium, value => config.FastCrystalarium        = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.incubator"), config.FastIncubator, value => config.FastIncubator                 = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.slime-incubator"), config.FastSlimeIncubator, value => config.FastSlimeIncubator = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.keg"), config.FastKeg, value => config.FastKeg = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.preserves-jar"), config.FastPreservesJar, value => config.FastPreservesJar = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.cheese-press"), config.FastCheesePress, value => config.FastCheesePress    = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.mayonnaise-machine"), config.FastMayonnaiseMachine, value => config.FastMayonnaiseMachine = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.loom"), config.FastLoom, value => config.FastLoom = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.oil-maker"), config.FastOilMaker, value => config.FastOilMaker                 = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.seed-maker"), config.FastSeedMaker, value => config.FastSeedMaker              = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.charcoal-kiln"), config.FastCharcoalKiln, value => config.FastCharcoalKiln     = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.slime-egg-press"), config.FastSlimeEggPress, value => config.FastSlimeEggPress = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.tapper"), config.FastTapper, value => config.FastTapper = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.lightning-rod"), config.FastLightningRod, value => config.FastLightningRod = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.bee-house"), config.FastBeeHouse, value => config.FastBeeHouse             = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.mushroom-box"), config.FastMushroomBox, value => config.FastMushroomBox    = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.worm-bin"), config.FastWormBin, value => config.FastWormBin        = value),
                        new CheatsOptionsCheckbox(i18n.Get("fast-machines.fruit-trees"), config.FastFruitTree, value => config.FastFruitTree = value)
                    };
                    this.Options.AddRange(machines.OrderBy(p => p.label));
                }
                break;

            case MenuTab.Skills:
                this.Options.Add(new OptionsElement($"{i18n.Get("skills.title")}:"));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("skills.increase-farming"), 200, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("skills.increase-mining"), 201, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("skills.increase-foraging"), 202, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("skills.increase-fishing"), 203, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("skills.increase-combat"), 204, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("skills.reset"), 205, slotWidth, config, cheats, i18n));
                this.Options.Add(new OptionsElement($"{i18n.Get("professions.title")}:"));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.combat.fighter"), this.GetProfession(SFarmer.fighter), value => this.SetProfession(SFarmer.fighter, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.combat.scout"), this.GetProfession(SFarmer.scout), value => this.SetProfession(SFarmer.scout, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.combat.acrobat"), this.GetProfession(SFarmer.acrobat), value => this.SetProfession(SFarmer.acrobat, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.combat.brute"), this.GetProfession(SFarmer.brute), value => this.SetProfession(SFarmer.brute, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.combat.defender"), this.GetProfession(SFarmer.defender), value => this.SetProfession(SFarmer.defender, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.combat.desperado"), this.GetProfession(SFarmer.desperado), value => this.SetProfession(SFarmer.desperado, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.farming.rancher"), this.GetProfession(SFarmer.rancher), value => this.SetProfession(SFarmer.rancher, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.farming.tiller"), this.GetProfession(SFarmer.tiller), value => this.SetProfession(SFarmer.tiller, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.farming.agriculturist"), this.GetProfession(SFarmer.agriculturist), value => this.SetProfession(SFarmer.agriculturist, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.farming.artisan"), this.GetProfession(SFarmer.artisan), value => this.SetProfession(SFarmer.artisan, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.farming.coopmaster"), this.GetProfession(SFarmer.butcher), value => this.SetProfession(SFarmer.butcher, value)));     // butcher = coopmaster
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.farming.shepherd"), this.GetProfession(SFarmer.shepherd), value => this.SetProfession(SFarmer.shepherd, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.fishing.fisher"), this.GetProfession(SFarmer.fisher), value => this.SetProfession(SFarmer.fisher, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.fishing.trapper"), this.GetProfession(SFarmer.trapper), value => this.SetProfession(SFarmer.trapper, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.fishing.angler"), this.GetProfession(SFarmer.angler), value => this.SetProfession(SFarmer.angler, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.fishing.luremaster"), this.GetProfession(SFarmer.mariner), value => this.SetProfession(SFarmer.mariner, value)));     // mariner = luremaster (???)
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.fishing.mariner"), this.GetProfession(SFarmer.baitmaster), value => this.SetProfession(SFarmer.baitmaster, value)));  // baitmaster = mariner (???)
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.fishing.pirate"), this.GetProfession(SFarmer.pirate), value => this.SetProfession(SFarmer.pirate, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.foraging.forester"), this.GetProfession(SFarmer.forester), value => this.SetProfession(SFarmer.forester, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.foraging.gatherer"), this.GetProfession(SFarmer.gatherer), value => this.SetProfession(SFarmer.gatherer, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.foraging.botanist"), this.GetProfession(SFarmer.botanist), value => this.SetProfession(SFarmer.botanist, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.foraging.lumberjack"), this.GetProfession(SFarmer.lumberjack), value => this.SetProfession(SFarmer.lumberjack, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.foraging.tapper"), this.GetProfession(SFarmer.tapper), value => this.SetProfession(SFarmer.tapper, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.foraging.tracker"), this.GetProfession(SFarmer.tracker), value => this.SetProfession(SFarmer.tracker, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.mining.geologist"), this.GetProfession(SFarmer.geologist), value => this.SetProfession(SFarmer.geologist, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.mining.miner"), this.GetProfession(SFarmer.miner), value => this.SetProfession(SFarmer.miner, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.mining.blacksmith"), this.GetProfession(SFarmer.blacksmith), value => this.SetProfession(SFarmer.blacksmith, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.mining.excavator"), this.GetProfession(SFarmer.excavator), value => this.SetProfession(SFarmer.excavator, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.mining.gemologist"), this.GetProfession(SFarmer.gemologist), value => this.SetProfession(SFarmer.gemologist, value)));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("professions.mining.prospector"), this.GetProfession(SFarmer.burrower), value => this.SetProfession(SFarmer.burrower, value)));     // burrower = prospector
                break;

            case MenuTab.Weather:
                this.Options.Add(new OptionsElement($"{i18n.Get("weather.title")}:"));
                this.Options.Add(new CheatsOptionsWeatherElement($"{i18n.Get("weather.current")}", () => CJB.GetWeatherNexDay(i18n)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("weather.sunny"), 10, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("weather.raining"), 11, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("weather.lightning"), 12, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("weather.snowing"), 13, slotWidth, config, cheats, i18n));
                break;

            case MenuTab.Relationships:
            {
                this.Options.Add(new OptionsElement($"{i18n.Get("relationships.title")}:"));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("relationships.give-gifts-anytime"), config.AlwaysGiveGift, value => config.AlwaysGiveGift = value));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("relationships.no-decay"), config.NoFriendshipDecay, value => config.NoFriendshipDecay     = value));
                this.Options.Add(new OptionsElement($"{i18n.Get("relationships.friends")}:"));

                foreach (NPC npc in this.GetSocialCharacters().Distinct().OrderBy(p => p.displayName))
                {
                    this.Options.Add(new CheatsOptionsNpcSlider(npc, onValueChanged: points => this.Cheats.UpdateFriendship(npc, points)));
                }
            }
            break;

            case MenuTab.WarpLocations:
                this.Options.Add(new OptionsElement($"{i18n.Get("warp.title")}:"));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.farm"), slotWidth, this.WarpToFarm));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.pierre-shop"), slotWidth, () => this.Warp("Town", 43, 57)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.blacksmith"), slotWidth, () => this.Warp("Town", 94, 82)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.museum"), slotWidth, () => this.Warp("Town", 101, 90)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.saloon"), slotWidth, () => this.Warp("Town", 45, 71)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.community-center"), slotWidth, () => this.Warp("Town", 52, 20)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.carpenter"), slotWidth, () => this.Warp("Mountain", 12, 26)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.adventurers-guild"), slotWidth, () => this.Warp("Mountain", 76, 9)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.ranch"), slotWidth, () => this.Warp("Forest", 90, 16)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.mines"), slotWidth, () => this.Warp("Mine", 13, 10)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.willy-shop"), slotWidth, () => this.Warp("Beach", 30, 34)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.wizard-tower"), slotWidth, () => this.Warp("Forest", 5, 27)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.hats"), slotWidth, () => this.Warp("Forest", 34, 96)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.desert"), slotWidth, () => this.Warp("Desert", 18, 28)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.sandy-shop"), slotWidth, () => this.Warp("SandyHouse", 4, 8)));
                if (Game1.player.hasClubCard)
                {
                    this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.casino"), slotWidth, () => this.Warp("Club", 8, 11)));
                }
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.quarry"), slotWidth, () => this.Warp("Mountain", 127, 12)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.new-beach"), slotWidth, () => this.Warp("Beach", 87, 26)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.secret-woods"), slotWidth, () => this.Warp("Woods", 58, 15)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.sewer"), slotWidth, () => this.Warp("Sewer", 3, 48)));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("warp.bathhouse"), slotWidth, () => this.Warp("Railroad", 10, 57)));
                break;

            case MenuTab.Time:
                this.Options.Add(new OptionsElement($"{i18n.Get("time.title")}:"));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("time.freeze-inside"), config.FreezeTimeInside, value => config.FreezeTimeInside = value));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("time.freeze-caves"), config.FreezeTimeCaves, value => config.FreezeTimeCaves    = value));
                this.Options.Add(new CheatsOptionsCheckbox(i18n.Get("time.freeze-everywhere"), config.FreezeTime, value => config.FreezeTime         = value));
                this.Options.Add(new CheatsOptionsSlider(i18n.Get("time.time"), (Game1.timeOfDay - 600) / 100, 19, value => this.SafelySetTime((value * 100) + 600), width: 100, format: value => Game1.getTimeOfDayString((value * 100) + 600)));
                break;

            case MenuTab.Quests:
            {
                this.Options.Add(new OptionsElement($"{i18n.Get("activequests.title")}:"));
                {
                    int i = 0;
                    foreach (Quest quest in Game1.player.questLog)
                    {
                        if (!quest.completed.Value)
                        {
                            this.Options.Add(new CheatsOptionsInputListener(quest.questTitle, 300 + i++, slotWidth, config, cheats, i18n));
                        }
                    }
                }
                this.Options.Add(new OptionsElement($"{i18n.Get("completedquests.title")}:"));

                foreach (Quest quest in Game1.player.questLog)
                {
                    if (quest.completed.Value)
                    {
                        this.Options.Add(new OptionsElement(quest.questTitle)
                            {
                                whichOption = -999
                            });
                    }
                }
            }
            break;

            case MenuTab.Controls:
                this.Options.Add(new OptionsElement($"{i18n.Get("controls.title")}:"));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("controls.open-menu"), 1000, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("controls.freeze-time"), 1001, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("controls.grow-tree"), 1002, slotWidth, config, cheats, i18n));
                this.Options.Add(new CheatsOptionsInputListener(i18n.Get("controls.grow-crops"), 1003, slotWidth, config, cheats, i18n));
                break;
            }
            this.SetScrollBarToCurrentIndex();
        }
Esempio n. 7
0
        public override void receiveLeftClick(int x, int y)
        {
            if (this.greyedOut || this.Listening || !this.SetButtonBounds.Contains(x, y))
            {
                return;
            }

            // callback handler
            if (this.OnToggled != null)
            {
                this.OnToggled();
                return;
            }

            // hardcoded handling
            if (!this.ButtonNames.Any())
            {
                switch (this.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");
                    this.Cheats.WaterAllFields();
                    break;

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

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

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

                case 13:
                    this.Cheats.SetWeatherForNextDay(Game1.weather_snow);
                    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;

                case int n when(n >= 300 && n <= 399):
                    for (int i = Game1.player.questLog.Count - 1; i >= 0; i--)
                    {
                        Quest q = Game1.player.questLog[i];

                        if (this.label == q.questTitle)
                        {
                            q.questComplete();
                        }
                    }

                    Game1.exitActiveMenu();
                    break;
                }
            }
            else
            {
                this.Listening = true;
                Game1.soundBank.PlayCue("breathin");
                GameMenu.forcePreventClose = true;
                this.ListenerMessage       = this.PressNewKeyLabel;
            }
        }