Skip to content

Commit

Permalink
Add enhancement to have Zora's River waterfall always open
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanLongstaff committed Oct 20, 2024
1 parent 6d1d57d commit a1032a0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions soh/soh/SohMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,8 @@ void DrawEnhancementsMenu() {
"- Not within range of Ocarina playing spots");
UIWidgets::PaddedEnhancementCheckbox("Pause Warp", CVAR_ENHANCEMENT("PauseWarp"), true, false);
UIWidgets::Tooltip("Selection of warp song in pause menu initiates warp. Disables song playback.");
UIWidgets::PaddedEnhancementCheckbox("Zora's River waterfall always open", CVAR_ENHANCEMENT("OpenZoraWaterfall"), true, false);
UIWidgets::Tooltip("Skips having to play Zelda's Lullaby to enter Zora's Domain.");

ImGui::EndTable();
ImGui::EndMenu();
Expand Down
16 changes: 12 additions & 4 deletions soh/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,19 @@ void BgSpot03Taki_Init(Actor* thisx, PlayState* play) {

this->switchFlag = (this->dyna.actor.params & 0x3F);
DynaPolyActor_Init(&this->dyna, DPM_UNK);
CollisionHeader_GetVirtual(&object_spot03_object_Col_000C98, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);

if (CVarGetInteger(CVAR_ENHANCEMENT("OpenZoraWaterfall"), 0)) {
this->state = WATERFALL_OPENED;
this->openingAlpha = 0.0f;
} else {
this->state = WATERFALL_CLOSED;
CollisionHeader_GetVirtual(&object_spot03_object_Col_000C98, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
this->openingAlpha = 255.0f;
}

Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
this->bufferIndex = 0;
this->openingAlpha = 255.0f;
BgSpot03Taki_ApplyOpeningAlpha(this, 0);
BgSpot03Taki_ApplyOpeningAlpha(this, 1);
this->actionFunc = func_808ADEF0;
Expand Down Expand Up @@ -90,7 +98,7 @@ void func_808ADEF0(BgSpot03Taki* this, PlayState* play) {
this->openingAlpha = 0;
}
}
} else if (this->state == WATERFALL_OPENED) {
} else if (this->state == WATERFALL_OPENED && !CVarGetInteger(CVAR_ENHANCEMENT("OpenZoraWaterfall"), 0)) {
this->timer--;
if (this->timer < 0) {
this->state = WATERFALL_CLOSING;
Expand Down

0 comments on commit a1032a0

Please sign in to comment.