public ModOptionsPageHandler(IModHelper helper, IDictionary <string, string> options) { _options = options; helper.Events.Display.MenuChanged += ToggleModOptions; _helper = helper; _luckOfDay = new LuckOfDay(helper); _showBirthdayIcon = new ShowBirthdayIcon(helper.Events); _showAccurateHearts = new ShowAccurateHearts(helper.Events); _locationOfTownsfolk = new LocationOfTownsfolk(helper, _options); _showWhenAnimalNeedsPet = new ShowWhenAnimalNeedsPet(helper); _showCalendarAndBillboardOnGameMenuButton = new ShowCalendarAndBillboardOnGameMenuButton(helper); _showScarecrowAndSprinklerRange = new ShowItemEffectRanges(helper); _experienceBar = new ExperienceBar(helper); _showItemHoverInformation = new ShowItemHoverInformation(helper.Events); _shopHarvestPrices = new ShopHarvestPrices(helper); _showQueenOfSauceIcon = new ShowQueenOfSauceIcon(helper); _showTravelingMerchant = new ShowTravelingMerchant(helper); _showRainyDayIcon = new ShowRainyDayIcon(helper); _showCropAndBarrelTime = new ShowCropAndBarrelTime(helper); _showToolUpgradeStatus = new ShowToolUpgradeStatus(helper); _showRobinBuildingStatusIcon = new ShowRobinBuildingStatusIcon(helper); _elementsToDispose = new List <IDisposable>() { _luckOfDay, _showBirthdayIcon, _showAccurateHearts, _locationOfTownsfolk, _showWhenAnimalNeedsPet, _showCalendarAndBillboardOnGameMenuButton, _showCropAndBarrelTime, _experienceBar, _showItemHoverInformation, _showTravelingMerchant, _showRainyDayIcon, _shopHarvestPrices, _showQueenOfSauceIcon, _showToolUpgradeStatus, _showRobinBuildingStatusIcon }; int whichOption = 1; Version thisVersion = Assembly.GetAssembly(this.GetType()).GetName().Version; _optionsElements.Add(new ModOptionsElement("UI Info Suite 2 v" + thisVersion.Major + "." + thisVersion.Minor + "." + thisVersion.Build)); var luckIcon = new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowLuckIcon), whichOption++, _luckOfDay.ToggleOption, _options, OptionKeys.ShowLuckIcon); _optionsElements.Add(luckIcon); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowExactValue), whichOption++, _luckOfDay.ToggleShowExactValueOption, _options, OptionKeys.ShowExactValue, luckIcon, false)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowLevelUpAnimation), whichOption++, _experienceBar.ToggleLevelUpAnimation, _options, OptionKeys.ShowLevelUpAnimation)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowExperienceBar), whichOption++, _experienceBar.ToggleShowExperienceBar, _options, OptionKeys.ShowExperienceBar)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.AllowExperienceBarToFadeOut), whichOption++, _experienceBar.ToggleExperienceBarFade, _options, OptionKeys.AllowExperienceBarToFadeOut)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowExperienceGain), whichOption++, _experienceBar.ToggleShowExperienceGain, _options, OptionKeys.ShowExperienceGain)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowLocationOfTownsPeople), whichOption++, _locationOfTownsfolk.ToggleShowNPCLocationsOnMap, _options, OptionKeys.ShowLocationOfTownsPeople)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowBirthdayIcon), whichOption++, _showBirthdayIcon.ToggleOption, _options, OptionKeys.ShowBirthdayIcon)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowHeartFills), whichOption++, _showAccurateHearts.ToggleOption, _options, OptionKeys.ShowHeartFills)); var animalPetIcon = new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowAnimalsNeedPets), whichOption++, _showWhenAnimalNeedsPet.ToggleOption, _options, OptionKeys.ShowAnimalsNeedPets); _optionsElements.Add(animalPetIcon); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.HideAnimalPetOnMaxFriendship), whichOption++, _showWhenAnimalNeedsPet.ToggleDisableOnMaxFirendshipOption, _options, OptionKeys.HideAnimalPetOnMaxFriendship, animalPetIcon)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.DisplayCalendarAndBillboard), whichOption++, _showCalendarAndBillboardOnGameMenuButton.ToggleOption, _options, OptionKeys.DisplayCalendarAndBillboard)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowCropAndBarrelTooltip), whichOption++, _showCropAndBarrelTime.ToggleOption, _options, OptionKeys.ShowCropAndBarrelTooltip)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowItemEffectRanges), whichOption++, _showScarecrowAndSprinklerRange.ToggleOption, _options, OptionKeys.ShowItemEffectRanges)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowExtraItemInformation), whichOption++, _showItemHoverInformation.ToggleOption, _options, OptionKeys.ShowExtraItemInformation)); var travellingMerchantIcon = new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowTravelingMerchant), whichOption++, _showTravelingMerchant.ToggleOption, _options, OptionKeys.ShowTravelingMerchant); _optionsElements.Add(travellingMerchantIcon); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.HideMerchantWhenVisited), whichOption++, _showTravelingMerchant.ToggleHideWhenVisitedOption, _options, OptionKeys.HideMerchantWhenVisited, travellingMerchantIcon, false)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowRainyDay), whichOption++, _showRainyDayIcon.ToggleOption, _options, OptionKeys.ShowRainyDay)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowHarvestPricesInShop), whichOption++, _shopHarvestPrices.ToggleOption, _options, OptionKeys.ShowHarvestPricesInShop)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowWhenNewRecipesAreAvailable), whichOption++, _showQueenOfSauceIcon.ToggleOption, _options, OptionKeys.ShowWhenNewRecipesAreAvailable)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowToolUpgradeStatus), whichOption++, _showToolUpgradeStatus.ToggleOption, _options, OptionKeys.ShowToolUpgradeStatus)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(OptionKeys.ShowRobinBuildingStatusIcon), whichOption++, _showRobinBuildingStatusIcon.ToggleOption, _options, OptionKeys.ShowRobinBuildingStatusIcon)); }
internal ModOptionPageHandler(IDictionary <String, String> options) { _options = options; Events.Display.MenuChanged += ToggleModOptions; // _helper = helper; // ModConfig modConfig = _helper.ReadConfig<ModConfig>(); _iconLuckOfDay = new IconLuckOfDay(); _iconBirthday = new IconBirthday(); _iconNewRecipe = new IconNewRecipe(); _iconToolUpgrade = new IconToolUpgrade(); _iconTravelingMerchant = new IconTravelingMerchant(); _showNPCOnMap = new ShowNPCOnMap(_options); _showCalendarAndBillboard = new ShowCalendarAndBillboard(); _showAccurateHearts = new ShowAccurateHearts(); _showMonsterHealthBar = new ShowMonsterHealthBar(); _showScarecrowAndSprinklerRange = new ShowItemEffectRanges(); _showLocationName = new ShowLocationName(); _showBuriedItems = new ShowBuriedItems(); _showStaminaHealthNumber = new ShowStaminaHealthNumber(); _showWAnimalNeedsPet = new ShowAnimalNeedsPet(); _showItemHoverInformation = new ShowItemHoverInformation(); _showCropAndBarrelTime = new ShowCropAndBarrelTime(); _shopHarvestPrices = new ShopHarvestPrices(); _experienceBar = new ExperienceBar(); _partsToDispose = new List <IDisposable>() { _iconLuckOfDay, _iconBirthday, _iconNewRecipe, _iconToolUpgrade, _iconTravelingMerchant, _showNPCOnMap, _showCalendarAndBillboard, _showAccurateHearts, // _showMonsterHealthBar, _showScarecrowAndSprinklerRange, // _showLocationName, _showBuriedItems, // _showStaminaHealthNumber, _showWAnimalNeedsPet, _showItemHoverInformation, _showCropAndBarrelTime, _shopHarvestPrices, _experienceBar, }; string Trans(string key) => ModEntry.Translation.Get(key); int whichOption = 1001; Version thisVersion = Assembly.GetAssembly(this.GetType()).GetName().Version; _optionParts.Add(new ModOptionPart("Easy Info UI v" + thisVersion.Major + "." + thisVersion.Minor + "." + thisVersion.Build)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.IconLuckOfDay), whichOption++, _iconLuckOfDay.Toggle, _options, OptionKeys.IconLuckOfDay)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.IconBirthday), whichOption++, _iconBirthday.ToggleOption, _options, OptionKeys.IconBirthday)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.IconNewRecipe), whichOption++, _iconNewRecipe.ToggleOption, _options, OptionKeys.IconNewRecipe)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.IconToolUpgrade), whichOption++, _iconToolUpgrade.ToggleOption, _options, OptionKeys.IconToolUpgrade)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.IconTravelingMerchant), whichOption++, _iconTravelingMerchant.ToggleOption, _options, OptionKeys.IconTravelingMerchant)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.ShowNPCOnMap), whichOption++, _showNPCOnMap.ToggleShowNPCLocationsOnMap, _options, OptionKeys.ShowNPCOnMap)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.ShowCalendarAndBillboard), whichOption++, _showCalendarAndBillboard.ToggleOption, _options, OptionKeys.ShowCalendarAndBillboard)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.ShowHeartFills), whichOption++, _showAccurateHearts.ToggleOption, _options, OptionKeys.ShowHeartFills)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.ShowMonsterHealthBar), whichOption++, _showMonsterHealthBar.ToggleOption, _options, OptionKeys.ShowMonsterHealthBar)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.ShowItemEffectRanges), whichOption++, _showScarecrowAndSprinklerRange.ToggleOption, _options, OptionKeys.ShowItemEffectRanges)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.ShowLocationName), whichOption++, _showLocationName.ToggleOption, _options, OptionKeys.ShowLocationName)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.ShowBuriedItems), whichOption++, _showBuriedItems.ToggleOption, _options, OptionKeys.ShowBuriedItems)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.ShowStaminaHealthNumber), whichOption++, _showStaminaHealthNumber.ToggleOption, _options, OptionKeys.ShowStaminaHealthNumber)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.ShowAnimalsNeedPets), whichOption++, _showWAnimalNeedsPet.ToggleOption, _options, OptionKeys.ShowAnimalsNeedPets)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.ShowExtraItemInformation), whichOption++, _showItemHoverInformation.ToggleOption, _options, OptionKeys.ShowExtraItemInformation)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.ShowCropAndBarrelTooltip), whichOption++, _showCropAndBarrelTime.ToggleOption, _options, OptionKeys.ShowCropAndBarrelTooltip)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.ShowHarvestPricesInShop), whichOption++, _shopHarvestPrices.ToggleOption, _options, OptionKeys.ShowHarvestPricesInShop)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.ShowExperienceBar), whichOption++, _experienceBar.ToggleShowExperienceBar, _options, OptionKeys.ShowExperienceBar)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.AllowExperienceBarToFadeOut), whichOption++, _experienceBar.ToggleExperienceBarFade, _options, OptionKeys.AllowExperienceBarToFadeOut)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.ShowExperienceGain), whichOption++, _experienceBar.ToggleShowExperienceGain, _options, OptionKeys.ShowExperienceGain)); _optionParts.Add(new ModOptionCheckbox(Trans(OptionKeys.ShowLevelUpAnimation), whichOption++, _experienceBar.ToggleLevelUpAnimation, _options, OptionKeys.ShowLevelUpAnimation)); }
public ModOptionsPageHandler(IModHelper helper, ModOptions _options, bool showPersonalConfigButton) { if (showPersonalConfigButton) { helper.Events.Display.MenuChanged += ToggleModOptions; } _helper = helper; _showPersonalConfigButton = showPersonalConfigButton; _luckOfDay = new LuckOfDay(helper); _showBirthdayIcon = new ShowBirthdayIcon(helper); _showAccurateHearts = new ShowAccurateHearts(helper.Events); _locationOfTownsfolk = new LocationOfTownsfolk(helper, _options); _showWhenAnimalNeedsPet = new ShowWhenAnimalNeedsPet(helper); _showCalendarAndBillboardOnGameMenuButton = new ShowCalendarAndBillboardOnGameMenuButton(helper); _showScarecrowAndSprinklerRange = new ShowItemEffectRanges(helper); _experienceBar = new ExperienceBar(helper); _showItemHoverInformation = new ShowItemHoverInformation(helper); _shopHarvestPrices = new ShopHarvestPrices(helper); _showQueenOfSauceIcon = new ShowQueenOfSauceIcon(helper); _showTravelingMerchant = new ShowTravelingMerchant(helper); _showRainyDayIcon = new ShowRainyDayIcon(helper); _showCropAndBarrelTime = new ShowCropAndBarrelTime(helper); _showToolUpgradeStatus = new ShowToolUpgradeStatus(helper); _showRobinBuildingStatusIcon = new ShowRobinBuildingStatusIcon(helper); _showTodaysGift = new ShowTodaysGifts(helper); _elementsToDispose = new List <IDisposable>() { _luckOfDay, _showBirthdayIcon, _showAccurateHearts, _locationOfTownsfolk, _showWhenAnimalNeedsPet, _showCalendarAndBillboardOnGameMenuButton, _showCropAndBarrelTime, _experienceBar, _showItemHoverInformation, _showTravelingMerchant, _showRainyDayIcon, _shopHarvestPrices, _showQueenOfSauceIcon, _showToolUpgradeStatus, _showRobinBuildingStatusIcon }; int whichOption = 1; Version thisVersion = Assembly.GetAssembly(this.GetType()).GetName().Version; _optionsElements.Add(new ModOptionsElement("UI Info Suite 2 v" + thisVersion.Major + "." + thisVersion.Minor + "." + thisVersion.Build)); var luckIcon = new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowLuckIcon)), whichOption++, _luckOfDay.ToggleOption, () => _options.ShowLuckIcon, v => _options.ShowLuckIcon = v); _optionsElements.Add(luckIcon); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowExactValue)), whichOption++, _luckOfDay.ToggleShowExactValueOption, () => _options.ShowExactValue, v => _options.ShowExactValue = v, luckIcon)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowLevelUpAnimation)), whichOption++, _experienceBar.ToggleLevelUpAnimation, () => _options.ShowLevelUpAnimation, v => _options.ShowLevelUpAnimation = v)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowExperienceBar)), whichOption++, _experienceBar.ToggleShowExperienceBar, () => _options.ShowExperienceBar, v => _options.ShowExperienceBar = v)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.AllowExperienceBarToFadeOut)), whichOption++, _experienceBar.ToggleExperienceBarFade, () => _options.AllowExperienceBarToFadeOut, v => _options.AllowExperienceBarToFadeOut = v)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowExperienceGain)), whichOption++, _experienceBar.ToggleShowExperienceGain, () => _options.ShowExperienceGain, v => _options.ShowExperienceGain = v)); if (!_helper.ModRegistry.IsLoaded("Bouhm.NPCMapLocations")) { _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowLocationOfTownsPeople)), whichOption++, _locationOfTownsfolk.ToggleShowNPCLocationsOnMap, () => _options.ShowLocationOfTownsPeople, v => _options.ShowLocationOfTownsPeople = v)); } var BirthdayIcon = new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowBirthdayIcon)), whichOption++, _showBirthdayIcon.ToggleOption, () => _options.ShowBirthdayIcon, v => _options.ShowBirthdayIcon = v); _optionsElements.Add(BirthdayIcon); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.HideBirthdayIfFullFriendShip)), whichOption++, _showBirthdayIcon.ToggleDisableOnMaxFriendshipOption, () => _options.HideBirthdayIfFullFriendShip, v => _options.HideBirthdayIfFullFriendShip = v, BirthdayIcon)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowHeartFills)), whichOption++, _showAccurateHearts.ToggleOption, () => _options.ShowHeartFills, v => _options.ShowHeartFills = v)); var animalPetIcon = new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowAnimalsNeedPets)), whichOption++, _showWhenAnimalNeedsPet.ToggleOption, () => _options.ShowAnimalsNeedPets, v => _options.ShowAnimalsNeedPets = v); _optionsElements.Add(animalPetIcon); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.HideAnimalPetOnMaxFriendship)), whichOption++, _showWhenAnimalNeedsPet.ToggleDisableOnMaxFirendshipOption, () => _options.HideAnimalPetOnMaxFriendship, v => _options.HideAnimalPetOnMaxFriendship = v, animalPetIcon)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.DisplayCalendarAndBillboard)), whichOption++, _showCalendarAndBillboardOnGameMenuButton.ToggleOption, () => _options.DisplayCalendarAndBillboard, v => _options.DisplayCalendarAndBillboard = v)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowCropAndBarrelTooltip)), whichOption++, _showCropAndBarrelTime.ToggleOption, () => _options.ShowCropAndBarrelTooltip, v => _options.ShowCropAndBarrelTooltip = v)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowItemEffectRanges)), whichOption++, _showScarecrowAndSprinklerRange.ToggleOption, () => _options.ShowItemEffectRanges, v => _options.ShowItemEffectRanges = v)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowExtraItemInformation)), whichOption++, _showItemHoverInformation.ToggleOption, () => _options.ShowExtraItemInformation, v => _options.ShowExtraItemInformation = v)); var travellingMerchantIcon = new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowTravelingMerchant)), whichOption++, _showTravelingMerchant.ToggleOption, () => _options.ShowTravelingMerchant, v => _options.ShowTravelingMerchant = v); _optionsElements.Add(travellingMerchantIcon); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.HideMerchantWhenVisited)), whichOption++, _showTravelingMerchant.ToggleHideWhenVisitedOption, () => _options.HideMerchantWhenVisited, v => _options.HideMerchantWhenVisited = v, travellingMerchantIcon)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowRainyDay)), whichOption++, _showRainyDayIcon.ToggleOption, () => _options.ShowRainyDay, v => _options.ShowRainyDay = v)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowHarvestPricesInShop)), whichOption++, _shopHarvestPrices.ToggleOption, () => _options.ShowHarvestPricesInShop, v => _options.ShowHarvestPricesInShop = v)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowWhenNewRecipesAreAvailable)), whichOption++, _showQueenOfSauceIcon.ToggleOption, () => _options.ShowWhenNewRecipesAreAvailable, v => _options.ShowWhenNewRecipesAreAvailable = v)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowToolUpgradeStatus)), whichOption++, _showToolUpgradeStatus.ToggleOption, () => _options.ShowToolUpgradeStatus, v => _options.ShowToolUpgradeStatus = v)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowRobinBuildingStatusIcon)), whichOption++, _showRobinBuildingStatusIcon.ToggleOption, () => _options.ShowRobinBuildingStatusIcon, v => _options.ShowRobinBuildingStatusIcon = v)); _optionsElements.Add(new ModOptionsCheckbox(_helper.SafeGetString(nameof(_options.ShowTodaysGifts)), whichOption++, _showTodaysGift.ToggleOption, () => _options.ShowTodaysGifts, v => _options.ShowTodaysGifts = v)); }