From fde3c8e98f7206c1e91fa1f4599695f6b7805171 Mon Sep 17 00:00:00 2001 From: PurpleHato Date: Wed, 8 Jun 2022 17:14:46 +0200 Subject: [PATCH 1/7] Fix: Dualsense (PS5) Gyro No needs to use the hacky stuff anymore :D --- libultraship/libultraship/SDLController.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/libultraship/libultraship/SDLController.cpp b/libultraship/libultraship/SDLController.cpp index ab2c48b30..2d8e8bb0d 100644 --- a/libultraship/libultraship/SDLController.cpp +++ b/libultraship/libultraship/SDLController.cpp @@ -195,7 +195,6 @@ namespace Ship { SDL_GameControllerGetSensorData(Cont, SDL_SENSOR_GYRO, gyroData, 3); const char* contName = SDL_GameControllerName(Cont); - const int isSpecialController = !strcmp("PS5 Controller", contName); float gyro_drift_x = CVar_GetFloat(StringHelper::Sprintf("gCont%i_GyroDriftX", contNumber).c_str(), 0.0f); float gyro_drift_y = CVar_GetFloat(StringHelper::Sprintf("gCont%i_GyroDriftY", contNumber).c_str(), 0.0f); const float gyro_sensitivity = CVar_GetFloat(StringHelper::Sprintf("gCont%i_GyroSensitivity", contNumber).c_str(), 1.0f); @@ -205,25 +204,14 @@ namespace Ship { } if (gyro_drift_y == 0) { - if (isSpecialController == 1) { - gyro_drift_y = gyroData[2]; - } - else { - gyro_drift_y = gyroData[1]; - } + gyro_drift_y = gyroData[1]; } CVar_SetFloat(StringHelper::Sprintf("gCont%i_GyroDriftX", contNumber).c_str(), gyro_drift_x); CVar_SetFloat(StringHelper::Sprintf("gCont%i_GyroDriftY", contNumber).c_str(), gyro_drift_y); - if (isSpecialController == 1) { - wGyroX = gyroData[0] - gyro_drift_x; - wGyroY = -gyroData[2] - gyro_drift_y; - } - else { - wGyroX = gyroData[0] - gyro_drift_x; - wGyroY = gyroData[1] - gyro_drift_y; - } + wGyroX = gyroData[0] - gyro_drift_x; + wGyroY = gyroData[1] - gyro_drift_y; wGyroX *= gyro_sensitivity; wGyroY *= gyro_sensitivity; From c927403fa506bccf6b4a7e045e9cb1a91344bdce Mon Sep 17 00:00:00 2001 From: PurpleHato Date: Tue, 7 Jun 2022 23:05:33 +0200 Subject: [PATCH 2/7] Fixed: Kaleido Link Rotation I made a fucksie woopsie while refactoring --- libultraship/libultraship/SohImGuiImpl.cpp | 8 ++++---- .../ovl_kaleido_scope/z_kaleido_equipment.c | 20 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 4f084549f..1738f30de 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -882,13 +882,13 @@ namespace SohImGui { { if (ImGui::BeginMenu("Animated Link in Pause Menu")) { ImGui::Text("Rotation"); - EnhancementRadioButton("Disabled", "gPauseLiveRotation", 0); - EnhancementRadioButton("Rotate Link with D-pad", "gPauseLiveRotation", 1); + EnhancementRadioButton("Disabled", "gPauseLiveLinkRotation", 0); + EnhancementRadioButton("Rotate Link with D-pad", "gPauseLiveLinkRotation", 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"); - EnhancementRadioButton("Rotate Link with C-buttons", "gPauseLiveRotation", 2); + EnhancementRadioButton("Rotate Link with C-buttons", "gPauseLiveLinkRotation", 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) { + if (CVar_GetS32("gPauseLiveLinkRotation", 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 125981bff..9e5bca1d1 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,8 +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; + u8 AllowCRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 2) ? 1 : 0; + u8 AllowDPadRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 1) ? 1 : 0; if (LINK_AGE_IN_YEARS == YEARS_CHILD) { pos.x = 2.0f; @@ -120,19 +120,19 @@ void KaleidoScope_DrawPlayerWork(GlobalContext* globalCtx) { link_kaleido_rot.x = link_kaleido_rot.z = 0; - if (AllowDPadRotation && CHECK_BTN_ALL(input->cur.button, BTN_DLEFT) || - AllowCRotation && CHECK_BTN_ALL(input->cur.button, BTN_CLEFT)) { + 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; - } else if (AllowDPadRotation && CHECK_BTN_ALL(input->cur.button, BTN_DRIGHT) || - AllowCRotation && CHECK_BTN_ALL(input->cur.button, BTN_CRIGHT)) { + } 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; } - if (AllowDPadRotation && CHECK_BTN_ALL(input->press.button, BTN_DUP) || - AllowDPadRotation && CHECK_BTN_ALL(input->press.button, BTN_DDOWN)) { + 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)) { + } 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; } From 45e18f9aca0297eaeba074d75d6650d95a074677 Mon Sep 17 00:00:00 2001 From: PurpleHato Date: Sun, 12 Jun 2022 14:10:02 +0200 Subject: [PATCH 3/7] Tweak: Typo fixed --- libultraship/libultraship/SohImGuiImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 1738f30de..3c7f046fb 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -913,7 +913,7 @@ namespace SohImGui { EnhancementRadioButton("Random", "gPauseLiveLink", 15); Tooltip("Randomize the animation played each time you open the menu"); EnhancementRadioButton("Random cycle", "gPauseLiveLink", 16); - Tooltip("andomize the animation played on hte menu after a certain time"); + Tooltip("Randomize the animation played on the menu after a certain time"); if (CVar_GetS32("gPauseLiveLink", 0) >= 16) { EnhancementSliderInt("Frame to wait: %d", "##MinFrameCount", "gMinFrameCount", 1, 1000, ""); } From 04bb9cd48ea91ed8577c26945735f0de1b9af8ad Mon Sep 17 00:00:00 2001 From: PurpleHato Date: Mon, 13 Jun 2022 22:27:55 +0200 Subject: [PATCH 4/7] Tweak from @louist103 made true/flase back instead of 0 1 --- soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 9e5bca1d1..046d8068a 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,8 +98,8 @@ void KaleidoScope_DrawPlayerWork(GlobalContext* globalCtx) { f32 scale; Input* input = &globalCtx->state.input[0]; s16 RotationSpeed = 150 * CVar_GetS32("gPauseLiveLinkRotationSpeed", 0); - u8 AllowCRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 2) ? 1 : 0; - u8 AllowDPadRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 1) ? 1 : 0; + u8 AllowCRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 2) ? true : false; + u8 AllowDPadRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 1) ? true : false; if (LINK_AGE_IN_YEARS == YEARS_CHILD) { pos.x = 2.0f; From 2a1145785eaef8d9ab52cc3ef3293e4fe77fb0bd Mon Sep 17 00:00:00 2001 From: PurpleHato Date: Mon, 13 Jun 2022 22:57:08 +0200 Subject: [PATCH 5/7] Tweak: Draw Distance Kokiri menu behavior (#459) * ADDED: Draw Distance toggle under Experimental enhancement * FIXED: Dark Link Apparition + Kokiri NPC spawn * Added a Toggle for Kokiri NPC since they are mystics * TWKEA: Desciription got the Kokiri draw distance * FIXED: Horses behavior Fixed Epona shout on title screen + Epona call from songFixed Zelda and Ganon horses that could still be seen on camera pan on the castle escape cinematic * Tweak: Draw Distance: Kokiris menu behavior Force the Kokiri Draw Distance to be set to 0 if the Draw Distance is disabled --- libultraship/libultraship/SohImGuiImpl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 3c7f046fb..587e17e9b 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -1007,7 +1007,9 @@ namespace SohImGui { Tooltip("Turns off the level of detail setting, making models always use their higher poly variants"); EnhancementCheckbox("Disable Draw Distance", "gDisableDrawDistance"); Tooltip("Turns off the objects draw distance, making objects being visible from a longer range"); - if (CVar_GetS32("gDisableDrawDistance", 0) == 1) { + if (CVar_GetS32("gDisableDrawDistance", 0) == 0) { + CVar_SetS32("gDisableKokiriDrawDistance", 0); + } else if (CVar_GetS32("gDisableDrawDistance", 0) == 1) { EnhancementCheckbox("Kokiri Draw Distance", "gDisableKokiriDrawDistance"); Tooltip("Kokiris are mystical being that appear from a certain distance\nEnable this will remove their draw distance\nNeeds to reload the map to take effect"); } From 15b28370fcd3e399536223603b222e91d2b6c749 Mon Sep 17 00:00:00 2001 From: louist103 Date: Tue, 14 Jun 2022 11:08:00 -0400 Subject: [PATCH 6/7] Fix --- libultraship/libultraship/SohImGuiImpl.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 587e17e9b..9a02934cd 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -64,8 +64,6 @@ namespace SohImGui { bool p_open = false; bool needs_save = false; std::vector CustomTexts; - int SelectedLanguage = CVar_GetS32("gLanguages", 0); //Default Language to 0=English 1=German 2=French - int SelectedHUD = CVar_GetS32("gHudColors", 1); //Default colors to GameCube. ImVec4 hearts_colors; ImVec4 hearts_dd_colors; ImVec4 a_btn_colors; From 5fcddaa066cad80ff9c3f9946b3e3df101afd3f3 Mon Sep 17 00:00:00 2001 From: louist103 Date: Tue, 14 Jun 2022 11:10:52 -0400 Subject: [PATCH 7/7] Remove another unused thing. --- libultraship/libultraship/SohImGuiImpl.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 9a02934cd..e89da81fc 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -63,7 +63,6 @@ namespace SohImGui { GameOverlay* overlay = new GameOverlay; bool p_open = false; bool needs_save = false; - std::vector CustomTexts; ImVec4 hearts_colors; ImVec4 hearts_dd_colors; ImVec4 a_btn_colors;