Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a time saver option to allow players to instantly put items away #600

Merged
merged 6 commits into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion libultraship/libultraship/ImGuiImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,8 @@ namespace SohImGui {
Tooltip("The default response to Kaepora Gaebora is\nalways that you understood what he said");
EnhancementCheckbox("Fast Ocarina Playback", "gFastOcarinaPlayback");
Tooltip("Skip the part where the Ocarina playback is called when you play\na song");

EnhancementCheckbox("Instant Putaway", "gInstantPutaway");
Tooltip("Allow Link to put items away without having to wait around");
ImGui::EndMenu();
}

Expand Down Expand Up @@ -1169,6 +1170,15 @@ namespace SohImGui {

if (ImGui::SliderInt("##FPSInterpolation", &val, 20, 250, "", ImGuiSliderFlags_AlwaysClamp))
{
if (val > 250)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use clamp for this:

val = math::clamp(val, 20.0f, 250.0f);

{
val = 250;
}
else if (val < 20)
{
val = 20;
}

CVar_SetS32(fps_cvar, val);
needs_save = true;
}
Expand Down
11 changes: 9 additions & 2 deletions soh/src/overlays/actors/ovl_player_actor/z_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -9884,8 +9884,15 @@ void func_808473D4(GlobalContext* globalCtx, Player* this) {
this->unk_837 = 20;
}
else if (this->unk_837 != 0) {
doAction = DO_ACTION_NONE;
this->unk_837--;
if (CVar_GetS32("gInstantPutaway", 0) != 0)
{
this->unk_837 = 0;
}
else
{
doAction = DO_ACTION_NONE;
this->unk_837--;
}
}

Interface_SetDoAction(globalCtx, doAction);
Expand Down