From d97ecd125bc59d095422eaed4b35046a4c752728 Mon Sep 17 00:00:00 2001 From: PurpleHato Date: Sat, 21 May 2022 17:09:35 +0200 Subject: [PATCH] ADDED/ Choice to use C-Button or D-pad --- libultraship/libultraship/SohImGuiImpl.cpp | 9 +++++++-- .../ovl_kaleido_scope/z_kaleido_equipment.c | 20 ++++++++++++------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 350c2b05d..9d60c2267 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -686,9 +686,14 @@ namespace SohImGui { if (ImGui::BeginMenu("Graphics")) { if (ImGui::BeginMenu("Animated Link in Pause Menu")) { - EnhancementCheckbox("Rotate Link with D-pad", "gPauseLiveLinkRotation"); + ImGui::Text("Rotation"); + EnhancementRadioButton("Disabled", "gPauseLiveRotation", 0); + EnhancementRadioButton("Rotate Link with D-pad", "gPauseLiveRotation", 1); Tooltip("Allow you to rotate Link on the Equipment menu with the DPAD\nUse DPAD-Up or DPAD-Down to reset Link's rotation"); - if (CVar_GetS32("gPauseLiveLinkRotation", 0) == 1) { + EnhancementRadioButton("Rotate Link with C-buttons", "gPauseLiveRotation", 2); + Tooltip("Allow you to rotate Link on the Equipment menu with the C-buttons\nUse C-Up or C-Down to reset Link's rotation"); + + if (CVar_GetS32("gPauseLiveRotation", 0) != 0) { EnhancementSliderInt("Rotation Speed: %d", "##MinRotationSpeed", "gPauseLiveLinkRotationSpeed", 1, 20, ""); } ImGui::Separator(); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 0afb0154f..125981bff 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -98,6 +98,8 @@ void KaleidoScope_DrawPlayerWork(GlobalContext* globalCtx) { f32 scale; Input* input = &globalCtx->state.input[0]; s16 RotationSpeed = 150 * CVar_GetS32("gPauseLiveLinkRotationSpeed", 0); + bool AllowCRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 2) ? true : false; + bool AllowDPadRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 1) ? true : false; if (LINK_AGE_IN_YEARS == YEARS_CHILD) { pos.x = 2.0f; @@ -118,20 +120,24 @@ void KaleidoScope_DrawPlayerWork(GlobalContext* globalCtx) { link_kaleido_rot.x = link_kaleido_rot.z = 0; - if (CHECK_BTN_ALL(input->cur.button, BTN_DLEFT) && CVar_GetS32("gPauseLiveLink", 1) >= 1) { - //printf("Rotation (L)Desired:[%d]\n", link_kaleido_rot.x); + if (AllowDPadRotation && CHECK_BTN_ALL(input->cur.button, BTN_DLEFT) || + AllowCRotation && CHECK_BTN_ALL(input->cur.button, BTN_CLEFT)) { link_kaleido_rot.y = link_kaleido_rot.y - RotationSpeed; - link_kaleido_rot.x = 0; - } else if (CHECK_BTN_ALL(input->cur.button, BTN_DRIGHT) && CVar_GetS32("gPauseLiveLink", 1) >= 1) { - //printf("Rotation (R)Desired:[%d]\n", link_kaleido_rot.x); + } else if (AllowDPadRotation && CHECK_BTN_ALL(input->cur.button, BTN_DRIGHT) || + AllowCRotation && CHECK_BTN_ALL(input->cur.button, BTN_CRIGHT)) { link_kaleido_rot.y = link_kaleido_rot.y + RotationSpeed; - link_kaleido_rot.x = 0; } - if (CHECK_BTN_ALL(input->press.button, BTN_DUP) || CHECK_BTN_ALL(input->press.button, BTN_DDOWN) && CVar_GetS32("gPauseLiveLink", 1) >= 1) { + if (AllowDPadRotation && CHECK_BTN_ALL(input->press.button, BTN_DUP) || + AllowDPadRotation && CHECK_BTN_ALL(input->press.button, BTN_DDOWN)) { + link_kaleido_rot.y = 32300; + } else if (AllowCRotation && CHECK_BTN_ALL(input->press.button, BTN_CUP) || + AllowCRotation && CHECK_BTN_ALL(input->press.button, BTN_CDOWN)) { link_kaleido_rot.y = 32300; } + link_kaleido_rot.x = 0; + extern int fbTest; gsSPSetFB(globalCtx->state.gfxCtx->polyOpa.p++, fbTest); func_8009214C(globalCtx, pauseCtx->playerSegment, &pauseCtx->playerSkelAnime, &pos, &link_kaleido_rot, scale,