[Enhancement] Added checkbox to disable finishing difficulty behavior changes (#1990)

This commit is contained in:
Oliver Schall 2022-11-23 13:43:06 +01:00 committed by GitHub
parent c3f51fef2a
commit 4526550e95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 11 deletions

View File

@ -109,6 +109,7 @@ const std::vector<const char*> enhancementsCvars = {
"gFairyReviveEffect",
"gFairyReviveHealth",
"gFairyRevivePercentRestore",
"gCustomizeFishing",
"gInstantFishing",
"gGuaranteeFishingBite",
"gFishNeverEscape",

View File

@ -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();
}

View File

@ -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) {