Enhancement: Aiming reticle for the bow/slingshot (#2715)

* Bow reticle enhancement

* Menu bar checkbox

* fix

* simplify bow/slingshot reticle logic

* Comment on RETICLE_MAX

* Tooltip clarity update

---------

Co-authored-by: briaguya <briaguya@alice>
This commit is contained in:
RaelCappra 2023-04-22 22:59:34 -03:00 committed by GitHub
parent c4b90d0bfe
commit 25ceca0fbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

View File

@ -503,6 +503,8 @@ namespace GameMenuBar {
UIWidgets::Tooltip("Explosions are now a static size, like in Majora's Mask and OoT3D. Makes bombchu hovering much easier.");
UIWidgets::PaddedEnhancementCheckbox("Prevent Bombchus Forcing First-Person", "gDisableFirstPersonChus", true, false);
UIWidgets::Tooltip("Prevent bombchus from forcing the camera into first-person mode when released.");
UIWidgets::PaddedEnhancementCheckbox("Aiming reticle for the bow/slingshot", "gBowReticle", true, false);
UIWidgets::Tooltip("Aiming with a bow or slingshot will display a reticle as with the hookshot when the projectile is ready to fire.");
ImGui::EndMenu();
}

View File

@ -1391,6 +1391,11 @@ Vec3f D_801261E0[] = {
{ 200.0f, 200.0f, 0.0f },
};
// OTRTODO: Figure out why this value works/what this value should be
// This was originally obtained by working down from FLT_MAX until the math
// started working out properly
#define RETICLE_MAX 3.402823466e+12f
void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
Player* this = (Player*)thisx;
@ -1555,6 +1560,24 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void
play, this, ((this->heldItemAction == PLAYER_IA_HOOKSHOT) ? 38600.0f : 77600.0f) * CVarGetFloat("gCheatHookshotReachMultiplier", 1.0f));
}
}
} else if (CVarGetInteger("gBowReticle", 0) && (
(this->heldItemAction == PLAYER_IA_BOW_FIRE) ||
(this->heldItemAction == PLAYER_IA_BOW_ICE) ||
(this->heldItemAction == PLAYER_IA_BOW_LIGHT) ||
(this->heldItemAction == PLAYER_IA_BOW) ||
(this->heldItemAction == PLAYER_IA_SLINGSHOT))) {
if (heldActor != NULL) {
MtxF sp44;
s32 pad;
Matrix_RotateZYX(0, -15216, -17496, MTXMODE_APPLY);
Matrix_Get(&sp44);
if (func_8002DD78(this) != 0) {
Matrix_Translate(500.0f, 300.0f, 0.0f, MTXMODE_APPLY);
Player_DrawHookshotReticle(play, this, RETICLE_MAX);
}
}
}
if ((this->unk_862 != 0) || ((func_8002DD6C(this) == 0) && (heldActor != NULL))) {