diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h index 438116cc8..b5c54de06 100644 --- a/soh/soh/Enhancements/presets.h +++ b/soh/soh/Enhancements/presets.h @@ -109,6 +109,7 @@ const std::vector enhancementsCvars = { "gFairyReviveEffect", "gFairyReviveHealth", "gFairyRevivePercentRestore", + "gCustomizeFishing", "gInstantFishing", "gGuaranteeFishingBite", "gFishNeverEscape", diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index ae71f2711..813df89b3 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -570,7 +570,7 @@ namespace GameMenuBar { if (ImGui::BeginMenu("Shooting Gallery")) { UIWidgets::EnhancementCheckbox("Customize Behavior", "gCustomizeShootingGallery"); UIWidgets::Tooltip("Turn on/off changes to the shooting gallery behavior"); - bool disabled = CVar_GetS32("gCustomizeShootingGallery", 0) == 0; + bool disabled = !CVar_GetS32("gCustomizeShootingGallery", 0); const char* disabledTooltip = "This option is disabled because \"Customize Behavior\" is turned off"; UIWidgets::EnhancementCheckbox("Instant Win", "gInstantShootingGalleryWin", disabled, disabledTooltip); UIWidgets::Tooltip("Skips the shooting gallery minigame"); @@ -586,15 +586,19 @@ namespace GameMenuBar { UIWidgets::Spacer(0); if (ImGui::BeginMenu("Fishing")) { - UIWidgets::EnhancementCheckbox("Instant Fishing", "gInstantFishing"); + UIWidgets::EnhancementCheckbox("Customize Behavior", "gCustomizeFishing"); + UIWidgets::Tooltip("Turn on/off changes to the fishing behavior"); + bool disabled = !CVar_GetS32("gCustomizeFishing", 0); + const char* disabledTooltip = "This option is disabled because \"Customize Behavior\" is turned off"; + UIWidgets::EnhancementCheckbox("Instant Fishing", "gInstantFishing", disabled, disabledTooltip); UIWidgets::Tooltip("All fish will be caught instantly"); - UIWidgets::PaddedEnhancementCheckbox("Guarantee Bite", "gGuaranteeFishingBite", true, false); + UIWidgets::PaddedEnhancementCheckbox("Guarantee Bite", "gGuaranteeFishingBite", true, false, disabled, disabledTooltip); UIWidgets::Tooltip("When a line is stable, guarantee bite. Otherwise use default logic"); - UIWidgets::PaddedEnhancementCheckbox("Fish Never Escape", "gFishNeverEscape", true, false); + UIWidgets::PaddedEnhancementCheckbox("Fish Never Escape", "gFishNeverEscape", true, false, disabled, disabledTooltip); UIWidgets::Tooltip("Once a hook has been set, fish will never let go while being reeled in."); - UIWidgets::PaddedEnhancementSliderInt("Child Minimum Weight: %d", "##cMinimumWeight", "gChildMinimumWeightFish", 3, 10, "", 10, false, true, false); + UIWidgets::PaddedEnhancementSliderInt("Child Minimum Weight: %d", "##cMinimumWeight", "gChildMinimumWeightFish", 3, 10, "", 10, false, true, false, disabled, disabledTooltip); UIWidgets::Tooltip("The minimum weight for the unique fishing reward as a child"); - UIWidgets::PaddedEnhancementSliderInt("Adult Minimum Weight: %d", "##aMinimumWeight", "gAdultMinimumWeightFish", 6, 13, "", 13, false, true, false); + UIWidgets::PaddedEnhancementSliderInt("Adult Minimum Weight: %d", "##aMinimumWeight", "gAdultMinimumWeightFish", 6, 13, "", 13, false, true, false, disabled, disabledTooltip); UIWidgets::Tooltip("The minimum weight for the unique fishing reward as an adult"); ImGui::EndMenu(); } diff --git a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c index 570fcae82..8e07c56d4 100644 --- a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -2900,24 +2900,24 @@ f32 Fishing_GetMinimumRequiredScore() { // RANDOTODO: update the enhancement sliders to not allow // values above rando fish weight values when rando'd if(sLinkAge == 1) { - weight = CVar_GetS32("gChildMinimumWeightFish", 10); + weight = CVar_GetS32("gCustomizeFishing", 0) ? CVar_GetS32("gChildMinimumWeightFish", 10) : 10; } else { - weight = CVar_GetS32("gAdultMinimumWeightFish", 13); + weight = CVar_GetS32("gCustomizeFishing", 0) ? CVar_GetS32("gAdultMinimumWeightFish", 13) : 13; } return sqrt(((f32)weight - 0.5f) / 0.0036f); } bool getInstantFish() { - return CVar_GetS32("gInstantFishing", 0); + return CVar_GetS32("gCustomizeFishing", 0) && CVar_GetS32("gInstantFishing", 0); } bool getGuaranteeBite() { - return CVar_GetS32("gGuaranteeFishingBite", 0); + return CVar_GetS32("gCustomizeFishing", 0) && CVar_GetS32("gGuaranteeFishingBite", 0); } bool getFishNeverEscape() { - return CVar_GetS32("gFishNeverEscape", 0); + return CVar_GetS32("gCustomizeFishing", 0) && CVar_GetS32("gFishNeverEscape", 0); } void Fishing_UpdateFish(Actor* thisx, PlayState* play2) {