Пример #1
0
        public override void receiveLeftClick(int x, int y)
        {
            if (greyedOut)
            {
                return;
            }

            if (_bubbleButtonSource.Contains(x, y))
            {
                BubblesMenu.OpenMenu(_config);
            }

            if (!_checkButtonSource.Contains(x, y))
            {
                return;
            }

            Game1.playSound("drumkit6");
            _isChecked = !_isChecked;

            // Change options
            switch (_option)
            {
            case OptionsEnum.ShowReportButton:
                _config.DisplayReportButton = _isChecked;
                return;

            case OptionsEnum.ShowDetailedInfo:
                _config.ShowDetailedInfo = _isChecked;
                break;

            case OptionsEnum.DisplayBubbles:
                _config.DisplayBubbles = _isChecked;
                return;

            case OptionsEnum.NewRecipeOnTv:
                _config.NewRecipeOnTv = _isChecked;
                break;

            case OptionsEnum.Birthdays:
                _config.Birthdays = _isChecked;
                break;

            case OptionsEnum.TravelingMerchant:
                _config.TravelingMerchant = _isChecked;
                break;

            case OptionsEnum.UnwateredCrops:
                _config.UnwateredCrops = _isChecked;
                break;

            case OptionsEnum.UnharvestedCrops:
                _config.UnharvestedCrops = _isChecked;
                break;

            case OptionsEnum.DeadCrops:
                _config.DeadCrops = _isChecked;
                break;

            case OptionsEnum.UnpettedPet:
                _config.UnpettedPet = _isChecked;
                break;

            case OptionsEnum.UnfilledPetBowl:
                _config.UnfilledPetBowl = _isChecked;
                break;

            case OptionsEnum.UnpettedAnimals:
                _config.UnpettedAnimals = _isChecked;
                break;

            case OptionsEnum.MissingHay:
                _config.MissingHay = _isChecked;
                break;

            case OptionsEnum.FarmCave:
                _config.FarmCave = _isChecked;
                break;

            case OptionsEnum.UncollectedCrabpots:
                _config.UncollectedCrabpots = _isChecked;
                break;

            case OptionsEnum.NotBaitedCrabpots:
                _config.NotBaitedCrabpots = _isChecked;
                break;

            // Animal products
            case OptionsEnum.AllAnimalProducts:
                foreach (var key in _config.AnimalProducts.Keys.ToList())
                {
                    _config.AnimalProducts[key] = _isChecked;
                }
                break;

            case OptionsEnum.CowMilk:
                _config.AnimalProducts["Cow milk"] = _isChecked;
                break;

            case OptionsEnum.GoatMilk:
                _config.AnimalProducts["Goat milk"] = _isChecked;
                break;

            case OptionsEnum.SheepWool:
                _config.AnimalProducts["Sheep wool"] = _isChecked;
                break;

            case OptionsEnum.ChickenEgg:
                _config.AnimalProducts["Chicken egg"] = _isChecked;
                break;

            case OptionsEnum.DinosaurEgg:
                _config.AnimalProducts["Dinosaur egg"] = _isChecked;
                break;

            case OptionsEnum.DuckEgg:
                _config.AnimalProducts["Duck egg"] = _isChecked;
                break;

            case OptionsEnum.DuckFeather:
                _config.AnimalProducts["Duck feather"] = _isChecked;
                break;

            case OptionsEnum.RabbitsWool:
                _config.AnimalProducts["Rabbit's wool"] = _isChecked;
                break;

            case OptionsEnum.RabbitsFoot:
                _config.AnimalProducts["Rabbit's foot"] = _isChecked;
                break;

            case OptionsEnum.Truffle:
                _config.AnimalProducts["Truffle"] = _isChecked;
                break;

            case OptionsEnum.SlimeBall:
                _config.AnimalProducts["Slime ball"] = _isChecked;
                break;

            // Machines
            case OptionsEnum.AllMachines:
                foreach (var key in _config.Machines.Keys.ToList())
                {
                    _config.Machines[key] = _isChecked;
                }
                if (!_isChecked)
                {
                    _config.Cask = 0;
                }
                else if (_config.Cask == 0)
                {
                    _config.Cask = 4;
                }
                break;

            case OptionsEnum.BeeHouse:
                _config.Machines["Bee House"] = _isChecked;
                break;

            case OptionsEnum.CharcoalKiln:
                _config.Machines["Charcoal Kiln"] = _isChecked;
                break;

            case OptionsEnum.CheesePress:
                _config.Machines["Cheese Press"] = _isChecked;
                break;

            case OptionsEnum.Crystalarium:
                _config.Machines["Crystalarium"] = _isChecked;
                break;

            case OptionsEnum.Furnace:
                _config.Machines["Furnace"] = _isChecked;
                break;

            case OptionsEnum.Keg:
                _config.Machines["Keg"] = _isChecked;
                break;

            case OptionsEnum.LightningRod:
                _config.Machines["Lightning Rod"] = _isChecked;
                break;

            case OptionsEnum.Loom:
                _config.Machines["Loom"] = _isChecked;
                break;

            case OptionsEnum.MayonnaiseMachine:
                _config.Machines["Mayonnaise Machine"] = _isChecked;
                break;

            case OptionsEnum.OilMaker:
                _config.Machines["Oil Maker"] = _isChecked;
                break;

            case OptionsEnum.PreservesJar:
                _config.Machines["Preserves Jar"] = _isChecked;
                break;

            case OptionsEnum.RecyclingMachine:
                _config.Machines["Recycling Machine"] = _isChecked;
                break;

            case OptionsEnum.SeedMaker:
                _config.Machines["Seed Maker"] = _isChecked;
                break;

            case OptionsEnum.SlimeEggPress:
                _config.Machines["Slime Egg-Press"] = _isChecked;
                break;

            case OptionsEnum.SodaMachine:
                _config.Machines["Soda Machine"] = _isChecked;
                break;

            case OptionsEnum.StatueOfEndlessFortune:
                _config.Machines["Statue Of Endless Fortune"] = _isChecked;
                break;

            case OptionsEnum.StatueOfPerfection:
                _config.Machines["Statue Of Perfection"] = _isChecked;
                break;

            case OptionsEnum.Tapper:
                _config.Machines["Tapper"] = _isChecked;
                break;

            case OptionsEnum.WormBin:
                _config.Machines["Worm Bin"] = _isChecked;
                break;

            case OptionsEnum.DrawUnwateredCrops:
                _config.DrawBubbleUnwateredCrops = _isChecked;
                break;

            case OptionsEnum.DrawUnharvestedCrops:
                _config.DrawBubbleUnharvestedCrops = _isChecked;
                break;

            case OptionsEnum.DrawDeadCrops:
                _config.DrawBubbleDeadCrops = _isChecked;
                break;

            case OptionsEnum.DrawUnpettedPet:
                _config.DrawBubbleUnpettedPet = _isChecked;
                break;

            case OptionsEnum.DrawUnpettedAnimals:
                _config.DrawBubbleUnpettedAnimals = _isChecked;
                break;

            case OptionsEnum.DrawAnimalsWithProduce:
                _config.DrawBubbleAnimalsWithProduce = _isChecked;
                break;

            case OptionsEnum.DrawBuildingsWithProduce:
                _config.DrawBubbleBuildingsWithProduce = _isChecked;
                break;

            case OptionsEnum.DrawBuildingsMissingHay:
                _config.DrawBubbleBuildingsMissingHay = _isChecked;
                break;

            case OptionsEnum.DrawTruffles:
                _config.DrawBubbleTruffles = _isChecked;
                break;

            case OptionsEnum.DrawCrabpotsNotBaited:
                _config.DrawBubbleCrabpotsNotBaited = _isChecked;
                break;

            case OptionsEnum.DrawCask:
                _config.DrawBubbleCask = _isChecked;
                break;

            default:
                throw new ArgumentOutOfRangeException($"Option {_option} is not possible on a checkbox.");
            }
            SettingsMenu.RaiseReportConfigChanged();
        }